Posts

Showing posts from February, 2011

php - localhost working fine but phpmyadmin is not -

i have installed wamp server 2.4. installation goes fine. able log the localhost. works fine (includes sqlbuddy , webgrind), except phpmyadmin page. can please me out might causing problem. attaching apache access log here: 127.0.0.1 - - [17/jul/2013:17:20:43 +0530] "get /phpmyadmin/ http/1.1" 500 - 127.0.0.1 - - [17/jul/2013:17:20:43 +0530] "get /favicon.ico http/1.1" 404 209 when try log phpmyadmin page, displays http 500 internal server error. tried reinstalling already. same problem persists xampp. tried too. did start mysql service? i'm using xampp don't know how done in wamp, in xampp have go xampp control panel , press start next mysql.

How to keep the javascript running when the browser tab is not active -

this code: <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script> <script> var myseconds = 20; var mycolor = 'rgba(255, 100, 0, 0.8)'; //alert('you have '+math.floor(myseconds/60)+' minutes , '+myseconds%60+' seconds finish. press “ok” begin.'); $(function(){ $('div#pie_to_be').pietimer({ seconds: myseconds, color: mycolor }, function(){ $('#caspioform').submit(); });}); (function($){jquery.fn.pietimer=function(options,callback){var settings={'seconds':10,'color':'rgba(255, 255, 255, 0.8)','height':this.height(),'width':this.width()};if(options){$.extend(settings,options);}this.html('<canvas id="pie_timer" width="'+settings.height+'" height="'+settings.height+'">'+settings.seconds+'</canvas>');var val=360;interval=setinterval(timer,40);function timer(){var can...

.net - Web Management Service failing at random -

so have custom deploy script looks similar this msdeploy.exe ^ -source:manifest='path_to_manifest' ^ -dest:auto,computername="https://host:port/msdeploy.axd?site=sitename",username='domain\user',password='muhpass',includeacls='false',authtype='basic' ^ -verb:sync ^ -enablerule:donotdeleterule ^ -disablelink:apppoolextension ^ -disablelink:contentextension ^ -disablelink:certificateextension ^ -setparamfile:"path_to_the_file" ^ -allowuntrusted ^ -usechecksum ^ -retryattempts=2 ^ -presync:runcommand="path_to_script",waitinterval=60000 ^ -postsync:runcommand="path_to_script",waitinterval=60000 i have removed of values, can assume they're correct, because scripts deploys app successfully, not every time. step fails: performing '-presync'... info: using id '7bb88177-4329-4b66-a7b9-a563811edca3'...

ssl - What kind of private key is located in a PKC12 pfx file? -

can clarify me kind of "private key" located in pfx file ? i asking because after having read quite lot on digital certification still bit confuse on private key part, when certificate authority involved. the part missing said private key kept secret on ca side if go in personal certificate store , try export certificate, able export private key in it. is private key same private key not supposed know ? if talking ssl-certificates , ssl think mean x509 -certificates in common. let me make clear first: passwords of private keys different . the magic here chaining of certificates, i.e. root certificate ca intermediate certificate ca (for instance class 2) your certificate if @ ssl-certificate, find structure. every certificate within hierarchy can seen certificate own. can find more information within msdn article . briefly description point of view: the certifcates within chain can seen separate certificates. own ability sign information priv...

database - how to implement aggregated tables in vertica -

how implement aggregated table in vertica database? vertica provide inbuilt options. if not possible, alternative ? want avoid overhead of updating in both fact table , aggregated table. for aggregated table, have rolled own in past. using sort of script running via cron , keeping track of aggregated. i highly recommend setting projection(s) tuned types aggregate query desire. if done properly, can see pretty results.

IOS Get if a telephone number is iphone or android -

i developing ios app , want know in adressbook numbers have iphone. know ios use function enable or disable communicate facetime other contacts. any suggestion? well there no way can list of iphone users phone numbers. , talking facetime....i think maintaining database of facetime users phone numbers or emails. and if want this...you need register users of app numbers , emails , verify them well... update: when calling using email address, must verify email address use facetime , signed in apple id account. please refer article

mysql - Quiz layout improvement -

i'm simple quiz. wan't print questions out in 1 page, formatted layout like: question 1 answer 1 answer 2 question 2 answer 1 answer 2 i'm working on following code: $get_qa = $mysqli->query(" select a.question question, a.id qid, b.answer answer, b.qid aqid (related to: question id) rw_questions left outer join rw_qanswers b on a.id = b.qid"); while($qa = $getqa->fetch_assoc()){ echo $qa['question'].$qa['answer']; } this result in messy list. how improve like, wrote @ top? cool! guess need improve foreach or that? build 2 arrays, 1 of them 2-dimensional like: questionid question answer 1 sky has color? blue 1 sky has color? red 2 is? answer 1 .... save in array this: $questions[1] = "sky has color?"; $answers[1][0] = "blue"; $answers[1][1] = "red"; $questions[2] = "what is?"; $answers...

iphone - popToViewController, it isn't give me any crash but, doesn't open controllview and animating so code doesn't work -

