Posts

Showing posts from August, 2014

glassfish - Javassist ClassCastException in Hibernate and Netbeans -

Image
could me this, have happened making application generate error. following tutorial on using hibernate in netbeans . after getting line "from film", according tutorial executed test read records of film table result error below. googled find do, have seen far it's reported javassist jar file existing in different directories. one, in hibernate (hibernate 4.x-javassist-3.15.0.ga) directory, found out true, , other in glassfish (glassfish server 4) directory. tried searching in glassfish lib directory, nothing seems exist. java.lang.classcastexception: dvdstore.language_$$_javassist_4 cannot cast javassist.util.proxy.proxyobject @ org.hibernate.proxy.pojo.javassist.javassistlazyinitializer.getproxy(javassistlazyinitializer.java:147) @ org.hibernate.proxy.pojo.javassist.javassistproxyfactory.getproxy(javassistproxyfactory.java:71) @ org.hibernate.tuple.entity.abstractentitytuplizer.createproxy(abstractentitytuplizer.java:631) @ org.hibernate.persister.en

android - Add only top and bottom border on LinearLayout -

i add bottom , top border on linearlayout . have tried : <?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android" > <item android:bottom="1dp" android:top="1dp"> <shape android:shape="rectangle"> <solid android:color="#ffffff" /> <stroke android:width="1dp" android:color="#000" /> </shape> </item> </layer-list> but add border around shape.. could me please ? make two file , put this code . can set border top , bottom border, main.xml <textview android:text="this textline" android:background="@drawable/border_set" /> border_set.xml this file located full path project_root/res/drawable/border_set.xml <?xml version="1.0" encoding="utf-8"?> <l

Excel Attachment sent via php mail() is corrupted -

am using below code send excel file attachment. <?php ini_set ("smtp","smtp.smpt.com"); ini_set ("sendmail_from","from.com"); $date=date("l js \of f y"); $to = 'my mail id'; $from = 'from mail id'; $replyto = 'from mail id'; $fileatt="zxxxxxyyyyyy.xls"; $subject = 'tran data rejects of ' .$date; $message= "hi team, please find attached file having tran data rejects of today thanks, edw support"; $flags = 'style="display:none;"'; $attachment = chunk_split(base64_encode(file_get_contents($fileatt))); $filename = $fileatt; $boundary =md5(date('r', time())); $headers = "from: mail\r\nreply-to: mail"; $headers .= "\r\nmime-version: 1.0\r\ncontent-type: multipart/mixed; boundary=\"_1_$boundary\""; $message="this multi-part message in mime format. --_1_$boundary con

cordova - i get this alert in my app , only in android.Created with phonegap -

i need find alert on app phonegap , pooshwoosh notification. alert on android. <?xml version="1.0" encoding="utf-8"?> <!-- config.xml reference: https://build.phonegap.com/docs/config-xml --> <widget xmlns = "http://www.w3.org/ns/widgets" xmlns:gap = "http://phonegap.com/ns/1.0" id = "........." version = "1.0.1"> <name>....</name> <description> .... </description> <author ..... </author> <!-- enable individual api permissions here. "device" permission required 'deviceready' event. --> <feature name="http://api.phonegap.com/1.0/device" /> <gap:plugin name="org.apache.cordova.device" version="0.2.8" /> <!-- if not want permissions added app, add following tag config.xml; still have

r - Looking for a more concise way to recategorise a variable -

i have vector of integer ages want turn multiple categories: ages <- round(runif(10, 0, 99)) now want variable binned 3 categories, depending on age. want output object, ages.cat this: young mid old 1 0 0 1 2 1 0 0 3 1 0 0 4 1 0 0 5 1 0 0 6 0 1 0 7 1 0 0 8 0 0 1 9 0 1 0 10 0 1 0 at present creating object following code: ages.cat <- array(0, dim=c(10,3)) # create categorical object 3 bins ages.cat[ages < 30, 1] <- 1 ages.cat[ages >= 30 & ages < 60, 2] <- 1 ages.cat[ages >= 60, 3] <- 1 ages.cat <- data.frame(ages.cat) names(ages.cat) <- c("young", "mid", "old") there must faster , more concise way recode data - had play dplyr couldn't see solution particular problem functions. ideas? what's 'canonical' solution problem in base r or using package? whatever alternatives, i'm they'll more co

