Posts

Showing posts from May, 2010

Unknown fonts in mysql database -

how reproduce unknown fonts correct hindi font in mysql database? have database contains hindi field , fonts not showing correctly shows **à ¤­à ¤¾à ¤°à ¤¤à ¥€à ¤¯** how convert font? thanks i once faced same problem in used $con->set_charset("utf8"); right before query.

javascript - method to save file in html? -

so have been messing around html , literally canvas , creates drawing board you, , got have export button on page. when hit button opens new page image; want accomplish have save file locally on webserver when hits button. the line opens drawing is: window.open(lc.getimage().todataurl()); is there way accomplish this? here's full code. <html> <head> <!-- stylesheet --> <link href="/draw/literallycanvas-0.4.1/css/literallycanvas.css" rel="stylesheet"> <!-- dependency: react.js --> <script src="http://cdnjs.cloudflare.com/ajax/libs/react/0.10.0/react-with-addons.js"></script> <!-- literally canvas --> <script src="/draw/literallycanvas-0.4.1/js/literallycanvas.js"></script> </head> <body> <!-- widget goes. can css it. --> <!-- kick off --> <script src="//ajax.googleapis.com/ajax/libs/jquer...

python - django migrate has error: Specify a USING expression to perform the conversion -

i change model field charfiled() genericipaddressfield() ip = models.genericipaddressfield() and use django 1.7 migrate ./manage.py makemigrations core ./manage.py migrate but there error: return self.cursor.execute(sql, params) django.db.utils.programmingerror: column "ip" cannot cast automatically type inet hint: specify using expression perform conversion. i try this,but not work: alter table core_message alter column ip type inet using (ip::inet); error: error: invalid input syntax type inet: "" what can now? please me thank you! one quick fix drop , create field: delete migration changing field type. delete/comment field ip make migrations get back/uncomment field ip new field type make migrations migrate i did in production , restored data previous csv backup , python script of few lines code.

powershell - Regex optionally match port number in url -

i have regex http:\/\/(?<servername>[^"]+):(?<port>[^"]+) pick server , port url. works fine when port exists in url when port number doesn't exist doesn't match server either. example, url -> http://server1:20 values returned servername = server1 port = 20 url -> http://server2 values returned servername = blank port = blank for second case values servername = server2 port = blank you can modify regex bit as ^http:\/\/(?<servername>[^:]+)(:(?<port>.+))?$ example : http://regex101.com/r/sn8it4/1 changes made [^:]+ matches other : . part matches servername (:(?<port>.+))? matches followed : . part matches portnumber ? quantifier, quantifies 0 or 1 occurence of portnumber

jquery - How do i call external javascript function/lines in html? -

