Posts

Showing posts from 2011

html - Unexpected gap between columns with absolute positioned elements -

i trying make line have 3 columns have hover effect shows item description. on google chrome, when hover first item, gap appears between second , third column. on mozilla firefox same thing happens when it's 4 or 2 columns instead of three, gap appears between 2 last items. markup <div class="row row-3"> <div class="column"> <img src="http://placehold.it/800x650" alt="" class="image" /> <div class="info"> <p class="description">lorem ipsum dolor sit amet, consectetur adipisicing elit.</p> </div><!-- .info --> </div><!-- .column --> <div class="column"> <img src="http://placehold.it/800x650" alt="" class="image" /> <div class="info"> <p class="description">lorem ipsum dolor sit amet, con...

typoscript - Seperate Headline and Content-Elements with TS and Fluid | Typo3 -

i use project fluid template engine. here want seperate headline-elements backend (column normal). my idea is, write in ts following code: lib.pageheadline = user lib.pageheadline{ [...] } and in page object following code 10 = fluidtemplate 10{ [...] variables{ [...] pageheadline < lib.pageheadline } } the problem become headline. hope problem understandable. ok ... it's easy. here solution, render headlines seperate content fluid-templates. temp.pageheadline = content temp.pageheadline{ table = tt_content select{ pidinlist = = colpos = 0 } renderobj = text renderobj.field = header } pageheadline < temp.pageheadline this all.

azure - How to stay logged-in in windows phone 8 , c#? -

i wrote application allows new user sign in (using azure). when clicking on home button, , after seconds returning application (without logging out) - need sign in again. i want allow user stay signed in. can help? thanks!

node.js - Migration from Java backend with simple Javascript frontend to MEAN stack -

i created client-server web app using java backend (jboss resteasy, jackson, mongodb) , javascript frontend (just jquery , plugins). now learning javascript want create same app using mean stack. what should start with? necessary tools installed (node.js, grunt, bower etc). mongodb needed data ready. should start mongoose model data? or angular part? i suggest building bottom-up existing documents in mongodb mongoose models , doing quick prototype replicate key performance scenario of existing application. capacity planning, you'll have real application workloads , foundation add angular on top of later.

PHP loop that stops at every iteration -

we have game writing in php , need loop through each player , allow them make move. problem having php loop through for , while loop upon page load , not let each player turn. actually right in infinite loop since never evaluates true because doesn't let them make turn. should stop , let each player movehere() . activeplayer enables game board each player , once movehere executes properly, set $turnover true. however, loop never pauses , infinitely loops. see code snippet: for ($i=1; $i<=$charactercount; $i++) { activateplayer($i); while (!$turnover){ movehere(); } } "pausing" php makes no sense. php server-side, cannot interact php page @ middle of execution client (the browser). you should consider reading documentation javascript , ajax (and client/server communication).

java - If the constant interface anti-pattern is such a crime, why does Swing do it? -

