Posts

Showing posts from September, 2011

windows - Push an argument into stack? -

i know first 4 arguments in register ( rcx , rdx , r8 , r9 ), , additional arguments pushed on stack. question: how push argument onto stack? tried (push 0) not work? code ( masm64 ) extrn exitprocess: proc extrn messageboxexa: proc .data caption db '64-bit hello!', 0 message db 'hello world!', 0 .code start proc sub rsp, 38h mov rcx, 0 ; hwnd = hwnd_desktop lea rdx, message ; lpcstr lptext lea r8, caption ; lpcstr lpcaption mov r9d, 0 ; utype = mb_ok push 0 ; wlanguageid call messageboxexa mov ecx, eax add rsp, 38h call exitprocess start endp end i'm know messagebox , messageboxex work same way, im trying use messageboxex because need 1 parameter passed (for learning purpose). i know i've asked similar question, more related vb.net while not. my assembly little rusty, under impression arguments went onto stack (in reverse order) - i'

linux - Sanity check SSH public key? -

i have asked users public "id_rsa.pub" ssh key, place in "/home/theiraccount/.ssh/authorized_keys", can login server ssh. i'd automate process. is there anyway sanity check string give me (programmatically or otherwise)? want verify sshd can read text , looks valid public key (and hasn't been corrupted)? put way, format of id_rsa.pub file? if enters in field can write in form handler script verify complete , correct? ssh-keygen can used calculate fingerprint of key file, fail if don't pass key: ssh-keygen -l -f id_rsa.pub another possibility ssh-vulnkey , have advantage of checking keys against blacklist of known compromised keys @ same time.

c++ - Unknown type name class -

i have following header files: https://gist.github.com/wemakeweb/5501443 , compiler reports "unknown type name class" . have included forward declaration, break circular including , think have to. did forget? edit : put in 1 header file, , compiler still reports "expected ; after top level declarator" https://gist.github.com/wemakeweb/5583500 edit 2 im getting linker errors. "undefined symbols architecture x86_64" solved, problems were circular including main.c instead of main.cpp the actual code in static lib not linked properly this error? error: unknown type name ‘class’ you're compiling c rather c++. make sure source file has .cpp extension, , relevant compiler flags set correctly. (it helps if include exact error message , line numbers. don't try , retype, cut+paste.)

javascript - Locally serving filepicker.io JS -

we use require.js handle javascript module loading. how source @ http://api.filepicker.io/v1/filepicker.js updated? safe (as in won't cause our app break when make changes) download , serve locally via such module loader? i assume because of versioning in directory on updating api you'll update directory. overall, recommend against storing filepicker.js locally. while try not change javascript (for caching purposes, one), push out changes fix issues found or add new features. occasionally, things don't affect external api, change way library communicates our servers - in these cases, if using copy stored locally, implementation no longer work. with regard "v1" versioning, version number of api (rather js include), distinguish v0 api deprecated in december 2012.

ios - Reset keychain on the device -

i'm testing login flow (using keychainitemwrapper ) inside app on device. how reset/delete keychain app? on simulator, clicking on ios simulator -> reset content , settings... . keychain items in ios sandbox, users don't have access remove unwanted keychain item. these accessible via api's only. keychainitemwrapper *keychainitem = [[keychainitemwrapper alloc] initwithidentifier:[[nsbundle mainbundle] bundleidentifier] accessgroup:nil]; //or how access keychain [keychainitem resetkeychainitem]; or can reset device >> device settings, general, reset, reset settings. but, reset keychain every app installed on device.

phonecalls - Get call receive event in android -

can incoming call pick , end call event in android through coding? want when received incoming call should show toast message. incoming call want when end call should show toast message in app.please suggest me. if want when application's 1 activity use following code : phonestatelistener phonestatelistener = new phonestatelistener() { @override public void oncallstatechanged(int state, string incomingnumber) { if (state == telephonymanager.call_state_ringing) { // incoming call: pause music log.i("phone", "ringing"); } else if (state == telephonymanager.call_state_idle) { log.i("phone", "idle"); } else if (state == telephonymanager.call_state_offhook) { // call dialing, active or on hold log.i("phone", "offhook"); } super.oncallstatechanged(state, i

vb.net - Visual Basic (2010) - Using variables in embedded text files? -

ive been able search need on here, , i've found easily, seems exception. i'm writing program in visual basic 2010 express, it's simple text based adventure game. i have story, multiple possible paths based on button/option choose. text of each story path saved in own embedded resource .txt file. could write contents of text files straight vb, , solve problem, that's not way want this, because end looking messy. my problem need use variable names within story, here's example of contents of 1 of embedded text files, "when "+playername+" woke up, "+genderheshe+" didn't recognise "+genderhisher+" surroundings." i have used following code read file text box private sub frmadventure_load(byval sender system.object, byval e system.eventargs) handles mybase.load dim thestorytext string dim imagestream stream dim textstreamreader streamreader dim assembly [assembly] assembly = [assembly].getexec

