Posts

Showing posts from January, 2012

Using PowerShell to convert XML to HTML -

i have xml file: <?xml version="1.0" encoding="utf-8"?> <?xml-stylesheet type='text/xsl' href='file:///c:/program%20files/application/log_format.xsl'?> <!doctype log [<!entity data system 'data/20130408.dat'>]> <log xmlns="runtime:log">&data;</log> the xsl file transforms html. can't open file in ie fine , view expected results. via powershell script convert in plain html. how go that? this blog entry has code snippet should work. uses system.xml.xsl.xslcompiledtransform .net class xsl transformation. rest getting input , displaying output. this comment, guess i'll make answer it's easier other people searching solution.

java - Checking if a message contains a string -

i have have class check id phrase contained in message, tried matcher , pattern , string.contains() , results returned odd. here class: public class motsclesfilter implements emailfilter { final string name = "filtrage par mots cles"; /*private pattern chainespam; private matcher chainecourriel;*/ private int nboccmotspam; private byte confidencelevel; @override public string getfiltername() { return this.name; } @override public byte checkspam(mimemessage message) { analyze(message); if(this.nboccmotspam==0) this.confidencelevel = 1; else if (this.nboccmotspam>0 && this.nboccmotspam<2) this.confidencelevel = cant_say; else if (this.nboccmotspam>1 && this.nboccmotspam<3) this.confidencelevel = 50; else if (this.nboccmotspam>3 && this.nboccmotspam<4) this.confidencelevel = 65; els

mysql - how to get string in among of lines using php -

i having file settings.txt. contains lines like set version=3 set backup_drive=d:\ set backup_directory=backup\ set hourly_directory=hourly\ set input_directory=c:\mysql\data\cdr\ set username=username set password=password this file @ other location or on other server. have file using ... $frserver = file_get_contents("http://ip here/cdr/settings.txt"); i used $file = file_get_contents("http://ip heresettings.txt"); $filearr = explode("\r\n",$file); echo $filearr[5]; // output: set username=desired username and "set username=desired username" bt want "desired username"..just issue left nw now unable username , password it. how username , password can compare them in db... assuming $frserver = 'set version=3 set backup_drive=d:\ set backup_directory=backup\ set hourly_directory=hourly\ set input_directory=c:\mysql\data\cdr\ set username=username set password=password'; the whole solution these 2 l

apache - user is "nobody" when creating directory PHP -

i have following code: mkdir($thumb_dir) which creates directory in proper location, when view permissions owner : nobody group : nobody i don't have shell access chown . how prevent user assigned nobody , how delete folder have made since don't have permission. it's godaddy shared server... you can delete empty directories rmdir(). nobody user runs apache process. can't change owner within php, nor can delete folder using shell access (or make changes on whatsoever) without root permissions; can manipulate through php

asp.net - Automating .Net 1.1 Web Applications deployment -

i have been researching little bit how automate vs2003 web application projects. "devenv.com" solution via command-line require iis , appropriate mapping show stopper tfs2012 team build box , possibly have build same projects different branches (diff physical path same virtual folder mapping issue). alternative far migrate away new project system. want know if able teambuild working web applications projects without altering code drastically (project system or .net target version). ps: aware of msbee , nant not offer of solution.

c++ - libpng warning in Eclipse -

i on ubuntu 12.04 lts using eclipse 3.7.2 trying use mathgl. simple, c++ looks like: #include <iostream> #include <mgl2/mgl.h> using namespace std; int main() { mglgraph gr; gr.fplot("sin(pi*x)"); gr.writepng("test.png"); return 0; } when run following warning : libpng warning: application built libpng-1.2.46 running 1.5.13 and test.png cannot displayed. any ideas on how fix it? thanks! you have re-build app use libpng-1.5.13. built 1.2.46. or read release notes 2 versions , determine supported in 1.2.46 , stay within boundaries. must trying use functionality in lidpng not in 1.2.46

scala - useless implicit keyword assigned to method ? / Play framework 2 -

as official documentation of play framework recommends, can use implicit request in order improve access objects associated request. sample: def index = action { implicit request => session.get("connected").map { user => ok("hello " + user) }.getorelse { unauthorized("oops, not connected") } } this due addition of following implicit method belonged controller trait: /** * retrieves session implicitly request. * * example: * {{{ * def index(name:string) = action { implicit request => * val username = session("username") * ok("hello " + username) * } * }}} */ implicit def session(implicit request: requestheader) = request.session question: why method declared implicit ? isn't enough declare request parameter implicit ? i expected see instead: def session(implicit request: requestheader) = request.session the first implicit keyword indeed not ne

crash - How do I get TWebBrowser in Delphi XE2 to run? -

the twebbrowser component in delphi xe2 seems buggy. there sort of code have run in order instantiate in special way? create new delphi project drop twebbrowser component onto form. in form1.formcreate() call webbrowser1.gohome (to google). if compile 32-bit , go specific webpages error messages. google (ncbi nucleotide blast) , click first link. in addition these javascript errors if click link opens in new window, opens in ie (a separate application). the 64-bit version seems more broken. going same site (ncbi nucleotide blast) entire program crashing due 'divide_by_zero' error. regarding floating point exceptions, twebbrowser expects operate floating point exceptions masked. looks using delphi default floating point settings , have exceptions unmasked. suspect if mask exceptions problems disappear. do so: setexceptionmask(exallarithmeticexceptions); and others have said, silence javascript popups setting silent true .

c# - modal indeterminate progress bars -

i have windows app calls other classes , within thise stored procedures , creates csv file of lot of info. need progress bar runs until done user can see happening. have scoured internet , cant seem work. want bar start running on button click. why seem difficult? closest got starting bar in marquee wont "start" until after object has been filled me no good, need start while object being filled. being done in c#. ideas? you need run long running task in separate thread ui can update while task runs. see windows forms progressbar: easiest way start/stop marquee? example of setting up.

Use Arduino programmer modes to upload code on virtual COM port -

this question related upload arduino code on virtual serial port through arduino ide . main problem being able upload code onto virtual com port instead of using arduino take binary code output , use in other application. problem process of uploading related bootloader on arduino , that's why upload process never reaches 100%. suggested solution either implement bootloader in application or use out there. my question can make use of different programmer modes in arduino ide sort of by-pass bootloader upload process can reach 100% , code reach virtual com port? any highly appreciated. thanks sounds virtual serial port driver getting stuck on timeouts or buffers. ide calls avrdude specific protocol match built arduino's bootloader, loaded on avr. there other bootloader (in fact many, many mention), of may have different timing , such, use them no longer arduino. see possibilities .\avrdude.exe -c. if trying dump of going on serial port. have used virtual serial

exc bad access - EXC_BAD_ACCESS error on fwrite using underlying array from vector class -

i stumped exc_bad_access error. using zlib compress , save data array ch in function deflatereadout called function generate. program fails @ fwrite on marked line. class wsumap { public: vector<vector <unsigned char> > chunk; int xcomp[4]; int ycomp[4]; vector<int> priority; hash hashchunk; wsumap() { chunk.resize(4); chunk[0] = vector<unsigned char>(chunk); chunk[1] = vector<unsigned char>(chunk); chunk[2] = vector<unsigned char>(chunk); chunk[3] = vector<unsigned char>(chunk); priority.push_back(0); priority.push_back(1); priority.push_back(2); priority.push_back(3); xcomp[0] = -1; xcomp[1] = -1; xcomp[2] = -1; xcomp[3] = -1; ycomp[0] = -1; ycomp[1] = -1; ycomp[2] = -1; ycomp[3] = -1; } void generate() { (int = 0; i<chunk; i++) { chunk[0][i]=100; } (int = 0; < 16; i++) { (int j = 0; j < 16; j++) { cout << chu

html5 - Access HTML 5 Player - iOS SDK -

i using hpple links webpages , have problem. because flash unsupported on ios, have use html 5 player. trying access player. if website loads, , user doesn't have flash, there option watch video using html 5 player. html looks like. <a href="http://www.mysite.com/viewvid.php?viewcode=view_code" class="usehtml5"></a> what want know how access html player using ios sdk? i've been trying forever. thank you! you link should load player , can use tag play videos. <video src="http://example.com/path/mymovie.mov" controls height=340 width=640 poster="http://example.com/path/poster.jpg">[enter link description here][1] </video> for more details can check https://developer.apple.com/library/safari/#documentation/audiovideo/conceptual/using_html5_audio_video/audioandvideotagbasics/audioandvideotagbasics.html

c++ - Why does atomic_flag.clear() have a sub-optimal default memory_order argument? -

std::atomic_flag has 2 functions these default std::memory_order s: void clear(std::memory_order order = std::memory_order_seq_cst); bool test_and_set(std::memory_order order = std::memory_order_seq_cst); perhaps i'm wrong, shouldn't clear always memory_order_release , test_and_set always memory_order_acquire ? maybe misunderstand these do. the default memory order sequential consistency ( std::memory_order_seq_cst ) atomic operations in c++11. can specify more relaxed memory order if want, although more complicated reason about. the std::atomic_flag garanteeded lock-free , can used build other synchronization methods. whereas std::atomic<t> types can implemented locks if compiler/library writer chooses , still conform specification. why std::atomic_flag exists these defaults. depending on trying might make sense specify different memory order defaults set conservatively correct sequential consistency.

mercurial - hg: default server name several local reposotories -

i have plenty of small projects served hgwebdir , want configure local repos such way don't need create similar hgrc files every project: [paths] default = http:/ /myserver.com/projectn default-push = http:/ /myserver.com/projectn can use default value this? [paths] default = projectn environment variables won't work (win7). you use schemes extension . put in ~/.hgrc: [extensions] schemes = [schemes] = http://myserver.com and repository hgrc's can contain: [paths] default = my://projectn

ruby on rails - Soft deleting huge user accounts with a background task -

i'm using rails , devise app stores lot of data on users. want make possible user deactivate account similar way facebook if log in, account gets reactivated. far i've tackled using soft delete. problem is, when people delete accounts, there's data needs soft deleted takes while run. naturally, instinct use delayed_job this. problem is, works on account deletion, not on reactivation. don't want users have sit around 10 second while data restored, can't in background, because they'll logged in before of data has been restored. any ideas how go solving problem? thanks in advance! you'll want set soft_delete tracked boolean flag on relevant records. set default scopes return records don't have flag set. when comes time activate or deactivate, gather relevant records , hit them update_all . here's example run against 13,000 user records give sense of time & performance: 1.9.2p320 :001 > user.update_all(soft_deleted: false) sql

3d - Is it possible to use AssImp in a WP8 Direct3D application? -

i'm making application benefit being able import bunch of various model file types, hence interest in assimp. however, appears compiling project arm more difficult seems , since not expert @ compiling foreign systems i'm not having luck using in wp8 app. has been able use assimp in wp8 app? see others have been able make work ios app , compiling wp8 must not impossible, may difficult. so long story short, possible , after couple days of fiddling, managed port over. the way did wasn't best way it, i'll explain here anyways: i spent lot of time trying compile library separately linking it. a. able build both arm , x86/x64 using method unable link it. b. managed built adding source files , dependencies blank wp8 static library template. c. times when did link properly, runtime error saying module not found. through effort spent trying above approach work, became @ configuring vs2012 project compile assimp, went more direct approach avoid having

continuous - php do something with interval -

i have form, : <form name="form1" action="" method="post"> <input type="text" name="tfcari" /> <input type="submit" name="btcari" /> </form> <?php if (isset($_post['btcari'])) { echo $_post['tfcari']; ?> how doing : click submit - echo text - wait 5 seconds - echo text (automatically) - wait 5 seconds - echo text (automatically) - ... thanks all. php pre-processes before sending website, if put sleep method, delay page frrom displaying long. the -easiest- way use jquery ajax call, use settimeout echo text every 5 seconds: // assuming jquery linked $(function() { // connect php file $.ajax({ url: 'php-file-with-tfcari-var.php', type: 'post', success: function(data) { // data ajax call returns, let's assume it's $_post variable php var tfcari = data.tfcari;

Trouble with jQuery video plug in -

i trying use jquery plug in video background, website: http://dfcb.github.io/bigvideo.js/ this how sourcing libraries in html: <script src="jquery-1.6.2.min.js" type="text/javascript"></script> <script src="jquery-1.9.1.js" type="text/javascript"></script> <script src="map.js" type="text/javascript"></script> <script src="jquery.imagesloaded.js" type="text/javascript"></script> nothing seems happening when preview. missing something? have better instructions how use plug in? thank you!

jquery - How to make an image change when a .slideToggle() go up and down -

my code website doesn't work here link fiddle: note jsfiddle updated needs help... jsfiddle if click image changes doesn't change back... line 39 adds image: $("#sel" + i).prepend("<img id='ico" + + "' src='https://dl.dropbox.com/s/5z6muxkoq2ort9l/arrowside.png' width='24' height='24' /> "); you binding click events elements before exist. either move loop above event bind statements, or group them in function can call after rest of script runs. see example: http://jsfiddle.net/tpchp/ function bindclicks() { $("#ico1").click(function() { //rest of code here } //more click binding fun } (var = 1; < recipes.length + 1; i++) { $("#sel" + i).attr("data-hidden", i); $("#sel" + i).prepend("<img id='ico" + + "' src='https://dl.dropbox.com/s/5z6muxkoq2ort9l/arrowside.png' wid

c++ - ASM I/O pins HCS12 micro controller -

iam using hcs12 micro controller. following program have takes input on board keypad , displays letters on board lcd depending on key pressed (i attached portion of code dealing inputs / outputs, can attach rest if need easier on eyes way). what rid of keypad being used inputs, , use sensor have sends active low signals though 3 separate pins instead. way in stead of having push keypad each time, whenever sensor reads 1 of readings (either porta1, 2 or 3) display correct letter. the init_keypad function sets porta0-porta3 inputs. in getkey function im not sure how change if statements read porta0-porta3 individualy void init_keypad(void){ ddra = 0xf0; // pa7-pa4 output; pa3-pa0 input ddrb = 0xf0; pucr |= 1; // pupae =1 (enable pull-up on porta inputs) } char getkey(void){ porta = 0xe0; // selects row 0 if ((porta & 1) == 0){ cmdwrt(0x01); delay(20); if ((porta & 1) == 0) return('l');//true if '1'

code won't show in bash (python) -

i using python on mac , using python through wrangler , lot of stuff going wrong randomly think i'm doing wrong. have simple program , when run in bash on in terminal won't show up. code: def shoes(): j= "jordans" a= "adidas" n= "nikes" question = input("whats ur fav. shoe?") if a: return i access in bash this: cd ~/desktop/scripts ls python shoe.py then nothing shows up add this: if __name__=='__main__': shoes() and if want show something, use print 123 or sys.stdout(123)

javascript - waypoint Plugin Jquery -

this question exact duplicate of: jquery waypoints plugin $(function() { // our dom lookups beforehand var nav_container = $(".nav-container"); var nav = $("nav"); nav_container.waypoint({ handler: function(event, direction) { nav.toggleclass('sticky', direction=='down'); if (direction == 'down') nav_container.css({ 'height':nav.outerheight() }); else nav_container.css({ 'height':'auto' }); }, offset: 15 }); }); how you? - i'm using imakewebthings.com/jquery-waypoints move nav element down page. how ever un-stick nav element @ specific segment of page , when scrolling stick , carry original spot- maybe 30pixcel after scrolling down. any appreciated. if understand you're wanting element stick when passes threshold, , return fixed when goes above that?

java - Moving an extended class from jar to application -

i have interface , 2 classes below. skeletoninterface , skeletonparent auto generated. 3 files resides in jar file, deployed web project under web-inf/lib. have requirement move skeletenchild jar web project. ran issues when tried that. how can expose/access implementation class in web project? // auto generated interface public interface skeletoninterface{ public int foo(int i){ } } // auto generated class public class skeletenparent implements skeletoninterface { public int foo(int i){ // not implement here } } // actual implementation class public class skeletenchild extends skeletenparent{ @override public int foo(int i){ // want implement here } }

order - Quick sort an array and store the new ordering in C -

i have 2 int arrays *start , *end size might 5 millions. *start stores start node number of edge , *end stores end node number. want sort *start in ascending way , stores new ordering scheme, before sorting: start[0] = 5 start[1] = 7 start[2] = 8 start[3] = 1 start[4] = 4 after sorting, becomes start[0] = 1 start[1] = 4 start[2] = 5 start[3] = 7 start[4] = 8 i want stores new ordering scheme "3 4 0 1 2". reason want store new ordering scheme need use rearrange *end. there function qsort() in c library can sorting job doesn't store ordering scheme. there other functions can both? or how write function on own? lot. you should review data structure you're using. if use: struct data { int start; int end; }; you can allocate single array of structure, , use standard qsort() function once sort (once). don't need sort order array order end array since start , end values moved in parallel because they're members of same structure:

io - User input after print -

i'm trying make simple lua program converts fahrenheit celsius , kelvin , don't know how put input command on same line print line. here's mean. i want program display: fahrenheit = "here's user input" i know how make say fahrenheit = "user input" i'm still novice. this code far: print("fahrenheit = ") f = io.read() c = (5/9)*(f-32) print("celsius = "..c) k = c + 273 print("kelvin = "..k) look io.write() , io.read() . instance, say: io.write("fahrenheit = ") the write command writes output screen buffer, doesn't add newline. similarly, read checks latest input, , returns it. for reference, suggest this link tutorial.

mysql - What are the basics for a login system -

i working on project log-in system. want know basics of log-in system including authenticating methods in order called "advanced" log-in system. hmm, need password confirmation, secret question , answer password reseting, check if user admin or not, check if blocked or not, password strength depends on character typed, etc.

CSS Sticky Footer - With Margin -

i'm trying apply method of sticky footer: http://code.google.com/p/cleanstickyfooter/ it works great, however, have 1 problem. design particular site has 34px margin @ top of page. i've tried few ways of implementing it, either doing body {margin-top:34px} or doing container {margin-top:34px} . however, in both cases, sticky footer gets messed up. when try compensate 34px, doesn't ever seem work out. any ideas? here's fiddle example: http://jsfiddle.net/jrzkb/ using modern clean css sticky footer , it's working (on firefox , ie9): http://jsfiddle.net/jrzkb/1/ <body> <header> header</header> <article>lorem ipsum...</article> <footer></footer> </body> html { position: relative; min-height: 100%; } body { margin: 0 0 100px; /* bottom = footer height */ } header { background-color: green; } footer { position: absolute; left: 0; bottom: 0; height: 100

tomcat - Get memory usage of a webapp without catalina resources in jProfiler -

i'm using jprofiler figure out how memory being consumed webapp. i've written simple "hello world" app , launched using tomcat, attached jprofiler jvm , surprised see memory usage. screenshot: http://i.stack.imgur.com/ylrvr.png i guess memory usage shown due catalina consuming resources. idea how find out actual usage webapp, without memory consumed catalina? you have use heap walker in jprofiler find out how string objects referenced. select java.lang.string in "classes" view of heap walker , create new object set then, switch "cumulated incoming references" view , follow large bars.

javac - Compile in Java 6, run in 7 - how to specify useLegacyMergeSort? -

i'm wondering if compile in java 6, runs program on java 7, java 6 or 7 version of arrays.sort used? it's important because new mergesort throws illegalargumentexception, , old 1 doesn't (see comparison method violates general contract! java 7 only ) now, it's possible compile in java 7 using arrays.uselegacymergesort, flag isn't available java 6 - , want compatible on mac os snow leopard (which uses 6). for reason (see http://madbean.com/2006/target14/ ) -target compiler flag doesn't seem produce compatible code, we'd rather compile in java 6. any suggestions? try set system property java -djava.util.arrays.uselegacymergesort=true ... note it's not arrays public api src /** * old merge sort implementation can selected (for * compatibility broken comparators) using system property. * cannot static boolean in enclosing class due * circular dependencies. removed in future release. */ static final c

javascript - .zip file downloading as .php -

i have .zip file generated on server using php. file generated valid , checked downloading via ftp etc. i need create way user download file after generated , file deleted. here headers sending. header("pragma: public"); header("expires: 0"); header("cache-control: must-revalidate, post-check=0, pre-check=0"); header("cache-control: public"); header("content-description: file transfer"); header('content-type: application/zip'); header("content-transfer-encoding: binary"); header('content-disposition: attachment; filename="'.basename($archive_file_name).'"'); header("content-length: " . filesize($this->dirpath."/".$archive_file_name) ); ob_clean(); //echo is_file($this->dirpath."/".$archive_file_name); readfile($this->dirpath."/".$archive_file_name); unlink($this->dirpath."/".$archive_file_name); exit; the code above works

sendkeys - vb.net multi process -

here scenario, have 2 sendkeys application (using timer) , rewrite one, im having problem, example, if enable timer1 send lots of "q" until stop it, if enabled timer2 send "1" "2" "3". output of process qqqqq123q123q123q123q123q123 and it's not wanted, before merge 2 sendkeys output me this qqqq1qqq2qq3qqqqqq1q2q3qqqq1 both timer have same interval. thing happen when merge 2 timer in 1 runnnig application timer1 timer2 timer1 again, alternating process instead of doing in same time. hope can me. thx take @ reference: http://msdn.microsoft.com/en-us/library/system.windows.forms.timer.aspx it says: this windows timer designed single-threaded environment ui threads used perform processing so single threaded, intervals of timer same. behandled sequentially. should use system.threading.thread instead. see example below. make paramaterized thread object takes string argument sendkeys should send on thread. , start

API call to Delete from facebook news feed (facebook.stackowerflow) -

i'm sorry cross posting, seems posted question general stackoverflow (not facebook one). ( api call delete facebook news feed ) could please help? when user (let arnold) posts link friend's wall (to chuck) via app, fb makes post in chuck's news feed (with same link). question - there fb api ability delete message chuck's news feed? once chuck clicks link posted arnold on chucks wall, same link on news feed becomes no longer valid. need drop news feed post (but not wall post) link disposable, in news feed looks "new". in fb documents ( http://developers.facebook.com/docs/reference/api/user/ ) under home section (this connection corresponds news feed) have not found mentions ability delete posts news feed. however there ability delete post. , somewhere on forums mentioned ability set is_hide=true news feed posts. dear guys, please suggest there ability hide/delete news feed posts? can find documentation that? thanks you can delete facebo

c# - Get PDF Printout from console application programatically in background -

how can printout of pdf file printer programatically? printout command should execute without additional dialog popping up. i'm using console application , need without using 3rd party library or tool along lines of @freelancer wrote, use following method uses adobe's registry settings find path acrobat reader executable, prints silently default printer: private void printpdf(string filename) { var hkeylocalmachine = registry.localmachine.opensubkey(@"software\classes\software\adobe\acrobat"); if (hkeylocalmachine != null) { var exe = hkeylocalmachine.opensubkey("exe"); if (exe != null) { var acrobatpath = exe.getvalue(null).tostring(); if (!string.isnullorempty(acrobatpath)) { var process = new process { startinfo = { useshellexecute = false, filename

ios - can i add key value pair to NSarray or dictionary inside a for loop? -

Image
i want add values nsmutabledictionary loop key value pairs ? currently using code for(int j=0;j<[array count];j++){ for(int l=0;l<array2 count] ;l++){ // retreive category plist ,then check whether matching "catid" nsstring *temp=[nsstring stringwithformat:@"%@",allbookplist[@"listbook"][j][@"cate"][l][@"categories"]]; if([catid isequaltostring:temp]){ // "catid" matching temp ,retreive corresponding bid plist nsstring *str=[nsstring stringwithformat:@"%@",allbookplist[@"listbook"][j][@"bid"]]; // add value "bid" , key "catid" mutabledictionary nsmutabledictionary *m=[[nsmutabledictionary alloc]init]; [m setvalue:str forkey:catid]; } } } the result each time value of final dictionary "m" replaced latest val

google apps script - Library with identifier XXXXXXX is missing (perhaps it was deleted?) -

i have created spreadsheet tracking projects status sends custom notifications people watching particular project(s). have moved 99% of code external library , have referenced within spreadsheet script. 1 of actions happens every minute (trigger) synchronize project changes between multiple sheets within spreadsheet. happens less 10 times 1440 executions (every minute in 24 hours) getting error saying library missing: library identifier xxxxxxx missing (perhaps deleted?) i using versioning on library , production spreadsheets have "development mode" set off. do know happening , should check stop errors being raised , sent? according release notes november 4 2013 , fix sporadic missing library errors has been rolled out. (refer issue 2817 .) at same time, change introduced such "if version of library has been deleted library owner, scripts can no longer use version." previously, script have been using version 3 of library, say, after version had

jquery - Sliding Div's removing 1st one from left and adding new from right -

i have 3 div section horizontaly want after time interval left div removed , new div added right direction this html file having 3 div sections within outer div html <div id="sub-category"> <div id="sub-category1"> </div> <div id="sub-category2"> </div> <div id="sub-category3"> </div> </div> in jquery time interval of 5sec after every 5sec slidedivsection(). right removing first div , shifting not adding new div right. jquery function slidediv(){ setinterval(function(){slidedivsection()}, 5000); } function slidedivsection(){ $("#sub-category1").slideup(); $("#sub-category1").remove(); $("#sub-category2").attr('id',"sub-category1");//setting id of sub-cateogry2 sub category1 $("#sub-category2").attr("id","sub-category2&q

root - data directory not accessible android -

i have rooted device , trying write file on /data/data folder, "parent directory of file not writable: /data/data/test.txt" exception occur when control going create file. code: runtime runtime = runtime.getruntime(); process process = runtime.exec("chmod 777 /data/data"); process.waitfor(); resultfile = new file(environment.getdatadirectory()+ "/data/test.txt"); if (!resultfile.exists()) { resultfile.createnewfile(); } please me wrong. change directory /data/data/your_package_name/test.txt

c# - String not getting converted to datetime -

i have have excel file getting date in string format "30-12-1899 07:50:00:am" when trying convert datetime giving error as string not recognized valid datetime i trying convert this convert.todatetime(hometoschool[7],new datetimeformatinfo { shortdatepattern = "dd-mm-yyyy", dateseparator = "-" }) use datetime.parseexact string mydate = "30-12-1899 07:50:00:am"; datetime dt1 = datetime.parseexact(mydate, "dd-mm-yyyy hh:mm:ss:tt", cultureinfo.invariantculture) for more information date , time format strings, custom date , time format strings

apache - DNS & Web Application Deployment -

hi have following situation : currently on 1 vps box (with 1 ip address), have lampp running 'commercial' part of website on port 80. have actual web application running on tomcat on port 8080. i wanted find out approach should take people can go www.example.com (lampp commercial site) or www.example.com/app/ (web app) without having go www.example.com:8080/app/ how go doing in dns , possible @ all? the reason require lampp because use php commercial site, java ee actual web application. you can apache proxying: proxypass /app http://www.example.com:8080/app proxypassreverse /app http://www.example.com:8080/app proxyrequests off now when make request http://www.example.com/app , forwarded http://www.example.com:8080/app transparently.

osx - View Based Table View Within a View Based Table View -

i'm looking create mac app in have table view within table view. i used view based table view , inside it's cellview, i've placed table view. far, good. run program , can see both table views working fine. created different outlets tables warning says warning: unsupported configuration: outlet 'innertable' of 'file's owner' connected 'table view,' invalid destination (object may repeated @ runtime.) i looked error couldn't definite answer. my aim create "pulse" app available iphone / ipad. another thing: when make inner table view - view based, without writing code, error: command /applications/xcode.app/contents/developer/usr/bin/ibtool failed exit code 255 i cannot seem control inner table view in way. here's screen shot of how things in xib. ![screen shot shows xib](http://prntscr.com/zuic3) any appreciated. there demo project in apple documentation called tableviewplayground. in apple demon

java - Rollback auto-generated table values during unit tests -

my unit test config is: junit, dbunit, spring. in spring context have embedded database - hsqldb <jdbc:embedded-database id="datasourcespied"> <jdbc:script location="classpath:test_ddl.sql"/> </jdbc:embedded-database> my unit tests come following class-level annotations: @contextconfiguration(locations = "classpath:/test-context.xml") @runwith(springjunit4classrunner.class) @transactional @testexecutionlisteners({dependencyinjectiontestexecutionlistener.class, transactiondbunittestexecutionlistener.class, dbunittestexecutionlistener.class}) my test schema has following fragments: create table test( id bigint generated default identity, name varchar(255) not null, ... ); the @transactional annotation rollbacks changes make during single unit test method but doesn't clear id values! auto-generated id value doesn't reset, unit tests have dependency on order in run! how reset auto-ge

caching - Grails ehcache.xml custom caches configuration -

ehache.xml cache configuration has been created. setting in file works hibernate 2l cache custom caches (for example caching service methods invocation: @cacheable('somecache') ) cache plugin settings don't work <cache name="somecache" maxelementsinmemory="100" timetoliveseconds="86400" timetoidleseconds="86400"/> but if setting in config.groovy -- works grails.cache.config = { cache { name 'somecache' timetoidleseconds 86400 timetoliveseconds 86400 maxelementsinmemory 100 } } like springcache plugin tried share cachemanager cachemanager(ehcachemanagerfactorybean) { shared = true } where no result now have write configuration in 2 places , cache managing use grailscachemanager.cachemanager & cachemanager.instance any ideas? upd: configuration in config.groovy has been created import grails.test.test grails.cache.config = { domain { name test timetoidle

What is the time complexity of INSERT, UPDATE and SELECT in SQLite? -

i developing android application , using sqlite. wonder that: what time complexity of insert, update , select operations. (i happy if answer in terms of bigo notation other answers welcome.) what cpu usage? both questions vague answer, may help: time complexity: given particular sql statement perhaps figure time , complexity, there many factors point single answer. you might interested in explain query plan can particular selects. cpu usage: again, cpu usage of exactly? complex queries may hit cpu bit more, think you'll find of work i/o.

java - GWT - how to get the tabText of selected tab? -

i want tab text when click on tab. this: tabpanel.addselectionhandler(new selectionhandler<integer>() { @override public void onselection(selectionevent<integer> event) { //get tabtext here } }); but index. assuming using tabpanel , haven't provided custom widget tabbar , this: tabpanel.addselectionhandler(new selectionhandler<integer>() { @override public void onselection(selectionevent<integer> event) { string tabhtml = tabpanel.gettabbar().gettabhtml(event.getselecteditem()); } }); of course, underlying html of tab, <div>tab text</div> . text put in add() methods wrapped in either label , or html widget, whether have chosen display tab text html. of course not handy, need store somewhere tab text (in tabpanel extension i'd guess, or model) @ insertion time (overriding add(...) s) , retrieve when needed (by adding simple getter them).

asp.net - Create multiple parts of complex model in the main view -

i'm little new asp.net mvc, have complex model. public class buildingpermit { public int applicationid { get; set; } public virtual person applicant { get; set; } public virtual area applicantarea { get; set; } public virtual icollection<owner> owners { get; set; } /... } using scaffolding, created controller , views. however, want register details in same page, meaning in buildingpermit 's create view, creating details applicant of type person , applicationarea of type area , on. there way can accomplish this? if it's not possible, think it's possible add link create object. when user clicks on it, page goes view, creates it, information , shows in buildingpermit 's view. i'd appreciate help. you achieve creating editor template person, area, owner etc in: ~/views/shared/editortemplates/person.cshtml ~/views/shared/editortemplates/area.cshtml ~/views/shared/editortemplates/owner.cshtml the editor template w

android - When to delete file shared with external apps by content provider -

in application allow users share files external apps using content provider. files encrypted before can share 1 of files, need decrypt , store in application internal storage. after implemented custom content provider can point file using given url , return parcelfiledescriptor instance. for security issues remove file internal storage after external application has used it, or user canceled operation. edit: external application sharing file 3rd party application. so question is: when should remove file, or know of event can listen or handler can attach file? thank responses. side question be: know of way wouldn't have store file on internal storage, rather send directly stream external app? the answer question use pipes parcelfiledescriptor. code described in busy coder's guide android development commonsware. the solution based on: https://github.com/nandeeshwar/pfd-create-pipe actual solution managed implement is: https://github.com/commonsguy/cw

Google Maps Android API v2 tutorial -

i'm working on tutorial google maps android api v2 @ : https://developers.google.com/maps/documentation/android/start i'm trying simple map shown in app, yet it's not working (the app doesn't open, , there's message box "the "test2" application has stopped.") , don't know why. followed said in tutorial. here's code : androidmanifest.xml : <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.test2" android:versioncode="1" android:versionname="1.0" > <uses-sdk android:minsdkversion="8" android:targetsdkversion="17" /> <permission android:name="com.example.test2.permission.maps_receive" android:protectionlevel="signature"/> <uses-permission android:name="com.example.t

ios - Undefined symbols for architecture armv7: "_OBJC_CLASS_$_SSZipArchive" -

i try using extractzipfile plugin @ this: https://github.com/phonegap/phonegap-plugins/tree/master/ios/extractzipfile but when compiler xcode 4.6.1 in sdk 6.1 throws error: undefined symbols architecture i386: "_objc_class_$_ssziparchive", referenced from: objc-class-ref in extractzipfileplugin.o ld: symbol(s) not found architecture i386 clang: error: linker command failed exit code 1 (use -v see invocation) i try issue @ here: undefined symbols architecture armv7 ssziparchive but shows error: /users/alienware/desktop/extractzipfile/ssziparchive/tests/ssziparchivetests.m:10:9: 'sentestingkit/sentestingkit.h' file not found i work phonegap , make app in ios, dump. update : try add ssziparchive.m compiler source , come new error: undefined symbols architecture i386: "_unzclose", referenced from: +[ssziparchive unzipfileatpath:todestination:overwrite:password:error:delegate:] in ssziparchive.o "_unzclosecurrentfil

Different alignments on a tablerow Android -

i have custom listview layout xml <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="vertical" > <tablelayout android:id="@+id/tablelayout1" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" > <tablerow android:gravity="center" > <imageview android:id="@+id/image" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="left" android:gravity="left"/> <textview android:id="@+id/headline" android:layout_width="fill_parent" android:

asp.net - VS close all folders in solution explorer -

just general q regarding features in vs. i have downloaded source code of tutorial contains vast number of files , folders. reason unknown myself whenever open particular project in vs folders open showing files in project, in solution explorer. instead of spending few minutes minimizing folders in project there general rule or option close folders when project opened/viewed solution explorer. thanks you can use powercommands visual studio 2010 or productivity power tools visual studio 2012 . right-click in solution explorer , choose collapse projects .

c# - .NET Binary Serialization in QuickGraph 3.6 -

for portability reasons, quickgraph 3.6 not allow .net (4.0) binary serialization. necessary when want persist large graphs. unfortunately source code provided authors not compile, impossible enable (binary) serialization. can see here ( quick graph issue ) not 1 has found problem. know how compile quickgraph 3.6 source code? other suggestions? thanks in advance, diego. finally, recompiled project standard library. here solution. d

mysql - Query result is very slow -

i developing website other social networking site using mysql. i wish give people suggestion users, , have implemented functionality in application, working slow. process take 2-3 seconds fetch result server. has necessary indexes, relations on table. have used explain command understand it, got nothing problematic in it. can't understand basic problem in it. please me. here table structure : table : usermaster ~~~~~~~~~~~~~~~~~~ create table `usermaster` ( `userid` mediumint(8) unsigned not null auto_increment, `username` varchar(20) default null, `emailid` varchar(50) default null, `firstname` varchar(20) not null, `lastname` varchar(20) not null, `cityid` mediumint(8) unsigned default null, primary key (`userid`), unique key `ux_usermaster_username` (`username`), unique key `ux_usermaster_emailid` (`emailid`), key `fk_usermaster_citymst_cityid_idx` (`cityid`), key `fk_usermaster_countrymst_count

xslt - Selecting the lowest value from and xml without sorting -

i'm transforming xml document html table using xslt, , want change background color of cell containing lowest "price" value without sorting list. i'm new on this, i'm doing following w3c schools examples. xml file looks this: <?xml version="1.0" encoding="iso-8859-1"?> <!-- edited xmlspy® --> <catalog> <cd> <title>empire burlesque</title> <artist>bob dylan</artist> <country>usa</country> <company>columbia</company> <price>10.90</price> <year>1985</year> </cd> <cd> <title>black angel</title> <artist>savage rose</artist> <country>eu</country> <company>mega</company> <price>11.90</price> <year>1995</year> </cd> <cd> <title>for times</title> <artist>kenny rogers</artist>

android - Have Textview text fill the screen? -

i have activity receives string. string used populate textview. need text fill entire textview, set fixed size. depending on amount of text entered, text should resize maximum size still allow text visible in textview. add snip code in layout : android:layout_width="fill_parent" android:layout_height="fill_parent"

powershell - Script to convert multiple SID to readable username -

i have text file contain below detail, need on script can convert multiple sid readble username, i'm doubt coding. window based permission file contain information below sample when open notepad [/] s-1-5-21-1449722967-1661817991-10773629-12231=rw s-1-5-21-1449722967-1661817991-10773629-15527=rw [am_attg:/] s-1-5-21-1449722967-1661817991-10773629-1207=rw between, have found script convert sid how can use powershell change sid in csv user? therefore, save file .csv , put heading first column user , second column permission user permission [/] s-1-5-21-1449722967-1661817991-10773629-12231 rw s-1-5-21-1449722967-1661817991-10773629-15527 rw [am_attg:/] s-1-5-21-1449722967-1661817991-10773629-1207 rw but getting error below when tried first powershell script, reply on hints post appreciated. import-csv : cannot process argument because v