i making swing application, , realized had handful of classes needed access same set of constants. couldnt bring myself declare 1 primary holder of them , place them in there , have others reference it; thought, hey, i'll have them inherit common place, java doesnt multiple inheritence, can put infinity interfaces on things. idea came me dump them interface (it's true, naturally occurred me without doing research). i later learned heresy. "in fact, it's such bad idea there's name it: constant interface antipattern" - as discussed here (along alternate solution (which opted employ)). i fine until looking @ source code jdialog , jframe , read thusly: public class jdialog extends dialog implements windowconstants, accessible, rootpanecontainer, transferhandler.hasgettransferhandler { ... and public class jframe extends frame...

File upload using Guava and apache common? -

i use guava , apache commons convert temporary image have been loaded server conversion result corrupted file. problem "samplefile" corrupted , don't know why until have no error. import com.google.common.io.files; import org.apache.commons.codec.binary.base64; import java.io.file; import java.io.filenotfoundexception; import java.io.fileoutputstream; import java.io.ioexception; import java.util.uuid; public class imagedecoder { public static void main(string[] args) { byte[] data = null; final file input = new file("c:\\users\\xxx\\appdata\\local\\temp\\multipartbody2180016028702918119astemporaryfile"); try { data = base64.decodebase64(files.tobytearray(input)); } catch (exception ex) { system.out.print("problem"); } final file f = new file(string.format("samplefile_%s.jpg", uuid.randomuuid())); try { if (!f.exists()) ...

vb.net - cannot copy paste from datagridview -

i have simple blank windows form test project , datagridview , query fill datagridview in test project. can highlight columns , rows click ctrl + c open excel then click ctrl + v and data there. but on program inherited in company have similar data grid view. cannot copy paste how can identify difference here? check data grid view properties both test project , program inherited. both has same following: 1. read = false 2. copyclipboardmode = enablewithautoheadertext what else prevent me copy paste value? in inherited program way copy paste ist double click cell , copy, but. limits me copy 1 cell @ time , instead of multiple cell please advise? thank you this code snippet test project private sub form1_load(sender object, e eventargs) handles me.load datagridview1.rows.add(new string() {"test", "test2", "test3"}) datagridview1.rows.add(new string() {"test", "test2", "test3"}) datagri...

CSS for Symfony2 forms: "Hello World" equivalent -

how alter fields.html.twig template? looking "hello world" equivalent see first ever change form. what's working (within bundle view add.article.html.twig): <div class="well;"> <form method="post" {{ form_enctype(form) }}> {{ form_widget(form,{attr: {class:'test'}} ) }} <input type="submit" class="btn btn-primary" /> </form> </div> the test class doing css .test{background-color:grey;}. using bootstrap. in fields.html.twig have: {% block aliquam_input %} {% spaceless %} <div> {{ form_label(form) }} {{ form_errors(form) }} {{ form_widget(form, { 'attr': {'class': 'test'} }) }} </div> {% endspaceless %} {% endblock %} and in app/config/config.yml: # twig configuration twig: //.. form: resour...

r - Get table from one frame HTML using Rcurl and XML -

how 1 table on search in http://portal.inep.gov.br/basica-censo-escolar-matricula the table within th frame. i have select state owns data: e.g acre , click in "consultar" how can this? you can selenium require(rselenium) appurl <- "http://portal.inep.gov.br/basica-censo-escolar-matricula" rselenium::startserver() remdr <- remotedriver() remdr$open() remdr$navigate(appurl) # find iframes iframes <- remdr$findelements("css selector", "iframe") iframes[[1]]$highlightelement() # visual check remdr$switchtoframe(iframes[[1]]) # estado selections webelems <- remdr$findelements("css selector", "#uf option") estadonames <- sapply(webelems, function(x){x$getelementtext()[[1]]}) webelem <- webelems[[which(estadonames == "acre")]] webelem$clickelement() # click submit button webelem <- remdr$findelement("id", "btnsubmit") webelem$clickelement() # find table web...

mysql - PHP function calling sql SUM not working -

don't know why function not working function sumall($row ,$monthnr, $first){ $data = "select sum($row) closeday month(dates) = $monthnr , year(dates) = year(curdate())"; $result = mysql_query($data); $query_data = mysql_fetch_row($result); $first = $query_data[0]; return $first; } //calling function sumall('total' , 01, $first); help please thanks you have non sence parameters in function, try this: function sumall($row,$monthnr){ $data = "select sum(".$row.") sums closeday month(dates) = '".$monthnr."' , year(dates) = year(curdate())"; $result = mysql_query($data); $query_data = mysql_fetch_array($result); $first = $query_data['sums']; return $first; } call that: sumall('total' , 01);

Java and Scala not working together -

i have 2 projects, 1 maven java , maven scala. the scala 1 library, want use in java application. i have following dependencies in both : <dependency> <groupid>org.scala-lang</groupid> <artifactid>scala-compiler</artifactid> <version>2.9.0-1</version> <scope>compile</scope> </dependency> <dependency> <groupid>org.scala-lang</groupid> <artifactid>scala-library</artifactid> <version>2.9.0-1</version> </dependency> and found on googling, maven-scala-plugin in both apps <plugin> <groupid>org.scala-tools</groupid> <artifactid>maven-scala-plugin</artifactid> <version>2.14.3</version> <configuration> <charset>utf-8</charset> ...

angularjs - Call Angular Controller function on application Close -

i want execute function before application close. have code executing before route changes fine, want execute same function if close application instead of changes route..is there way? $scope.$on('$destroy', function () { element.autosave(); }); the "onbeforeunload" event fires before window starts unloading resources. more info here: mdn onbeforeunload beware of on handler, browser not complete, example, ajax request before unloading.

database - Sql data loading blank row errors -

Image
i have excel file contains data needs loading sql script. have gotten of done coming against problem due spreadsheet. spreadsheet has data in rows implicit 1 above (see picture below). does have idea of how can this? links other pages welcome,i wouldn't know how start searching this. quick way fill blanks in excel: select table hit f5 click special tick "blanks" , hit ok all blank cells in table selected. without changing selection, type = sign hit arrow key on keyboard. hold down ctrl , hit enter now blank cells contain formula references cell right above. copy table , paste on paste special > values replace formulas values. far less key strokes writing macro, , faster in processing, too.

javascript - How to merge two different HTML? -

how can merge 1 table table other page? i basicly having 3 radio buttons. my intention when first tick a,then show website , next while ticking b...i shall able view website too...so after thinking b...i see website on left & website b on right. but code below not work expected...it juz display content of last radio button tick. kindly assist.tq <!doc html> <html> <title></title> <head> <script type="text/javascript"> <!-- function show(id) { if (document.getelementbyid(id).style.display == 'none') { document.getelementbyid(id).style.display = ''; } } //--> <!-- function hide(id) { document.getelementbyid(id).style.display = 'none'; } //--> </script> </head> <body> <table cellspacing="1" cols="3" border="0"> <tbody> <tr valign="top" align="left"> <td width="202"><...

Parsing through many big files in folder using terminal command and outputting terminal output to text file (C/C++) -

i'd read in output specified terminal command , store in text file. terminal command includes path file in i'd loop through each file in folder, , storing output terminal text file. want keep output in 1 text file in order. for example, i want use command in terminal: "translate /data/xyzdata/raw/ne/vdata* * *.gz" where translate user built command takes .gz file , outputs ascii on terminal display. * represents changing part of file name each time parses through contents of folder. note these files enormous. data particle physics detector. eventually, i'd parse through .../raw/**/... well, going through few other folders. i'd take text file , read in lines , sum columns produce histograms of hit rates per detector section. a typical file looks this: 00000000 00000010 00010001 11001100 where each digit section of detector , 1 represents "hit". any ideas? i'm open trying new.

amazon web services - Does ELB connection draining apply when spot instances are terminated? -

a new aws elb feature, connection draining, announced. http://aws.amazon.com/about-aws/whats-new/2014/03/20/elastic-load-balancing-supports-connection-draining/ apparently works auto scaling groups - instances drained before being removed, apply spot instances being terminated aws due rising spot price? nothing definitive find, reading on this, think answer no. spot instances different animals regular instances, , way connection draining works can specify upto 60 minute delay before connection-drained enabled instance gets terminated when becomes unhealthy - if aws allow added layer of safety spot instances, up-end way spot instances used , how positioned. the trade-off using spot instances has been, "you can pay fraction of cost, risk being terminated @ instant without warning"...if added 60 minute 'warning' spot instances, while fantastic end-users point of view, think severely eat aws's on-demand , reserved instance pricing model , won't ...

java - What's the meaning of "Maven projects do not use runtimes" -

when convert java web project (with runtime environment of tomcat or so) ordinary project maven project, prompts "maven projects not use runtimes" . what's meaning of it? the purpose of maven support build activities resolving build time dependencies. so, in maven pom should add libraries required complete successful build. the runtime libraries not required perform build , setup runtime libraries there other ways i.e. can add them using project properties dialog box --> targeted runtimes. you can refer this discussion relevant question.

java - Updating list after insert new items through a JSP form -

in spring project, passing list jsp page controller in way: mav.addobject("tipos", tipo.listatipos()); mav.addobject("campos", atributo.listakey()); in jsp page, besides display items, can add new items too, demonstrated in code below (both html , jquery): html <table class="bordered campos" id="edit_campos"> <thead> <tr> <th>campo</th> <th>#</th> </tr> </thead> <tfoot> <tr> <td> <input type="text" name="nome_campo"> </td> <td> <button type="button" id="incluir_campo" class="btn btn-link">incluir</button> </td> </tr> </tfoot> <c:foreach var="item_key" items="${campos}"> <tr id="linha_${item_key.id}"> <td> <input type="text" name="${item_key.nome}" va...

java - Sending a BlobMessage using JmsTemplate with CachingConnectionFactory -

i using activemq message broker , have jms requirement of sending big document input stream processed consumers. issue have if use spring's org.springframework.jms.connection.cachingconnectionfactory wrap activemqconnectionfactory, i'll have cast session object (javax.jms.session) org.apache.activemq.activemqsession suggested in here ( sending files using active mq blobmessage ). exception if cast generic session object activemqsession because spring provides proxy javax.jms.session , not target object proxies (ie org.apache.activemq.activemqsession). solution resorted use plain activemqconnectionfactory instead of using cachingconnectionfactory. there way me keep cachingconnectionfactory without getting classcastexception sample code below? jmstemplate.send(new messagecreator() { public message createmessage(session session) throws jmsexception { org.apache.activemq.activemqsession activemqsession = ((org.apache.activemq.activemqsession) session); b...

string - Is it possible to use the KMP algorithm to find a longest substring? -

suppose have pattern p , text t, , want find largest prefix of p matches substring of t. possible modify kmp algorithm such operation? (if remember correctly, kmp algorithm partial matches, interested in longest possible match). as kmp scanning text, state of kmp shows length of longest prefix of pattern matches text current point, record maximum length seen , point in pattern @ seen, , use find longest matching prefix of p. another way of doing put prefixes of p aho-corasick. run-time behaviour similar, although consume little more store. allow use existing library - if had 1 aho-corasick, instead of modifying kmp implementation.

c++ - Windows String Formats -

this absolutely newbie's question. i writing first c++ console application. retrieve command line arguments using commandlinetoargvw . second argument supposed integer, convert string integer. problem: atoi gets const char * commandlinetoargvw returns pwstr * . need start using conversion functions, or (hopefully) missing something. thank you.

xcode5 - Pass integer between two view controllers -

what i'm trying accomplish pretty simple: passing integer between view controllers. i've looked @ ton of tutorials , thought had it, code seems need fixing. viewcontroller1.h int selectnumber; @interface viewcontrollerincome : uiviewcontroller { iboutlet uilabel *inputnumber; } -(void)setintval:(nsuinteger)inval; viewcontroller1.m #import "viewcontroller2.h" -(void)setintval:(nsuinteger)inval { _intval = inval; } - (ibaction)enterbutton:(id)sender{ selectnumber = _intval; } viewcontroller2.h int incomenumber; nsuinteger _intval; @interface viewcontroller : uiviewcontroller @property (weak, nonatomic) iboutlet uilabel *numberlabel; viewcontroller2.m - (void)viewdidload { [super viewdidload]; // additional setup after loading view, typically nib. [nsstring stringwithformat:@"%d",_intval]; incomenumber = incomenumber + _intval; numberlabel.text = [nsstring stringwithformat:@"%i", incomenumber]; _intval = 0; } as ca...

c++ - Cannot open type library file: 'msxml4.dll': No such file or directory -

i trying import dll in code: #import <msxml4.dll> but @ every place have import, getting error: error 1415 fatal error c1083: cannot open type library file: 'msxml4.dll': no such file or directory... what causes of .dll missing. code use work fine before untill in resintalled windows , trying build again. search msxml4.dll present in code base or c: dir /s /b msxml4.dll is find paths in step 1,add path additional library directories of project. 2.1 right click on project > configuration properties > linker > general > additional library directories 2.2 add path additional library directories

android - I want to put a text and image in imageview -

i used bitmap crop image. draw text on image, want below image of same imageview. have seen using textview below image, requirement put text , image in single imageview. my main class: public class mainactivity extends activity { static imageview imageview; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); imageview=(imageview)findviewbyid(r.id.imageview1); bitmap bitmap=bitmapfactory.decoderesource(getresources(), r.drawable.images_1); imageview.setimagebitmap(getcirclebitmap(bitmap)); } @override public boolean oncreateoptionsmenu(menu menu) { // inflate menu; adds items action bar if present. getmenuinflater().inflate(r.menu.main, menu); return true; } public static bitmap getcirclebitmap(bitmap bitmap) { //crop circle bitmap output; //check if rectangular image if (bitmap.getwidth() > bitmap.getheight()) { outp...

java - What is MediaStore? And how can I use this to retrieve music -

i'm new java , i'm making simple application need collect .mp3 files in sdcard . i'm not sure on how can achieve this. have researched on mediastore on official android website there isn't information stating is, does, how can implement it. , there weren't examples useful. so question how can implement mediastore method retrieve .mp3 files device, how supposed build new class ? mediastore , do? relates mediastore . thank developers. method im using retrieve files - reason doesn't import music files. public class songsmanager { // sdcard path final string media_path = ("/sdcard/music"); private arraylist<hashmap<string, string>> songslist = new arraylist<hashmap<string, string>>(); // constructor public songsmanager(){ } /* * function read mp3 files sdcard * , store details in arraylist */ public arraylist<hashmap<string, string>> getplaylist(){ ...

php - Mysqli vs mysql, different result -

i have created script local (windows, xampp) , after checking if works moved online server (linux). have problem collection results database. have written using mysqli, prepared statements , first insert statement works perfect, when go @ results program tells can't find result. i've got table: session columns: id, createdon , name when using following lines of code don't results if ($stmt = $mysqli->prepare("select id, name `session` name = ?;")) { $stmt->bind_param('s', $name); $stmt->execute(); } no results , no errors. variable $stmt->num_rows have 0 value. variable $name contains: 'red'. when performing query: select id, name `session` name = 'red'; in phpmyadmin results want, when test code using orginal mysql functions (mysql_connect, mysql_query , mysql_fetch_assoc). results want. thus, program able fetch results want, mysqli not able fetch them. i'm doing wrong? or forgetting something? ...

android - Why do I have two R file in gen package? -

Image
at first mainactivity.java didn't have error. have configed id button, text fields. , added in com.mikeyaworski.basiccalculations but don't know have done project has 2 r.java in gen package. one in package android.support.v7.appcompat. other in com.mikeyaworski.basiccalculations (my config here). mainactivity.java has error because cannot find r.layout.activity_main (because variable in com.mikeyaworski.basiccalculations package think project use r.java package android.support.v7.appcompat) what should problem? try clean built project , check proper r file(i.e com.mikeyaworski.basiccalculations.r) imported, done trick me.hope solve issue :)

Awk extract data block between text strings -

i'm fighting awk again pulling out data log file. area in question of log file looks this, there few thousand lines above , below block: 4c*dj - (b-c)*djk + 2*(2a+b+c)*d1 - 4*(4a+b-3c)*d2 = 0 value = 0.5293955920d-22 alpha matrix in cm-1 axis mode inertia coriol. anharm. total x 1 -0.37699d-03 -0.36413d-02 0.10830d-01 0.68121d-02 x 2 -0.83656d-03 -0.53163d-02 0.14483d-01 0.83306d-02 x 3 -0.15253d-02 -0.10512d-01 0.20064d-01 0.80264d-02 x 4 -0.17103d-03 -0.73492d-03 0.14953d-01 0.14047d-01 x 5 -0.96312d-03 -0.11748d-01 0.15825d-02 -0.11128d-01 x 6 -0.46095d-03 -0.94225d-02 0.44165d-02 -0.54669d-02 x 7 -0.26926d-01 -0.10167d-01 0.29406d-01 -0.76866d-02 x 8 -0.17827d-02 -0.21079d-01 0.74564d-02 -0.15405d-01 x 9 -0.55840d-02 0.84897d-01 -0.29596d-02 0.76354d-01 x 10 -0.50287d-24 0.36312d-01 -0.44078d-02 0.31904d-01 x 11 -0....

c# - Google Drive API File Upload Error: "Missing end boundary in multipart body." -

i'm attempting multipart upload google via web request, , i've followed google's instructions on how construct valid multipart file upload request can send metadata , actual file data @ same time, keep getting "missing end boundary in multipart body." error when try , upload file , out of ideas why. doing wrong? also, i'm not using drive sdk did not suit needs. here's code: public bool writefiledata(stream data, dsfile file, dsuser user) { var parent = new parent(); var folders = getuserfolders(user, false); dsfolder parentfolder = folders.where(f => f.fullpath == file.virtualpath).firstordefault(); parent.id = parentfolder.depositoryfolderid; var addfilerequest = new addfilerequest(); addfilerequest.parents.add(parent); addfilerequest.title = (file.filename.tolower().contains(".ext") == false) ? file.filename + ".ext" : file.filename; addfilere...

c# - libVLCNet player positioning (without showing the movie begining) when opening new video -

i'm looking @ libvlcnet 0.4.0.0 "simpleplayer" example http://sourceforge.net/p/libvlcnet/wiki/home/ , want ask if possible to open new file , play predefined position without needing play start of movie? use this: libvlcinterop.libvlc_media_player_play(descriptor); libvlcinterop.libvlc_media_player_pause(descriptor); libvlcinterop.libvlc_media_player_set_position(descriptor, (float)0.8); int res = libvlcinterop.libvlc_media_player_play(descriptor); when trying play new file user can notice small fraction of beginning of movie. how can position player particular area after load new file without showing small portion of beginning of movie? i don't know particular library, can passing "media options" before play media. use libvlc api function libvlc_media_add_option . if can in library, can specify start time and/or end time - has specified seconds rather percentage position. the options pass api function...

php - SELECT query "greater than" not working properly? -

i have function of code written on site display user messages: function fetch_conversation_summery(){ $sql = "select `conversations`.`conversation_id`, `conversations`.`conversation_subject`, max(`conversations_messages`.`message_date`) `conversation_last_reply` max(`conversations_messages`.`message_date`) > `conversations_members`.`conversation_last_view` `conversation_unread` `conversations` left join `conversations_messages` on `conversations`.`conversation_id` = `conversations_messages`.`conversation_id` inner join `conversations_members` on `conversations`.`conversation_id` = `conversations_members`.`conversation_id` `conversations_members`.`userid` = {$_session['userid']} , `conversations_members`.`conversation_deleted` = 0 group `conversations`.`conversation_id` order `conversation_last_reply` desc"; ...

javascript - access subdomain iframe url from other subdomain page -

i'm trying access iframe contentwindow property iframe hosted on subdomain within same domain. have code on a.domain.com (which hosts role of parent page): <script type="text/javascript"> $(document).ready(function () { $('#frame').load(function () { var iframe = document.getelementbyid('frame'); if (iframe) { var item = iframe.contentwindow; if (item.indexof("completed") != -1) { window.location.href = '../home/completed/'; } else { window.location.href = '../home/payagain/'; } } }); }); </script> the actual iframe content sits on b.domain.com , want current page in iframe. i see examples need set document.domain = "domain.com" in both a.domain.com , b.domain.c...

c# - How to fold in text field to above the combo box -

this code displaying combo box user wants make change data. displaying above combo box our item substitution suggestion coming table. dont want show suggestion text message, 'please note suggestion on main page'. how , can fold in new text? if can, keep 'dead fields ' because changing. <styles grouppanel-forecolor="black"></styles> </dx:aspxgridview> <dx:aspxpopupcontrol id="popupstatus" clientinstancename="popupstatus" runat="server" showfooter="false" showclosebutton="true" showshadow="true" modal="true" width="500px" height="250px" popuphorizontalalign="windowcenter" popupverticalalign="windowcenter" headertext="update status"> <contentcollection> <dx:popupcontrolcontentcontrol> <dx:aspxcall...

how to implement popup window without any actions performed in android? -

i want show pop window after activity has been launched. after few seconds delay pop should come. how can implement that?any ideas or examples?? if helpful ..thanks in advance. many ways so. if have list of activities want show pop-up, can uses 2 ways: create service actively checks foreground [top activities] in stack , if activity on want show pop-up, send broadcast show pop-up. create class extends asynctask class, waits xsecs in doinbackground , shows pop-up on onpostexecute, call execute of asynctask class while oncreate ends if want show 1 time. asynctask class best use in such scenario. can re-use asynctask class every in project.

Benchmarking Disk Performance (Windows and Linux on Xen) -

i kind of new world of virtualization...i doing tests using different tools (iometer, fio, dd tool, , bonnie++). idea benchmark disk performance different operating systems in virtualized environment , different types of virtualization (paravirt. , full-virt.). the results out of tests windows (xp, 7 , 8) not expected tools, since got relatively high performance results without installing paravirt. drivers windows, , more surprisingly after installing paravirt. drivers performance decreased. samples of tests using fio tool: writing sequential file size of 16 gb , block size of 512 kb windows 7 (full-virt.): 87.2 mb/s average aggregate bandwidth ubuntu (paravirt.): 72.9 mb/s average aggregate bandwidth any ideas going on here (i using opensuse os in case matters) !! thanks i'd downvote if could. core issue need accurately identify io profile of applications running. writing 16 gb of sequential data atypical workload. once have realistic understanding of ...

regex - PHP preg replace to change last two character in whole string -

hello developers have problem in preg_replace. i have text file includes : #define fwte_black "{000000ff #define fwte_test "{006600ff .. [edit] complete here : https://eval.in/133942 [edit] solved : http://gyazo.com/6cb4ec7b1ede1f99cda749b1863feefc in topic i want replace ending ff on each line }" will : #define fwte_black "{000000}" #define fwte_test "{006600}" .. please me. thanks try : preg_replace('/(.*)[f]{2}$/','$1}"','#define fwte_black "{000000ff'); based on comment update: echo preg_replace('/(.*)[f]{2}([\n\r])+/','$1}"$2',$mystring); http://ideone.com/uosent

c# - Making an array ints and replace the order of number I write -

what try do, example if write 5 numbers 1,2,3,4,5 after should print 5,4,3,2,1 int[] numbers = new int[5]; (int = 0; < numbers.length ; i++) { console.write(""); numbers[i] = int.parse(console.readline()); } (int = 0; < numbers.length; i++) { } if need print them in reverse order, want keep them stored inserted them, change second loop this: for (int i=numbers.length-1; >= 0; i--){ console.writeline(numbers[i]); }

SQL (MS) - Custom compare for Null=Value on many columns -

i have table 50 columns of identifying information inconsistently filled out, same individual. sadly, individuals not have unique identifier in system. for example, times may capture person's middle name, preferred name, , null - same individual. simplest solution think of custom compare function takes (null,value) , returns true, i'm not sure how implement this, or if it's wise. ideally link records lag on partition, there frustratingly little information on how partition works other takes 'value expression'. have tested can accept multiple comma separated columns, occurrence of null values causes miss matches.

php - How to do this URL rewrite? -

basically, when user types in http://www.domain.com/username want go http://www.domain.com/user?u=username . username name of user page want visit. how can this? need make url rewrite? there better way this? on websites involve user pages, can type in youtube.com/channel , facebook.com/username. want able on site. using php user pages. what need have hypertext access file (.htaccess). file allow use url rewriting. here need put inside file: rewriteengine on rewriterule ^([^/]*)$ /user?u=$1 [l]

Selenium with python -

on mac, using virtualenv , python try selenium. copied , pasted sample code verbatim simple usage section on http://selenium-python.readthedocs.org/getting-started.html , ran it. firefox starts up, nothing happens. after short while of doing nothing, firefox closes , error pasted below originally thought problem version differences. i'm on ff v28 , selenium 2.41 any ideas? (venv)1:tests danny$ python acceptance.py traceback (most recent call last): file "acceptance.py", line 4, in <module> driver = webdriver.firefox() file "/users/danny/sites/school/asa/venv/lib/python2.7/site-packages/selenium/webdriver/firefox/webdriver.py", line 59, in __init__ self.binary, timeout), file "/users/danny/sites/school/asa/venv/lib/python2.7/site-packages/selenium/webdriver/firefox/extension_connection.py", line 47, in __init__ self.binary.launch_browser(self.profile) file "/users/danny/sites/school/asa/venv/lib/python2.7/site-...

java - Log4j2 separate log files by module name -

i want write log files based on module name. ex. 1 log file user management module , 1 products module etc. my project package structure looks below; com.mycompany.service.user com.mycompany.service.product com.mycompany.controller.user com.mycompany.controller.product ... i want write log messages com.mycompany.*.user (com.mycompany.service.user , com.mycompany.controller.user) com.mycompany.user.log file, , com.mycompany.*.product com.mycompany.user.log file. i know can create loggers bellow <logger name="com.mycompany.service.user" level="info"> <appenderref ref="appenderusers" /> </logger> <logger name="com.mycompany.controller.user" level="info"> <appenderref ref="appenderusers" /> </logger> ... but way have add many loggers. cant use wildcard * or ** or regex logger name somethihng this? <logger name="com.mycompany.*.user" level="info...

How to remove one extension by asterisk CLI -

how remove 1 extension asterisk cli ? i try command: remove extension 300809@from-internal return failed remove extension 300809@from-internal the extension existed , use command show : sip show user 300809 return * name : 300809 secret : <set> md5secret : <not set> context : from-internal language : ama flags : unknown callingpres : presentation allowed, not screened call limit : 0 callgroup : pickupgroup : callerid : "device" <300809> acl : no codec order : (ulaw|alaw) 300809@from-internal not extension. user id. at least in asterisk terminology extension in dialplan [some_extension] . filename is: /etc/asterisk/extensions.conf

ios - Generate random Numbers with Specific need -

i developing cocos 2d game. please mention below arrangement. ---------------------------------| | | | | | | | | ---------------------------------| | | | | | | | | ---------------------------------| | | | | | | | | ---------------------------------| ---------------------------------| | | | | | | | | ---------------------------------| now, need generate numbers between 1-99 in upper block so, when user touch numbers dropped below block. , have check numbers make combination of operation(i.e. +,-, *,/) divided 10 or not? for example if user choose numbers 3,2,7,8 have internally calculated (3 +2 +7 +8 = 20 20%10 == 0 number divisible 10 increase score) , same thing -, *,/. math operator same have decide code user has think dragging numbers. so question how gen...

scala - Naming fields in immutable functional objects -

i learning scala @ moment via odersky's programming scala 2nd book , have covered chapter 6 discusses functional objects. in chapter, main example centres around creating class represent rational numbers , arithmetic of rational numbers. his cut-down class looks like: class rational (n : int, d : int) { val numer : int = n val denom : int = d def add (that: rational) : rational = new rational ( numer * that.denom + that.numer * denom, denom * that.denom) } in order achieve immutability, has introduced 2 new variables, numer , denom, represent same concepts class parameters, n , d. based on knowledge far, means if want create immutable functional objects in scala, have go through process of creating duplicates of class parameters can tedious. example, if wanted create class represent trade, have this: class trade ( direction : char, instrument : instrument, price : bigdecimal, quantity : bigdecima...

web services - how to read http get response (restful-ws) as java.io.file -

file file = new file("c:\\testing.txt") can achieve means somthing like: file file = new file("https://stackoverflow.com/ws-server/lookup/1.0/1234") the below webservice returns me same file content txt in string form. https://stackoverflow.com/ws-server/lookup/1.0/1234 can please let me know if doable. you can write response file . look @ this answer details. after can open file used to.

android - How to Hide the phone ringing screen when my Application is running -

how hide phone ringing screen when using application without notifying caller i.e. without unanswered call? i mean when call comes in between when using application call screen must hide , can use application without interruption , call can b shown on notification. please tell there way. this possible please check link below: http://img.talkandroid.com/uploads/2011/05/callbackgrounder-1024x606.jpg

Javascript Date using forward-slashes vs hyphens -

this question has answer here: different result yyyy-mm-dd , yyyy/mm/dd in javascript when passed “new date” [duplicate] 2 answers when i'm creating new date object , pass in date using hyphens new date("2015-07-02") // thu jul 02 2015 01:00:00 gmt+0100 (ist) and when use forward slashes new date("2015/07/02") // thu jul 02 2015 00:00:00 gmt+0100 (ist) notice time difference: 01:00:00 hyphens , 00:00:00 forward slashes this breaks code :( why happening? workaround this? (should set time 00:00:00 when using hyphens?) i need able compare dates have forward-slashes dates have hyphens , i'm not sure might need compare dates other symbols. is happening hyphens only? thanks. if recent browser can interpret date string iso-8601 - will it. examples : yyyy (eg 1997) yyyy-mm (eg 1997-07) yyyy-mm-dd (eg 1997-07...

JSON.Net: Schema validates where it shouldn't when using anyOf -

i'm trying detect if user specified boolean string instead of real boolean. i'm testing commentsmodule/enabled see if value false, once quotes , once without. the online validator: http://json-schema-validator.herokuapp.com/ works correctly, , identifies failure "instance value (\"false\") not found in enum (possible values: [false])". however, newtonsoft json (latest version) same schema , json defines valid json. schema: { "$schema":"http://json-schema.org/draft-04/schema#", "description": "pages json", "type": "object", "properties": { "name": {"type":"string"}, "description": {"type":"string"}, "channel": {"type":"string"}, "commentsmodule":{ "type": "object", "anyof...

objective c - Facebook json data error, cocoa error 3840 -

i'm trying data facebook, i'm getting error when try parse data dictionary: mistake: error domain=nscocoaerrordomain code=3840 "the operation couldn’t completed. (cocoa error 3840.)" (no value.) userinfo=0x144ad420 this code: nsstring *query = @"select page_id, type page_fan uid = me() "; // set query parameter nsdictionary *queryparam = @{ @"q": query }; // make api request uses fql [fbrequestconnection startwithgraphpath:@"/fql" parameters:queryparam httpmethod:@"get" completionhandler:^(fbrequestconnection *connection, id results, nserror *error) { if (error) { nslog(@"error: %@", [error localizeddescription]); } else { bool can = [nsjsonserialization isvalidjsonobject:results]; nslog(@"can %d", can); nserror *mistake; nsdictionary *first = [nsjsonserialization jsonobjectwithdata:results options:0 error:&mistake]; if (mistake) { nslog(@"mistake: %@", mistake...

Jasper + Struts2 Multiple reports in one action -

in struts.xml file <action name="myjaspertest" class="com.sample.supplierenquiryreport"> <result name="success" type="jasper"> <param name="location">/reports/xyz.jasper</param> <param name="datasource">mylist</param> <param name="format">pdf</param> </result> </action> i need return multiple pdf files after 1 action. possible? no, ui jsp can: open multiple actions, each 1 returning pdf; open jsp, multiple <iframe> , each 1 pointing (with src attribute) different action (or better, same, passing different parameters), , returning pdf. then several pages each 1 pdf, or big page several iframes, each iframe pdf.