javascript - getting the last / newest object from Parse.com -

what have input name , input button save name parse database, on load event pull names database , present them user. what i'm trying is: when page loaded list of names presented user. , when button clicked add user list , appear when page refreshed. this live example want without "thomas" being added on , on again in case. i know used query.first query.find save name database not display it. left in demonstrate i'm trying achieve. i figured out this question , below working code. $(window).load(function () { var contact = parse.object.extend("contact"); var query = new parse.query(contact); query.equalto("objectid"); query.find({ success: function (results) { (var = 0; < results.length; i++) { var firstname = document.createelement("label"); firstname.innerhtml = (results[i].attributes.firstname.tostring());

assembly - Is all data valid x86 16-bit machine code? -

executing ndisasm /dev/urandom seems never give me errors. suggests either lucky or bytes disassemble 16-bit assembler. i facing actual issue because want know if can rely on behavior test disassembler. i think not valid, cause think ndisasm output lines db 0x82 when doesn't match instruction. lines there.

How to get current logged in user's local timezone in asp.net mvc2 -

i need current logged in user's local timezone , pass function exports excel data analysis purpose. the export excel data functionality done using server side code, , need logged in user's local timezone client machine. can 1 me provide way resolve issue? thanks & regards, santosh kumar patro you'd need plugin of kind (i.e.: flash, or active-x). timezone of client isn't in http request header , can't access system information page rendered in browser. if users don't travel around much, save timezones profiles. edit: i've seen people talking solving kind of problem before, getting user's approximate location , inferring time zone that. should noted workaround may extremely innacurate.

c# - How to create link in for loop via Datetime -

i want create text(link) every month of year may, 2013 april, 2013 march, 2013 february, 2013 january, 2013 december, 2012 to have created loop var start = datetime.now; var end = datetime.now.addyears(20); (datetime time = start; time <= end; time = time.addmonths(1)) { //month , year } but i'm not sure because not work :( something like: datetime enddate = new datetime(2013, 12, 31); list<string> list = new list<string>(); (datetime startdate = new datetime(2013, 1, 1); startdate.month <= enddate.month; startdate = startdate.addmonths(1)) { list.add(startdate.tostring("mmmm, yyyy")); if (startdate.month == enddate.month) break; } for output: foreach(string str in list) console.writeline(str); output be: january, 2013 february, 2013 march, 2013 april, 2013 may, 2013 june, 2013 july, 2013 august, 2013 september, 2013 october, 2013 november, 2013 december, 2013

android - ActionBar list navigation: different text color in header and pop up menu -

Image
i have navigation list in action bar has dark background. pop menu however, has white background. so want achieve is, item text color inside of action bar white whereas items text color in menu pop black. this 2 examples got far: this how should like: does know solution? this code list navigation: arrayadapter<string> adapter = new arrayadapter<string>(this, android.r.layout.simple_dropdown_item_1line, new string[] { "item 1", "item 2" }); getsupportactionbar().setnavigationmode(actionbar.navigation_mode_list); getsupportactionbar().setlistnavigationcallbacks(adapter, new actionbar.onnavigationlistener() { @override public boolean onnavigationitemselected(int itemposition, long itemid) { return true; } }); getsupportactionbar().setselectednavigationitem(0) these collection of styles worked with. <style name="customtheme" parent="@st

jquery - How to add button at the end of each column in datatable in MVC 4? -

i new concept. want add button @ end of each column in datatable. i can in asp.net, not have idea in mvc 4. please advise me on issue. code below: <table class="plans-table"> <thead> <tr> @foreach (datacolumn col in table.columns) { <th>(@col.columnname)</th> } </tr> </thead> <tbody> @foreach (datarow row in table.rows) { <tr class="plans-row"> @foreach (datacolumn col in table.columns) { <td> @row[col.columnname] </td> } </tr> } </tbody> </table> you can add button @ end of each row, like: <table class="plans-table"> <thead> <tr> @foreach (datac

jquery mobile navbar icons appear twice -

the icons in jquery mobile navbar appear twice, can't see why, code copied jquery docs <link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.1/jquery.mobile-1.3.1.min.css" /> <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script> <script src="http://code.jquery.com/mobile/1.3.1/jquery.mobile-1.3.1.min.js"></script> and navbar itself <div data-role="navbar" class="ui-navbar" role="navigation"> <ul class="ui-grid-b"> <li class="ui-block-a"> <a id="showlatest" data-icon="grid" data-theme="a" class="ui-btn-active ui-btn-icon-top ui-btn-up-a"> <span class="ui-btn-inner" aria-hidden="true"> <span class="ui-btn-text">latest</span> <span class="ui-icon ui-icon-grid ui-i

PHP / SQL - Convert EBCDIC to ASCII -

we have php server code, executing sql statements against our iseries midrange. here simplified version of sql query select 'regular' "sales_type", sum(sales_type1) "sales" salestable the query executes fine, problem when using static field/value such 'sometext' "title" , results come in php, not in desired format string(7) "Ù…�����" to connect system , retrieve results db2_connect ( '*local', 'user', 'pass' ); if (! $connection) {[error code]} $stmt = db2_prepare ( $connection, $strsql ); if (! db2_execute ( $stmt ) ) { [error code ] while ( $row = db2_fetch_array ( $stmt ) ) { var_dump($row[1]); } we on php version 5.2.17 our iseries v7r1m0 a solution convert server side php or in sql query self great. thanks! edit from bucks suggestion have changed user profile ccsid 37 instead of 65535 now (below) bit closer... string(7) "Ù…‡¤“™" is possibly because chan

php - convert pdf into jpg using exec -

i want convert pdf-image .jpg-image. i made convert.php can call filename of pdf file , convert jpg. call function this: http://www.example.ch/tools/img/cache/convert.php?f=mypdf.pdf this looks this: if ($f = @$_request['f']) { $f = htmlspecialchars(urldecode($f)); $url = 'http://www.example.ch/img/cache/'.$f; $file = strtolower($f); $ch = curl_init($url); curl_setopt($ch, curlopt_returntransfer, 1); curl_setopt($ch, curlopt_useragent, 'mozilla/5.0 (windows; u; windows nt 6.1; en-us; rv:1.9.1.2) gecko/20090729 firefox/3.5.2 gtb5'); $data = curl_exec($ch); $retcode = curl_getinfo($ch, curlinfo_http_code); curl_close($ch); if ($retcode == 200) { file_put_contents($file, $data); $converted_filename = str_replace('.pdf', '.jpg', $file ); $cmd = 'convert '.$file.' '.$converted_filename; exec('convert '.$file.' '.$converted_filename)

perl - Substring replacement using regex -

i having terrible time learning perl regular expressions. trying : replace occurrences of single # @ beginning of line with: ##### . replace occurrences of full line of # characters (ignoring leading or trailing spaces) with # ---------- # . i know s/# that's know , can find. suggestions. the beginning of line matched ^ . therefore, line starting # matched by /^#/ if want # single, i.e. not followed # , must add negative character class: /^#[^#]/ we not want replace character following # , replace non matching group (called negative look-ahead ): /^#(?!#)/ to add replacement, change s/^#(?!#)/#####/ the full line can matched following regular expression: /^#+$/ plus means "once or more", ^ , $ have been explained. have ignore leading , trailing spaces ( * means "zero or more"): /^ *#+ *$/ we not want spaces replaced, have keep them. parentheses create "capture groups" numbered 1: s/^( *)#+( *)$/$1#

html - Re-write links only not redirect -

hi don't know htaccess , can't understand how codes work. can me this www.site.com/forums/index.php?/cp/3-welcome/ will change text www.site.com/forums/welcome not redirect it. you first want ensure rewrite rules enabled. can through .htaccess file using code similar to: <directory /var/www/website/html> rewriteengine on rewritecond %{request_uri} !^/images/ rewriterule ... ... rewriterule </directory> once done should able run rewritecond command redirect rewrite engine enabled. your redirect within .htaccess file should like: rewriterule ^http://([^/]*)/forums/welcome(\d+)/(.*)$ http://$1/index.php?/cp/3-welcome/ of course may need update/edit required specific needs, should @ least give general idea.

is that thread safe to update entry.value.field directly in ConcurrentHashMap? -

sometimes, need update 1 field of entry.value . thread safe way construct new entry.value , use put method update. said, need make deep copy of original value though little modification. can update like map[key].field = fieldvalue; hash map returns entry safely, assignment of field out of scope of map. so, should here thread safety. code equivalent to: entry entry = map[key]; entry.field = fieldvalue; obviously field assignment operator doesn't know map.

deployment - Moving web application (Java/JSP) to a web server -

i have developed application netbeans (using java, jsp , jquery) in windows environment. ready transfer application web host application can available on web , told application have moved linux environment (hosting service bought). here concerns: how convert code linux? there automatic tool this? how deploy application server online (what need copy , directory on web?) my application writes directory on c:drive on laptop, should make application write correct directory designated directory on web server? i have read here , there online haven't got specific solutions this. how convert code linux? there automatic tool this? one of java key features portability , far haven't used os-specific code running program using cmd or similar or library os-dependant (which rare in these times there yet), don't have do. how deploy application server online (what need copy , directory on web?) you need generate war file . file zip web pages (jsps) , we

jquery - SlidesJS Pause Workaround? -

i downloaded , implemented new plugin named slidesjs. slides ran in auto-play mode. however, seemed notice problem(not sure if problem or feature). whenever clicked pagination item, auto-slide effect pauses. not showing play button on screen, , hence problem. want auto-slide effect continue after user clicks on pagination items. is there solution ? just add following complete callback in options (using slidesjs 3.0): $('#slides').slidesjs({ callback: { complete: function(number) { var plugininstance = $('#slides').data('plugin_slidesjs'); settimeout(function() { plugininstance.play(true); }, plugininstance.options.play.interval); } } });

active directory - Compare two organizational units with Powershell -

i compare 2 organizational units users. can user list command: ou_number_1: get-aduser -filter * -searchbase "ou=ou_number_1,ou=ou-sne_sharepoint,dc=vf,dc=local" | select samaccountname ou_number_2: get-aduser -filter * -searchbase "ou=ou_number_2,ou=ou-sne_sharepoint,dc=vf,dc=local" | select samaccountname i homonymous these lists. have put users in lists , compare them ? or better idea ? to summary, list homonymous of ou's. /update try $usergroup1 = get-aduser -filter * -searchbase "ou=ou_number_1,ou=ou-sne_sharepoint,dc=vf,dc=local" | select samaccountname $usergroup2 = get-aduser -filter * -searchbase "ou=ou_number_2,ou=ou-sne_sharepoint,dc=vf,dc=local" | select samaccountname $userinbothou = compare-object $usergroup1 $usergroup2 -includeequal be aware array $userinbothou contains powershell objects. when want samaccountname, must that: foreach($user in $userinbothou) { write-host $user.samaccou

Limit SQL statement to year -

i want take 2 following statement , results 2013. select count(distinct cast(c1.caseseqnumber varchar) + '-' + cast(c1.year varchar)), count(distinct cast(c2.caseseqnumber varchar) + '-' + cast(c2.year varchar)) caseparticipants c1 left join caseparticipants c2 on c1.year=c2.year , c1.caseseqnumber=c2.caseseqnumber , c2.participanttype = 'appellant rep 1' and second one select distinct c1.caseseqnumber, c1.year caseparticipants c1 left join caseparticipants c2 on c1.year=c2.year , c1.caseseqnumber=c2.caseseqnumber , c2.participanttype = 'appellant rep 1' c2.year null order year asc, caseseqnumber asc thanks! if looks have year field, add where clause: 1: select count(distinct cast(c1.caseseqnumber varchar) + '-' + cast(c1.year varchar)), count(distinct cast(c2.caseseqnumber varchar) + '-' + cast(c2.year varchar)) caseparticipants c1 left join caseparticipants c2 on c1

asp.net mvc 3 - MVC3 return a File always in a new tab without replace the old one -

i have form target="_blank" posts, process , return pdf file in new tab, problem is: when first time, it's ok, when again, instead of opening new tab, replaces old 1 new content! and if i'm using internet explorer, posts parameters null, in case need close new tab, , again controller: public actionresult submitreport(string parameter) { // code return file(stream, "application/pdf"); } view: @using (html.beginform("submitreport", "resumopagamentos", formmethod.post, new { area = "ci3s", @target = "_blank" })) { // etc.. etc... } html target values case-sensitive. _blank (capital b ) not special _blank value (which opens new tab), tab named _blank , reused if exists.

Java network with server-client in single model -

i want create network 3 nodes communicate each other. in more detail i'm trying to: create server-client model single project copy project in 2 more , there have 3 nodes by changing ports ofcourse can make them communicate if split projects in different computers after want 1 project send time (with made-up time lag) other 2 nodes , vice-verca other 2 nodes, , find average time. i dont want create single servers , single clients, want use threads make unified server-client runs simple "run". the problems i'm having node starts first finishes first , rest nodes left hanging , in endless loop. , other that i'm stuck no idea do. so far have made this: server: public class server implements runnable{ private int port; private string name; public server(int port, string name){ this.port=port; this.name=name; } public synchronized void run(){ while(true){ try{ thread.sleep(5000);

html - Vertical nav bar bug -

im trying write vertical nav bar, no proper styling yet. cant work out how make items appear along side properly. http://javascript.nicklewers.co.uk/ basic function, when clicking on 'android' games , apps pop out apps in line android search engines friend. i'd try before asking questions here simple things. may lot of flack. http://jsfiddle.net/hkdfq/1/ <ul class="menusubnav"> <li><a href="">home</a></li> <li><a href="">about</a> <ul> <li><a href="">games</a> <ul> <li><a href="">andriod</a></li> <li><a href="">windows</a></li> </ul> </li> </ul> </li> <li><a href="">contact</a></li>

typo3 - doNotLinkIt in userFunc -

im building menu following typoscript includelibs.myadminmenu = typo3conf/ext/my_admin/user_makemenu.php lib.usermenu = coa_int lib.usermenu.10 = hmenu lib.usermenu.10 { special = directory special.value = 184 modules = {$modules} entrylevel = 1 1 = tmenu 1.itemarrayprocfunc = user_myadminmenu->makemenu 1 { no = 1 no.allwrap = | act = 1 act.allwrap = | } } this works fine, inside makemenu method have following foreach($menuarr $i => $menu) { if (array_key_exists($menu['uid'], $this->paymentmodules)) { if (! in_array($this->paymentmodules[$menu['uid']], $modules)) { $menuarr[$i]['donotlinkit'] = 1; } } } this doesnt work - have tried with unset($menuarr[$i]) this removed menu item, want dont link, there way this? if not possible unlink menuitem, possible override url page? a different approach be: (untested) includelibs.my

javascript - zurb foundation 4 reveal modal changing the text in the data-reveal-id="myModal" -

hi sorry if numpty question. i'm using reveal , modal working fine. text "show info" when clicked working. how set text when clicked changes "hide info" function toggle() { var ele = document.getelementbyid("toggletext"); var text = document.getelementbyid("mymodal"); if(ele.style.display == "block") { ele.style.display = "none"; text.innerhtml = "show"; } else { ele.style.display = "block"; text.innerhtml = "hide"; }} a> id="mymodal" href="javascript:toggle();" data-reveal-id="mymodal"> show /a how set text when clicked changes "hide info" what trying not make sense. why, because element causes reveal show "outside" modal. otherwise, if it's inside, won't able open modal through element. based on description have this: <a href="#" data-

javascript - How to push item values to extreme top/bottom in selectbox? -

i researching , testing forms. far, succeeded in moving items in select box list , down 1 one following fiddle . instance of code (to move up): function moveup() { $("#list-box option:selected").each(function () { var listitem = $(this); var listitemposition = $("#list-box option").index(listitem) + 1; if (listitemposition == 1) return false; listitem.insertbefore(listitem.prev()); }); } but need move selected value, either @ extreme top in list or @ bottom. please try experiment fiddle , suggest me possible jquery tree traversal method if applies. thanks in advance! to move top: var listitem = $(this); listitem.insertbefore(listitem.siblings().first()); to move bottom: var listitem = $(this); listitem.insertbefore(listitem.siblings().last()); http://jsfiddle.net/mblase75/cyw6r/

c# - How to change bits inside Short -

i have short-variable in c# , want change specific bit. how can easiest way? do mean this? public static short setbit(short input, int bit) { return (short) (input | (1 << bit)); } public static short clearbit(short input, int bit) { return (short) (input & ~(1 << bit)); } you make them extension methods if want to.

java - Some of my prime numbers are coming up as not prime -

this question exact duplicate of: .class expected error in method , missing return statement error 3 answers im not sure whats wrong code, seems things coming prime. public static char isprime(int x) { char result = 'r'; for(int y=2;y<x;y++) { if(x%y==0) result = 't'; else result = 'f'; } return result; } you going end of loop result x-1 . you need start result = 't' , break out of loop false values.

c# - Format of the initialization string does not conform to specification starting at index 50 -

i have no idea means, can please "format of initialization string not conform specification starting @ index 50." code: initializecomponent(); connstring = "data source=.\\sqlexpress;attachdbfilename=c:\\users\andrew\\documents\\vinyl0.mdf;integrated security=true;connect timeout=30;user instance=true"; query = "select * record"; dadapter = new sqldataadapter(query, connstring); //this error appears. dtable = new datatable(); cbuilder = new sqlcommandbuilder(dadapter); cbuilder.quoteprefix = "["; cbuilder.quotesuffix = "]"; mydataview = dtable.defaultview; dadapter.fill(dtable); bindingsource bndsource = new bindingsource(); bndsource.datasource = dtable; i suspect problem: c:\\users\andrew \a escape sequence "alert" character (u+0007)... suspect wanted backslash followed "a". unlucky didn't compile-time error, you'd have done if you'd had \j or other invalid escape sequen

jquery - Temporarily disabling javascript function from repeating after mouseleave -

i have image gallery rotates through rotator class divs on www.creat3dprinters.com pauses on mouseenter , fires again 1 second after mouseleave . however, if user moves mouse in , out of rotator class div function calls stack , visible changes until 'stack' completed. i want 1 second delay has not been completed cancelled on 2nd , subsequent mouseenter not happen. i have tried using cleartimeout within mouseenter function not seem work. i know there stop() function did not work either. any suggestions appreciated. jquery(document).ready(function () { var initlist = setinterval('rotateit()', 4000); $('.rotator').mouseenter(function () { clearinterval(initlist); }).mouseleave(function () { timeout = settimeout(function () { rotateit() }, 1000); initlist = setinterval('rotateit()', 4000); }) }); function rotateit() { cleartimeout(timeout); if ($('#rotator-visi

coredump - Linux unable to create core dump from application -

i have 2 servers running vendor application. on 1 server if app crashes creates core dump second not. the servers supposed set same trying figure out why application doesn't create core dump. i've checked typical settings , have been doing research no luck. the strange part if run kill -s sigsegv $$ app user, generates core dump in same directory app supposed create core dump. vendor , linux group both unsure @ moment why i'm looking here help. $ cat /proc/sys/kernel/core_pattern core $ cat /proc/sys/kernal/core_uses_pid 1 $ ulimit -c unlimited $ cat /etc/security/limits.conf | grep core * soft core unlimited * hard core unlimited $ cat /etc/profile | grep ulimit ulimit -c unlimited > /dev/null 2>&1 $ cat /proc/sys/fs/suid_dumpable 0 $ cat /etc/sysconfig/init | grep core daemon_corefile_limit='unlimited' there several other reasons why coredump not created. check list of possible reasons in core(5): http://linu

how to determinate which conflicts or lack or libraries when uploading rails server? -

i very new on rails, , have problem trying set project on local machine (the project started) , tons of error, firstly did bundle install , after download gems , libraries tried rails server , problem many errors, , dont know have install or in order make run. any idea? here shell result i think have install libraries.. idea of these problems? c:/ruby200/lib/ruby/gems/2.0.0/gems/listen-1.0.2/lib/listen/adapter.rb:195:in ` require': cannot load such file -- wdm (loaderror) c:/ruby200/lib/ruby/gems/2.0.0/gems/listen-1.0.2/lib/listen/adapter .rb:195:in `load_dependent_adapter' c:/ruby200/lib/ruby/gems/2.0.0/gems/listen-1.0.2/lib/listen/adapter s/windows.rb:33:in `load_dependent_adapter' c:/ruby200/lib/ruby/gems/2.0.0/gems/listen-1.0.2/lib/listen/adapter .rb:187:in `usable?' c:/ruby200/lib/ruby/gems/2.0.0/gems/listen-1.0.2/lib/listen/adapter s/windows.rb:25:in `usable?' c:/ruby200/lib/ruby/gems/2.0.0/gems/listen-1.0.2/lib/listen/adapter .rb:179:in `usab

image - HTML and CSS3 - Two Background Divs -

i have been having trouble website @ moment. i'm trying 2 divs sit on top of each other create effect , background if jagged off. example here: https://docs.google.com/drawings/d/1idqwkdkbs-xxlrvzlf8bh5k_b6iizmlmnjdki8cgzsc/edit?usp=sharing . problem can't work. shows 1 of images @ time. heres code: <div style="background-image:url('http://www.mediadude.co.uk/wp-content/themes/wpbootstrap/images/washedwalltexture2.jpg'); background-repeat:repeat-x; clear:both;"> <p><!--emptyspace--></p> </div> <div style="background-image:url('http://www.mediadude.co.uk/wp-content/themes/wpbootstrap/images/washedwalltexture1.jpg'); background-repeat:repeat; clear:both"> <!--content here--> </div> thanks time. your code works expected. divs don't stack on top of each other default. display: block , , stay within document flow. means second div sit below first div, , first paragraph. givi

Downloading using webview android? -

is there permission set in android manifest download file/document using webview? i'm trying display button using webview, when button clicked, file should downloaded , saved in device. this permission given: `<uses-permission android:name="android.permission.write_external_storage"/>` this piece of code loads page contains button in it: storelocator = (webview) findviewbyid(r.id.storelocator); storelocator.setwebviewclient(new webviewclient()); storelocator.getsettings().setjavascriptenabled(true); // storelocator.getsettings().setbuiltinzoomcontrols(true); storelocator.setwebchromeclient(new webchromeclient() { public void onprogresschanged(webview view, int progress) { progressdialog.show(); progressdialog.setprogress(0); activity.setprogress(progress * 1000); progressdialog.incrementprogressby(progress); if (progress == 100 && progressdialog.isshowing())

html - Div resizing itself despite my css rules -

i have bit of html looks this: <div class="pointwrap"> <div class="imgwrap"> <img src="howtoplay1.jpg" height="101" width="177"/> </div> <div class="textwrap"> tap anywhere in drop zone release ball. </div> </div> and css rules code this: .pointwrap { border-style:solid; border-width:2px; border-color:#2e2e2e; -webkit-border-radius: 10px; -moz-border-radius: 10px; border-radius: 10px; background-color:#848484; margin:3px 7px 7px 7px; width:290px; height:170px; } .imgwrap { width:120; margin:5px 5px 5px 5px; float:left; } .textwrap { font-size:9px; margin:0px 6px 6px 6px; float:right; } div.textwrap { width:40; height:110; float:right; } my problem every time load page, textwrap div resizes/realigns wrong. i have set float right, 40px wide , 110px tall, places under img div instead of right of it, changing dimensions of imgwrap div 217 wide , 11px tall,

Adding Timestamp Value in MS Access DB (MDB) using java JDBC -

i trying insert new row in table has timestamp column value. following code: long millisecs = system.currenttimemillis() ; timestamp ts = new java.sql.timestamp(millisecs) ; s.executeupdate("insert tblpublichols(date) values("+ts+")"); i tried preparedstatment follows: long millisecs = system.currenttimemillis() ; timestamp ts = new java.sql.timestamp(millisecs) ; preparedstatement pstmt ; pstmt = conn.preparestatement("insert tblbasicholiday " + "(date, regionid) " + "values (?, ?)") ; pstmt.clearparameters() ; pstmt.settimestamp(1, ts); pstmt.setint(2, 1); int count = 0 ; count = pstmt.executeupdate() ; still getting same error, follows java.sql.sqlexception: [microsoft][odbc microsoft access driver] syntax error in insert statement. can me out on this? thanks. i suspect problem date reserved word. try: string sql = "insert tblbasicholiday ([date], regionid) values (?,

mysql - SQL WORK IMPROVMENT -

player table: player_id player_name position_id position table: position_id position_description team table: team_id team_name game table: game_id home_team_id guest_team_id score location date stats table game_id player_id number of fouls number of rebounds i have tried following query find various position player can play @ them: select player.player_name,position.position_name player,position player.fname='john' , position_name='guard,midfield,striker' i have tried following query list games date , location has example 5 fouls, tried query: select game.date,location,number of fouls, game,stats game.date=game.id , game.location=game.id , number of fouls > 5 group game.date,game.location here's start @ least, first couple of points: i'd avoid column names spaces. mysql handle them if use backticks, find them more trouble they're worth. these not extremely difficult queries. if have opportunity, spend hour or

http - Any record/playback utility available for IIS7/IIS7.5 -

back in days, used work "the microsoft playback utility" (from windows 2000 resource kit). you can check out here http://windowsitpro.com/systems-management/microsoft-playback-utility did of come across such utility, works iis 7 and/or iis 7.5? fiddler can playback requests.

ios - how to set table cell height dynamically depending on text label length? -

Image
i trying learn obj-c , ios programming, still new. decided try , make simple reddit client application. trying display front page posts within uitableview , each post represented own cell. on cell, here how setting title: cell.textlabel.numberoflines = 0; cell.textlabel.text = [[tempdictionary objectforkey:@"data"] objectforkey:@"title"]; [cell.textlabel sizetofit]; however, cell ends clipping if title text long. here's picture: how can make cells automatically adjust heights accommodate longer title labels, without intersecting other cells or detail text label? thank help! for new ios 8 there new way make simple. there new parameter calculates cell height respect of auto layout constraints. uitableviewautomaticdimension . can use in viewwillappear method of view controller. objective c: - (void)viewwillappear:(bool)animated { [super viewwillappear:animated]; self.tableview.estimatedrowheight = 70.0; // example. set average

html - how to use select element onchange event to fill hidden element -

any appreciated, i've been pulling hair out trying make work! i have form 5 select elements this: <select name="program1" class="floatctrl" id="cname" required="required" onchange="document.getelementbyid('program1_text').value=this.options[this.selectedindex].text"> <option value="" selected> </option> <option value="1"> break dancing 7/2/2013 $40.00</option> <option value="2"> guitar 7/10/2013 $40.00</option> <option value="3"> drums 7/12/2013 $40.00</option> <option value="4"> drawing 6/19/2013 $78.00</option> <option value="5"> watercolor painting 6/19/2013 $78.00</option> <option value="6"> kids art 8/7/2013 $30.00</option> <option value="7"> book making 6/12/2013 $40.00</option> <optio

Formatting a string to be a constant length in Python -

lets have few string titles: title0 = 'usa' title1 = 'canada' and want append list of '#' characters front , of these titles give them constant length like: ######## usa ######## ####### canada ###### with 1 space buffering start , end of text. can't symmetric number of symbols around word. there way built in python string formatting? python's str.format() has few options should want. can read more them here . should give wanted. title0 = '{:#^{width}}'.format(' usa ', width=19) title1 = '{:#^{width}}'.format(' canada ', width=19)

ruby on rails - Capistrano and EC2: Don't know how to build task 'db:migrate' -

when run command cap deploy:cold then in deployment process these errors: *** [err :: myapp.com] rake aborted! *** [err :: myapp.com] *** [err :: myapp.com] don't know how build task 'db:migrate' *** [err :: myapp.com] *** [err :: myapp.com] *** [err :: myapp.com] (see full trace running task --trace) *** [err :: myapp.com] then checked deployed - went releases folder , there these files: license revision lib public tmp readme.markdown rakefile log spec urbanairship.gemspec what happened rest (like app folder example)? edit: deploy file: set :stages, %w(production staging) set :default_stage, "devel" require 'capistrano/ext/multistage' set :application, "myapp" set :repository, "git@github.com:name/myapp.git" set :scm, :git set :deploy_to, "/opt/bitnami/apache2/htdocs/myapp" set :use_sudo, :false set :normalize_asset_timestamps, false before "deploy", "check_production&

c# - How get all public static members without getters and setters via reflection? -

my code var memberlist = member in type.getmembers(bindingflags.static | bindingflags.public) .where(m => !(m.name.contains("get_") || m.name.contains("set_") || m.name.contains("add_") || m.name.contains("remove_")) ) select member; what more elegant way? upd: , without add_/remove_ members of event handlers you can make query of defined accessors , exclude those: var propertyaccessors = type.getproperties(bindingflags.static | bindingflags.public) .selectmany(p => p.getaccessors()) .cast<memberinfo>(); var eventaccessors = type.getevents(bindingflags.static | bindingflags.public) .selectmany(e => new[] { e.getaddmethod(true), e.getremovemethod(true) }) .cast<memberinfo>(); var

what happens when add to cart button clicks in opencart -

can please tell me, function execute when click on 'add cart' button in store front? code or method execute when add cart button clicked? observed there calculations takes place. in view/theme/ * /template/product/product.tpl <input type="hidden" name="product_id" size="2" value="<?php echo $product_id; ?>" /> &nbsp; <input type="button" value="<?php echo $button_cart; ?>" id="button-cart" class="button" /> in javascript <script type="text/javascript"><!-- $('#button-cart').bind('click', function() { $.ajax({ url: 'index.php?route=checkout/cart/add', type: 'post', data: $('.product-info input[type=\'text\'], .product-info input[type=\'hidden\'], .product-info input[type=\'radio\']:checked, .product-info input[type=\'checkbox\'

javascript - How to retrieve values from a JSON Object in PHP -

i've tried many times now, using difference methods , none of them have worked me, i'm asking question. i have small form takes in 4 pieces of information, persons title, first name, middle name , last name. when hit button, json object formed, , sent post data through jquery.ajax method. json sent php file: { "title": "mr", "firstname":"banana", "middlename":"slippy", "lastname":"mcdougle" } ajax call on button press: function insertperson(obj, callback){ $.ajax({ type: "post", data: "json=" + json.stringify(obj), url: "insertdata.php", success: function(obj){ if (callback){ callback(obj) }; }, error: function(error){ console.log("error:"); console.log(error); } }); } i pas

sql - MySQL Error #1142 with INNER JOIN -

select * `pp` inner join `cm_master`.`locationguid` on `pp`.`addr` = `cm_master`.`address1` , `pp`.`zip` = left(`cm_master`.`postalcode`,5); i trying return columns in pp table matching locationguid record cm_master table when street address , zip matches between 2 tables. above code returns error: #1142 - select command denied user 'ameridw5'@'localhost' table 'locationguid' i running query in phpmyadmin. can point me in direction work? edit: cm_master table has address1, zip , locationguid columns. pp table has addr , zip columns. if pp.addr = cm_master.address1 , pp.zp = cm_master.zip return record in query cm_master.locationguid joined it. possible? your syntax wrong. need place left around table_name.column_name instead of splitting table_name , column_name. so change cm_master.left(postalcode,5) to left(cm_master.postalcode,5) the full query be: select * `pp` inner join `cm_master` on `pp`.`addr` = `cm_master`.`

on every launch of android application, it creates new instances of variables? -

i creating application in want beep on change of preset value accelerometer when toggle switch on. but problem is, if exit app when toggle switch on, , on next launch beeps twice, , beeps once if toggle switch off. how can rid of issue? button1.setonclicklistener(new onclicklistener() { @override public void onclick(view arg0) { // todo auto-generated method stub if(flg1==false) { stat.settext("status: on"); flg1=true; } else { stat.settext("status : off"); flg1=false; } } }); // public void onsensorchanged(sensorevent event) { deltax = event.values[0]; deltay = event.values[1]; deltaz = event.values[2]; //after changes delta values if(flg1==true &&(deltax>=thresh||

debugging - Is there a way to stop Valgrind on the first error it finds? -

if errors found in valgrind's output, want generate output using debug version of program. however, valgrinding thousands of runs in debug way time-intensive. so run in release mode, , if error found abort run , complete testing in debug. short of monitoring output , killing process manually, there better solution? you can use --db-attach=yes , --db-command= execute specific command want stop valgrind execution. normal debug process, --db-command invokes gdb child process. cannot stop execution killing process using --db-command=kill -9 %p , because kills child process, not valgrind itself. if using linux , has /proc file system support, can parent process number in 4th column in /proc/pid/stat . such have chance kill parent process stop valgrind. for example, valgrind --db-attach=yes --db-command="cat /proc/%p/stat | cut -d' ' -f4 | xargs kill -9" ./a.out when first error appears, asked ---- attach debugger ? --- [return/n/n/y/y/c/

java - How to style a TextButton? -

i have gwt textbutton . following css styles applied global css file nothing: .gwt-textbutton { color: red !important; } why? correct styles applied change style of textbutton widgets? textbutton cell-backed widget , based on appearance pattern. uses textbuttoncell render content , wraps using cellwidget<t> . the global css looking gwt-buttoncellbase obfuscated because used in clientbundle , need extend buttoncellbase.defaultappearance.resources , providing own style . other cell-based widget. need use right constructor ( textbutton(appearance appearance, string text) ). sample code follows. define resource appearance extension (fully quoted clarity): public interface myresources extends buttoncellbase.defaultappearance.resources { @override @source(value = {buttoncellbase.defaultappearance.style.default_css, "custom.css"}) buttoncellbase.defaultappearance.style buttoncellbasestyle(); } inside custom.css , override whatever want of