c# - EntityFramework Group by not included in SQL statement -

i'm trying create query similar this: select randomid myview ... group randomid note: ef doesn't support distinct thinking of going around lack of group by (or think) randomid numeric entity framework v.6.0.2 this gives me expected result in < 1 second query when trying same ef have been having issues. if linq similar this: context.myview .where(...) .groupby(mt => mt.randomid) .select({ id = group.key, count = group.count() } ) i sort of same result forcing count , making query > 6 seconds the sql ef generates this: select 1 [c1], [groupby1].[k1] [randomid], [groupby1].[a1] [c2] ( select [extent1].[randomid] [k1], count(1) [a1] [dbo].[myview] [extent1] (...) group [extent1].[randomid] ) [groupby1] but, if query had count commented out < 1 second if change select like: .select({ id = group.key} ) i of rows without group by statement in sql query , no distinct whatsoever: select [extent1]

android - ToggleButton makes mediaplayer play twice at once -

i have mediaplayer plays music in activity below. thing is, music transfers other activities , thats fine. when start music, go activity , come activity below, togglebutton has changed on off. therefore, if click on togglebutton, music starts again though music still playing music playing twice @ once! how make togglebutton know music playing when come activity, togglebutton "on" beginning? it's "off" default. public class spelaactivity extends activity { @override protected void oncreate (bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_spela); final mediaplayer mediaplayer = mediaplayer.create(getbasecontext(), r.raw.ljudfil); togglebutton musikknapp = (togglebutton) findviewbyid(r.id.togglemusik); musikknapp.setoncheckedchangelistener (new compoundbutton.oncheckedchangelistener() { public void oncheckedchanged(compoundbutton buttonview, boolean ischecked) { i

c# - Contextmenu showmodal -

as see contextmenu has show() . not showmodal() . what need sure user clicked on item in menu. user must click on of it. i can on closing event cancel property. when set cancel true - winforms allows select treeview's node (contextmenu tree node). so how make context menu modal ? for have write this void contextmenutreeview_closed(object sender, toolstripdropdownclosedeventargs e) { if (e.closereason == toolstripdropdownclosereason.itemclicked) return; if (treeview.selectednode != null && treeview.selectednode.tag != null) { if (changecustomereventhandler != null) changecustomereventhandler(this, new customertreenodeeventargs((guid)treeview.selectednode.tag)); } else { if (newcustomereventhandler != null) newcustomereventhandler(this, eventargs.empty); } } you cannot show standard menus in modal way hope do. that's n

python - Passing string of entry to another function with tkinter -

i'm using python3, trying pass user has typed in username , password box login function when press login button. , login functions should pack label of username onto gui. code: import tkinter tkinter import * import sys def login_gui(): global login_window global studentid_entry_login usr_login = stringvar() pwd_login = stringvar() login_window=tkinter.tk() login_window.title("login") login_window.geometry("200x200+500+300") username_label_login = tkinter.label(login_window, text="username:").pack() username_entry_login = tkinter.entry(login_window, textvariable=usr_login).pack() password_label_login = tkinter.label(login_window, text="\npassword:").pack() password_entry_login = tkinter.entry(login_window, textvariable=pwd_login).pack() button_login = tkinter.button(login_window, text="login", command = login).pack() login_window.mainloop() def login(): username = usr

windows - Kill a process using its PID in ruby -

i'm trying kill process using pid after given period of time, i.e, if process keeps running more 10 minutes, have call method kill it. i have 2 problems: first, can't manage kill process, i'm using: process.kill('int', pid) but errors keep popping bad file descriptor , or unsupported name 'sigquit' when use quit signal instead of int . second, how make 10 minutes timer before call method kill process? thanks. for timing, can use thread: thread.new sleep 10 * 60 begin process.kill('quit', pid) rescue errno::esrch # process exited end end _, status = process.wait2 pid puts status.exited? i unsure of why quit not working you. not replicate error.

java - OpenGL JOGL camera perspective -

