Posts

Showing posts from July, 2013

ruby on rails - Give a 404 instead of a 500 error for missing templates -

i have rails 3.0 app (working on 3.2 upgrade) , whenever requests template doesn't exist gives 500 error in production. instance mysite.com/blog_posts/532 sends post id 532 html no problem, if reason mysite.com/blog_posts/532.txt requested, app raises 500 actionview::missingtemplate error. this shouldn't happen, because template shouldn't there in first place. should more 404 error, or perhaps show html template. how can make app either show 404 error missing-template errors, or show default html template instead of giving 500? log: started "/blog_posts/73.txt" 127.0.0.1 @ 2013-05-20 21:22:51 -0400 processing blogpostscontroller#show text parameters: {"id"=>"73"} pk , serial sequence (2.0ms) select attr.attname, seq.relname pg_class seq, pg_attribute attr, pg_depend dep, pg_namespace name, pg_constraint cons seq.oid = dep.objid , seq.relkind = 's' , attr.attrelid = dep.refobjid , attr.attnum = dep.refobjs...

jsp - Common column header in display table Struts2 -

___________________________________________________________________ |___________ abcdefgh__________ | ____________ xyzwghi__________| |___1__________|_____2_____________|_______3_________|_____4________| |00000000000000|00000 11111 2222 | jt 60 r2 | 0.00000000 | |11111111111111|plast white mfpe | jt 60 r3 | 0.00000000 | |22222222222222|plast white mfpe | 0681 r3 | 0.00000000 | |______________|___________________|________________|_______________| i using display table in application create tables in jsp. requirement create common column headers below. dont have clue. not looking exact solution, guidance of great help...

c# - How to display MessageBox in Monodroid -