uinavigationcontroller *loginnavcon = [[uinavigationcontroller alloc] init]; loginnavcon.navigationcontroller.navigationbarhidden=yes; loginnavcon.navigationbar.barstyle = uibarstyleblack; //i created navigationcontroller hear pushme *p=[[pushme alloc]initwithnibname:@"pushme" bundle:[nsbundle mainbundle]]; //this simple controllview. there colour view [loginnavcon pushviewcontroller:p animated:yes]; nsarray *currentviewcontrollers = [loginnavcon viewcontrollers]; nsmutablearray *vcs = [nsmutablearray arraywitharray:currentviewcontrollers]; [loginnavcon setviewcontrollers:vcs animated:no]; [loginnavcon popviewcontrolleranimated:yes]; [loginnavcon poptoviewcontroller:p animated:yes]; set root with: initwithrootviewcontroller:(uiviewcontroller *)rootviewcontroller if pop, go vc.

sql - How to Convert the converted HTML tags back to the actual HTML Content -

i'm converting html tags xml using "dbms_xmlgen.convert" funciton. ex:- original html text:- <p style="margin-bottom: 0pt;"><font color=#000080 size=2><font color=#000080 size=2> converting xml :- select dbms_xmlgen.convert('<p style="margin-bottom: 0pt;"><font color=#000080 size=2><font color=#000080 size=2>') dual output:- <p style=&quot;margin-bottom: 0pt;&quot;&gt;&lt;font color=#000080 size=2&gt;&lt;font color=#000080 size=2>; now want convert above output actual html content. i.e <p style=&quot;margin-bottom: 0pt;&quot;&gt;&lt;font color=#000080 size=2&gt;&lt;font color=#000080 size=2>; to <p style="margin-bottom: 0pt;"><font color=#000080 size=2><font color=#000080 size=2> please suggest oracle function there or alternate. thanks you have use same function, time additional para...

java ee - DocumentBuilder FileNotFoundException when parsing xml String using continuous deployment on tomcat -