i have drawn 3 boxes each same size having different distance camera. these boxes ought perceived decreasing in size moving away camera. how acheive illusion of distance. //these 3 planes boxes // first plane gl.glvertex3i(0, 30, 30); gl.glvertex3i(10, 30, 30); gl.glvertex3i(10, 20, 30); gl.glvertex3i(0, 20, 30); //2nd plane gl.glvertex3i(20, 20, 37); gl.glvertex3i(30, 20, 37); gl.glvertex3i(30, 10, 37); gl.glvertex3i(20, 10, 37); //3rd plane gl.glvertex3i(40, 10, 45); gl.glvertex3i(50, 10, 45); gl.glvertex3i(50, 0, 45); gl.glvertex3i(40, 0, 45); //and eye @ code. gl.glmatrixmode(gl2.gl_modelview); gl.glloadidentity(); glu.glulookat( 35, 15, 10, 25, 15, 30, 0, 1, 0 ); gl.glmatrixmode(gl2.gl_projection); gl.glloadidentity(); gl.glortho(-50.0, 50.0, -30.0, 30.0, 0.0, 60.0); you need use perspective projection, instead of orthographic projection. instead of calling gl.glortho(

ios - Delete all my data in my Core Data store -

i have followed variety of posts here in delete data app can start over. have tried: a) deleting data: nsarray *entities = model.entities; (nsentitydescription *entitydescription in entities) { [self deleteallobjectswithentityname:entitydescription.name incontext:context]; } if ([context save:&error]) { ... - (void)deleteallobjectswithentityname:(nsstring *)entityname incontext:(nsmanagedobjectcontext *)context { nsfetchrequest *fetchrequest = [nsfetchrequest fetchrequestwithentityname:entityname]; fetchrequest.includespropertyvalues = no; fetchrequest.includessubentities = no; nserror *error; nsarray *items = [context executefetchrequest:fetchrequest error:&error]; (nsmanagedobject *managedobject in items) { [context deleteobject:managedobject]; nslog(@"deleted %@", entityname); } } b) delete physical data store: nserror *error; nspersistentst

vb.net - How to keep a Timer running after a program is closed? -

i have vb.net program uses timer 20 seconds. when program runs, timer works fine until finishes (for 20 seconds). problem if close program after 10 seconds, timer stops well. however, want code allows timer continue running until finishes remaining 10 seconds. question is, possible use timer , make run after program closed? alternatively, there other ways accomplish want (example: keep timeofday.ticks run if close program)? solutions appreciated. thanks, a-tech i'm not sure can continue run after closing, can postpone application closing following code. public class form1 dim closer boolean = false private sub button1_click(byval sender system.object, byval e system.eventargs) handles button1.click timer1.enabled = true label1.text = "timer started" end sub private sub timer1_tick(byval sender system.object, byval e system.eventargs) handles timer1.tick timer1.enabled = false label1.text = "timer stopped" if closer

php - Get everything between strings and replace with something else -