how can display message box in xamarin.android? how can yes or no response message box? --- updated : mybtn.click += (sender, e) => { new alertdialog.builder(this) .setmessage("hi") .show(); }; you can use alertdialog.buider class within activity . new alertdialog.builder(this) .setpositivebutton("yes", (sender, args) => { // user pressed yes }) .setnegativebutton("no", (sender, args) => { // user pressed no }) .setmessage("an error happened!") .settitle("error") .show();

c# - Windows kernel queuing outbound network connections -

we have application (a meta-search engine) must make 50 - 250 outbound http connections in response user action, frequently. the way creating bunch of httpwebrequests , running them asynchronously using action.begininvoke. uses threadpool launch web requests, run synchronously on own thread. note way .net 2.0 app , there no tpl speak of. using etw (our event sources combined .net framework , kernal ones) , netmon while thread pool can start 200 threads running our code in 300ms (so, no threadpool exhaustion issues here), takes variable amount of time, 10 - 15 seconds windows kernel make tcp connections have been queued up. this obvious in netmon - see around 60 - 100 tcp connections open (syn) (the number varies, it's never more around 120), rest trickle in on period of time. it's if connections being queued somewhere, don't know , don't know how tune can perform more concurrent outgoing connections. perfmon outbound connection queue stays @ 0 in connections e...

using selenium in a web service throws java.lang.NoClassDefFoundError exception -

i tried implemented web service dynamic web project. added selenium-server-standalone-2.32.0.jar file buildpath, added web-inf/lib folder. used web service wizard generate web service project. @ start of wizard displayed pop-up warning read: the service class "test.eko3.testeko3" not comply 1 or more requirements of jax-rpc 1.1 specification, , may not deploy or function correctly. value type "org.openqa.selenium.webdriver" used via service class "test.eko3.testeko3" not have public default constructor. chapter 5.4 of jax-rpc 1.1 specification requires value type have public default constructor, otherwise jax-rpc 1.1 compliant web service engine may unable construct instance of value type during deserialization. field or property "windowhandles" on value type "org.openqa.selenium.webdriver" used via service class "test.eko3.testeko3" has data type, "java.util.set", not supported jax-rpc 1.1 specification. insta...

Swap/exchange array keys php -

lets have array: array ( [0] => 18208021789 [1] => ziggo-humax ihdr5050c [2] => 191.90 [4] => [5] => foo bar } and want change replace place of [1] [5], result should have: array ( [0] => 18208021789 [1] => foo bar [2] => 191.90 [4] => [5] => ziggo-humax ihdr5050c } how can achieve php? $tmp=$arr[1]; $arr[1]=$arr[5]; $arr[5]=$tmp;

javascript - Setting colorbox lightbox ajax href variable -

i getting bad request in colorbox when pops up: is there away feed href using $ variable? ajaxcall: function ajaxcall(url, data_array, div_id, callback_fn) { var d = ajaxcall(url, data_array, "rhs_info", "do_quicklist_actions"); d.done(function(data) {     $.colorbox({href:"$data"}) }); try removing quotes $data , like: $.colorbox({href:$data});

javascript - popcorn.js: on mobile browser youtube "play" button does not appear -

i've been using popcorn.js youtube videos while. starting recently, on mobile browser (in case on ipad 2) "play" button doesn't appear did in past. video start load, can see title, instead of prominent "play" button black screen miniscule white dot in center. after checking source code, seems video inside iframe's video wrapper picking css style gives video height of 1px. if press barely visible dot video play , popcorn code execute fine. pretty deal-breaker. maybe youtube thing , not popcorn.js thing, i'm looking direction. see simple jsfiddle, based on 1 of popcorn.js examples, example: http://jsfiddle.net/nzhpa/1/ the code: var pop = popcorn.smart("#container", "http://youtu.be/vdvmstecak4"); pop.footnote({ start: 1, end: 5, text: "works youtube!", target: "footnote-div" }); pop.play(); it's autoplay breaks on ipad. in /popcorn-js/wrappers/youtube/popcorn.html...

fill gallery reading png files in dir php -

i have dir structure like: images/ imgex2.png s_imgex2.png imgre.png s_imgre.png where imgex2.png , imgre.png big images , s_imgex2.png , s_imgre.png thumbnails i want fill gallery absolute path in php like <li><a href="www.site.com/images/imgex2.png"> <img src="images/s_imgex2.png" alt="ex2" /> </a></li> <li><a href="www.site.com/images/imgre.png"> <img src="images/s_re.png" alt="re" /> </a></li> how fill given path gallery big image first , thumbnail (it has "s_" @ begining of filename) , put in alt="" name without "img" string? issue here not filenames have "img" trim not option other problem getcwd() returns 'file:///d:/hosting/2543486/html/site/images' not www.mysite.com i doing <? $dir = './'; $files = glob( $dir . '*.png'); foreach( $f...

winapi - Win32 CRYTO Who is responsible for certificate permissions in CERT_SYSTEM_STORE_SERVICES? -

my service use certificate in cert_system_store_services. problem system makes usage of cert_system_store_services uncomfortable. use mmc (started admin) , open local services storage service. import certificate file there. i expect newly created storage , certificate have appropriate permissions service (runs under network_service). neither storage itself, nor private key have permissions network_service initially. so, questions is: design or should avoid cert_system_store_services ?

Compiling issue with hadoop pipes -

i have come across 2 approaches compiling c++ programs using hadoop pipes hadoop 1.2.0 , have had no luck either of them. approach 1: i came across following link: http://cs.smith.edu/dftwiki/index.php/hadoop_tutorial_2.2_--_running_c%2b%2b_programs_on_hadoop and made following makefile cc = g++ hadoop_install = /home/hduser/hadoop platform = linux-amd64-64 cppflags = -m64 -i$(hadoop_install)/c++/$(platform)/include wordcount: wordcount.cpp $(cc) $(cppflags) $< -wall -l$(hadoop_install)/c++/$(platform)/lib -lhadooppipes -lhadooputils -lpthread -g -o2 -o $@ then whole ton of undefined references /home/hduser/hadoop/c++/linux-amd64-64/lib/libhadooppipes.a(hadooppipes.o): in function `hadooppipes::binaryprotocol::createdigest(std::string&, std::string&)': hadooppipes.cc:(.text._zn11hadooppipes14binaryprotocol12createdigestersss1_[_zn11hadooppipes14binaryprotocol12createdigestersss1_]+0x31): undefined reference `evp_sha1' hadooppipes.cc:(.text._...

java - use a variable from inside a for loop, outside of the loop -

i'm first time user here, though trying find answers nooby question have led me here in past. so basically, have code i'm using find surface temperature of planet earth, implementing few forumlas i've been provided with. need find value (epcarbondi) changes depending on carbon levels in atmosphere. used "for" loop java equation each time amount of carbon changes, bluej wouldnt compile it, said variable might not have been initialised. had declared before "for" loop not assigned value "for" loop meant there fill variable value, need use outside loop afterwards. i read somewhere if initialise variable outside loop 0, should work way^^, did it, , compiles , great. go execute it, , lines of info come out fine lo , behold, answers same!! so gather "for" loop has executed once , found answer not done other values need for? i really need advice if has any..i'd super grateful. need able use epcarbondi variable outside "fo...

unix - file not exist error in cygwin -

i executing maven command e drive different settings.xml file located @ h drive. i getting following error. its taking e base directory. user1234@abcavbavb17 /cygdrive/e/repo # mvn clean install -gs /cygdrive/h/settings.xml [error] error executing maven. [error] specified global settings file not exist: e:\cygdrive\h\setting s.xml please tell me fix this. thanks.

arrays - Number formatting in JavaScript -

i trying create js script format numbers using , separator going bad in logic implementation. i changing values of arr1 here. this js code using time - <script> var arr1 = [1,2,3,4,5,6,7]; arr1.reverse(); var = 1; var temparr = new array(); for( i; <= arr1.length ; i++ ) { if( i%3 == 0 ) { temparr[i-1] = arr1[i-1]; temparr[i] = ','; i++; } else { temparr[i-1] = arr1[i-1]; } } console.log(temparr.reverse().join('')); </script> expected output `` current wrong output 1,234 => ,234 12,345 => 1,345 123,456 => ,12,456 1,234,567 => ,23,567 kindly let me know doing wrong( logical part ) in snippet learning coding time. you've forgotten add original number comma: var arr1 = [1,2,3,4,5,6,7].reverse() , temparr = []; (var = 0; ++i <= arr1.length;) { temparr[i-1] = arr1[i-1]; if (i % 3 === 0) temparr[i] = arr1...

How to grab string from a HTML document using Javascript -

i trying grab string html page. string lives inside div tag no id, , has ever changing title property. it looks this: <div title = [this title changes depending on how page pulled up]> emailaddress abc@xyz </div> i want able grab " abc@xyz " out of whole mess. this html document ever changing, thing know sure stays same string want grab preceded " emailaddress " i've been staring @ 3 hours no progress. i'd thankful if can point me in right direction. without jquery: var divelements = document.getelementsbytagname( 'div' ); ( var = 0; < divelements.length; i++ ) { if ( divelements[i].innertext.match( 'emailaddress' ) ) { // div var mail_id = divelements[i].innertext.replace('emailaddress ',''); } } see fiddle .

iphone - FFMPEG Compiled Libraries And iOS -

i have copied compiled ffmpeg libraries test app xcode-project inspite of adding them project unable use them, #include <libavcodec/avcodec.h> givers error complied libraries (libavcodec.a, libavutil.a, libavformat.a, libavdevice.a> specified in link libraries required framework. when copied libs project questions come up. (1) did copy libs for, (armv6, armv7. i386) or fat universal. (2) did add libs in xcode (3) includes libs, search path them correctly set in xcode

jquery - Mouseenter function displays buttons and images over a div but hovering on these breaks mouseleave function -

html <div id="wrapper"> <div id="object1"> <img src="https://dl.dropboxusercontent.com/u/682110/person1.png" width="100" height="100" /> </div> <a class="button" href="#" >register</a> <div id="object-bg"></div> </div> js $("#object-bg").mouseenter(function () { $("#object1").delay(100).fadein(100); $(".button").delay(500).fadein(100); }); $("#object-bg").mouseleave(function () { $("#object1, .button").css("display", "none"); }); i have set basic demo here: http://jsfiddle.net/jesseyuen/4fpfg/4/ as button , user image not part #object-bg , hovering them result in triggers of mouse leave event use html instead <div id="wrapper"> <div id="object-bg"> <div id="object1"> <img src=...

perl - File search recursivly in the folders on windows -

trying write script search 2 file in folders once files found has perform operation on file : i using windows script. below hierarchy folders : logs / | \ abc def xyz / \ / \ /\ anr etc anr etc anr etc etc= text files. what trying do: i want check anr folder whether 2 files(pqr.txt , rst.txt) there or not, if files there operation on etc, have read 1 specific text file , search keywords in particular text file. how approaching: #!/bin/usr/perl -w use strict; use cwd; use file::find; $dir ="c:\aptscripts\apstress\logs"; find(\&file_operation,$dir); $first_file = @argv[0]; $sec_file= @argv[1]; sub file_operation { $file = $_; if(($file =~ /teaces/) && ($file =~ /traces.txt.bugreport/)) { opeartion } } but logic not able whatever ma trying do. can body me out in this. this 1 checks parent fold...

button - Android - How to position 4 text views? -

Image
update: i've opened new thread updated question here: android - how display 4 text views icons? thank answers, i'd appreciate if me newer thread above. i'm trying display 4 text views @ bottom of screen can't figure out how that. every time try move 1 button screws rest. here's looks like: here's manuel marks want position buttons (each line represents text view item position): here's current code, pointers great: <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="wrap_content" android:layout_height="wrap_content" tools:context=".mainactivity" > <android.support.v4.view.viewpager android:id="@+id/view_pager" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_alignparentleft="true" android:layo...

c# - why add xmlns="" in the attribute of a node? -

i using c# , xdcoument add nodes root element. use code: xelement mianimalnuevo = new xelement("principalnode", new xattribute("atribute1", "value attribute 1"), new xattribute("attribute2", "value attribute 2"), new xelement("subnode","0000")); but this: <principalnode atribute1="value attribute 1" attribute2="value attribute 2" xmlns=""> <subnode>0000</subnode> </principalnode> after attribute 2, see xmlns="". why? want attributes. thanks. this happens when have xml document has namespace defined somewhere tree. adding element not in namespace in empty namespace (i.e., no namespace ) add empty xmlns attribute. <xml xmlns="some_namespace_uri"> <foo>the foo element inherits 'some_namespace_uri' namespace</foo> <bar xmlns="...

objective c - IOS Audio units -

i trying implement low pass filter in core audio on ios when use code below error generated stating "the operation not completed", undescriptive of problem. , can see operation illegal. can me this? or refer me place decent documentation core audio because apples documentation unhelpful indeed. result = augraphnodeinfo(processinggraph, lowpassnode, null, &lowpassunit); if(result != noerr) { [self printerrormessage: @"augraphnodeinfo" withstatus: result]; return; } int bytesize = sizeof(audiounitsampletype); audiostreambasicdescription streamformat; streamformat.mformatid = kaudioformatlinearpcm; streamformat.mformatflags = kaudioformatflagsaudiounitcanonical; streamformat.mbytesperpacket = bytesize; streamformat.mframesperpacket = 1; streamformat.mbytesperframe = bytesize; streamformat.mchannelsperframe = 1; streamformat.mbitsperchannel = 8 * bytesize; streamformat.msamplerate = graphsamplerate; nslog (@"...

sql - update pipe separated Numeric Id with AlphaIds -

i have requirment need replace these pipe delimited numeric employee ids alphanumeric employee ids based on join master table on numeric employeeids 1384820|1379944|1376152|1252113|1250813|1246172|1084122|1037839 as update search..sf_per set userid = eu.alpid extranetusers eu (nolock) inner join search..sf_per pt on eu.empid = pt.userid also number pipe separated empids may vary. want update whole table , trying avoid loops. please suggest.

objective c - Possible to use Apple system sounds in my iOS app? -

can use system sounds in ios app? i'm looking have same list used in default timer app (marimba, alarm, doorbell etc). reason i'm asking in apple's own multimedia docs says: note: system-supplied alert sounds , system-supplied user-interface sound effects not available application. example, using ksystemsoundid_userpreferredalert constant parameter audioservicesplayalertsound function not play anything. then i've come across this list of system sound id 's. so can use access , use these sounds in own apps pass apple's review process? if not similar sounds available open source? actually if use audiotoolbox/audiotoolbox.h framework , import in header file view controller, can play apple system sounds without jailbreaking. example, putting audioservicesplaysystemsound(0x450); under ibaction play apple 'click' sound on execution of action. also, hear system sounds referenced earlier, there great app available on github wor...

Ant check if a directory (and sub directories) contains a certain file -

i'm trying check in ant if directory (and sub directories) contains file i'm using ant contrib : <if> <available> <filepath> <fileset dir="mydir"> <include name="**/*.aef" /> </fileset> </filepath> </available> <then> <fail/> </then> </if> i want fail if there @ least file ending "aef" in mydir or 1 of sub-directories. fails if no "*.aef" file found this should job, without need of ant-contrib: <fail message="at least 1 .aef file found"> <condition> <resourcecount when="greater" count="0"> <fileset dir="mydir" includes="**/*.aef" /> </resourcecount> </condition> </fail>

html - Jquery Ui Tabs Current Container display Issue -

first please visit fiddle: http://jsfiddle.net/vsqq3/ currently first 3 tabs ( tab 1 , tab 2 , tab 3 ) in display default, , when click on next> : tab 4 , tab 5 , tab 6 being in displayed. what want: want display tab 4 , tab 5 , tab 6 default. how can that? $(".wrapper #tab1,.wrapper #tab2").tabs({active: 0}).tabs({ collapsible: false, hide: { effect: "slideup", duration: 20 }, show: { effect: "slidedown", duration: 200 } }); var = $('.wrapper .main').addclass("passiv"); var prev = $('.wrapper .prev'); var next = $('.wrapper .next'); var tab_count = all.length-1; var currentcontainer = -1; prev.click(function(e) { e.preventdefault(); if (currentcontainer != 0) { currentcontainer -= 1; ctrlcontent...

c - What does char * argv[] means? -

i'm new c programming, encountered problem. in case of complicated declarations found this int *daytab[13]; // daytab array of 13 pointers int which means daytab name of array , name of array points first element of array. array name not compatible pointer manipulation daytab++ etc (correct me if i'm wrong). but found code written in dennis ritchie main(int argc, char * argv[]) { while( --argc > 0 ) printf("%s%s",*++argv,(argc>1) > " " : ""); printf("\n"); return 0; } how can manipulate argv ? not array name? the parameter char * argv[] decays pointer, char ** argv . can equally write function signature main() as: int main(int argc, char ** argv) you can pointer argv within main() , argv++ example bumps argv point @ argv[1] rather argv[0] . argv ---> argv[0] ---> "program" argv[1] ---> "arg1" argv[2] --...

java - How to add an image while we drag n drop tree item? -

i have tree number of childs , want drag , drop these child items on vertical panel. right working fine.the thing want know can add image in place of small icon comes @ time of dragndrop. you need override newdragproxy() method of pickupdragcontroller in order provide own proxy widget (say, image) when drag starts. do note need use setbehaviordragproxy(true) allow dragging proxies instead of original widgets (i.e., original widgets stay in place, , drag proxy of it, can style wish).

android - Replace first and last occurrences of a json string -

i fetching response webservice , trying parse json string. the response string is, [{"tbbid":0,"propertyid":1066637,"builderid":"9250c666-e76c-4206-8b37-343b2bb11a89","buildername":"david weekley homes","notes":"","address":"1 tbb4519","schooldistrict":null,"school":null,"cityid":"fort mill","countyid":"","stateid":"sc","zip":"29708","lat":"35.037240000000000","lng":"-80.979742000000000","price":364990,"propertystatusid":"av","propertystatusdescription":"available","stageid":"tbb","stagedescription":"to-be-built home","typeid":1,"typedescription":"house","subdivisionid":4121,"subdivisionname":"baxt...

batch file - To delete folder starting with a same starting charecters in DOS -

i need delete folders in folder in 1 shot, , folders start common name, not end with. command del/rm this? tried wildcards didn't work. c:\temp> rmdir hello* --- directories starting charecters 'hello', didnt work c:\temp> rmdir hello*.* --- didnt work from command line: for /d %i in (hello*) rd "%i" in batch file: for /d %%i in (hello*) rd "%%i"

loader - why the DSO was loaded at address 0 -

there simple test program,it dlopen()s dso "/lib/libc.so.6" , print address of symbol "printf". #include <dlfcn.h> #include <stdio.h> int main() { void* handle; void (*func)(); char* error_test; if (handle = dlopen("/lib/libc.so.6", rtld_now)) { func = dlsym(handle, "printf"); (*func)("address:%p\n",func); sleep(-1); dlclose(handle); return 0; } return -1; } when debug "ld_debug=all",it shows that: [root@localhost glibc_test]# ld_debug=all ld_debug_output=error ./test & [18] 14690 [root@localhost glibc_test]# address:0x2f87b0 but file "error" shows "/lib/libc.so.6" loaded address 0! that`s why? 14690: initialize program: ./test 14690: 14690: 14690: transferring control: ./test 14690: 14690: symbol=dlopen; lookup in file=./test [0] 14690: symbol=dlopen; lookup in file=/changed_glibc/lib/libdl.so.2 [0] ...

javascript - TinyMCE: validate elements on each keystroke -

i'm using tinymce base wysiwyg editor, , i'd allow subset of html elements entered in it, whatever mean. there 3 different means of entering html elements editor: buttons (such bold button), shortcuts ( ctrl+b bold) , copy-pasting. i'm using custom template, have limited number of buttons allow number of elements. but using shortcuts or copy/pasting, user can add whatever wants editor. the valid_elements configuration option allows filter out elements (it works whitelist), it's triggered on cleanup, (afaik) run when form submitted. this great, i don't want things added editor in first place if they're not valid elements . how achieve behavior? this great, don't want things added editor in first place if they're not valid elements. this not easy because need check each way of code can editor , check before insertion if html code valid. might easier call cleanup on actions: ed.execcommand('mcecleanup'); otherwi...

highcharts - Highstock display two horizontal rules -

Image
hi using charts site http://www.highcharts.com/ . stockchart set option crosshairs: [true, true] display both horizontal , verticall line mouse. questin , possbile display 2 horizontall lines lying out each other defined spread in mt4 ? you can use addplotline() , try add new in each move, or try use renderer path http://api.highcharts.com/highcharts#renderer.path() allows draw line in place.

xml - Error when consuming webservice in java -

hi calling webservice using java following error: severe: exception: org.xml.sax.saxexception: invalid element in iseries.wsbeans.createbiditem.xsd.createbiditemresponse - biditem @ org.apache.axis.encoding.ser.beandeserializer.onstartchild(beandeserializer.java:258) @ org.apache.axis.encoding.deserializationcontext.startelement(deserializationcontext.java:1035) @ org.apache.axis.message.sax2eventrecorder.replay(sax2eventrecorder.java:165) @ org.apache.axis.message.messageelement.publishtohandler(messageelement.java:1141) @ org.apache.axis.message.rpcelement.deserialize(rpcelement.java:236) @ org.apache.axis.message.rpcelement.getparams(rpcelement.java:384) @ org.apache.axis.client.call.invoke(call.java:2467) @ org.apache.axis.client.call.invoke(call.java:2366) @ org.apache.axis.client.call.invoke(call.java:1812) @ p6devc01.p6devc.service.basicsite.services.soap.createbiditemsoapbindingstub.createbiditem(createbiditemsoapbindingstub.java:...

Difference between two strings in VBScript -

i need way find difference between 2 strings in windows application using vbscript . 1 of strings known second 1 unknown during coding. know there functions strcompare , instr etc. these require know second string during coding. explanation: there text box in screen , there several buttons in same screen. , when buttons clicked, text in text box changes depending on button clicked. there way find changes made text after button clicked ? need text entered due button click. there simple way or requires complex coding ? thanks in advance. it depends on application , format of new string. if need find text appended original string, take new text , replace first occurrence of original string empty string: dim strold, strnew, strdiff strold = "apple" strnew = "apple, orange" strdiff = replace(strnew, strold, "", 1, 1) wscript.echo strdiff sample output: , orange or if need appended text without preceding comma, use this: ...

ios - how i can create boundingbox area using mapbox api -

hi m new in iphone development can me cache area using mapbox framework here guideline this you want use rmtilecachebackgrounddelegate protocol this. specify bounding box , region on your mapview.tilecache and start working. question how use protocol , how create bounding box thanks help. i provided answer via mapbox support forums. need learn cocoa apple's developer documentation. learn protocols or else not able create ios applications. pasting code example here when have tried nothing not help.

php - How to add a logo path to my company table in Codeigniter? -

i have form adding companies database. i've added field called logo. want use field user can upload logo company. using codeigniter upload class in form. my company table looks this: companies --------- id companyname address postalcode country email website logo my form looks liek this: <tr> <td><?= form_label('bedrijfsnaam:');?></td> <td><?= form_input('bedrijfsnaam');?><small> (spaties niet toegestaan)</small></td> </tr> <tr> <td><?= form_label('adres:');?></td> <td><?= form_input('adres');?></td> </tr> <tr> <td><?= form_label('postcode:');?></td> <td><?= form_input('postcode');?></td> </tr> <tr> <td><?= form_label('plaats:');?></td> <td><?= form_input('plaats');?></td> </tr> <tr> <td>...

web applications - How to start an Node.JS Web-App -

to start new project/webapp on node.js, need: folder structure; libraries (express, requirejs, mocha, bower, ...); software phases - build, compile, testing, ...; ... which best stack large-scale projects on javascript/node.js? thanks in advance help! first thing's first, keep simple. every new tool add dependency, , potential stress point project. in mind, tools, methodologies, , best-practices server-side javascript development are: folder structure doesn't really matter. makes sense you, , think make sense others if plan have collaborators. search github node.js projects , see how they're structured. found 1 example: https://github.com/thomasdavis/backbonetutorials/tree/gh-pages/examples/nodejs-mongodb-mongoose-restify libraries libraries use going depend on type of project you're working on. rest api hit database? mongodb, redis, mysql, neo4j, ... ? you're going need interface that. express great framework. (i believe can start pro...

xml - How I can execute a Batch Command in C# directly? -

hi have question c# , batch files. want execute batch command , save output in string in c#. can execute file not save content in string , show in textbox. my batch file: @echo off "c:\lmxendutil.exe" -licstatxml -host serv005 -port 6200>c:\temp\hw_lic_xml.xml notepad c:\temp\hw_lic_xml.xml here c# code: private void btnshowlicstate_click(object sender, eventargs e) { string command = "'c:\\lmxendutil.exe' -licstatxml -host lwserv005 -port 6200"; txtoutput.text = executecommand(command); } static string executecommand(string command) { int exitcode; processstartinfo processinfo; process process; processinfo = new processstartinfo("cmd.exe", "/c " + command); processinfo.createnowindow = true; processinfo.useshellexecute = false; // *** redirect output *** processinfo.redirectstandarderror = true; processinfo.redirectstandardoutput = true; process = ...

javascript - How long is the picture url from FB Open Graph User Object valid? -

i have facebook application, have included facebook javascript sdk , works quite good. i asking user basic permissions, want application query after picture object on users profile. this code: fb.login(function(response) { if (response.authresponse) { console.log('welcome! fetching information.... '); fb.api('/me/picture?type=square', function(response) { if( !response.data.is_silhouette ){ var url = response.data.url; // how long data exist? console.log('you have avatar on profile!'); }else{ console.log('you have no avatar uploaded profile!'); } }); } else { console.log('user cancelled login or did not authorize.'); } }); it retrieves profiles avatar image. how long url picture valid? expect url temporary. afaik image valid forever, or @ least until user decides delete it. after it´s static url....

start daemon on remote server via Jenkins SSH shell script exits mysteriously -

i have build job on jenkins building project , after done, opens ssh shell script on remote server , transfers files , stop , starts daemon. when stop , start daemon command line on rhel server, executes fine. when job executes in jenkins, there no errors. the daemon stops fine , starts fine. shortly after starting, daemon dies suddenly. sudo service daemonname stop # transfer files. sudo service daemonname start i'm sure problem isn't pathing does know special way jenkins executing ssh shell script cause daemon start not complete? the problem: when executing build through jenkins, command start daemon process executing, yet after build job done, daemon quit. the solution: thought whole time jenkins killing daemon. tried many different incarnations , permutations of disabling processtree module goes through , cleans zombie child processes. tried fooling resetting build_id environment variable. nothing worked. thanks thread found out that solution...

How to use if / else in .htaccess? -

i have .htaccess file using on multiple domains. now have part of code must run on development site. is possible put if / else statement in .htaccess file? this part of code must run on dev. site authtype basic authname "login required" authuserfile "/var/www/dev.mysite.com/.htpasswd" errordocument 401 default <files "login.php"> require valid-user </files>