Posts

Showing posts from August, 2015

sql server 2008 - DataAdapter.Update() doesn't work to update -

my sql statments follows insert statement works update , delete statements don't work purchase_invoiceno primary key column of purchase table value , insert value purchaseproduct table "select ident_current ('purchase') [purchase_invoiceno]" string deletecmd_purchaseproduct = @"delete purchaseproduct " + "purchaseproduct_no=@purchaseproduct_no , "+ "purchase_invoiceno=@purchase_invoiceno "; string updatcmd_purchaseproduct = "update purchaseproduct " + " set " + " purchaseproduct_serialno =@purchaseproduct_serialno" + ", purchase_invoiceno =@purchase_invoiceno" + ", productno =@productno" + " purchaseproduct_quantity =@purchaseproduct_quantity " + ", purchaseproduct_unit =@purchaseproduct_unit" + ", purchaseproduct_pric...

c# - How to deserialize when only interface is available? -

i have 3 components: utility library (processor.dll): knows element library element library (ielement): doesn't know library app: knows both libraries app calls processor library , passes class of type: classa : ielement classa serialized before being passed processor. processor base library , not know class types such classa. know ielement however. processor deserialize ielement passed it, of type classa. the issue interface cannot deserialized. processor not know classa , should not. how can reference passed in object in case? one way handle create serializationbinder implementation loads classa, pass reference instance of binder processor.dll processor.dll can use binder implementation deserialization. allow keep code references classa in app module (the serializationbinder implementation of course have defined in app module). here's example: given interface in element library public interface ielement { string dosomething(string param...

asp.net mvc - Knockout MVC - VB.NET issue with IsAssignableFrom and MethodCallExpression -

i having problems library called knockout mvc. .net wrapper around knockout.js. while works pretty when using in c# based asp.net mvc project, doesn't in vb.net based project , found out why. protected virtual string visitmethodcall(methodcallexpression m) { ... if (typeof(expression).isassignablefrom(m.method.returntype)) return visitmemberaccess(m.object, m.method.name); throw new notsupportedexception(); } the condition evaluates false when project calls library written in vb.net. same thing in c#: working perfectly. since not quite sure causing different behaviour, thought might idea ask community. maybe knows how line translated works both c# , vb.net. the code can found @ ~ line 260 here . [edit] to clarify things: code above not need translated vb.net. problem rather, condition contains returns different results based on whether called c# or vb.net code. believe isassignablefrom behaves differently vb.net , c#... need know how condition work indepen...

.net - LINQ Query not working for Right Outer Join -

i have sql query want convert linq. using c#. tried both linqpad , linqer. linqer not right outer join . linqpad not conversion @ all. can done via nested joins or like? select dbo.tblpatientmaster.ptm_name dbo.tblclinicalinformation inner join dbo.tblpatientdiagnosis inner join dbo.tbldiagnosisinformation on dbo.tblpatientdiagnosis.ptd_tgiid = dbo.tbldiagnosisinformation.tgi_id on dbo.tblclinicalinformation.tci_id = dbo.tbldiagnosisinformation.tgi_tciid right outer join dbo.tblpatientinformation on dbo.tblpatientdiagnosis.ptd_ptiid = dbo.tblpatientinformation.pti_id left outer join dbo.tbldepartmentmaster inner join dbo.tbldoctormaster on dbo.tbldepartmentmaster.deptm_id = dbo.tbldoctormaster.dcm_deptmid on dbo.tblpatientinformation.pti_dcmid = dbo.tbldoctormaster.dcm_id right outer join dbo.tblpatientmaster on dbo.tblpatientinformation.pti_id = dbo.tblpatientmaster.ptm_id

iphone - How to call An Animation Function from another class in ios? -

i have code slide animation written in first class -(void)send { right=[[viewprofilerightpanel alloc]initwithnibname:@"viewprofilerightpanel" bundle:nil]; right.view.frame=cgrectmake(0, 0, 260, 548); [self.view showorigamitransitionwith:right.view numberoffolds:[@"1" intvalue] duration:[@"0.58" floatvalue] direction:currdirectionrightpanel completion:^(bool finished) { nslog(@"4"); }]; } this code called when press button in first class , open right panel. animation close right panel is, -(void)close { [self.view hideorigamitransitionwith:right.view numberoffolds:[@"1" intvalue] duration:[@"0.58" floatvalue] ...

dotnetnuke - Looking for a free DNN community edition website Backup and restore procedure working with DNN 7 and SQL server express 2008 r2 -

i looking free dnn community edition website backup , restore procedure working dnn 7 , sql server express 2008 r2. i design , develop website in local pc connection speed actual server low. , want publish (deploy) result in server. may need repeat procedure few times our website under development , need add new pages or update existing ones. i use dnn 7 community edition. have googled , have found plenty of commercial tools backup , restore. free methods seems 1. old or not working or not straight forward procedure or very buggy. i have gone e.g. through 4 links given in http://www.dnnsoftware.com/community-blog/cid/134680/how-to-move-a-dotnetnuke-installation without success. could please me 1. how develop website in local pc , upload result in server? and later after adding few new pages in local pc how sync result server? thank in advance , consideration. . . . " when using sql express, if copy entire local folder production (including app_data...

php - Joomla FrontEnd Editing breaks shortcodes -

i have joomla website in localhost. i installed template called helix 2 has set of shortcodes. (i put in [block]blah blah [/block] , blah blah highlighted in nice looking box.) i posted beautiful looking articles way backend. unfortunately, have setup users able edit articles frontend. have manually checked database , shortcode saved in database. when clicking edit in frontend, database version not loaded in edit field! when editing frontend, joomla engine doesnot load database version of article, version rendered browser or else. latter version doesn't have shortcodes. so, after clicking save frontend original article formatting lost! have manually reenter shortcodes in frontend. so solution is, while clicking on edit button, if article editing loaded database can see shortcodes in proper places. so, there setting anywhere in joomla can me out this? ps: have tried editors tinymce, jce, editor-none same results. not editor problem. which joomla versi...

android - How do i add two listfragment in my app -

i have app displays first list using below code. how display on more list on click of list item below code. please me example code. public class mylistfragment1 extends listfragment { string[] videosetup ={ "properties", "color control", "tint", "3d depth", "3d format", "dynamic backlight", "mode", "cache id", }; @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); listadapter mylistadapter = new arrayadapter<string>( getactivity(), android.r.layout.simple_list_item_1, videosetup); setlistadapter(mylistadapter); } @override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { return i...

android - how to get week of the year using input date from user -

how current week of year using date? below code returns current week of year using current time. how change code take input date 26/8/2013 ?(in caseit should return 35). want implement taking input date form user return current week of year. calendar calender = calendar.getinstance(); log.d("current week:", "" + calender.get(calendar.week_of_year)); toast.maketext(this, "current year weeks is"+ calender.get(calendar.week_of_year), toast.length_short).show(); import java.text.simpledateformat; import java.util.calendar; import java.util.date; import java.util.gregoriancalendar; import android.net.parseexception; import android.widget.toast; ... /** * @param userinput input date user, format: "26/8/2013" */ public void getdayofweek(string userinput) { date date; simpledateformat format = new simpledateformat("dd/m/yyyy"); try { date = format.parse(userinput); } catch (parseexception e) { ...

java - How to store Data after SAX parsing -

i use sax parser parse xml file , store data arraylists-hashmaps within enddocument method of parser. seems though after parsing ends references gone , when try access them main method 0 arraylist-hashmap size(). in other words save data after parsing can print them out during sax-parsing. how possible save them in order re-use them after parsing done? have tried creating list of objects containing information need didnt work. handler code: public class myhandler extends defaulthandler { private list<string> rules = new arraylist<string>(); public myhandler() {acc = new stringbuilder();} public void startdocument(){ string startdocumentstring="parsing started ----- discovered rules :"; system.out.println(startdocumentstring);} public void enddocument(){ string enddocumentstring="\n \nparsing ended ------"; system.out.println(enddocumentstring); for(int i=0 ; i< rule...

python - downloading file using selenium -

i working on python , selenium. want download file clicking event using selenium. wrote following code. from selenium import webdriver selenium.common.exceptions import nosuchelementexception selenium.webdriver.common.keys import keys browser = webdriver.firefox() browser.get("http://www.drugcite.com/?q=actimmune") browser.close() i want download both files links name "export data" given url. how can achieve works click event only. thanks find link using find_element(s)_by_* , call click method. from selenium import webdriver # prevent download dialog profile = webdriver.firefoxprofile() profile.set_preference('browser.download.folderlist', 2) # custom location profile.set_preference('browser.download.manager.showwhenstarting', false) profile.set_preference('browser.download.dir', '/tmp') profile.set_preference('browser.helperapps.neverask.savetodisk', 'text/csv') browser = webdriver.firefox(...

javascript - mootools fire click event. How to pass own data? -

i have click event parent element , delegated event children. however, want able fire click , pass in simulated click event's information event listener. $('rt-main').addevent('click:relay(.catclick)', function(e){ e.stop(); new request({ method: 'get', url: 'index.php?option=com_categories&tmpl=component&view=listing&cat=' + this.get('id'), oncomplete: function(response){ $('rt-main').set('html', response); } }).send(); }); // here want fire event. how pass in 'id' of choosing? // know particular line fires first anchor. how target // psuedo-anchor? or better target class? $('rt-main').fireevent('click', {target: $('rt-main').getelement('a'), stop: function.from} ); dimitar correct. pass id: "data" in arguments, , add check in event handler passed in dat...

ios - Cancel gesture recognizer on button action -

i'm working on ipad app. have view in user can draw finger. view has subview, calculator, , have buttons. i when user touch button, superview (in user can draw) doesn't take account touch. (so user doesn't draw when touches calculator) preferably, not change code of calculator view , code of superview. have access them via properties of class. is there way solve problem please? have tried exclusivetouch, doesn't work. if have access button action , drawing gesture can set: gesture.enabled = no; to cancel current gesture processing , / or prevent starting. when want reenable gesture depends on type , how it's used doing (on next line) work ok.

php - HTML and MySQL problems using latin characters -

i trying create first web page using yii, php , mysql. have problems using latin characters. when write these characters can't show them correctly, example: id: 1 username: josé migueleditado password: contraseñajosemi besides, have same problem when try store characters in db. mean, when complete form field , click on submit, if 1 of theses fields have latin characters, db store text of field latin character. example: if write "maría" in form field db store "mar" inthe corresponding register. i know have problem charset don't know why. in db array of main.php have: 'db'=>array( ... 'charset' => 'utf8', ), besides in registers of db use "varchar(100) utf8_general_ci". in document main.php have: return array( 'basepath'=>dirname(__file__).directory_separator.'..', 'name'=>'prueba', 'language'=>'es', ...

no access to a java static method from scala -

i created program java , scala mixed, faced error while trying call java static method scala.here code: object gestionbasesscala { def sors_tout_de_suite() { application.launcher.append("scala : exit") } } the append method of launcher class (in java): public static void append(string text) { if (name_of_file != null && name_of_file != "") { bufferedwriter bufwriter = null; filewriter filewriter = null; try { filewriter = new filewriter(name_of_file, true); bufwriter = new bufferedwriter(filewriter); // ins�rer un saut de ligne bufwriter.newline(); bufwriter.write(text); bufwriter.close(); } catch (ioexception ex) { // logger.getlogger(textfilewriter.class.getname()).log(level.severe, // null, ex); } { try { bufwriter.close(); filewriter.close(); ...

How to display Text for all sizes in same position in android -

i need display alphabet 'a' starting postion should top line postion , end postion should bottom line of screen.. of screen ..i displayed top , bottom lines using view..in sizes of screens top , bottom lines displaying fine...but problem in alphabet displaying 1 screen remain screens not displaying properly...i tried using below code..please 1 suggest me public class extends activity { mediaplayer nextsound,mediay2; myview myview; relativelayout relativelayout, relativelayout1,relativelayoutmain; float screenheight, screenwidth, screendensity; float lefta, topa; public boolean action = false; button start,stop,next,back,home,erase,horn; boolean count = true; relativelayout.layoutparams lp61; sampleview sampleview; int username; string user; bundle b; bitmap bmp1; static bitmap bmp3; int lst; view content; string fname,name; @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); displaymetrics displaymetri...

java - Does Jooq supports Joda-Time? -

we looking date time support different timezones. seems hibernate supports joda time, idea jooq supports same? jooq not support joda-time, nor other third-party data type. can configure jooq code generator rewrite data types through custom converters. documented here: http://www.jooq.org/doc/latest/manual/sql-execution/fetching/data-type-conversion/ http://www.jooq.org/doc/latest/manual/code-generation/custom-data-types/

log4net - Configure Nhibernate log into file -

i have programmatically create log4net log config file: var properties = new namevaluecollection { {"configtype", "file"}, {"configfile", @"c:/log4net.config"} }; common.logging.logmanager.adapter = new common.logging.log4net.log4netloggerfactoryadapter(properties); this log4net.config (edited simplicity dove suggested) : <log4net> <appender name="rollingfile" type="log4net.appender.rollingfileappender"> <file value="c:/log.log" /> <appendtofile value="true" /> <maximumfilesize value="100kb" /> <maxsizerollbackups value="5" /> <layout type="log4net.layout.patternlayout"> <conversionpattern value="%d [%t] %-5p %c - %m%n" /> </layout> </appender> <root> <level value="all" /> <ap...

ios - Getting data of Child Element from its Parent counterpart -

im trying parse child data sub_category , show it, show relevant sub_category of parent category. sucessful in parsing data of parent element im having problem on how parse child element. - (void)parser:(nsxmlparser *)parser didstartelement:(nsstring *)elementname namespaceuri:(nsstring *)namespaceuri qualifiedname:(nsstring *)qname attributes:(nsdictionary *)attributedict { if([elementname isequaltostring:@"category"]){ datacurrent = [datafileholder alloc]; } } - (void)parser:(nsxmlparser *)parser foundcharacters:(nsstring *)string { currentlist = [[nsmutablestring alloc] initwithstring:[string stringbytrimmingcharactersinset:[nscharacterset whitespaceandnewlinecharacterset]]]; } - (void)parser:(nsxmlparser *)parser didendelement:(nsstring *)elementname namespaceuri:(nsstring *)namespaceuri qualifiedname:(nsstring *)qname { if([elementname isequaltostring:@"name"]){ datacurrent.nameofcat = currentlist; } if ([elemen...

java - Adding Link to another activity -

i add button link activity on registeractivity following code public void setonaccountcreationfirstviewlistener(onaccountcreationfirstviewlistener listener) { mlistener = listener; } /** * interface listeners of {@link accountcreationfirstview} * see {@link accountcreationfirstview#setonaccountcreationfirstviewlistener} */ public interface onaccountcreationfirstviewlistener { /** * user asked create account */ /** * user asked edit : has existing account */ void oneditaccountrequested(); } } can please me adding button activity called registeractivity button id button2 change button's xml , add android:onclick="openactivity" e.g. <button android:id="@+id/button2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:onclick="openactivity" android:text="@s...

javascript - Testing/validating/evaluating the outcome of every path in a function? -

disclaimer - i've tried finding answer via google/stackoverflow, don't know how define problem (i don't know proper term) i have many small ai snippets such follows. there ._ai snippet (like below) per enemy type, 1 function next() called finite state machine in main game loop (fyi: next function doesn't called every update iteration, when enemy shifted queue). the question: how test every case (taking account enemy ai snippets might more complex, having cases may occur 1 in 1000 turns) , ensure code valid? in example below, if added line blabla/1 under count++, error might not crop long time, javascript interpreter won't catch error until hits particular path. in compiled languages, adding garbage such blabla/1 caught @ compile time. // ai snippet this._ai = (function(commands){ var count = 0; return { next: function(ondone, goodies, baddies) { // if internal counter reaches // 2, launch super attack , ...

Eventbrite API - custom form registration in website -

we have created event in eventbrite portal , created campaign in separate website allow users registering event. have specific api method in eventbrite post custom form fields website when user click on submit button , register them attendee? in below documentation link, didn't find such api call register user event attendee http://developer.eventbrite.com/doc/ i work on eventbrite's api/platform team, can out here. eventbrite doesn't have api method allows third parties register attendees. part of model making sustainable business on lower margins relies on having impression in front of attendees , not allowing 'white labeling'. hope answers question! cheers!

PHP mysql recursive function array_unshift -

i have problem recursive function in php. call function , row database, put row array , call function again other rows, conected row... problem is, array_unshift save first row , other not. problem. thank answers. public static function nahrejzpravy($responsetable, $responseid){ $return = array(); $query = "select * zpravy responsetable = '$responsetable' , responseid = '$responseid'"; $result = query($query); while($row = mysql_fetch_assoc($result)){ array_unshift($return, $row); zpravy::nahrejzpravy('zpravy', $row['id']); } return $return; } <?php function getresponsesrecursive($responsetable, $responseid) { $responses = array(); $query = "select * zpravy responsetable = '$responsetable' , responseid = '$responseid'"; $result = mysql_query($query); while ( $row = mysql_fetch_assoc($result) ) { $row['responses'] = getrespo...

python - Error of CSRF verification failed. Request aborted -

i have code,there error of csrf verfication failed, request aborted. in form: <form method="post" action="/jobb/" class="form-horizontal" id="jobform" name="jform" enctype="multipart/form-data" >{% csrf_token %} in views.py @csrf_exempt def jobform(request): if request.method == 'post': getintable = job(app_id = request.post['jobid'],start_on = request.post['starton'], end_on = request.post['endon'],timeframe = request.post['timeframe'],odeskid = request.post['odeskid'],hourlyrate = request.post['hourlyrate'],assigne = request.post['assigne'],clientid = request.post['clientid']) getintable.save() return render_to_response('jobsform.html') else: return render_to_response('interviewform.html') you error because not returning requestcontext instance. fix can use render shortcu...

ruby - Rails: Ajax local works fine, but 404 in nginx server -

in js file : function jqshowresourcesselection( elem, select_id ) { if (elem.checked){ $("#" + select_id).attr("disabled","disabled"); $.ajax({ url: '/testbeds/resources_selection', type: 'post', datatype : 'script', data: {"configuration_id": $("#" + select_id).val()}, success: function() { addfilter(); } }); } else { $("#testbed_configuration_id").attr("disabled", false); $("#resourcesselection").html(''); } } in routes.rb resourcemanager::application.routes.draw resources :testbeds collection post :resources_selection end end resources :resources resources :configurations ................... root :to => 'configurations#index' end it works fine in local machine, both development , ...

javascript - Get the count of Checked check box using Jquery -

Image
this question exact duplicate of: count values of checked checkbox 6 answers i want count of checked check boxes form below code sample, thnks, digambar k. first of all, please post actual code in 'code' tags, appear in search results , can of future people looking same issue. also, little googling have found answer right away: $("input[type=checkbox]:checked").length

r - Set layers in ggplot2 via loop -

i expected that data <- data.frame(col1 = c(1, 2, 2, 3, 3, 4), col2 = c(1, 2, 2, 1, 2, 1), z = rnorm(6)) p1<-ggplot(data, aes(x=col1)) for(idx in unique(data$col2)){ p1<-p1 + geom_bar(subset = .(col2 == idx), aes(y = ..count..),fill = "blue", alpha = 0.2) } p1 have same output like p1<-ggplot(data, aes(x=col1)) p1<-p1 + geom_bar(subset = .(col2 == 1), aes(y = ..count..),fill = "blue", alpha = 0.2) p1<-p1 + geom_bar(subset = .(col2 == 2), aes(y = ..count..),fill = "blue", alpha = 0.2) p1 but istn't. how produce in loop same output in second example. this problem simple if subsetting yourself: library(ggplot2) data <- data.frame( col1 = c(1, 2, 2, 3, 3, 4), col2 = c(1, 2, 2, 1, 2, 1), z = rnorm(6)) ids <- unique(data$col2) p1 <- ggplot(data, aes(col1, y = ..count..)) for(id in ids){ df <- data[data$col2 == id, ] p1 <- p1 + geom_bar(data = df, fi...

Error while reading csv file in R -

i having problems in reading csv file r. x=read.csv("lorenzoferrone.csv",header=t) error in make.names(col.names, unique = true) : invalid multibyte string @ '<ff><fe>n' i can read file using libre office no problems. i can not upload file because full of sensible information. what can do? setting encoding seem solution problem. > x=read.csv("lorenzoferrone.csv",fileencoding = "ucs-2le") > x[2,1] [1] adriano caruso 100 levels: ada adriano caruso adriano diaz adriano diaz alberto ferrone alexey ... zia tina you need specify correct delimiter in sep argument.

php - Yii Framework logger always attaches the debug log at end of file -

i using yii framework write application , using yii logger functionality . problem append debug log statement @ end of log file. 1 has idea how why happening ? here log file data. [info] [application] sending sms [info] [application] exit _sendsms [info] [application] first msg business send . saving database [info] [application] entering _savechat [info] [application] exit _savechat [debug] [application] "incoming data value" [debug] [application] "api used in _checkarrayformat exotel" [debug] [application] " identifier 123" [debug] [application] " sms type new" [debug] [application] "api used in _setdatakey exotel" [debug] [application] " arruniqueaplhanum value array" [debug] [application] "new uid created g2f" [debug] [application] "using api outgoing sms exotel" [debug] [application] "using api outgoing sms exotel" you can configure log level should logg...

rails 3 migration error in change_column type -

i trying change column type , getting error. model conf , , column name xml . want change :file :binary . xml @ first created text , i've changed file similar migration file one. want same thing again , change type binary getting error. there migration file: class changeconfxmlcolumntobinary < activerecord::migration def change_column :confs, :xml, :binary end def down change_column :confs, :xml, :file end end and error: == changeconfxmlcolumntobinary: migrating ==================================== -- change_column(:confs, :xml, :binary) rake aborted! error has occurred, , later migrations canceled: undefined method `to_sym' nil:nilclass/home/staj/.rvm/gems/ruby-1.9.3-p429@rails3tutorial2nded/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/schema_definitions.rb:229:in `column' /home/staj/.rvm/gems/ruby-1.9.3-p429@rails3tutorial2nded/gems/activerecord-3.2.13/lib/active_record/connection_adapters/sqlite_adapter.rb:...

android - What color should an icon have when used in Action Bar? -

i want make icon used in actionbar. color should use fill it? in android documentation says: light theme. colors: #333333 enabled: 60% opacity disabled: 30% opacity dark theme. colors: #ffffff enabled: 80% opacity disabled: 30% opacity i know how set opacity in android color, in case it's png file. what hex value should use, in illustrator, fill icon achieve equivalent of #ffffff 80% opacity ? and other cases? for people making own icons: full opacity 255 (#ff in hex) 80% opacity set alpha 204 (#cc in hex) , 60% opacity set 153 (#99 in hex).

java - Access variable from inner class without making it final -

how work: public void onstart() { super.onstart(); int dayn = 0; int = 0; string day = null; string addfach; string mo1 = null; string mo2 = null; string mo3 = null; string mo4 = null; string mo5 = null; string mo6 = null; string mo7 = null; string mo8 = null; string mo9 = null; string mo10 = null; string mo11 = null; string di1 = null; string di2 = null; string di3 = null; string di4 = null; string di5 = null; string di6 = null; string di7 = null; string di8 = null; string di9 = null; string di10 = null; string di11 = null; string mi1 = null; string mi2 = null; string mi3 = null; string mi4 = null; ...

c# - spawning threads in a unit test -

there lot of information on how unit test threaded code not on spawning threads inside unit test method test synchronization mechanisms. [testmethod] public void testdiscountthreading() { thread[] threads = new thread[50]; (int = 0; < threads.length; i++) { threads[i] = new thread(pricethread); threads[i].start(); } (int = 0; < threads.length; i++) threads[i].join(); } i want stresstest if synchronization in code inside pricethread implemented correctly every single time method runs error "the agent process stopped while test running". possible spawn threads inside unit tests or can wrong here? im using visual studio 2010 shipped unit testing framework this not full answer, recommend have @ vs 2010 test runner error "the agent process stopped while test running." ideas. do know in code exception thrown? edit answer: this result when thread other main thread throws unhandled exception. case here, ie no issues loops...

Check fragment is presented in framelayout or not in android? -

hi friends have 2 framelayout in movies.xml namely container , detail_screen .in container add movies.xml contains listview ,and in detail_screen have expandable listview called movie_details.xml .now want check programatically in detail_screen fragment presented or not.if presented want remove fragment.i did follwing , working fine. if (getsupportfragmentmanager().findfragmentbytag("myfragment") != null) { getsupportfragmentmanager().begintransaction().remove(getsupportfragmentmanager().findfragmentbytag("myfragment")).commit(); } but there other way find whether fragment presented or not in frame layout in android programatically .thanks in advance i founded solution follows.i.e before adding fragments details_screen checking if fragment presented popping , add new fragment. if (getsupportfragmentmanager().findfragmentbyid(r.id.detail_screen) != null) { getsupportfragmentmanager().popbackstack(); } //to add fr...

java - How to change Tomcats JVM version? -

i have java jdk 1.7.0_21 installed on debian machine (along others). have configured debain use jdk: pi@raspberrypi ~ $ java -version java version "1.7.0_21" java(tm) se runtime environment (build 1.7.0_21-b11) java hotspot(tm) client vm (build 23.21-b01, mixed mode) from reading notes in tomcat catalina.sh, understand tomcat server should use java_home / jre_home system variables # java_home must point @ java development kit installation. # required run "debug" argument. # # jre_home must point @ java development kit installation. # defaults java_home if empty. i have set proper directory. echoing variables gives following output: pi@raspberrypi ~ $ echo $java_home /opt/oracle_java/jdk1.7.0_21/bin pi@raspberrypi ~ $ echo $jre_home /opt/oracle_java/jdk1.7.0_21/jre the tomcat web application manager still shows 1.6.0_27-b27 jvm in use. do have advice on how make tomcat run 1.7.0_21 jdk? ...

asp.net - How to get random time in certain time format -

i want date 2013/01/01 today. plus time 14:00 23:00 time interval 15min. for example: 2013/01/01 14:15 2013/01/21 14:30 2013/01/21 17:45 2013/03/17 14:00 . . . for date, can use code below i'm not sure of time part datetime start = new datetime(2013, 1, 1); random gen = new random(); int range = (datetime.today - start).days; start.adddays(gen.next(range)); this should work: int starthour = 14; int endhour = 23; int allquarters = enumerable.range(0, (endhour - starthour) * 4).count(); timespan time = timespan.fromminutes(gen.next(allquarters) * 15); start = start + timespan.fromhours(starthour) + time; demo

linux - Extract PID from sk_buff. -

i looking way determine process sk_buff directed. know there no straightforward way that. obtain sk_buff i'm using netif_rx notifier . i've had use notifiers instead of netfilter, because netfilter works in interrupt context (but, if netfilter can in way more usefull in case, can switch). i've tried far: struct pid *sk_peer_pid struct sock * . compare struct file * opened file descriptors struct files_struct of each task. heavy. network namespaces. useless, since processes use same namespace, , feature not enabled default on device. last idea compare somehow destination port packet, ports processes listening. there way that? desired port number packet, , up, , see process listening on it?

xslt - Join two string sequences in xpath -

how can create union of 2 string sequences in xpath 2.0? having 2 functions... <xsl:function name="my:foo" as="xs:string*"> .... </xsl:function> <xsl:function name="my:bar" as="xs:string*"> .... </xsl:function> i want iterate on both resulting string sequences like: <xsl:variable name="myresult" select="for $s in my:foo() ??union?? my:bar() return my:dosomethingwith($s)" /> just found answer in book "xslt 2.0 , xpath 2.0 4th edition", chapter 10 "the comma operator": the operands of «,» operator can 2 sequences. of course, single item sequence, operands can single items. either of sequences can empty, in case result of expression value of other operand. so like: <xsl:variable name="myresult" select="for $s in (my:foo(), my:bar()) return my:dosomethingwith($s)" />

sql - Group returned result by mysql -

i have following table table x labref name repeat_status 111 l 1 111 l 1 111 k 1 111 k 1 111 l 2 111 l 2 111 m 1 111 m 1 the result need labref name repeat_status 111 l 1 111 l 2 111 k 1 111 m 1 i have tried query not bring result, needs tweaking select name, repeat_status `x` labref = '111' group repeat_status; suggestions! select name, repeat_status `x` labref = '111' group name ,repeat_status;

java what url value for db driver, using wamp -

i have wamp server , when run it connection con = drivermanager.getconnection("jdbc:mysql://localhost/mysql", name, password); what should value of url? i mean should end point, think driver file, file? isn't mysql.exe? in docs said: database url of form jdbc:subprotocol:subname but database url?, should in wamp example? read jdbc... it should be "jdbc:mysql://localhost/dbname?" + "user=sqluser&password=sqluserpw" where dbname database name, , sqluser, sqluserpw username , password, should store in variables. it's choice whether send plain text or whatever. edit: have first load driver this: class.forname("com.mysql.jdbc.driver"); further edit: should put these, along mysql statements in function throws exception along lines of try/catch.

vb.net - "Value can not be null" on singleton instantiation -

i have singleton class attempting instantiate , giving exception "value cannot null" im declaring reference in main form like: dim devices deviceundertestbindinglist then instantiating in form.load: devices = deviceundertestbindinglist.getinstance the deviceundertestbindinglist class follows: imports system.componentmodel public class deviceundertestbindinglist ' deviceundertest 1 of other regular classes... inherits system.componentmodel.bindinglist(of deviceundertest) private shared singleinstance deviceundertestbindinglist private shared instancelock object private shared listlock object private sub new() mybase.new() end sub public shared readonly property getinstance deviceundertestbindinglist ' ensures 1 instance of list created. if singleinstance nothing synclock (instancelock) if singleinstance nothing singlein...

Is there a BLACKLIST Database available containing a list of MD5 digests of malware? -

i'm looking blacklist (free or commercial) can use on software checks files being malware. knows this? check out clamav signatures. they're in cvd file. can extract md5 signatures file.

javascript - Alternative syntax for self-invoking function? -

this question has answer here: location of parenthesis auto-executing anonymous javascript functions? 4 answers while writing javascript course coworkers, accidently discovered alternative syntax self-invoking function. know it, there specifics ? wasn't able find documentation it. code : classic syntax (function(){ console.log("i'm self-invoked!"); })(); alternate syntax (function(){ console.log("me too!"); }()); thanks hints ! the 2 identical in meaning. in both, ( @ start symbols start of expression . indicates start of a function expression intend invoke. invoke it. difference subtle , should not matter @ all, let's explore it: (function(){ console.log("i'm self-invoked!"); })(); here, ( tell compiler it's start of expression, compiler evaluates expression (...

Find greatest in multiple groups across tables MySQL -

i have table called packages contains data , related table contains other information. it's set this: name|version|architecture|date|id and in second table called distribution have this: repo|id the id's reference each other. want able newest (ordered date) grouping. want group name, architecture, , repo. problem can't seem normal greatest-n-in-group work right because have go across tables. have far select p1.name, p1.version, p1.arch, d1.repo, p1.date packages p1 inner join distribution d1 on p1.id = d1.id inner join ( select name, arch, repo, max(date) date packages inner join distribution on packages.id = distribution.id group name, arch, repo ) sq on p1.name = sq.name , p1.arch = sq.arch , d1.repo = sq.repo , p1.date = sq.date the problem doesn't seem group repo correctly. doesn't give me unique repo. edit: want newest version each repo....

Asserting view with Grails Spock Unit Test for Controllers -

grails 2.2.4 spock 0.7 i'm trying test correct view rendered grails controller. create method looks this: def create() { def documentcategories = documentcategory.list() def documenttypes = documenttype.list() def documentcomponents = documentcomponent.list() [documentcategories: documentcategories, documenttypes: documenttypes, documentcomponents:documentcomponents] } and test: def "test create action"() { given: def model = controller.create() expect: response.status == 200 model.documentcategories.size() == 0 model.view == '/document/create' } i've tried various versions of model.view including: view == '/document/create' response.forwardedurl == '/document/create' all of fail because model.view , view , , response.forwardedurl null. suggestions? as not defining view explicitly in controller method grails conventions take place. accordingly documentatio...