i trying between {code} tags $html string. so far have written doesn't work expected, replacing first {code} also work many code tags, haven't gotten far yet. <?php $html = <<< eot <p>lorem ipsum dolor sit amet, consectetur adipiscing elit.</p> <p>{code}my test code 1{/code}</p> <p>lorem ipsum dolor sit amet, consectetur adipiscing elit.</p> eot; $startpos = strpos($html, '{code}'); $endpos = strpos($html, '{/code}'); if($startpos !== false && $endpos !== false){ $startpos += 6; # strlen('{code}') $endpos += 7; # strlen('{/code}') // code $code = substr($html, $startpos, $endpos); // remove code apart start {code} $html = substr($html, $startpos-6, $endpos); // replace new code $new_code = 'test'; $html = str_replace('{code}', $new_code, $html); } echo $html; result : - http://codepad.viper-7.com/t9sbbn testmy te

watir - Can you change the browser profile in Ruby WQatir / Selenium mid-stream? -

i know can set special profile designating myprofile , saying browser = watir::browser.new :firefox, :profile => myprofile but possible declare browser = watir:browser.new :firefox to start out test standard profile , switch myprofile later? syntax that? can define scenario ? because, had done profile related things, had not need change profile later. had set profile @ beginning of file tell firefox not appear it's download prompt dialog box, download file @ told destination. so, interesting know why trying change profile later.

regex - Perl: grep is matching when it should not -

sub process_ignore{ $col_ref = shift; $ignore_ref = shift; foreach ( @{$ignore_ref} ) { if ( grep( /^$_$/, @{$col_ref})) { print "will ignore column: $_\n" if $debug; } else { print "will not ignore column: $_\n because not valid column" if $debug; } } if ($debug) { foreach $val ( @{$col_ref} ) { print "$val\n"; } } } &process_ignore(\@cols, \@ignores) -- @cols have a_id, status, stime @ignores have a_id, sdd output: ignore column: a_id ignore column: sdd a_id status stime i m not sure why going the matching if block when should not. there no sdd in @cols also, grep ignore case? i.e a_id vs a_id? replace: foreach ( @{$ignore_ref} ) { if ( grep( /^$_$/, @{$col_ref})) { to(at least): foreach $ignore ( @{$ignore_ref} ) { if ( grep( /^$ignore$/, @{$col_ref})) { or even(if regexp not necessary):

sql - MIN and MAX Oracle 10g -

i have table sales column , date of sales column, , want select min , max , date of min , max response single max date , single min date, in oracle, don't know how it, idea? thanks from explanation looks need below: 1) select sales , date table_name sales = ( select min(sales) table_name) 2) select sales , date table_name sales = ( select max(sales) table_name) in single query select sales , date table_name sales = ( select min(sales) table_name) union select sales , date table_name sales = ( select max(sales) table_name)

java - the import com.viewpagerindicator cannot be resolved -

Image
i newbie android. question maybe silly you, forgive me. receiving android project , open in adt. when open project there 2 errors in 2 java files, the import com.viewpagerindicator cannot resolved in problems. have searched google , find it's using viewpagerindicator . , jar name android-support-v4.jar . checked project libs folder there android-support-v4.jar , it's in android private libraries . i thought maybe it's not configured in build path. checked java build path tab in project properties window, it's in libraries tab. screenshot below: am missing anything? appreciated. you need include project android library project , seems haven't done this. from " including in project " section android-viewpagerindicator presented android library project. standalone jar not possible due theming capabilities offered indicator widgets. you can include project referencing library project in eclipse or ant. download source o

java - android app parse values through intent -

i trying parse value through intent while switching between activities. know should read values last intent getextra don't know why doesn't work. also when switch between activities on button click, application crashes. in activity main read text edittext , put in intent : public void schimba(view view){ int value = integer.parseint(instances.gettext().tostring());; intent intent = new intent(this, tabel.class); intent.putextra("max", value); startactivity(intent); } when switch activity 2 have this: intent intentobject = getintent(); int value; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); value = intentobject.getintextra("max", 0); /* for(i=0;i<=value;i++) { layoutinflater layoutinflate = null; layoutinflate = (layoutinflater) getsystemservice(context.layout_inflater_service); final view rowview = layoutinflate.inflate( r.l

collections - In Scala, apply function to values for some keys in immutable map -

let immutable map val m = (0 3).map {x => (x,x*10) }.tomap m: scala.collection.immutable.map[int,int] = map(0 -> 0, 1 -> 10, 2 -> 20, 3 -> 30) a collection of keys of interest val k = set(0,2) and function def f(i:int) = + 1 how apply f onto values in map mapped keys of interest resulting map be map(0 -> 1, 1 -> 10, 2 -> 21, 3 -> 30) m.transform{ (key, value) => if (k(key)) f(value) else value }

extjs - Error ext-all-dev.js:12300 Error: Cannot read property 'length' of undefined -

i have application in extjs works when creating view sends me following error: error: can not read property 'length' of undefined ext-all-dev.js: 12300 procude error in line of code ext-all-dev.js (i used pause on uncaught exception in chrome): getrendertree: function() {          var me = this,              result = me.callparent(arguments)              i, len;          (i = 0, len = result.length; <len; + +) {              result [i] = me.transformitemrendertree (result [i]);          }          return result;      } i created 3 classes: 1 - name ext.ux.panelfooter , extending 'ext.panel.panel' 2 - name ext.ux.panelheader , extending 'ext.panel.panel' 3 - name ext.ux.toolbar , extends ext.toolbar.toolbar help please, thank you. edit / update: this code var panelcenter = new ext.panel.panel({ region: 'center', id: 'centerpanel', title: 'system admin', enabletabscroll: t

javascript - AngularJS: use jquery with multiple ng-repeat -

i posted question concerning possibility of different scroller div same class name. works perfectly. here link of thread: scroll multiple div @ same time lately, i've made ​​changes in code make div dynamic (with ng-repeat ). since these changes, jquery function no longer works. think javascript executed before various ng-repeat completed. my function scroll on container same class name : var subcatcontainer = $(".sub-category-container"); subcatcontainer.scroll(function() { subcatcontainer.scrollleft($(this).scrollleft()); }); is there solution in order wait ng-repeat ? in directive? to complete explanation, created : jsfiddle

How to hide source and design buttons (Flash Builder)? -

Image
i using flash builder 4.6, want find way hide source & design buttons or can switch active buttons white gray or lavender (because prefer working @ night, dark tones make eyes feel pleasant) do have idea, please! if wanting make button hidden can set visible property false under whatever criteria want hidden. change color, in properties window of component view properties wish change , modify them in similar fashion. if(condition){ sourcebutton.visible = false; }

unit testing - why WCF scenario test generation wizard throw that error?what kind or log file i should use? -

Image
i'm creating wcf test , when wcf scenario test generation wizard comes there option create scenario called :"capture message log" when give wcf trace file throws error: messages.svclog not valid message log file the wcf trace file seems not closed : when open the wcf trace file appears next window: but know how can close file? , have do?

java - Hibernate composite keys with abstract class -

is possible have employee table composit primary key (personid,departmentname) keeping the person's class @id annotation , keeping abstract class. public abstract class person { @id @generatedvalue @column(name = "person_id") private long personid; @column(name = "firstname") private string firstname; // getter , setter methods, } @entity @table(name="employee") @primarykeyjoincolumn(name="person_id") public class employee extends person { @column(name="joining_date") private date joiningdate; @column(name="department_name") private string departmentname; public employee() { } public employee(string firstname, string lastname, string departmentname, date joiningdate) { super(firstname, lastname); this.departmentname = departmentname; this.joiningdate = joiningdate; } // getter , setter methods, }

asp.net mvc - MVC @Url.Abs helper does not seem to exist -

just writing simple mailer using asp mvc mailer have gone through tutorial , email being send. cannot seem include absolute urls. in example use html helper system.web.mvc.urlhelper the absolute should written so <a href="@url.abs(@url.action("index","home"))">linkage</a> but error 'system.web.mvc.urlhelper' not contain definition 'abs' , no extension method 'abs' accepting first argument of type 'system.web.mvc.urlhelper' found (are missing using directive or assembly reference?) from searching have done seems add nonchalant, if "you add thing." any suggestions? you have add: @using mvc.mailer; to mailer view

How to create button to another stack - Livecode -

Image
i want create button stack code i have 2 stack.and stacks name "aa" , "bb" i want create button in stack "bb" stack "aa" code on createdigits create button "test" of stack "bb" end createdigits results: it's create in stack name "aa" , error message: here's 1 way want: on createdigits set defaultstack "bb" create button "test" end createdigits

html - VB Agility Pack XPath select sub node in parent based on another sub nodes value -

i have html dom so: <div class="productcontainer"> <div class="image jsthumbnailreplace"> <a href=""> <img src="/img/noimagemedium.jpg"/> </a> </div> <div class="productdata" <div class="descriptionsection"> <div class="title">title</div> </div> </div> </div> i want select title text if source in image tag contains "noimagemedium". use visual studio 2010 vb.net , html agility pack achieve this. debugger says xpath expression invalid. i thought xpath should doesn´t work: //div[@class='descriptionsection']/div[@class='title'][//div[@class='productcontainer']/div[contains(@class, 'image') , contains(@class, 'jsthumbnailreplace')]/a/img[contains(@src, 'noimagemedium')]] apparently syntax wrong can´t figure

jquery - Filtering Javascript object array -

i trying new array object based on 2 of them. log1 = {1:"london",2:"new york",4:"berlin"}; log2 = [{id:1, location:"eu"},{id:2, location:"us"},{id:18, location:"asia"}]; i want make sure log1 keys exist in log2 and, if not, want delete it. be: result = {1:"london",2:"new york"}; i couldn't filter take 1 object. there way filter based on 2 object arrays? there neat way ? if using recent version of js array.map() , array.filter() , object.keys() try following more functional approach: var log1 = { 1: "london", 2: "new york", 4: "berlin" }; var log2 = [ {id: 1, location: "eu"}, {id: 2, location: "us"}, {id: 18, location: "asia"} ]; var ids = log2.map(function(obj) { return obj.id; }).map(string); object.keys(log1).filter(function(key) { return ids.indexof(key) === -1; }).foreach(functio

wpf - update user profile in silverlight -

i create user profile page in silverlight , use wcfria in project write these code doesnt change in database. how can implement page ? code : //domain service public void edituser(tbluser user,long id) { var query=(mydb.tblusers.where(u=>u.user_id==id).select(u=>u)).single(); try { query.fname = user.fname; query.lname = user.lname; query.email = user.email; query.cnum = user.cnum; query.address = user.address; query.url = user.url; mydb.savechanges(); } catch { return; } } //code behind : ctx.edituser(user, id); ctx.submitchanges();

How do I add a controller to ASP.NET MVC with Visual Studio 2013 and Entity Framework? -

i getting error when add controller in visual studio 2013 asp.net mvc 5.0 , entity framework 6.0. have added few controllers , generated views after added datatables package, getting type of error: error "there error running selected code generator" "there error getting type 'project.classes.studentclass' try rebuilding project" i have cleaned , rebuilt project still isn't working. there table named studentclass , want add controller table using entity framework. how can generate controller successfully? if error message says "there error getting type...", make sure built visual studio project after added class. scaffolding uses reflection find class.

c# - Regular Expression Validator for number with a length of 5 or 6 only -

i have textbox facultyid should accept 5 or 6 digit number. i want use regular expression validator validate user input. validation expression should put in? please help. i'm using asp.net , c# use validation expression on validator: validationexpression="\d{5,6}"

prolog - How to make a list of integers from 1 to N -

i'm using gnu prolog, , told can solved finite domain solver, or member/2 , is/2 . can come using both together, it's not working. here have far: unique([],n,0). unique([h|t],n,n1) :- length([h|t],n1), n2 n1-1, unique(t,n,n2), h #> 0, h #=< n. \+ member(h,t). when debug unique(x,3,3) trace , can see when calls member/2 , it's comparing 2 domains, 1..3 , 1..3 , succeed, shouldn't. can help? sorry solution doesn't use fd or member/2 . ;) using prior solution problem of generating list of integers 1 n: n_ups(n, xs) :- length(xs, n), numbered_from(xs, 1). numbered_from([], _). numbered_from([i0|is], i0) :- i1 i0+1, numbered_from(is, i1). you can use gnu built-in permutation predicate: unique(n, p) :- n_ups(n, l), permutation(l, p). results unique(3, l) : | ?- unique(3, l). l = [1,2,3] ? l = [1,3,2] l = [2,1,3] l = [2,3,1] l = [3,1,2] l = [3,2,1] no | ?- if want roll own permut

Can I create/draw my own custom polyline animation in Google Maps? -

once find 2 location points using; can create own custom polyline animation in google maps? i want able show dotted line animation being drawn goes 1 location 2nd location. polyline being drawn dotted curvy "treasure map" type line drawn 2nd location point. thank you!

VBA code that closes excel after inactivity and can run with other macros -

hello looking code close excel after specified amount of time user has been inactive. have code online problem not run correctly other macros in workbook. need code can run other macros , close after user inactivity. appreciated! call macro inactivity counter @ end of each macro. exit inactivity counter macro using global variable passing 0 @ beginning of each macro. sample code keyboard inactivity control: public br integer public declare sub sleep lib "kernel32" (byval dwmilliseconds long) private declare function getasynckeystate lib "user32" (byval vkey byte) integer sub brea() br = 0 'do stuff here call test end sub sub test() br = 1 dim t integer t = 0 while t < 15 t = t + 1 sleep (1000) = 0 255 ret = getasynckeystate(i) if ret <> 0 t = 0 next application.statusbar = t if br = 0 goto ends doevents wend application.quit ends: end sub

vb.net - VB 2008 Transferring stored values to textbox after initial textbox value is cleared -

self teaching vb beginner here. i have data entry section includes... 2 comboboxes(cbx_trucktype, cbx_doornumber) -------cbx_trucktype having 2 options (inbound, outbound) -------cbx_doornumber having 3 options (door 1, door 2, door 3) 2 textboxes (txb_customername, txb_ordernumber) -------txb_customername hold customer name -------txb_ordernumber hold order number and finally... a button(btn_entertruck) transfers text comboxes , textboxes following... 2 tabs the 1st tab has 2 buttons(btn_door1, btn_door2) btn_door1 has 3 corresponding textboxes -------txb_trucktypedoor1, txb_customernamedoor1, txb_ordernumberdoor1 btn_door2 has 3 corresponding textboxes -------txb_trucktypedoor2, txb_customernamedoor2, txb_ordernumberdoor2 the 2nd tab has 1 button(btn_door3) btn_door1 has 3 corresponding textboxes -------txb_trucktypedoor3, txb_customernamedoor3, txb_ordernumberdoor3 currently, have code (that works question had!) that, upon btn_entertruck

google chrome - Persist CSS alterations in Webkit Inspector -

is there way web inspector make style changes stick past page refreshes? as make changes , fixes, before upload or commit them server, it's helpful see them in inspector. however, link clicked, page refreshes , inspector grabs server-based version. there way around that?

How can i find the size of a window? -

for example if got window (which not part of project): example http://puu.sh/8lqkq.jpg there way size of window? (int x , y) thanks, revolt if have hwnd of window can use getwindowrect() or getwindowplacement() position , dimensions. update : on vista , later, getwindowrect() can report values not take glass/aero account. account that, can use dwmgetwindowattribute() dwmwa_extended_frame_bounds attribute instead.

css - How to align a div vertically on full unknown width? -

this question has answer here: how center div in page? (height & width)? 2 answers i mean, if have div, 200px of height , 200px of width, , want align vertically (i can align horizontaly "margin: auto", but, there way align vertically without knowking height of screen? thanks , sory english, it's not native language edit: height of screen here's example, fiddle div { position: absolute; width: 200px; height: 200px; top: 50%; left: 50%; margin-top: -100px; margin-left: -100px; }

Check for json change in python -

i running this python code on raspberry pi, checks usgs data , finds magnitude of earthquakes within last hour. problem json changing. how make keep checking see if changed again? the simplest setup periodically run request logic on , over, caching results each time, perhaps optional increasing backoff if several requests yield same results. you compare new parsed values previous ones if delta care about, or replace inline if you're want ensure freshest. since json.loads default deserializes dictionary, standard dictionary methods available make comparisons. very simple examples of timed-interval callbacks available on other posts alternatively there heavier solutions apscheduler , though that's lot more you'd interested in raspberry pi.

java - for loop to convert integer values into letters -

i working on homework assignment encodes , decodes letters int's , vice versa. first encoding loop have works great! public static string encode(string msg){ string result=""; string m = msg.touppercase(); char c; int x; (int = 0; i<m.length(); i++){ c = m.charat(i); x = c; if (x == 32){ x = 0; } else{ x -= 64; if (x < 1 || x > 26){ x = 99; } } result += string.valueof(x) + " "; } return result; } it takes string msg , runs loop convert integer equivalent. issue decoding. essentially, numbers input entered in comma in between each number. take message array , split remove commas. take , read each value in loop , display letter equivalent. stuck. understand logic. it's reverse of first loop, cannot seem code it. here have: public static string decode(string msg){ string result = ""; st

Convert Binary to Decimal in MIPS, Assembly MARS -

i trying convert binary decimal in mips language, using mars simulator. program accepts binary number, , conversion, multiplying (shift left number's place $t9). way of saying multiplying each 1 digit 2 raised power of place, , summing result. i not have understanding of how values stored , communicated between ascii, decimal, , problem "sum" coming out 40,000 rather value of binary number in decimal. doing wrong here? .data msg1: .asciiz "enter number in base 2 (-2 quit): " msg2: .asciiz "\nresult: " allones: .asciiz "1111111111111111" empty: .space 16 newline: .asciiz "\n" sum: .space 16 summsg: .asciiz "\nsum: " onefound: .asciiz "\none found\n" zerofound: .asciiz "\nzero found\n" .text .globl main main: getnum: li $v0,4 # print string system call la $a0,msg1 #"please insert value (a > 0) : " syscall la $a0

sql - MySQL finding duplicate items in a row -

i wanna ask if possible make query see duplicate items between 2 tables? i've tried solutions returns duplicated rows not duplicated items. for example, have these 2 tables: table_a | | b | c | d | .......................................... | door | book | keys | shoe | | door | bags | desk | keys | | rice | fish | cake | shoe | table_b | | b | c | d | | tape | fans | robe | spec | | keys | shoe | fans | room | | hall | pops | door | disc | so, in end returns items has duplicates. example, | door | | keys | | shoe | ..... i've tried few queries still can't find solution. thanks. you can unpivoting data , using group by : select col (select col table_a union select b table_a union select c table_a union select d table_a union select table_b union select b table_b union select c table_b union select d

javascript - Kendo UI - Displaying images in a tooltip -

i have issue displaying images within tooltip. each territory contains photo field. i'm trying display placeholder image if photo field null. here's idea of i'm trying achieve, tried out got errors. i'm pretty sure template syntactically incorrect: <script type="text/x-kendo-template" id="storeterritory"> <div class="tooltipcontent"> #for(var = 0; < territories.length; i++){# #if (#=photo# != 'null' && #=photo# != '') {# <img src="#=territories[i].photo#" alt="" /> #} else{# <img src="https://cdn4.iconfinder.com/data/icons/website-kit-2/600/547756-cross-128.png" alt="" /> #}# #}# </div> </script> here's demo working tooltip (without snippet above): http://jsbin.com/ijunosa/25/edit the problem if enclosing photo between #= , # since if surrounded # don

javascript - loading scripts and making sure they are present -

i have onload function loading d3... var d3script = document.createelement("script"); d3script.src = "http://d3js.org/d3.v3.min.js"; head.insertbefore(d3script, head.firstchild); d3script.onload = function() { }; while group of async's running google maps api calls. want make when other async's finish , return array, can start doing d3 stuff. don't know how make if: a. d3 finishes loading first, checks other array has returned before running b. array of async's returns first, checks d3 , if it's not there waits load before doing d3 operations. var d3script = document.createelement("script"); d3script.src = "http://d3js.org/d3.v3.min.js"; otherstuff.onload = function() { head.insertbefore(d3script, head.firstchild); d3script.onload = function() { // stuff }; };

c# - Execute code during winform progress bar running -

i have small winform application , put progress bar on first running form. progress bar completes in 10 seconds , after progress bar completes next activity starts database call. i want when progress bar runs 10 seconds, during time database call should work instead of calling after progress bar completes. can explain or have sample code explain technique ??? in advance. your issue arises fact running heavy duty work on user interface thread, holding thread doing anything. to solve issue need run on separate thread , control.invoke progress bar control when needs update. check out threading , ui on vs magazine.

sql - How to write postgres query for below issue? -

level1 | level2 | level3 | level4 key | value | key |value | key | value | key | value ---------------------|----------------|---------------------|----------------- setting1 | true | | setting1 | true |setting1 | false |setting2 | false| |setting2 | false | | |setting3 | true i have 4 tables. level1, level2, level3, level4. each has key value pair. i want key, value pair such if key value pair present in level1 should not check level2,3,4. if it's not present in level1 should go level2 if not level3. value present in level4. so final o/p of type map. key | value --------------------- setting1 | true setting2 | false setting3 | true is possible sql query or need write function or procedure it? one approach use case - when structure. see sqlfiddle

oracle - Trigger is giving PL/SQL statement ignored error -

i have trigger , have modified using case statements it's giving errors: create or replace trigger trg_stg_timeattendance after insert or update on co_conf_em_tm_enr referencing new new each row declare pragma autonomous_transaction; --variable declaration stg_pos_ta - as400 l_induction_fl char(1) := 'n'; l_error_code varchar2(10); l_error_messg varchar2(100); --variable declaration stg_ta_payroll - lotus notes v_ta_date number(6) := null; v_time_in number(4) := null; v_time_out number(4) := null; v_mgr_ovrd char(1) := 'n'; v_area varchar2(20) := null; v_assc_name varchar2(60) := null; v_misc_wages_desc varchar2(30) := null; v_shrt_str_name varchar2(50) := null; v_session_no number(2) := 0; v_oim_enabled char(1); begin ----merging stg_pos_ta - as400 - start begin select decode(nvl(commission_percentage, 0), 0, 'y', 'n') l_induction