i have utility class converts object xml string , builds pdf out of it. the class working fine started use continuous deployment on tomcat (i.e. app.war deployed app##00010.war , new version of app uploaded twice day) , since having massive issues documentbuilder. my utility class has load several files class path (dtd, fop conf, xsl styesheet, etc.). use full path [path start]/tomcat 7.0/webapps/ app##0010 /[path file] load files filenotfoundexception [path start]\tomcat 7.0\webapps\ app (the system cannot find file specified). hence documentbuilder seems ignoring full path giving him. here method use converts xml string xml file: public static document stringtoxml(string xmlsource) throws saxexception,parserconfigurationexception, malformedurlexception,ioexception{ documentbuilderfactory factory=documentbuilderfactory.newinstance(); factory.setnamespaceaware(true); documentbuilder builder=factory.newdocumentbuilder(); return builder.parse(n...

ios - Xcode Build error with one spec. Library: ld: library not found for -lzbar -

i checked out working app svn. want test in iphone simulator. building failed. ld /users/ludwig/library/developer/xcode/deriveddata/mysoftware-eclocsslmbcdgibhlruzhzsnyctb/build/products/debug-iphonesimulator/mysoftware.de.app/mysoftware.de normal i386 cd /users/ludwig/mysoftware_svn/mysoftware/trunk/mobileclient/ios/mysoftware setenv iphoneos_deployment_target 4.3 setenv path "/applications/xcode.app/contents/developer/platforms/iphonesimulator.platform/developer/usr/bin:/applications/xcode.app/contents/developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin" /applications/xcode.app/contents/developer/toolchains/xcodedefault.xctoolchain/usr/bin/clang -arch i386 -isysroot /applications/xcode.app/contents/developer/platforms/iphonesimulator.platform/developer/sdks/iphonesimulator6.1.sdk -l/users/ludwig/library/developer/xcode/deriveddata/mysoftware-eclocsslmbcdgibhlruzhzsnyctb/build/products/debug-iphonesimulator -l/users/ludwig/mysoftware_svn/mysoftware/trunk/mo...

javascript - Two synced events creating an infinite loop -

i have text area synchronizing goinstant . here code looks like: var myroom = platform.room('myroom'); var mykey = myroom('mykey'); // listen set events on platform key , update textarea mykey.on('set', function(textareacontent) { $('textarea').val(textareacontent); }); // when textarea changes, set platform key $('textarea').on('change', function(){ var textareacontent = $(this).val(); mykey.set(textareacontent, function(err) { if (err) throw err; }); }) this creates infinite loop, when updating 1 text field i.e. when changing value of textarea, triggers platform key update, in turn changes value of textarea infinitely ... edit: based on top answer came following constructor: function bounceprotection() { var remoteupdate = false; // remote toggle this.local = function(cb) { if (remoteupdate) return; cb(); }; this.remote = function(cb) { remoteupdate = true; cb(); remoteupdate = false...

php - How to install New Relic Agent on WAMP -

i've php projects on windows server 2008 uses wamp server. install new relic agent 1 of php websites, couldn't find guides wamp users. is there tried install new relic agent on wamp? if so, how can install it? please don't redirect document has nothing wamp. i've read lot of documentation containing no information wamp server. new relic doesn't have php agent windows. faq confirms this. if want install new relic agent php, have use of os listed here .

g++ - Qt: mingw compiled library does only work with both library.so and library.lib file present -

i compiled library using mingw toolchain provided qt 5.0.2 on windows. result received library.so file. first failed using library in qt application, found out works fine when make copy of liblibrary.so file , call liblibrary.dll or liblibrary.lib (which file ending supported add library wizard in qtcreator). now wonder if normal or if should change in order not have both files (which exact copies). leaving 1 away makes application crash during start up. added library follows qt pro file: libs += -l"../path/to/library" -llibrary includepath += $$quote(../path/to/library) edit: compiled library using mingw of qt, not qt project using mingw32-make , provided makefile. result liblibrary.so . edit: seems work when renaming copy liblibrary.dll instead of .lib. still, need 2 files make application work -- .so , .dll. chris that's weird, think should *.a , *.dll files when building shared lib mingw on windows, said in documentation : in windows, m...

linux - Interpreting time command output on a multi threaded program -

i have multi threaded program , profiling time taken starting before pthread_create's , after pthread_join's. now find time, lets call x , shown below in "done in xms" user + sys time of time output. in app number argument a.out controls how many threads spawn. ./a.out 1 spawn 1 pthread , ./a.out 2 spawns 2 threads each thread same amount of work. i expecting x real time instead of user + sys time. can please tell me why not so? means app indeed running parallel without locking between threads. [jithin@whatsoeverclever tests]$ time ./a.out 1 done in 320ms real 0m0.347s user 0m0.300s sys 0m0.046s [jithin@whatsoeverclever tests]$ time ./a.out 2 done in 450ms real 0m0.266s user 0m0.383s sys 0m0.087s [jithin@whatsoeverclever tests]$ time ./a.out 3 done in 630ms real 0m0.310s user 0m0.532s sys 0m0.105s code int main(int argc, char **argv) { //read words getwords(); //set number of words use int maxwords = words....

c# - add image to datatable or gridview -

i have datatable bind gridview. columns variable i'd take advantage of autogeneratedcolumns. i'd bind image in condtions. need do? void gridview1_rowcreated(object sender, system.web.ui.webcontrols.gridviewroweventargs e) { datarowview drv = e.row.dataitem datarowview; if (drv != null) drv[1] = new htmlimage() { src = "add.png" }; } it sounds autogeneratedcolumns property won't here because column types apply whole gridview; not calculated per-row. you might able use templatefield databinding conditionally format field each row without writing code. if doesn't done you, suppose have write code. bear in mind rowcreated event fires (event on postback) when row created, give non-null dataitem ( e.row.dataitem ) when gridview goes datasource databinding; if gridview has cached rendered state (in viewstate), data item null. @ point, able access row's primary key fields doing this: var keys = mygridview.datakeys[rowindex]; ...

python - How to extract the common words before particular symbol and find particular word -

if have dictionary: mydict = {"g18_84pp_2a_mvp1_goodiest0-hkj-dfg_mix-cmvp1_y1000-mix.txt" : 0, "g18_84pp_2a_mvp2_goodiest0-hkj-dfg_mix-cmvp2_y1000-mix.txt" : 1, "g18_84pp_2a_mvp3_goodiest0-hkj-dfg_mix-cmvp3_y1000-mix.txt" : 2, "g18_84pp_2a_mvp4_goodiest0-hkj-dfg_mix-cmvp4_y1000-mix.txt" : 3, "g18_84pp_2a_mvp5_goodiest0-hkj-dfg_mix-cmvp5_y1000-mix.txt" : 4, "g18_84pp_2a_mvp6_goodiest0-hkj-dfg_mix-cmvp6_y1000-mix.txt" : 5, "h18_84pp_3a_mvp1_goodiest1-hkj-dfg-cmvp1_y1000-fix.txt" : 6, "g18_84pp_2a_mvp7_goodiest0-hkj-dfg_mix-cmvp7_y1000-mix.txt" : 7, "h18_84pp_3a_mvp2_goodiest1-hkj-dfg-cmvp2_y1000-fix.txt" : 8, "h18_84pp_3a_mvp3_goodiest1-hkj-dfg-cmvp3_y1000-fix.txt" : 9, "p18_84pp_2b_mvp1_goodiest2-hkj-dfg-cmvp3_y1000-fix.txt" : 10} i want extract common part g18_84pp_2a_m...

image - "Undefined Reference To 'IMG_Load'" CodeBlocks and SDL_Image Error -

Image
i'm learning sdl through lazy foo's tutorial, can't proceed further img_load doesn't seem work. tried setting says, doesn't work. put include files include folder, , lib files lib folder. found there x86 , x64 folders in lib folder. when tried x64 (because have 64-bit system)it worked fine, codeblocks told me suggestions (like when wrote "img" showed suggestion "img_load" (which means library got initalized?)), when come compiling code, happens: http://puu.sh/3eqa5.png . when try x86 version, exact same error. i had little search around internet, , find few threads, of them abandoned. closest got answering problem this: http://www.dreamincode.net/forums/topic/118299-sdl-image-error-sdl/ guy solved problem downloading problem linux can use, not windows. } i'm running windows 7 64-bit, codeblocks 12.11, sdl 1.2.15 , sdl_image 1.2.12. i don't know problem is! you should go compiler , debugger settings again , under linker...

javascript - jQuery: Search for div containing specific mark up -

i'm stuck editor outputs <p><br></p> when textfield empty , want target divs none content. i've been trying .filter, text lengths, :contains, .html , not can't seem find way <div> contains mark up. other <div> may contain , text normal , fine, need target code below specifically. <div> <p> <br> </p> </div> any idea how approach this? try this... var $div = $("div").filter(function() { return this.innerhtml.replace(/\s+/g, '').tolowercase() == "<p><br></p>"; }); the resulting object ($div) jquery collection of divs you're interested in.

How to run a command correct for CMD in remote box using PowerShell? -

i need run remote command of powershell cmd. command call cmd: powershell -command "$encpass=convertto-securestring -asplaintext mypass -force;$cred = new-object system.management.automation.pscredential -argumentlist myuser,$encpass; invoke-command -computername "remote_computer_name" -scriptblock {<command>} -credential $cred;" in place of <command> (including < , > signs) can command can run in cmd.exe. example there can perl -e "print $^o;" or echo "hello world!" (note: there cannot perl -e 'print $^o;' , because incorrect command cmd due single quotes). appears command perl -e "print $^o;" , other command contains double quotes doesn't handled expected. here expect return os name of remote box perl's point of view, prints nothing due obscure handling of double quotes powershell and/or cmd. so question following, how run command correct cmd in remote box using powershell? ther...

logic - Converting to XOR conjunctive form -

the xor conjunctive form defined follows : (a xor b) , (c xor d)...etc and sat-xcf language defined precedent (xor conjunctive) expressions satisfiable. i know sat-xcf np hard ? thus, there function able convert satisfiable boolean expression satisfiable xor conjunctive form ? thank contribution. i think answer last question "no" 2 variables. specifically, (a or b) cannot represented , of number of xor expressions. there few different xor expressions in 2 variables: false, true, a, b, !a, !b, (a xor b), , (a xor !b). if , of these: false, true, a, b, !a, !b, (a xor b), (a xor !b) you'll set false 1 of 4 possible combinations of (a, b). leaves expression true, different (a or b).

sql - How do I dynamically pivot row values into columns without aggregare? -

lets have following table representing results user survey system. surveyid responseid questionid answer -------- ---------- ---------- ------ 1 1 1 'answer 1' 1 1 2 'answer 2' 1 1 3 'answer 3' 1 2 1 'red' 1 2 2 'blue' 1 2 3 'green' what want pivoted output such shown below. surveyid responseid q1 q2 q3 -------- ---------- -- -- -- 1 1 'answer 1' 'answer 2' 'answer 3' 1 2 'red' 'blue' 'green' i know how achieve if there same 3 questions database hosts multiple surveys have number of unique questionids need q1, q2, q3 columns dynamic depending upon number , ids of survey's questions. i thought...

php - Converting array to individual variables -

i using simplehtmldom parse webpage , extract data , put in mysql database. extracted data , put in array problem facing how convert array variable may use in database query insert record in specific fields. want convert array individual variables here code <?php include("simple_html_dom.php"); $html = file_get_html('abc.html'); $sched = array(); foreach ( $html->find('tr[class=highlight-darkgrey]') $event ) { $item['title'] = trim($event->find('td', 1)->plaintext); $sched[] = $item; } var_dump($sched); ?> and output array (size=6) 0 => array (size=1) 'title' => string 'network admin, field engineer, engineering analyst, sales executive, pa hr director required telecommunication company' (length=124) 1 => array (size=1) 'title' => string 'karachi, hydrabad, lahore, rawalpindi, peshawar, multan, faisalabad' (length...

xslt - Maintaining XML comments during XSL Transformations -

xml <?xml-stylesheet type="text/xsl" href="script.xsl"?> <elements> <stack> <name>ray</name> <status>0</status> </stack> <!-- comment 1 --> <things> <!-- comment 2 --> <thing> <color>red</color> <!-- state comment --> <state>solid</state> <!-- weight comment --> <weight>45</weight> <unit>34</unit> <!-- comment 3 --> </thing> </things> <favs> <stick>ready</stick> <!-- comment 4--> </favs> </elements> expected output <elements> <stack> <name>ray</name> <status>0</status> </stack> <!-- comment 1 --> <mainelements> <!-- comment 2 --> <specialthing> <!-- weight comment --> <propertyone>45</pr...

haskell - Type inference of instance functions -

the problem i want able create 2 data types : a , b , create 2 functions f : f :: -> int -> int f :: b -> string -> string -> string the way can (so far know) use type classes , instances . the problem is, not want explicit write f signatures - want type checker infer me. possible? example code {-# language flexibleinstances, functionaldependencies, undecidableinstances #-} data = a{ax::int} deriving(show) data b = b{bx::int} deriving(show) data c = c{cx::int} deriving(show) -- don't want explicit signature int->int -- love write: -- instance func_f (a->b) instance func_f (int->int) f _ = i*2 -- don't want explicit signature string->string->string -- love write: -- instance func_f b (a->b->c) instance func_f b (string->string->string) f _ s1 s2 = "test"++s1++s2 -- don't want explicit signature a->a -- love write: -- instance func_f c (a->b) instance func_f c (a->a) f _...

algorithm - Print the Longest leaf-to-leaf path in a binary tree along with its length -

i solving problem in have find longest leaf-to-leaf path in binary tree along length. for example, if binary tree follows: /\ b c / / \ d e f / \ \ g h p \ k the longest leaf-to-leaf path k-h-d-b-a-c-f-p of length 8 . i calculating length recursively finding length of left , right sub-tree , return height_left + height_right + 1 . concept correct?. also how should print longest leaf-to-leaf path? want idea proceed. it seems me algorithm close finding diameter of binary tree. diameter of tree number of nodes on longest path between 2 leaves in tree. i think can here implementation: http://www.geeksforgeeks.org/diameter-of-a-binary-tree/ , adapt or optimize it's time complexity if want. think o(n) enough.

sql server - SSRS Report Datasets & Modularity: Query Abstracted SQL Only Once? -

Image
i have bids report displays 2 tables, each based on datasets of similar data formatted differently. both dataseta query data separate stored procedure -- since both stored procedures have similar functionality, i've abstracted portion of repeated sql it's own parameterized function. this works , cleaner, still inefficient because ssrs server calling getenrollments() each dataset separately. wasteful because returns same data. options improving this? ideally make sense create sort of enrollments dataset (queried once) based on function, derive other 2 datasets enrollments set. however, understanding not possible

Check if the browser is Firefox -

i need know if browser running page firefox. came across code below: var isgecko = (navigator.product == 'gecko'); but true firefox , safari. only firefox has string "firefox" in user agent, easy as var isfirefox = (navigator.useragent.indexof('firefox') !== -1); edit: yes, mozilla discourages it

android - Amount of apps you create -

is there limit amount of apps can create on google play android platform. apologize in advance if question answered, searched forum multiple times not find answer. i looking forward long term relationship building apps, wanted see if there cap, or limit, how many apps can submit google play. thanks no, there no limit amount of apps may publish. however, each app must have unique package name, , conceivable run out of unique package names (although it'll take long time). there 65535 character limit on length due java's virtual machine constraints. however, you're more run filesystem problems if package name big fit path. example, windows nt kernel limits file names 32767 characters, limit you'll hit before java one.

android - Why do these ImageButtons changing position using relative layout? -

learning android development through trial , error, i'm having slight issue rendering of buttons on top of image view depending on resolution of phone. i have imageview 2 imagebuttons (at moment) on top. relative imageview. post xml markup below. issue when run on "nexus 4" in android studio, looks correct. when debug through samsung galaxy s4, imagebuttons off slightly, , i'm not sure why problem if relative imageview. understand resolutions different, how 1 go making sure renders same on smallest of screens, newer 1080p screens becoming more popular? i can post pictures if need be, feel xml provide adequate information on issue. any appreciated. in advance! <imageview android:layout_width="fill_parent" android:layout_height="fill_parent" android:id="@+id/srmap" android:layout_alignparenttop="false" android:layout_alignparentleft="false" android:backgr...

module - Why do `perl Foo.pm` and `perl -I. -mFoo -e1` behave differently? -

with code in foo.pm: use strict; use warnings; package foo; begin { $foo::authority = 'cpan:ether'; } 1; loading file module gives no errors: $ perl -i. -mfoo -e1 $ and yet, loading file directly does: $ perl foo.pm name "foo::authority" used once: possible typo @ foo.pm line 6. moreover, perl -e'require "foo.pm"' not warn. why there difference? file being parsed differently, how , why? "why" technical point of view, or language design point of view? from language point of view, makes sense because variable referred within module may part of module's public api. example, data::dumper exposes bunch of package variables alter behaviour. (arguably bad design, ho hum.) these variables might referred once in module, can potentially referred other parts of program. if it's referred in main script once, , no modules refer it, it's more mistake, warning within script, not in module. from technical po...

eclipse - gwt : URL was not found. eclpse/ -

what have proper run app under eclipse web app ? my application working fine under tomcat when start in eclipse using 'run web app' i've got many massages : ' the requested url /com.xxx.xxx.xxx/xxxx not found on server. ' those messages firebug plugin. please help. in eclipse check run configuration . do right click of project : run as->run configuration->web application->arguments -remoteui "${gwt_remote_ui_server_port}:${unique_id}" -startupurl gwtdevtest.html -loglevel info -codeserverport 9997 -port 8888 -war d:\project_backup\sample-workspace2.0\gwtdevtest\war com.test.gwtdev.gwtdevtest as per project path , module, changes in arguments.

delphi - My Tab in the ms.windows explorer -

Image
there such small free program - hashtab ( http://www.implbits.com/hashtab/hashtabwindows.aspx ). once installed, adds tab standard windows file properties , can count checksums of files. how can done (to set tab in windows explorer file properties (on win exp. on file - right mouse click menu -> properties))? delphixe4. p.s. sorry bad english. this called property sheet handlers can try msdn documentation includes c++ sample.

javascript - JS into Rails Asset Pipeline -

my manifest rails asset pipeline looks this: //= require jquery //= require jquery_ujs //= jquery-backstretch/jquery.backstretch.js i have vendor directory follows: vendor assets components jquery-backstretch jquery.backstretch.js but it's not importing backstretch.js file @ error in page. i have components added asset path follows: config.assets.paths << rails.root.join("vendor", "assets", "components") any ideas on how can js file used? from comment above: require needed in front of jquery-backstretch .

asp.net - New Expression Syntax issue -

Image
in asp.net 4.0 page, inside itemtemplate in gridview, have applied new expression syntax binding columns <%#: eval(columnname) %> the data bound in local machine. after deploying server, framework 4.0 installed receive following error cs1525: invalid expression term ':' against above expression. solution regarding ? included in web.config ? have verified deployed server's application pool running .net 4.0 , not .net 2.0 ? the : syntax valid in .net 4.0 , later. here sample screenshot iis: note: ignore lines , text, taken question.

AngularJS and Spring Security. How to handle AngularJS Urls with Spring Security -

let me explain problem. have implemented site in angularjs accessed this: http://localhost:8080/example/resources/#/ here can call different pages, example login page: http://localhost:8080/example/resources/#/login admin page: http://localhost:8080/example/resources/#/admin user page: http://localhost:8080/example/resources/#/user now, have implemented spring security in example in order catch every call , check if has role_user privileges. far good, have done configuration in spring security context file: <security:http create-session="stateless" entry-point-ref="restauthenticationentrypoint" authentication-manager-ref="authenticationmanager"> <security:custom-filter ref="customrestfilter" position="basic_auth_filter" /> <security:intercept-url pattern="/**" access="role_user" /> </security:http> this configuration checks every url called, if user ha...

magento - Use a template/block in a helper -

i have helper method items in customer's cart public function getcartdata() { //get cart data $quote = mage::getsingleton('checkout/session')->getquote(); $cartitems = $quote->getallvisibleitems(); $items = ''; foreach ($cartitems $item) { $items .= $item->getid() . " "; } return $items; } but want replace line $items .= $item->getid() . " "; with instance of template/checkout/cart/sidebar/default.phtml how go this? method being called in ajax controller. want update user's cart without page refresh, needs formatted. so want render what's in template each $item in loop? if @ app/design/frontend/base/default/layout/checkout.xml , see original sidebar block defined: <block type="checkout/cart_sidebar" name="cart_sidebar" template="checkout/cart/sidebar.phtml" before="-"> <action method="additemrender"...

scroll parent to position given child in the middle of the visible area using javascript/jQuery -

i have <ul> 10 <li> elements in it, each of largish (say 200-300px high). have bunch of surrogates these items, small , visible. when user clicks on 1 of these surrogates, scroll <ul> cause corresponding <li> item positioned in middle of visible portion of <ul> (unless 1 of top or bottom elements). i've looked @ bunch of examples use scrolltop: , cannot figure out how specify parameter correctly. i've created jsfiddle illustrate problem. clarification : the scrolling must operate on list, not on body element; must have scroll bar operates list scrolling manually. list 1 component in complex ui, , rest of elements must not scrolled operation. jsfiddle is need? changed markup little bit. function used scrolling: $('.nav li a').click(function(e){ e.preventdefault(); var itemtop = $($(this).attr('href')).offset().top; var itemheight = $($(this).attr('href')).height(); var windowh...

triggers - OAuth 2.0 in background while creating events on GCAL from Salesforce using Google Calendar API v3 (REST API) -

my situation: i'm trying populate shared google calendar when event created on salesforce interface. im using latest google calendar v3 (restful) api same https://developers.google.com/google-apps/calendar/ apex development language. i'm using trigger catches value fields (trigger.new) , passing values class json serialization, authentication , api call. till now, able data object , pass class , serialized. need oauth 2.0 call before can make google calendar api call. https://developers.google.com/google-apps/calendar/ i have setup application on google api console , obtained client id, client secret etc. the usual way oauth 2.0 works authentication page pops-up waiting user grant access api can access calendars linked users account. my question: there way can oauth done in background using static/private key either obtained granting access once not every time or programmatically using key value in class authenticate user. looking forward getting useful suggest...

java - Order by not working for child objects in Hibernate -

i want retrieve child objects sorted on particular column. have parent class student public class student { @id @generatedvalue(strategy=generationtype.auto) @column(name="student_id") private long studentid; @column(name="student_name") private string studentname; @onetomany(mappedby="student") private list<phone> studentphonenumbers ; } and child class phone public class phone { @id @generatedvalue(strategy=generationtype.auto) @column(name="phone_id") private long phoneid; @column(name="phone_no") private string phonenumber; @column(name ="update_tmstp") private date updatetmstp; @manytoone @joincolumn(name = "student_id") private student student; } i fetching student object in turns gives me list of phone nos. , want phone nos sorted based on column updatetmstp wrote this student stu = (student)session.cr...

Opening a .csv file with vbscript that is constantly being updated -

i have .csv file 1 line being overwritten updated data data bus. looks this: doors closed, open, closed, closed, and it's being updated (lets every second) valve changes show in csv file, so: doors closed, closed, closed, closed, if have vbscript reading line of information receive errors trying access said file? here's pretty code have part: 'create file system object set fso = createobject("scripting.filesystemobject") 'initialize few items strsource = "c:\test.csv" 'open source file read set inputfile = fso.opentextfile(strsource,forreading) 'skip first line since heading strline = inputfile.readline 'read file line line while not inputfile.atendofstream strline = inputfile.readline 'split line on comma array strvalues = split(strline, ",") the code works .csv files aren't in use wondering if throw errors (even though i'm reading it) if file accessing being updated. thanks ...

Object Oriented PHP Email Contact Form Not Sending -

i have done quite few contact forms in php no problem, i'm new oop , can't quite wrap head around how should work. i'm working tutor helping me self teach this, giving me resources learn oop, i'm stuck on this. make simple contact form send user info email specified on same form. these requirements: the user class should: contain relevant submitted data properties of class have constructor method let declare class , set data in 1 statement the email class should: be static have method let send email in 1 statement have method replace formatting tags ([b] / [i] / [[name]]) proper equivalent have proper access methods (private / public) i'm not worried validation or syntax conversion right want work through why email isn't sending. runner.php: <?php class user { public $firstname; public $lastname; public $toemail; public $fromname; public $fromemail; public $subject; public $message; public function post() { if (isset($_post['s...

php - method return html symfony2 -

i try send html code in symfony2 : public function testaction() { $html = '<input type="text">' return $this->render('testbundle:default:index.htlm.twig',array( 'html' => $html, )); } when use html variable in page index.html.twig : {{ html }} result <input type="text"> but not want result. result want page index.html.twig display me input (the text area). an answer doc : http://twig.sensiolabs.org/doc/api.html#escaper-extension the escaper extension adds automatic output escaping twig. defines tag, autoescape, , filter, raw. when creating escaper extension, can switch on or off global output escaping strategy: $escaper = new twig_extension_escaper('html'); $twig->addextension($escaper); if set html, variables in templates escaped (using html escaping strategy), except using raw filter: {{ article.to_html|raw }} you can change escaping mode locally using autoescape tag (se...

OCI8 for PHP (Oracle Connection) values come with spaces (completed to full lenght) -

i using oci8 php connecting oracle 11g database. everything working fine, imported values oracle database come spaces, completed full lenght. for example, value on db nchar(10 char) 'value' oci8 returns 'value ' with 5 spaces, 10 chars total. any ideas or recommendations? yes, *char types in oracle have spaces appended way end, not php-specific. use rtrim() if don't want them: select rtrim(field_name) field_name ... ... or php's own rtrim() of course.

Javascript If else statement trouble within a Function Validate() -

the following script should validate input fields depending on selection user makes in drop-down box (var problem). the trouble i'm having when if statement runs problem == 4 (below) , user has filled in corresponding cityid field, alert (alert#3) next if statement (problem == 5) triggered. want alert#3 trigger if user has selected problem == 5 drop-down , has not filled in model field. the same trouble happens respectively when if statement runs problem == 5. function validatesor() { var user = document.sor.user; var problem= document.sor.problem; var cityid = document.sor.cityid; var errors1 = document.sor.errorcodes1; var model = document.sor.model; var errors2 = document.sor.errorcodes2; var software = document.sor.softwaretype; if (user.value == "") { window.alert("please enter name."); user.focus(); return false; } if (problem.selectedindex < 1) { alert("al...

.htaccess - rewrite rule in htaccess didnt work -

im trying beautify urls, urls that http://www.mysite.com/details.php?id=19&object=1 object=1 (videos) or object=0 (articles) i want change url to http://www.mysite.com/videos/19 of course make videos because mentioned when object =1 means videos and when object =0 i want this http://www.mysite.com/articles/19 i tried using tutorials , didnt work.nothing happen. options +followsymlinks rewriteengine on rewriterule ^videos/([a-za-z]+)/([0-9]+)/$ details.php?object=$1&id=$2 and how do if condition rewritecond check if object 1 or 0 , if 1 print videos else articles. any apreciated. it better use rewritemap case here. here sample how use it: add following line httpd.conf file: rewritemap objmap txt://path/to/objectmap.txt create text file /path/to/objectmap.txt this: articles 0 videos 1 add these line in .htaccess file under document_root : options +followsymlinks -multiviews rewriteengine on rewriterule ^(...

c# - How to get all XML nodes with the same name without knowing their level? -

i have xml example: <fruits> <red_fruits> <red_fruits></red_fruits> </red_fruits> <yellow_fruits> <banana></banana> </yellow_fruits> <red_fruits> <red_fruits></red_fruits> </red_fruits> </fruits> i have 4 red_fruits tags, 2 of them shares same parentnode (fruits), want have same parentnode. but want have same name (red_fruits), means yellow_fruits tag isn't included. this way doing right using c# language: xmldocument doc = new xmldocument(); string selectedtag = cmbx.text; if (file.exists(txtfile.text)) { try { //load doc.load(cmbfile.text); //select nodes xmlnodelist selectednodelist = doc.selectnodes(".//" + selectedtag); } catch { messagebox.show("some error message here"); } } this returning me red_fruits, not ones belongs fruits. i can't ...

sql - trying Insert data of tables into one temporary table and insert again into same temp table from a different table -

trying insert data of tables 1 temporary table adn insert again same temp table different table select sfb.sap_ship_to,sfb.sap_sold_to,sfb.invoice_date,fb.material_group,sfb.fuel_group,sfb.interface_status,sfb.gross_flag,sfb.gross_qty, sfb.net_qty into #mda_temp_sap_fuel_bdocs mda_agreement_site sas join sap_fuel_bdocs sfb on sas.sap__c = sfb.sap_ship_to sfb.interface_status = 'summed'/* and */ -------------------------------------------step2 select sfb.sap_ship_to, sfb.sap_sold_to, sfb.invoice_date, sfb.material_group, sfb.fuel_group, sfb.interface_status, sfb.gross_flag, sfb.gross_qty, sfb.net_qty #mda_temp_sap_fuel_bdocs mda_agreement_site sas join sap_fuel_bdocs_archive sfb on sas.sap__c = sfb.sap_ship_to sfb.interface_status = 'summed'

flash - Javascript setInterval change background? -

i want use javascript make element change it's background color red when jumped link further page. after second should change white, give sort of flashing effect. i've managed change red white, keeps on going! can tell me how make flash once? this javascript code... function glow() { setinterval( function() { var see = document.getelementbyid("see"); var run = document.getelementbyid("run"); var enter = document.getelementbyid("enter"); see.style.backgroundcolor = 'red'; run.style.backgroundcolor = 'red'; enter.style.backgroundcolor = 'red'; }, 400); setinterval( function() { var see = document.getelementbyid("see"); var run = document.getelementbyid("run"); var enter = document.getelementbyid("enter"); see.style.backgroundcolor = 'white'; ...

sql - Dropping last record with autoincrementing primary key -

suppose have database auto-incrementing primary key , 25 records (pk goes 1 25). delete record pk=25; pk values go 1-24. add new record. pk value 25. this quite problematic if other tables used value 25 foreign key. would linked erroneous record. how issue customarily addressed? in databases, once allocated, auto increment value not reused if original row deleted. there exception in sqlite if rely on built-in rowid value rather declaring column autoincrement. in second case, things work expect (values never recycled). in first case, however, in situation describe (deletion of highest-numbered row), value will recycled. but consider in case describe rowid used primary key , all other references protected enforced foreign key relationship then, in order delete record value 25, references must first removed database. the problem occurs when have non-enforced references primary key value. nonetheless, think it's best practice explicitly declare primary key...

silverlight - Component One Pdfviewer override save button -

is there way override save button on pdfviewer component one? you can refer sample shows how create custom c1reportviewer or c1pdfviewer toolbar. same can implemented c1.wpf.toolbar well. regards, mohita

visual studio 2012 - Move Cursor Up/Down Lines -

i'm trying mimic functionality set in sublime text allows me move cursor 'j' or 'k' in vi. in windows world guess similar pgup/pgdn, i'd go up/down 1 line not 1 page. here's bindings in sublime text i'd mimic: [ {"keys": ["ctrl+i"], "command": "move", "args": {"by": "lines", "forward": false}}, { "keys": ["ctrl+k"], "command": "move", "args": {"by": "lines", "forward": true}} ] edit: logarr pointed out, easier way phrase want mimic up/down arrow keys using ctrl+i , ctrl+k there vim extensions visual studio. there free vsvim extension works in visual studio 2010+ , viemu works in visual studio 2003+ plus few other applications. if want remap , down keys, can change keyboard mapping. tools->options find keyboard section. there can change key bindings edit.linedown ,...

Trim() the values of all xml elements and attributes in an xml document using c# -

i'm trying figure out simplest way take xml this: <car> <description model="ford ">blue </description> </car> into this: <car> <description model="ford">blue</description> </car> using linq xml, how like: foreach (var element in doc.descendants()) { foreach (var attribute in element.attributes()) { attribute.value = attribute.value.trim(); } foreach (var textnode in element.nodes().oftype<xtext>()) { textnode.value = textnode.value.trim(); } } i think should work... don't believe need use tolist avoid disturbing things iterate, you're not changing structure of xml document, text.

sql server - SQL Overlapping Date Range -

i have table 3 fields "start date" , "end date" , "allocation %". need find out records in table falls within 3 months current date, and (this 1 tricky) records overlapped date ranges sum(allocation %) > 100. please me come query. this table schema. table (resourceassignment) - resourceassignmentid (pk) - resourceid (fk) - assigned (fk) - start date - end date - allocation % i need find on allocated resources within period (from current day 3 months). thanks in advance! not sure if you're after, show resourceid allocation above 100% begin or end date within last 3 months: select resourceid resourceassignment startdate between dateadd(month,-3,getdate()) , getdate() or enddate between dateadd(month,-3,getdate()) , getdate() group resourceid having sum([allocation %]) > 100

bash - replace double quoted hash with sed -

i have problem replacing default password hash in config file: sed -i 's/default_password_crypted: "[^"]*"/default_password_crypted: "\$1\$mf86/uhc\$wvcicxred6crbz2onwxyac."/' input.txt i following error: sed: -e expression #1, char 74: unknown option `s' works: search pattern: default_password_crypted: "$1$mf86/uhc$wvcicx2t6crbz2onwxyac." sed -i 's/default_password_crypted: "[^"]*"/default_password_crypted: "1234567890"/' input.txt how need write replace pattern hash ? thx you need escape literal / inside replacement it’s delimiter: sed -i 's/default_password_crypted: "[^"]*"/default_password_crypted: "\$1\$mf86\/uhc\$wvcicxred6crbz2onwxyac."/' input.txt or use different character, example , : sed -i 's,default_password_crypted: "[^"]*",default_password_crypted: "\$1\$mf86,uhc\$wvcicxred6crbz2onwxyac.",...

How can i Use image in menu in wordpress? -

my whole website made in wordpress. menu's in text links. want highlight 1 of them using image link instead of text link. how do in wordpress? each menu item has unique css id, in following example: <li id="menu-item-765"><a href="http://menu.item/url/">some menu item</a></li> create menu , @ page source find menu id's. can set background image menu item , hide text using css. using above example: li#menu-item-765 { display: block; background-image:url('http://url.to/yourbackgroundimage.jpg'); background-repeat: no-repeat; width: 100px; height: 50px; text-indent: -9000px; } set width , height properties size of image. text-indent property hides menu link text off screen, , background-image property displays image instead. repeat each menu item.