Posts

Showing posts from August, 2011

readprocessmemory - Read Process Memory in C++ -

i coding hack online-game have issue. value address want changing everytime restart game. void wallshootfunction(bool fenable) { if(fenable) { int value = 0x000000; int oo = readprocessmemory("s4client", (lpvoid)value, &value, 4, 0); writepointer(oo, 0x0, 4) } } i did that. thing want is, need add value +3 everytime, example if it's orig. value 5, must 8. if orig. value changes 7, must 10, 17 => 20 etc. how can ? thanks. ok: hacking online games not considered cool; readprocessmemory not return int , nor should have int parameter using them; the first parameter readprocessmemory not "name" process, process handle. you'll have find handle using enumprocesses etc.

Elements with a height equal to their width with just html/css -

i had idea making elements high wide css , html. requirement text inside aligned in center, horizontally , vertically across multiple lines. so based on other peoples thoughts on ( http://www.mademyday.de/css-height-equals-width-with-pure-css.html ) i made following html: <span class='box'> <span class='height'></span> <span class='content'>this longer text demonstrate multiple lines being centered.</span> </span> accompanied following css: .box { /* width */ width: 25%; display: table; } .height { display: table-cell; /* height item become %-age of width of .box, 1:1 ratio */ padding-top: 100%; } .content { display: table-cell; vertical-align: middle; text-align: center; } here's fiddle: http://jsfiddle.net/cjxb7/ . this seems work fine, however, when resizing browser ( longer tekst, browser big small ) elements don't keep ratio. i've tried in major bro...

vb.net - Undefined UserControl error -

i created usercontrol in application, problem have every time edit code of usercontrol have delete usercontrols added gui because fails compile. the project / application called panel , usercontrol called timerpanel, contains couple of text boxes within groupbox. the error reads type 'panel.timerpanel' not defined. the strange thing works ok until edit usercontrol. like said, if delete usercontrol gui, compiled , added again gui control, works ok. i read somewhere on forum must add reference system.windows.forms, , did , behaves same. what can doing wrong? when error go , build project again, see if fixes issue (building project again fixes lots of errors , when add/change user control needed use it)

css - navigation background colour -

i trying change 'get demo' (menu-item-382) on nav have square colored background around (#3eaabd). this code using inspect element tool: <header id="masthead" class="navbar navbar-fixed-top swatch-red-white text-caps" role="banner"> <div class="container"> <div class="navbar-header"></div> <nav class="collapse navbar-collapse main-navbar" role="navigation"> <div class="menu-sidebar pull-right"></div> <div class="menu-main-menu-container"> <ul id="menu-main-menu" class="nav navbar-nav navbar-right"> <li id="menu-item-342" class="menu-item menu-item-type-post_type menu-item-object-page cur… page-item-215 current_page_item menu-item-342 active active"></li> <li id="menu-item...

ios - NSURLSession tasks creation -

i'm working on networkcommunicator helper class, handle connection server,i'm using nsurlsession api , have question creation of nsurlsession tasks. there 2 ways create taks: 1 - nsurlrequest 2 - url i wondering preferred way? more specific in way life easier (adding headers, setting verb types, etc'..). thanks you more flexible when use methods take nsurlrequest example datataskwithrequest: method. way can customize http method, request body, headers, every parameter of nsurlrequest because creates it. methods take nsurl create nsurlrequest for you under hood cannot modify request afterwards. example datataskwithurl: method creates http get request specified url , cannot change post . example of creating task nsurlrequest . can see can flexible here: // create simple json data. nsdata *jsondata = [nsjsonserialization datawithjsonobject:@{ @"numbers" : @[@1, @2, @3] } options:0 error:nil]; // create post request our json requ...

voice recognition - Speech matching api or algorithm -

is there api or algorithm (free or commercial) matching 2 segments of speech audios? there no need convert speech text. want know whether 2 segments of audio speaking same words. algorithm should allow speed or amplitude variation between 2 samples. example, 1 sample might faster , louder other sample. , hope such algorithm should independent of languages spoken. some people might call technology voice tag. it's used in cars hands-free calling. record voice tag person's name in whatever language like. later on, speak same thing call person.

jquery - IE8: invisible third-level navigation menu in Foundation 5.2 -

Image
i'm on suicide mission support ie8 foundation 5.2-based site. things have gone well, i'm stuck on problem can't seem figure out: there's multi-level flyout menu (operating on click, not hover), , third level of said menu appears in right place, never shows up—in ie8. here's looks (client identity obscured): it's absolutely-positioned element, i've googled around , tried many unsuccessful tricks: setting progressively-higher z-indexes starting outer container , working way menu forcing overflow: visible , opacity: 1 , display: block , clip: auto on missing ul , parents manually setting generous widths , heights thinking maybe ul isn't getting haslayout the thing gets close setting position: relative on ul . results in silly , unusuable page layout, of course, can @ least see menu items change. i've set fiddle using assets straight out of development pile: http://jsfiddle.net/24tka/ i know foundation 5.2 not offer support ie8...

json - JavaScript map containing arrays turns into map containing maps -

i creating map containing arrays. i'm sending map parameter method in popup window. this map of arrays turning map of maps in popup window!! im using ie8. i'm creating map this: var mapdetails = new object(); mapdetails.fields = ['a','b']; mapdetails.optsampledata = ['x','y']; json of map im sending: {'fields':['a','b'],'optsampledata':['x','y']} json of map im receiving: {'fields':{'0':'a','1':'b'},'optsampledata':{'0':'x','1':'y'}} this wouldnt problem in js data can still accessed fields[0]. but, i'm sending server-side i'm using gson parse json. gson turns map. try function function myparser(str) { str = str.replace(/'/g, '"'); var obj = json.parse(str); for(var item in obj) { if(obj.hasownproperty(item)) { var array = []; ...

data format error in association rule learning R -

i tried search other posts in r related this, did not find duplicated questions(at least efforts). know need priori function in library("a rules") though. i have large array file each row list user1: [1,2,3,4] # [1,2,3,4] itemlist purchased user user2: [4] ................ i want find items tend purchased together. how should proceed? seems need convert data "transaction" format file also. so did temp <- split(a, 1:nrow(a)) # temp list of lists b <- as(temp, "transactions") but got error "error in asmethod(object) : can coerce list atomic components only" can help? i googled example , run following code without problem a_list <- list(c("i1","i2","i5"), c("i2","i4"), c("i2","i3"), c("i1","i2","i4"), c("i1","i3"),c("i2","i3"),c("i1","i3"), c("i1...

How to serializable from java application and de-serializable on android? -

i'm newbie android, , i'm developing application on android. app need use class de-serializable , data. class: package fu.sna2014.smartnavigation.utility; import java.io.serializable; public class streetobject implements serializable{ /** * */ private static final long serialversionuid = 437865663147928104l; private string id; private string name; private byte[] sound; public streetobject(string id, string name, byte[] sound) { this.id = id; this.name = name; this.sound = sound; } public string getid() { return id; } public void setid(string id) { this.id = id; } public string getname() { return name; } public void setname(string name) { this.name = name; } public byte[] getsound() { return sound; } public ...

c# - User to specify directory path -

i give users option select directory path on local machine (not select actual file). this can save xml files directory on hard drive. when user selects directory want pass path code loads data xml files database. i know can users select file: <label for="file">filename:</label> <input type="file" name="file" id="file" /> but not want, want them select directory. can advise if done in mvc application. a web application cannot directly write user's computer. best can provide downloadable link , user needs save as browser. in case, forget directory path , give link/button on web page xml files. on click , generate xml file database , use following snippet user download prompt. // code on click of button/link fileinfo file = new fileinfo(tempfilepathonserver); response.clear(); response.clearheaders(); response.clearcontent(); response.addheader("content-disposition", ...

Detect mouseover event over jquery ui datepicker -

i using form placed on div moves in , out of screen when hover on it. take effect use jquery .hover() event: $('#formulario').hover( function () { $(this).stop().animate({'marginright':'-2px'},200); }, function () { $(this).stop().animate({'marginright':'-345px'},200); } ); the problem using jquery ui datepicker in form, , when move widget select date, div's mouseleave event executes , form moves out. have tried find way detect mouseenter event datepicker can't find way avoid this. here example of problem the datepicker element created outside of div doesn't carry hover. created empty display not yet set "none", filled in contents of calendar when first appears, after set display: none hide. so wanted check 2 situations, datepicker empty, or set display: none. wrapped around hide animation means div cannot hide while datepicker open: if ($('#ui-datepicker-...

Neo4j 2 Cypher fuzzy search -

i'm using neo4j 2 rest api , have ability add plugins. i have entity in database label 'entity' , name 'united kingdom'. how execute fuzzy search find entity. i able find using queries united kingdom uniter kingdom united kinjdom so .*<query>.* won't it. i notice there support in previous versions. start n = node:index("name : 'united kinjom'~0.2") return n but doesn't appear work anymore. it still works. adding fulltext search automatic new schema indexes on roadmap. until can still use "legacy" indexes. http://jexp.de/blog/2014/03/full-text-indexing-fts-in-neo4j-2-0/

Strange output when invoking model method from a runner in Rails -

i'm invoking model method runner: rails runner -e development "sala.new.recipient_list2" model method: def recipient_list2 email_list = sala.all(email) email_list.each |recipient| puts "#{recipient}" end end and i'm getting following output: #<sala:0xb05665c> #<sala:0xb055770> #<sala:0xb05566c> #<sala:0xb055568> #<sala:0xb055464> #<sala:0xb055360> #<sala:0xb05525c> #<sala:0xb055158> #<sala:0xb055054> #<sala:0xb054f50> #<sala:0xb054e4c> #<sala:0xb054d48> #<sala:0xb054c44> #<sala:0xb054b40> #<sala:0xb054a3c> if call modified version of method looks controller: def recipient_list email_list = sala.all(email) end controller call: @list = to_be_notified.recipient_list and display @list in view, list of emails. why isn't working runner ? ! add .email in recipient_list2 meth email_list.each |recipient| puts "#{...

standards - Hardware Devices and Standardization -

i'm not sure if each hardware type (display screen, usb, printer, etc) has follow unified standard in order communicate cpu. example, bits transmitted , forth between display screen interface , cpu interpreted cpu specific command, , interpretation correct (for same bits) if display screen used (from manufacturer). if not true, how bios supposed communicate hundreds of different hardware devices varying methods of interpreting bits going , forth device interface cpu? i find standardization notion more practical. the bios needs understand limited set of hardware required boot cpu. not need understand "hundreds" of devices. example, bios has no idea usb printer is. in general, bios understands following devices: the cpu/chipset "core" hardware - e.g. ddr3 memory controller basic pci/pci express initialization - nothing device-specific the video controller - enough code basic initialization, typically provided option rom the sata controll...

How can I stream remote epub in android app -

i want application stream / read epub remote , display readers. epub wont saved on client. is possible stream remote epub ? searched google on didn't relevant. if tried please me out! yes or no appreciated if source. thanks.. if don't want save epubs on client can web application, check https://github.com/readium/readium-js . if have website can used read epub can wrap-up access website in android app , achieve desired result.

vb.net - Error:this template attempted to load content assembly -

ok got visual studio pro create phone applications in vb.net. yet when installed template got error error:this template attempted load content assembly. have nuget installed , error displaying before had need here. i'm usualy visual studio 2010 ide , trying load following temaplte:vb windowsphone application template under silver light. , knows have tried installing nuget changed nothing. appreciated thank you. check out link below; http://www.itorian.com/2012/08/error-this-template-attempted-to-load.html no error not same. error message provided half , cannot know template/component giving error. provide full error better. athar

c++ - Why is the class holding a reference copyable? -

having class holding reference expect following code fail miserable, compiles: #include <iostream> struct referenceholder { std::string& str; referenceholder(std::string& str) : str(str) {} }; // why compile? referenceholder f() { std::string str = "hello"; return referenceholder(str); } int main() { referenceholder h = f(); std::cout << "should garbage: " << h.str << '\n'; return 0; } compiler: g++ 4.7.2 (with -std=c++11) edit : -fno-elide-constructors compiles happily there's no problem copy-initialising class, example does: new reference initialised refer same object old one. of course, undefined behaviour when function return leaves reference dangling. the reference prevents default-initialisation , copy-assignment; following small change fail reasons: referenceholder h; // error: can't default-initialise reference h = f(); // error: can...

cwnd - TCP Congestion Window Size Too Large? -

Image
i try emulate network comprised of 2 host , 1 switch using mininet. 1 host sender, sending packets continuously other host (receiver) using iperf tool. h1----------------------------switch--------------------------h2 -------100mbps|0.125ms-----------100mbps|0.125ms------ the link between host , switch has bandwidth of 100mbps , delay of 0.125ms. each packets sent has size of 1.5kb , switch has buffer of 400 packets. delay of each link 0.125ms rtt between h1, h2 4*0.125=0.5ms cwnd (congestion window) number of packets sender send in 1 rtt, throughput computed as: throughput = cwnd/rtt. because max(througput) < bandwidth cwnd < rtt*bandwidth=0.5*10^(-3)*100*10^6=50000b~6kb = 4packets but when monitor cwnd using tcp_probe tool, surprisingly display cwnd bigger 200kb (~120packets), bigger expected. even buffer 400 packets, cannot has cwnd large that. please explain me, i'm stuck @ problem. thank you! i don't think can calculate cwnd , rtt wa...

time comparison in two editText : android -

i have 2 edittext in enter time in , time out. googled couldn't find proper answer comparing 2 edittext having time in them. want create kind of validation function tells time in cannot less time out. eg if come office @ 09:00 cannot leave office @ 8:am my time picker function 1 edittext : { final calendar c = calendar.getinstance(); mhour = c.get(calendar.hour_of_day); mminute = c.get(calendar.minute); // launch time picker dialog timepickerdialog tpd = new timepickerdialog(this, new timepickerdialog.ontimesetlistener() { @override public void ontimeset(timepicker view, int hourofday, int minute) { // display selected time in textbox txttime.settext(string.format("%02d:%02d", hourofday, minute)); ...

css - Stylesheets in Rails -

i use 1 of stylesheets public folder (several directories each own css file) 1 of controllers. having trouble bringing in static css file. i've tried following code - <%= stylesheet_link_tag "/public/foldername/style2.css" %> but it's not working please try <%= stylesheet_link_tag "/foldername/style2.css" %>

javascript - How to get back to ajax state with dynamic data -

here application on working. when user clicks on alphabet the respective data loaded through ajax call. , profile of associated faculty displayed. when user clicks on list buttion page goes previous page rather page of selected alphabet. what want , when user clicks on list button user have go aphabet selected ajax call ? how can ?

javascript - Im trying to find out what is allowing users to withdraw twice the amount or more, of what is in their accounts -

i have section of site allows users withdraw dogecoins in accounts wallet. newly launched today. today noticed user depositing , withdrawing multiple times in row. withdrawals double deposits. luckily have reserve in case happened, , no user accounts affected. i checked dogechain, , seems there. no transaction malleability, , amounts withdrawn. problem is, time hit dogechain, doubled, pretty means site allowing happen. the scope of going on, outside of know of php. when user withdraws, click button opens small withdraw window: button code: <a href="#" onclick="javascript:return withdraw();" class="withdraw">withdraw</a></div> background javascript withdraw() function: function _requestwithdraw(amount,valid) { $.ajax({ 'url': './content/ajax/withdraw.php?valid_addr='+valid+'&amount='+amount+'&_unique=<?php echo $unique; ?>', 'datatype': "json", ...

java - Why is final needed inside a method but not inside a class -

in android if i'm updating variable inside listener, e.g. ondraglistener, either need make variable final if it's declared inside method. private void mymethod() { final int[] = {null}; mf.setondraglistener(new touchablewrapper.ondraglistener() { @override public void ondrag(motionevent motionevent) { map.setmylocationenabled(false); log.d("map", "stopped location , remove drag listener"); if (motionevent.getactionmasked() == motionevent.action_up) { //stop restartlocation if it's running if (restart[0] != null) { restart[0].cancel = true; } restart[0] = new restartlocation(); restart[0].start(); } } }); } or if it's outside of method doesn't need final. private restartthread restart; private void mymethod() { mf.setondraglistener(new touchablewrapper.ondragliste...

payment - How to create eCheck account type in paypal buyers sandbox account ? And, How to test it with ebay sanbox orders? -

hello , we have paypal buyer sandbox & seller sandbox account. have ebay buyer & seller sandbox account. i checked 1 order ebay buyer account. redirect paypal sandbox account. there got option change account type. there did not echeck account type. tried create echeck account in paypal buyer account. please give full details how create echeck account type in paypal buyer. things should needs do? thanks in advance sandbox not support echeck funding option. if need test ipn data sent in relation these types of payments, can use ipn simulator @ https://developer.paypal.com/webapps/developer/applications/ipn_simulator .

sql - how to check for null in datarow row in c# -

i have code foreach (datarow row in dtgraph.rows) { string username = row["username"].tostring(); string loggedstate = row["loggedstate"].tostring(); string interactionid = row["interactionid"].tostring(); string interactiontype = row["interactiontype"].tostring(); } how check if row["something"] null? i tried run code, , null values becomes "" (empty). i need check if these null. i stupid question, problem making tostring() thought null becomes null or null or null or empty? thanks use dbnull.value var username = row["username"].tostring(); to var username = reader["username"] != dbnull.value ? row["username"].tostring():""; update var username = ""; if(reader["username"] != dbnull.value) { username = row["username"]....

Text Game - If statement based of input text - Python -

so, i'm making text based puzzle game using python programming class (we forced use python), instead of having user simple 1 or 2, want program detect if user has entered 'hesitate' or 'walk' exactly. currently have determine amount of characters in user's input, makes possible them input anything. #choice number1 def introchoice(): print("do 'hesitate? or 'walk forward") def hesitate(): print() print("you hesistate, startled sudden illumination of room. focusing on old man has turned you. gestures come closer. \n ''come in, come in, don't frightened. i'm frail old man'' says.") print() # def walk(): print() print("default") print() #currently determines input inputvar = 5 #user input choice = str(input()) #checks length if len(choice) >= inputv...

c# - FlowLayoutPanel glitch with lot of child -

Image
i'm having trouble flowlayoutpanel , child controls rendering. if add 300+ child controls, panel stops render them @ point. last displayed item has sort of overlap , other child controls missing. thanks. looks flowlayoutpanel not support lot of controls. way fixed creating new user control includes flowlayoutpanel , vertical scroll bar. panel holds 100 controls @ 1 time , logic handles v scroll bar position, add or remove controls panel. this way allows handle 4000+ child controls.

Eclipse and Java: Using ProcessBuilder gives Error: Could not find or load main class -

i have master.java class spawning 2 types processes (server.java , client.java) this: to start process server.java (which has main) string[] servercmd = {"java", "server"} processbuilder pb = new processbuilder(servercmd); pb.inheritio(); process p = pb.start(); to start process client.java (which has main) string[] servercmd = {"java", "client"} processbuilder pb = new processbuilder(servercmd); pb.inheritio(); process p = pb.start(); once starts run errors this: error: not find or load main class server error: not find or load main class client all 3 of these files master.java client.java server.java in same folder. does know how fix error or how configure eclipse handle it? i don't have best answer on this, use debugger , step through process. way can see when it's failing. also, check see arguments allowing more 1 argument @ time. example: run program , have fail. within eclipse click on 'run' ta...

java - Android Eclipse Split for newline -

in application android i've inserted : log.i("myapp1", response.tostring()); this output of logcat in eclipse response.tostring: 04-08 20:54:21.674: i/myapp1(9930): 23/03/2014<br />pics 1<br /><br /><br />09/03/2014<br />pics 2<br /><br /><br /> how output in layout android? need tried split < br /> without success... 23/03/2014 pics 1 09/03/2014 pics 2 instead of <br /> html code use \n in code. string editedresponse = response.replaceall("<br />", "\n"); log.i("myapp1", editedresponse); if want display string in textview sure set android:lines 2 or greater. <textview android:id="@+id/txttitlevalue" android:text="line1: \n-line2\n-line3" android:layout_width="54dip" android:layout_height="fill_parent" android:lines="2" android:textsize="11px" />

c# - Web services and client DLL -

i have web service , client dll. web service uses oracle database. for testing client dll, copied web service , made point test database. copied client dll , added test web service using "add web reference". what use 1 web service , 1 client dll able tell client dll use either use test or production database rather 2 identical web serivces , client dlls. edit i mis-stated issue. need use 1 client dll , 2 web services (one production version, 1 development/test version) , able to, somehow, tell client dll web services use. sample of how web service, client dll , client app used: public class dssservice : system.web.services.webservice { public dssservice() { } [webmethod(messagename = "getfacility", bufferresponse=true, description = "blah.")] public facility getfacility(string sfdbid, string szip, string sfinno) { facility ofacility = ...; ... return ofacility; } .... } client dll: ...

python gnupg.GPG no such file or directory -

i'm trying verify file signature, when creating gnupg object using gpg = gnugp.gpg(gnupghome='/users/myname/.gnupg') however keep getting no such file or directory error. i've tried different paths home, not including path , letting use default, no avail. some of functions not need beyond gpg home directory (i.e. ~/.gnupg) specified, others require little more that. if you're manipulating keyrings. i got around making config.py file in same directory other scripts contains this: homedir = "/users/username" gpg_home = homedir+"/.gnupg" gpg_homeshort = "~/.gnupg" # optional pub_ring = gpg_home+"/pubring.gpg" sec_ring = gpg_home+"/secring.gpg" pring = [] sring = [] pring.append(pub_ring) sring.append(sec_ring) that's os x, linux, bsd , other unixes change first line to: homedir = "/home/username" for scripts basic encryption , decryption, should work: import gnupg config impor...

mvvmcross - Can't bind tableview cell's "Selected" property -

i have view model public class complectationsubitemwrapper: mvxviewmodel { public complectationsubitemwrapper () { } private complectationsubitem _complectationsubitem; public complectationsubitem complectationsubitem { { return _complectationsubitem; } set { _complectationsubitem = value; raisepropertychanged(() => complectationsubitem); } } private bool _isselected; public bool isselected { get{ return _isselected; } set { _isselected = value; raisepropertychanged(() => isselected); } } } how can bind isselected property tablecell's selected? tried: this.delaybind(() => { var set = this.createbindingset<genericpopovercell, complectationsubitemwrapper>(); set.bind(lbltitle).to(vm => vm.complectationsubitem.title); set.bind(this).for(s => s.selected).to(vm => vm.isselected); set.apply (); ...

audio - Detect frequency from microphone Java -

i make program can transfer data pulses of frequency unsure on how detect if frequency present. i assume need filter out unneeded frequencies can't seem find on how this. are there libraries or have build own? there examples of or similar being done? it looks though you're trying implement modem , , advised @ proven modulation techniques used purpose - qpsk , qam . technique imply in question crude of amplitude modulation - modulating carrier of given frequency bit-stream. heterodyning might place start when demodulating this. using fft yield poor results because of sampling effect of windowing, result in poor bandwidth. another practical problem face once you've demodulated signal clock recovery. highly probable original bitstream clock asynchronous sample clock @ receiver. in order decode data-stream, need recover sender's clock (that say, relationship between , local clock). phased lock loop usual way of achieving this. you need work out...

oracle - ORA-24550: signal received: [si_signo=6] error -

i want know ora-24550: signal received: [si_signo=6] means? i know oracle error , may oracle latest patch can solve issue. when error triggered, scenario signal has handled or whether error occur when application has handle related oracle , application failed that. this sign oracle client has received signal wasn't expecting. oracle docs say: ora-24550: unhandled signal #number received. string cause: serious error: signal received action: refer platform-specific signal code, , see if application code caused error. otherwise, record error state , notify oracle support services. by default, oracle registers own signal handlers, you can configure let signals propagate instead . you see log line this: ora-24550: signal received: [si_signo=6] [si_errno=0] [si_code=1] [si_int=597680428] [si_ptr=0x239fe290] [si_addr=0x3f445c43c0] and may see traceback too. to debug, need find out producing signal. si_signo=6 means you're getting signal 6...

android - Canceling alarm when activity is destroyed -

i have service running in android app. service started using alarmmanager repeating alarm. when event occurs, service sends out broadcast, received within fragment. there alarm canceled (alarm.cancel(pendingintent)). so far, good. do if activity/fragment gets destroyed? how can still cancel service? just call alarm.cancel() same pendingintent you've used start @ ondestroy method of activity/fragment: alarmmanager alarm = (alarmmanager) getsystemservice(context.alarm_service); alarm.cancel(pendingintent) from description of cancel() method: remove alarms matching intent . alarm, of type, intent matches 1 (as defined filterequals(intent) ), canceled.

android - Black screen on running the code -

i'm trying understand sprites in andengine. wrote below code load simple image "img" package com.example.pxc; import org.andengine.engine.camera.camera; import org.andengine.engine.options.engineoptions; import org.andengine.engine.options.screenorientation; import org.andengine.engine.options.resolutionpolicy.ratioresolutionpolicy; import org.andengine.entity.scene.scene; import org.andengine.entity.sprite.sprite; import org.andengine.opengl.texture.atlas.bitmap.bitmaptextureatlas; import org.andengine.opengl.texture.atlas.bitmap.bitmaptextureatlastextureregionfactory; import org.andengine.opengl.texture.atlas.bitmap.buildablebitmaptextureatlas; import org.andengine.opengl.texture.atlas.bitmap.source.ibitmaptextureatlassource; import org.andengine.opengl.texture.atlas.buildable.builder.blackpawntextureatlasbuilder; import org.andengine.opengl.texture.atlas.buildable.builder.itextureatlasbuilder.textureatlasbuilderexception; import org.andengine.opengl.texture.regi...

beyondcompare - Comparison of folders with Beyond Compare Script -

i have beyond compare script compare file contents of 2 folders , produce text-report. how can this? using text-report compares 2 files. folder-report not compare file contents. thanks myscript.txt load %1 %2 expand select all.files file-report layout:side-by-side options:display-mismatches output-to:%3 now can create batch file , write this: "c:\program files (x86)\beyond compare 3\bcomp.com" @myscript.txt file1.txt file2.txt save.txt /silent

mysql - Execute a query using Hibernate-Java -

i have query select userid userinfo datediff(expirydate,curdate())<100; how can query executed using hibernate?? i have tried list<string> usernames = (list<string>)(getsession().createquery("select userid userinfo datediff(expirydate,current_date)<100;").list()); (iterator iterator = usernames.iterator(); iterator.hasnext();){ string username= (string) iterator.next(); system.out.println(username); } but does'nt return result there other way this?? if it's in native sql dialect of database, have use this: list<string> usernames = (list<string>)(getsession().createsqlquery("yournativesqlquery").list());

apk - Batch file to run an Android app in emulator -

compile.bat : set path=%path%;h:\source\program\sdk\tools; set path=%path%;h:\source\program\sdk\platform-tools; cd sdk\tools emulator -avd emulator2 adb wait-for-device cd sdk\platform-tools adb install -r sp.apk here batch file run .apk emulator. cd, adviser wants run app in computer using cd. sdk folder in cd , same directory compile.bat . setting of path correct? there error when test compile.bat cd, says too many files specified; take apk file , verifier file . the adb install command become adb install -r sp.apk apk p.apk t_rootproject_name-debug.apk . want install sp.apk in emulator. when run commands in cmd, not in batch file working. also want know how enable camera in laptop emulator. app requires camera run. can me please? begging you. need tomorrow graduation. thank you.

python - Integrity Error *_id may not be null -

i'm relatively new python , django please forgive ignorance. i receiving following error when saving formset integrityerror @ /jobs/1/ jobs_education.applicant_id may not null here view: def application(request, job_id): job = get_object_or_404(job, pk=job_id) #return 404 if job isn't yet published if (job.pub_date>timezone.now()): return httpresponsenotfound('<h1>job not found</h1>') educationinlineformset = inlineformset_factory(applicant, education, extra=1, can_delete=false) if request.method == 'post': form = applicantform(request.post) formset = educationinlineformset(request.post) if form.is_valid() , formset.is_valid(): # save model database, directly form: applicant_saved = form.save() formset.applicant_id = applicant_saved.id print 'formset %s' % formset.__dict__ formset.save() return render(requ...

regex - How to extract number more gracefully in Python using xpath and regular expression -

i have small html snippet want extract number – grade. using python scrapy , re . my code works, far being nice. here html snippet, want 2 . <div id="left"> <div class="0"><b>certificate:</b></div> <div class="1"> <div></div> <div> <a class="link" href="new.html">maths</a>&nbsp;(first)&nbsp;&nbsp;&nbsp;grade 2<br> </div> </div> <div class="2"></div> </div> and here how solved far: ! note = sel.xpath('//*[@id="left"]/div[2]/div[2]/text()[2]').extract() ! print note > [u'\xa0(first)\xa0\xa0\xa0grade 2'] ! note_string = ''.join(note) ! note_only = re.search(r'\d+', note_string).group() > 2 it's not best practice transform lists strings extract such tiny information. how can better? you can use following xpath expression 2 substring-...

mysql - how to select data when i use from fulltext and inner join? -

Image
i have 2 tables , want select data 2 tables inner join work true. problem in out of query select tbl_usersmeta.name, tbl_usersmeta.family, tbl_users.* tbl_usersmeta inner join tbl_users on tbl_usersmeta.id , tbl_users.id in ( select id tbl_users match(username) against('a*' in boolean mode)) problem :

Android zxing throws NullPointerException -

i planing use zxing library provide qr code functionality in android app. able work, throws exception. using sample code provided library github link. can let me know causing exception? links intentintegrator , intentresult classes. sample code mainactiivity (used eclipse generate initial code): package com.example.testapp; import android.app.activity; import android.app.alertdialog; import android.os.bundle; import android.util.log; import android.view.menu; import android.view.menuitem; import android.view.view; import android.view.view.onclicklistener; import android.widget.button; import com.google.zxing.integration.android.intentintegrator; public class mainactivity extends activity { private static final string tag = "mainactivity"; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); button b = (button) findviewbyid(r.id.button1); ...

java - Code inside this undetectable malware -

i have got message 2 times in facebook quoting " lol abc.rar" , abc.rar file has executable jar file once clicked tries connect facebook , enters same message chat randomly. decompiled using jd gui 0.36 , found class czjffdqozxffyhrq inside malware/virus,there manifest file inside it.i tried virus total gives no results. surely threat has come me 2 facebook friends of mine, unrelated each other ,so it's spreading fast virus total result: https://www.virustotal.com/en/file/a5ce78b2b3e3d6a98982ec300ff05abc8b56a5ed27b9b67b2e2fc417fc56a9df/analysis/1397065080/ now code of class:-package com.cakes; import java.io.file; import java.io.fileoutputstream; import java.io.ioexception; import java.io.inputstream; import java.io.outputstream; import java.net.url; public class czjffdqozxffyhrq { public static string mrdbdgwortilmglt() { int[] tdclrmdqriktvlkvmy = { 104, 116, 116, 112, 58, 47, 47, 100, 108, 46, 100, 114, 111, 112, 98, 111, 120, 117, 115, 101, 114, 99,...

gorm - Error using generics on grails domain class -

i'm trying create generic abstract hierarchy implementation, code following: abstract class abstracthierarchy<t> { t parent static hasmany = [children: t] static constraints = { parent(nullable: true) } static mapping = { tableperhierarchy false } } im getting error: abstracthierarchy.groovy: -1: class java.lang.object refers class java.lang.object , uses 1 parameters, referred class takes no parameters. so question is, doing wrong? supported grails? searching error found http://jira.grails.org/browse/grails-11065 i'm using grails 2.3.7 way. on account of type erasure, expect everywhere using t in domain model, might using object . gorm's perspective model above equivalent to abstract class abstracthierarchy { object parent static hasmany = [children: object] static constraints = { parent(nullable: true) } static mapping = { tableperhierarchy false } } whic...

php - don't cache some HTML -

i know if can exclude of html being cached. using mediawiki software. mediawiki solution or other php solution work well. my mediawiki pages cached , implementing site notice feature expires after few days. when pages cached, doesn't honor expiration date , being displayed time. want exclude part of code being cached. implementing mediawiki extension. thanks mediawiki caching works in many layers. there number of server side caches , apart caching in client. (as might have noticed, mw notoriously slow, unless implement @ least of caching functionalities.) first of want figure out sitenotices cached. i'm sure aware, there more 1 place can set sitenotice: mediawiki:anonnotice mediawiki:sitenotice $wgsitenotice in localsettings.php through few different extensions do stay on page long? secondly, can try , figure out sitenotice cached: is there difference if logged in/out? parts of interface can harder cached anonymous users. does message disappea...

mysql - Sum items and not already in use -

insert results(month,region,item, yield12mo,unitsshipped) select m.period,s.region,s.item,avg(s.yield), sum(s.shippedqty) sales s, period m s.buydate >= date_sub(m.startdate,interval 12 month) , s.buydate <= m.enddate group s.item; sales table contains items, sale dates, prices, etc. period table contains time frame in question (altered auto-script) i need find way add yield12mo results if total qty shipped each item between selected date range >= 10 , region + item combo not in results table. if less 10 shipped in time period or if region + item combo in results, not add. i know need type of if statement or case statement combined join, i'm new , cannot figure it. any appreciated. thank you! this tough 1 because know little schema, think following should work. disclaimer: have ever worked in mssql, not mysql, of syntax may different... insert results(month, region, item, yield12mo, unitsshipped) select m.period,s.region,s.item,avg(s.yield), ...

c# - Web API can't deserialize a Javascript Date.toISOString()? -

i'm looking way pass javascript dates .net web api controllers without installing library on client... i'm expecting javascript dates deserialize .net datetime. var date = new date(); post({currentdate: date.toisostring()}); arrives @ server datetime.min (indicating failed deserialize). here's example of being sent on wire, apicontroller not able create datetime correct date... request: {"date":"2014-04-16t17:03:03.383z"} c#: [serializable] public class myobj { public datetime date { get; set; } } public class mycontroller : apicontroller { public httpresponsemessage post(myobj dd) { // dd's date property equals datetime.min rather correct date... return null; } } } remove [serializable] attribute.

eclipse - Which sequence should be follow to synchronize code (commit and update) using Egit? -

i quite new egit (an eclipse plugin git). i getting weird errors (like dirty tree, conflict exception) while synchronizing code when there conflict between local file , remote file. so sequence should follow use git in better way? right performing following steps: fetching merging (in step getting errors using team synchronization.) add git index (in case there conflict) committing please me better way if any. that seems correct, described in " resolving merge conflict " of egit user guide . this egit tutorial adds following tips: use git staging view find conflicting files, in large projects faster navigating package explorer view. the rest follows doing: once have manually merged changes, select team → add context menu of resource mark conflicts resolved , commit merge resolution via team → commit .

join - How do you make a condition on a column in one table apply to every instance of a primary key? -

i have table called 'artists' has columns artist_id, artist_name, artist_genre , table called 'albums' artist_id, album_id, album_name, album_number_songs etc. i join these 2 tables via artist_id. want know artists have never had album on 12 songs. have tried this: select distinct artist_name artists inner join albums on albums.artist_id=artists.artist_id album_number_songs < 12 however checks instances , output on whether or not album has < 12 not artist overall...does know? please try query: select artist_name artists artists.artist_id not in (select albums.artist_id albums albums.artist_id = artists.artist_id , albums.album_number_songs > 12) this includes artists no albums think corresponds better initial task.

python - Implementing K-Medoids in numpy: the medoids selection step -

as author of this question i'm trying implement k-medoids using numpy. i'm more interested in how implement medoids-individuation step (second step in [ 2 ]), consisting in selecting, cluster cluster, sample minimizes sum of distances other samples belonging same cluster. let assume have same structures described in [ 1 ]: # number of samples n_samples = 5 # distance square matrix d = np.array([[ 0., 3.04959014, 4.74341649, 3.72424489, 6.70298441], [ 3.04959014, 0. , 5.38516481, 4.52216762, 6.16846821], [ 4.74341649, 5.38516481, 0. , 1.02469508, 8.23711114], [ 3.72424489, 4.52216762, 1.02469508, 0. , 7.69025357], [ 6.70298441, 6.16846821, 8.23711114, 7.69025357, 0. ]]) # medoids medoids = np.array([0, 3]) # cluster membership array cl = np.array([0, 0, 1, 1, 0]) i can't implement using numpy ... can me? [edit] current best solution is: for c in range(number...

django - haystack: How to limit SearchQuerySet to a single SearchIndex? -

context: searchindex analogous django's model . tied single model via get_model . searchqueryset analogous django's queryset (except way of obtaining instance). haystack_connections analogous django's databases . one not apparent difference performing searchqueryset operations uses searchindex subclasses have. how perform operations on single searchindex (for single model) only? connections don't seem meant this. searchqueryset.models answer, buried deep in docs. add .models(djangomodel1, djangomodel2) searchqueryset calls, models returned chosen searchindex es' get_model .

java - scrollable vaadin view to display all the components in the page -

how can 1 achieve html webpage in vaadin using layout components (new vaadin) right whatever components add in ui component components appear in browser... there no scrolling option see other components added below in hierarchy public class loginview extends customcomponent implements view, button.clicklistener { public static final string name = "login"; private textfield user; private passwordfield password; private button loginbutton; nativeselect select_role; private horizontallayout fieldsbottompanel; private verticallayout fieldsleftpanel; private gridlayout loginpanelgrid; private verticallayout filedstoppanel; private verticallayout loginformlayout; private label top_header_panel; private verticallayout virtualkeyboard; private verticallayout fieldsrightpanel; private verticallayout footer; private verticallayout header; private window page; public loginview() { ...