in javascript file have code: $(function() { $('#carousel span').append('<img src="img/gui/carousel_glare.png" class="glare" />'); $('#thumbs a').append('<img src="img/gui/carousel_glare_small.png" class="glare" />'); $('#carousel').caroufredsel({ responsive: true, circular: false, auto: true, infinite: true, items: { visible: 1, width: 200, height: '56%' }, scroll: { fx: 'directscroll', pauseonhover: true, duration: 500 } }); $('#thumbs').caroufredsel({ responsive: true, circular: false, infinite: false, auto: false, prev: '#prev', next: '#next', items: { visible: { min: 2, ...

jQuery - Table > Hide entire Column, Toggle CSS classes for onClick TD and Checkbox with selected/highlighted Counter -

i looking jquery table multiple functionalities below. 1. onclick on hide column 1 checkboxes @ top, entire column of relevant table should hidden except first column (checkboxes column) 2. onclick of inside tbody tr td except checkbox , should apply " highlighttr " class relevant tr element , onclick of inside tbody tr td checkbox should apply " selecttr " class relevant tr , number should shown in both scenarios. 3. clicking on thead th checkbox should select all checkboxes inside tbody respective class your appreciated, please me! html: <label><input type="checkbox" id="col_1">hide column 1</input></label> <label><input type="checkbox" id="col_2">hide column 2</input></label> <label><input type="checkbox" id="col_3">hide column 3</input></label> <div class="selected-counter">selected: <spa...

Passing variables to another classes (Java) -

i have java program contains multiple classes, of extend jpanel (except class containing main method). trying pass int variables 1 class and, using asked questions, came this: class rollpanel public int getbraincount() { return braincount; } class brainspanel (where trying send variable) void setbraincount() { rollpanel rollpanel = new rollpanel(); braincount = rollpanel.getbraincount(); } this doesn't give errors, when add braincount label see value, 0. braincount declared @ class level of rollpanel, given value code in button listener: value1 = generator.nextint(3) + 1; value2 = generator.nextint(3) + 1; value3 = generator.nextint(3) + 1; //rolltotal++; //counts how many brains rolled. if (value1 == 1) braincount++; if (value2 == 1) braincount++; if (value3 == 1) braincount++; i understand declaring variable automatically mean val...

arrays - Object[] inside Object[] Java returns memory address? -

trying access object[] inside initial object[] returns memory address i.e. system.out.println(object[1]); . how return contents instead? when call system.out.println on array (or other object matter), implicitly invoke tostring() method (assuming it's not null , of course). arrays implement in trivial manner, so, mentioned, address, not useful. arrays.tostring should give more useful output: system.out.println(arrays.tostring(objects[1])); or better yet, use arrays.deeptostring print entire "parent" array: system.out.println(arrays.deeptostring(objects));

php - Oxwall - Newsfeed limit on wall -

how can increase newsfeed limit on oxwall wall. default allows 40 only. can customize code make 100,150?? i know file need modify : ow_plugins/newsfeed/components/feed_widget.php but not know code need modify. you can following : go : public_html/ow_plugins/newsfeed/components/feed_widget.php line 100: 'optionlist' => array(2 => '2', 3 => '3', 4 => '4', 5 => '5', 6 => '6', 7 => '7', 8 => '8', 9 => '9', 10 => '10', 11 => '11', 12 => '12', 13 => '13', 14 => '14', 15 => '15', 16 => '16', 17 => '17', 18 => '18', 19 => '19', 20 => '20', 25 => '25', '30' => 30, '40' => 40), add array till need 100,150.

segmentation fault. ubuntu version dependent -

#include <string.h> #include <unistd.h> #include <stdio.h> #include <stdlib.h> #include <sys/wait.h> #include <signal.h> #define max_cmd_arg 10 #define max_cmd_grp 10 const char *prompt = "myshell> "; char* cmdgrps[max_cmd_grp]; char* cmdvector[max_cmd_arg]; char cmdline[bufsiz]; enum stat{ none, fg, bg, }; int status=none; int pid=0; void sigint_handler(int sign){ fputs("\n",stdout); } void fatal(char *str) { perror(str); exit(1); } int makelist(char *s, const char *delimiters, char** list, int max_list) { if((s == null) || (delimiters == null)) return -1; char *snew = s + strspn(s, delimiters); /* delimiters를 skip */ if((list[0] = strtok(snew, delimiters)) == null) return 0; int numtokens = 1; while(1) { if((list[numtokens] = strtok(null, delimiters)) == null) break; if(numtokens == (max_list - 1)) return -1; numtokens++; } return...

Reading a text file in C, stopping at multiple points, breaking it into sections -

i have program has text file variable in length. must capable of being printed in terminal. problem if code large, part of becomes inaccessible due limited scroll of terminal. thinking of having command executed character continue lines after point, allowing user see needed, , scroll if needed. closest have come see here, prints text file 1 line @ time press enter. extremely slow , cumbersome. there solution? #include <stdio.h> #include <stdlib.h> #include <string.h> #include <errno.h> int main() { file *audit; audit = fopen("checkout_audit.txt", "r"); char length_of_code[60000]; int ch; while ((ch = fgetc(audit)) != eof) { fgets(length_of_code, sizeof length_of_code, audit); fprintf(stdout, length_of_code, audit); getch(); if (ferror(audit)) { printf("this error message!"); return 13; } } fclose(audit); return 0; } the libraries inc...

regex - unexpected end of regular expression in python -

hello learning web development in came across kind of error, regex code : def valid_username(self , username): user_re = re.compile(r"^[a-za-z0-9_-]{3,20}$") if user_re.match(username): return username def valid_password(self, password): pass_re = re.compile(r"^.{3,20}$") if pass_re.match(password) : return password def valid_email(self, email): email_re = re.compile(r"^[\s]+@[\s]+\.[\s\+$") if email_re.match(email): return email and error log: traceback (most recent call last): file "/home/suraj/google_appengine/lib/webapp2-2.3/webapp2.py", line 1511, in __call__ rv = self.handle_exception(request, response, e) file "/home/suraj/google_appengine/lib/webapp2-2.3/webapp2.py", line 1505, in __call__ rv = self.router.dispatch(request, response) file "/home/suraj/google_appengine/lib/webapp2-2.3/webapp2.py", line 1253, in default_dispatcher return route.handler_adapter(req...

getDeclaredMethod in Java Fails -

i have batch app uses file input method names , names used execute method same name design. eg file has gettemperature , gettemperature executed in class. i using following java: java version "1.7.0_55" openjdk runtime environment (icedtea 2.4.7) (7u55-2.4.7-1ubuntu1~0.13.10.1) openjdk 64-bit server vm (build 24.51-b03, mixed mode) the code is: if (args.length < 2) { system.out.println("sf <retailername> retailername <manname> man"); system.exit(1); } getsoogrdata wa = new getsoogrdata(); try { bufferedreader bf = new bufferedreader(new filereader(args[0])); string line = null; while ((line = bf.readline()) != null) { class c = wa.getclass(); c.getdeclaredmethod(line, null); } the compiler gives warnings raw type (class raw type) , warnings on getdeclaredmethod saying type. class declared: public class getsoogrdata { private hashmap<st...

git - change exist commit to current commit -

this question has answer here: git rebase basics 2 answers simply, i've done : a------b-------c \ \ b2 now, want change b b2. a------b2-------c is possible? solution history: i added work history. $ git log commit b671c70b c commit f4acdc2b b commit 56f38939 $ git checkout f4acdc2b and modified something... committed -amend option. $ git commit -amend $ git log commit e2fd729 b' commit 56f3893 now, became this: a------b-------c \ \ b' to rebasing b b' $ git checkout b671c70b $ git rebase -i 56f38939 which opens interactive editor pick f4acdc2b b pick 56f38939 just remove line pick f4acdc2b , save , quit. if there error error: not apply b671c70b... c , edit merge conflicts , then, $ git add . $ git rebase --continue $ git log commit 914c6bc c' commit 56f389...

Responsive image doesn't render on page load in Chrome, renders on browser resize or opening dev tools -

i having strange issue img renders when browser gets resized or dev tools opened. img has srcset , sizes attributes, , inside polymer template. displays whithout attributes, or outside of polymer shadow dom. issue came chrome 39, believe, , restricted google chrome, there no polyfills @ work anymore. there no errors in console, naturally, status 200 ok there. having no issues in firefox or ie. polymer version 0.5.0, , reported issue @ polymer github page, maybe there else it. lex ok, think may have fixed this, though bit silly had way. had written these combined declaration: background: url(image-name.jpg) top center fixed; when write long form seems work fine. background-image: url(image-name.jpg); background-position: top center; background-attachment: fixed; if have more time it, i'll comment in info find on why may be.

javascript - Multiple CSV files to PHP Array - -

i have problems csv files. have 50 csv files, looks same below. i need import them php array - (later put them js var, , use in diagrams) csv dont looks should (i cant change it) - have data @ top (first 10 lines) - need use them in different places (just show them - "kategoria:";"rolnictwo, leŚnictwo Łowiectwo"; - title) "okres sprawozdawczy:";"dane roczne"; "kategoria:";"rolnictwo, leŚnictwo Łowiectwo"; "grupa:";"skup produktÓw rolnych"; "podgrupa:";"skup produktów na 1 ha użytków rolnych"; "wymiary:";"wykaz produktów, lata"; "kod";"jednostka terytorialna";"buraki cukrowe";"buraki cukrowe";"buraki cukrowe";"buraki cukrowe"; "2010";"2011";"2012";"2013"; "[kg]";"[kg]";"[kg]";"[kg]"; "1100000000";" ŁÓdzkie...

angularjs - how to use a single controller for multiple routes -

how assign couple of controller , view multiple route patterns in angularjs? example have couple of view , controller: { templateurl: '/partial/single-item.html', controller: 'singleitemcontroller' } witch want them 2 routes: /car/:id /bike/:id you can have route : /:myroute/:id , test in controller(or in route regex) value of myroute example

POST a file as a binary stream to server using javascript -

i have doubt, have tried searching on web generally, not find answer want. local system, have uploaded file using html input type=file attribute. make file binary stream using javascript , post of stream server. have idea or example code me understand how works? for ex: have <input type="file" id="myfile"> <button onclick="myfunction()">upload</button> <script> function myfunction() { var x = document.getelementbyid("myfile"); //convert x iostream* //do http post request server , write file stream request.getstream } </script> is possible js? @ moment focusing on uplaoding media files images. has uploaded iostream because format accepted server. also, has work safari!! in advance! filereader methods support filereader.readasbinarystring( ) is deprecated. don't use it! it's no longer in w3c file api working draft: void abort(); void readasarraybuffer(blob blob); ...

time - Difference between timestamps PHP decimal format -

im trying difference between timestamps in php. for instance have login time $login = "2014-11-24 13:45:00"; $current_time = date('y-m-d h:i:s'); // lets pretend 2014-11-24 14:50:00 i want compare login time current time, , show in 2 formats the obvious display have this. showing difference. 01:05:00 // time difference but want have in decimal format calculations. how can convert above 'difference' decimal display.?? 1.083 // in case 1:05 difference calculates 1.083 in decimal more examples... 00:30:00 // half hour difference 0.5 // decimal 00:45:00 // 45 minutes 0.75 // decimal 03:14:00 // 3 hours 14 minutes 3.23 // decimal $login = strtotime("2014-11-27 01:00:00"); $current_time = time(); echo "difference in hours: ". ($current_time-$login)/3600; simple :) fiddle

go - golang POST image and text field with multipart/form-data -

yes, have found answers: http://matt.aimonetti.net/posts/2013/07/01/golang-multipart-file-upload-example/ golang post data using content-type multipart/form-data http-post file multipart programming in go language and answers not helpful, because i'm error multipart.newwriter. version of go lang 1.3.3 i'm trying send text data , image form(templates/form.html) <form enctype="multipart/form-data" method="post"> <div class="row"> <div class="large-6 columns"> <label>image <input type="file" name="image" class="button"/> </label> </div> </div> <div class="row"> <div class="large-12 columns"> <label>about me <textarea type="text" name="aboutmyself" class="aboutmyself"></textare...

Wrong sum fetching from several tables - postgresql -

postgresql version 9.1.13 i have 1 table code linked several tables want sum. so far result not correct values (jsfiddle) http://sqlfiddle.com/#!15/efedc/18 select code_name, sum(estrec_sum) est, sum(hr_sum) total, sum(case when hr_status='0' hr_sum else 0 end) unbill, sum(case when hr_status='1' hr_sum else 0 end) bill code right join hr on code_id=hr_code right join estrec on code_id=estrec_code hr_job='1' , estrec_job='1' group code_name the sum of estrec_sum sum estrec_job , hr_status ignored further testing: running each table separate gets correct values: select code_name, sum(case when estrec_job = '1' estrec_sum else 0 end) est code right join estrec on code_id=estrec_code estrec_job = '1' group code_name order code_name copy gets 100 on job 1 expected. select code_name, sum(case when hr_job = '1' hr_sum else 0 end) total, sum(case when hr_job = '1' , hr_status='0' hr_sum else 0 en...

(Oracle SQL) Problems with joins and pairs of rows -

i have 3 tables create table airships( idas number primary key, nameas varchar2(20), range number ); create table certificate( idem number not null, idas number not null, foreign key (idem) references employees(idem), foreign key (idas) references airships(idas) ); create table employees( idem number primary key, nameem varchar2(20), paycheck number ); i have find pairs of employees certified same airships range on 3000. i know have use join, dont know how find pairs same table. select e1.nameem, e2.nameem, a.nameas employees e1 join certificates c1 on e1.idem = c1.idem join certificates c2 on c1.idas = c2.idas , c1.idem < c2.idem join employees e2 on e2.idem = c2.idem join airships on a.idas = c1.idas a.range > 3000 the c1.idem < c2.idem test keeps reporting employee pair himself, , avoids showing same pair twice (in opposite order). ...

Xamarin : Using ArrayAdapter in an Android Fragment -

i trying use arrayadapter populate spinner view located in fragment follows public override view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { var view = inflater.inflate(resource.layout.salarydefinition, container, false); spnbanks = view.findviewbyid<spinner>(resource.id.spinner1); spnbanks.adapter = new arrayadapter<string>(context, resource.layout.salarydefinition, sections); return view; } the problem can't find context pass arrayadapter constructor. any idea how solve this, or populate spinner view in fragment? fragment has getactivity method, returns activity fragment associated with. use in place of context .

sql select statement to show results if source = B exists then results with source B otherwise results from source O -

i want select report report source 'b' if exists, otherwise report_source 'o' select r.rep_id, r.rep_name, r.rep_status, r.rep_source o.cmp_id, o.cmp_company_name, o.cmp_company_al company o, report r o.cmp_id = r.rep_cmp_id , r.rep_status in ('n','a') , r.rep_source = ???decode; output example: rep_id rep_name rep_status rep_source cmp_id cmp_company_name cmp_company_name_al 100 rep-2000 o 144 asm assist support mgt 120 rep-9900 b 144 asm assist support mgt i want results if rport source b. if there no report source company show report report source o so results shown in case: 120 rep-9900 b 144 asm assist support mgt i think you: (when want select char 'b...

add some of the fields of an XML together with XSLT (but not all) -

i great noob xslt concerned. copied , pasted stuff forum, , works. however, finetune. can find examples of how concat fields, nog how concat of fields. i have xml <xs:element name="medewerker_x"> <xs:complextype> <xs:sequence> <xs:element name="medewerker" type="xs:string" minoccurs="0" /> <xs:element name="roepnaam" type="xs:string" minoccurs="0" /> <xs:element name="voorletters" type="xs:string" minoccurs="0" /> <xs:element name="voorvoegsel" type="xs:string" minoccurs="0" /> <xs:element name="achternaam" type="xs:string" minoccurs="0" /> <xs:element name="e-mail_werk" type="xs:string" minoccurs="0" /> </xs:sequence> ...

objective c - How to update widget UI on data change iOS 8 Today Extension -

i need confirm these things does widgetperformupdatewithcompletionhandler called notification center self or manually call in way? if don't have widgetperformupdatewithcompletionhandler control how can update data on data change (i using service fetch json feeds url) here have noticed. widgetperformupdatewithcompletionhandler called once when widget loaded. viewwillappear/didappear called on switching between today , notification. though have read tutorials , other stuffs specific point unable understand. haven't pasted code here it's more of conceptual thing. kindly share knowledge ncwidgetproviding delegates. updated: enable widget update view when it’s off-screen make following changes widgetperformupdatewithcompletionhandler . the system takes snapshot of widget , periodically , try update it. if updates successfully, function calls system-provided completion block ncupdateresult.newdata enumeration. if update wasn’t successful, existing snapshot ...

c++ - howto use the libcurl by ndk standalone tool chainon on android -

now, have question: first of ndk standalone tool chain ---arm-linux-androideabi-g++ sucessful; have write commandline c++ program use libcurl http requests, can successful compile on mac( has libcurl default? ) use g++, when use arm-linux-androideabi-g++ compile it, produce following error: arm-linux-androideabi-g++ -std=c++11 -lcurl upload.cpp -o upload upload.cpp:12:23: fatal error: curl/curl.h: no such file or directory compilation terminated i have libcurl(include files , .a lib file) can used in android, howto configure arm-linux-androideabi-g++ can compile successfully? advance i guess include header like #include <curl/curl.h> if that, arm-linux-androideabi-g++ searches header file in specific location. , if arm-linux-androideabi-g++ not point same directory g++, headers can not found. try copy header files of curl project, jni/curl folder, , use " instead of < #include "curl/curl.h" if have right .a file, functions in header ...

angularjs - Dynamically attaching validation in directive does not update class -

i'm trying dynamically toggle validation in form attaching validation directive element under conditions. works intended, input field either valid or invalid depending if directive attached or not , valid. however, when add or remove directive, input field looses it's $dirty , $touched. have ng-class directive in there should change class depending on validity , not work. the input field looks this, validatelogic function returns true or false. <input name="testinput" type="text" ng-class="{'error': testform.testinput.$invalid && testform.testinput.$dirty }" ng-model="testinput" attach-directive="{'validate-test': validatelogic() }" /> and directive looks this: myapp.directive('attachdirective', function($compile, $timeout) { return { restrict: 'a', require: 'ngmodel', link: function (scope, element, attrs, ctrl) { scope.$wat...

hadoop - How to effectively reduce the length of input to mapper -

my data has 20 fields in schema. first 3 fields important me far map reduce program concerned. how can decrease size of input mapper first 3 fields received. 1,2,3,4,5,6,7,8...20 columns in schema. want 1,2,3 in mapper process offset , value. note cant use pig other map reduce logic implemented in map reduce. you need custom recordreader : public class trimmedrecordreader implements recordreader<longwritable, text> { private linerecordreader linereader; private longwritable linekey; private text linevalue; public trimmedrecordreader(jobconf job, filesplit split) throws ioexception { linereader = new linerecordreader(job, split); linekey = linereader.createkey(); linevalue = linereader.createvalue(); } public boolean next(longwritable key, text value) throws ioexception { if (!linereader.next(linekey, linevalue)) { return false; } string[] fields = linevalue.tostring().split(","); ...

raml - Cannot POST to Mule console mock service -

i have enabled mule mock service via api console. requests work fine, not post - gives 404; i'm testing through 'try it' console, api def. exists: response request url http://mocksvc.mulesoft.com/mocks/87307809-5047-4f11-8376-f79b90612e8f/api/1.1/potentials/invoices status 404 headers connection: keep-alive content-length: 84 content-type: text/html date: thu, 27 nov 2014 09:57:26 gmt server: nginx vary: accept-encoding cannot post /mocks/87307809-5047-4f11-8376-f79b90612e8f/api/1.1/potentials/invoices any known issues - or doing wrong? update - getting 500 response: the url looks dodgy, there's proxy involved; have switched off proxy in anypoint config. remote address:107.23.223.75:443 request url:https://anypoint.mulesoft.com/apiplatform/proxy/http://mocksvc.mulesoft.com/mocks/4549e09f-5372-49a2-a025-1a779be1f8b0/api/1.0/potentials/invoices/by-group?calcs=sync request method:post status code:500 internal server error response headers view source connect...

php - Magento: can't retrieve saved billing address -

i have problem trying show saved billing address in checkout process. basically, existing code (onepagecheckout) uses following code show dropdown list existing addresses: <?php echo $this->getaddresseshtmlselect('billing') ?> // billing <?php echo $this->getaddresseshtmlselect('shipping') ?> // shipping the problem billing dropdown has same values shipping one. the code shows dropdown following: <?php echo $this->getaddresseshtmlselect('billing') ?> // billing <?php echo $this->getaddresseshtmlselect('shipping') ?> // shipping shipping correct, billing shows shipping values. but if perform following query on db: select * sales_flat_quote_address customer_id = <my_customer_id>; i can see 2 addresses, 1 address_type shipping, 1 address_type billing. the method reported here has same problem. i'm stucked...any hints appreciated. thanks. edit: mysql select: select address_id, s...

c++ - glDrawArrays() draws one more unwanted object automatically -

i'm trying learn modern opengl this site , i'm on vertex arrays. know can minimise opengl function calls using gldrawarrays instead of glvertex**() each vertex. from point both functions should result in same output, i'm getting additional drawing didn't make through gldrawarrays() . here code (vertices , display() ) float triangles[]={ 0.0f, 5.0f, 0.0f, -5.0f, -5.0f, -4.0f, 5.0f, -5.0f, -4.0f, 0.0f, 5.0f, 0.0f, -5.0f, -5.0f, 4.0f, 5.0f, -5.0f, 4.0f, 0.0f, 5.0f, 0.0f, -5.0f, -5.0f, -4.0f, -5.0f, -5.0f, 4.0f, 0.0f, 5.0f, 0.0f, 5.0f, -5.0f, -4.0f, 5.0f, -5.0f, 4.0f,}; void display(void) { glclear (gl_color_buffer_bit | gl_depth_buffer_bit); glcolor3f(0.1f, 1.0f, 0.0f); glenableclientstate(gl_vertex_array); glvertexpointer(3, gl_float, 0, triangles); gldrawarrays(gl_triangles, 0, sizeof(triangles)); gldisableclientstate(gl_vertex_array); glflush (); // try commneting glflush() } and when run program, creates 3d triangle programmed, 2d square shape...

php - 413 Request Entity Too Large nginx -

i trying increase upload limit on php application 512mb changing nginx.conf follows - #user nginx; worker_processes 1; #error_log /var/log/nginx/error.log; #error_log /var/log/nginx/error.log notice; #error_log /var/log/nginx/error.log info; #pid /var/run/nginx.pid; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; client_max_body_size 512m; #log_format main '$remote_addr - $remote_user [$time_local] "$request" ' # '$status $body_bytes_sent "$http_referer" ' # '"$http_user_agent" "$http_x_forwarded_for"'; #access_log /var/log/nginx/access.log main; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 6500; #tcp_nodelay on; #gzip on; #gzip_disable "msie [1-6]\.(?!.*sv1)"; server_tokens of...

html - twitter bootstrap - moving objects to navbar when collapsed bootstrap 3 -

i got topnavbar disappears when website gets loaded on mobile device content on topnavbar appear on collapsed main navigation. topnavbar collapsed navigation how able achieve or possible or have create class specially collapsed menu? thank in advance what following: 1) create top-menu container big devices 2) create same menu in collapse container small devices 3) use css , @media switch between 2 lists <header> <div class="container"> <!-- top menu not mobile devices --> <div id="top-menu" class="clearfix"> <ul class="nav navbar-nav"> <li> <a href="#"> topitem1 </a> </li> <li> <a href="#"> topitem2 </a> </li> </ul> ...

javascript - IE11 Developer Tool Search Bar blocks after some searches -

Image
i'm having trouble when trying debug javascript on ie. use search bar find functions i'm after, , in cases searchbar becomes disabled , way can work again if close browser , open again.

c# - Using Open Xml to create xlsx file for Excel 2013 -

i need create excel file xlsx. so, decided use open xml (open xml 2.0 because have use .net 3.5). after research open xml, created class : public class excelfilemanager : filemanager { private spreadsheetdocument _package; private row _currentrow; private sheetdata _sheetdata; private int? _cellcolumnn2; private int _cellcolumnn1; private int _cellrow; public excelfilemanager(string path) : base(path) { _package = spreadsheetdocument.create(path, documentformat.openxml.spreadsheetdocumenttype.workbook); _cellcolumnn1 = 65; _cellrow = 1; createspreadsheet(); } private void createspreadsheet() { var workbookpart1 = _package.addworkbookpart(); workbookpart1.workbook = new workbook(); var worksheetpart1 = workbookpart1.addnewpart<worksheetpart>(); worksheetpart1.worksheet = new worksheet(); var sheets = _package.workbookpart.workbook.appendchild...

ios - New iTunes mandatory about Xcode version -

new itunes asking build application using xcode 5.1.1 or later. there work around upload application built on xcode5.0 no, must build latest version of xcode (preferably xcode 6.1) users of newer devices / oses best possible experience. updating 5.0 5.1 shouldn't of stretch sdk didn't change lot between ios 7 , ios 7.1.

ruby on rails - how to set default value for select field inside a form -

in code have: <%= form_for(:category,:url=>{:action=>'update',:id=>@category.id}) |f|%> <div class="field"> <b style="color: #808080;"> cuisine name:&nbsp;</b> <%= f.select :cuisine_id,options_from_collection_for_select(@cuisines,"id","cuisine_name"),prompt:'select cuisine' %> i using form update "cuisine_name". problem want set default value field.now getting values available. you're there. docs : options_from_collection_for_select(collection, value_method, text_method, selected = nil) so need pass 1 more argument create option selected default options_from_collection_for_select(@cuisines,"id","cuisine_name", <your thing here>)

javascript - Change the filepath to save the page content depending on the existence of a page element -

i downloaded many pages html casperjs, want separate them in 2 folders. files contains id="trie" , others not. what can do, please? this script casper.repeat(j , function(){ casper.open(arrdata[i]); // arrdata[i] : contains url of file download casper.wait(5000, function(){ file = 'pages/road/r_' + +'.html'; fs.write(file, casper.gethtml(), 'w'); }); i++; }); but want this casper.repeat(j, function(){ casper.open(arrdata[i]); if ("id=trie" exists in contains of arrdata[i] ){ file put pages/trie/...html } else { file put pages/road/...html } i++; }); you want use exists function: var = 0; var fs = require('fs'); casper.repeat(j, function(){ (function(i){ casper.thenopen(arrdata[i], function(){ if (casper.exists("#trie")){ fs.write("pages/trie/"+i+".html", casper.gethtml()); } else { fs.write("pages/road/...

c# - Upon Button Click Display Pop-Up for Certain Time and then Redirect Page - ASP.NET -

i have form. upon clicking submit button, want display message (say: ""submitted successfully) pop-up. pop-up must stay 3 seconds , after want reload/redirect page. i aware can achieve using jquery. want know if there way achieve through asp.net/c# can write in cs file of aspx page. how achieve this? below button-click method have written currently. notice code: thread.sleep(3000) - during 3 second delay want show pop-up. protected void btnsubmit_click(object sender, eventargs e) { sqlconnection con = new sqlconnection(configurationmanager.connectionstrings["defaultconnection"].connectionstring); con.open(); sqlcommand cmd = new sqlcommand("insert demo_userinfo values (@userid, 'fx1234', (select releaseid demo_releaseinfo productname='asd'), 0)", con); cmd.parameters.addwithvalue("@userid", txtuserid.text); cmd.executenonquery(); con.close(); thread.sleep(3000); response.re...

ios - Are class-based Swift Constants Forced to be Optional -

i'm new swift development, apologise if silly question - having read apple's guide, surprised behaviour have come across (and little miffed). i creating simple class defines number of uninitialised constants @ beginning of class. when class initialised, values set. seems though cannot unless declare constants optional, though not optional , set in constructor. example: class testclass { private let urladdress:string init(urladdress: string) { self.urladdress = geturladdresswithproto("http", urladdress:urladdress) } func geturladdresswithproto(proto: string, urladdress:string) -> string { return "\(proto)://\(urladdress)/" } } the function geturladdresswithproto returns non-optional string xcode throws error: error: variable 'self.urladdress' used before being initialized does have thoughts firstly on why case , if there suitable alternative declaring constants optional? the compiler w...

Rich Snippet won't display price -

i want add snippets code using mikroformats. succeced on rating item name , availability however, whatever try price not display. here code; <ul itemprop="offerdetails" itemscope="" itemtype="http://data-vocabulary.org/offer" class="uk-subnav uk-subnav-line"> <meta itemprop="pricecurrency" content="try"> <li itemprop="price" class="element element-text"> <strong>fiyatı: </strong>8,00 ₺ </li> <li class="element element-select"> <strong><span itemprop="availability" content="in_stock">porsiyon</span>: </strong>1 </li> <li class="element element-relatedcategories"> <strong>köken: </strong><a href="/menü/category/türkiye">türk mutfağı</a> </li> </ul> also tried did not work either; <ul itemprop="offerdetails" itemscope="...