Posts

Showing posts from March, 2014

assembly - How do you check syscall for x86_64? -

i can't find dedicated official website search such information . for example,if want exit ,how should syscall introduced in x86_64? any manual kind of details? i'm on centos. glibc sysdeps/unix/sysv/linux/x86_64/syscall.s , see if helps.

jquery - How can I find the <script> element where my JavaScript is declared? -

for fragment of html/javascript gets loaded host web page dynamically, need javascript fragment know declared. there way of finding tag executing javascript loaded from? the html fragment loaded same host current page using jquery ajax call , inserting result dom. edit: what trying do, , above 1 potential way of implementing it, have fragment of html/javascript being loaded dynamically , known initialization function called host page parameters. portable solution allow worlds meet solve problem. you may use id attribute script tag , find #mylib selector or find using tag&attr selector script[src="mylib.js"] .

javascript - stop() before a highlight is causing the color to not reset -

i have following: $('#list_item_title', this).stop().effect('highlight', {color: '#8dd2f7'}, 700); this occurs when user tries submit 0 input.length. if user presses enter several times, highlights stack why added stop. problem animation stops , input color variation of highlight color , not neutral white background. any ideas? stop() accepts parameters. .stop( [clearqueue,] [jumptoend] ) stop api documentation you should invoke in way: $('#list_item_title', this).stop(false, true).effect('highlight', {color: '#8dd2f7'}, 700); by doing so, color changed directly #8dd2f7 when stop animation.

visual studio - Schema Compare and Update comments out unused code -

i have visual studio 2010 database project. works great stuff. however 1 thing annoying. have table called dbo.mycooltable. if go the database , rename dbo.mykindacooltable works fine in database. however, when schema compare , write changes database project leaves old file in project. end 2 files (dbo.mycooltable.table.sql , dbo.mykindacooltable.table.sql). once or twice not problem, on time adds up. , tedious go through project , manually delete each of these "left over" files. is there way delete "left on files" when write database project schema compare? not know of in current world, of the denali changes syncing code. have not seen how far take paradigm, or had time play it, however. know not in current world.

java - Separate thread for SQL DB Queries -

i writing application have regularly poll sql database latest entries. these entries translated java objects , passed gui represent them graphically. i have databasemanager class query db needed, these methods don't return until after query , translation complete. causes gui hang immensely. i set run sql queries in separate thread. offer guidance? see http://java.sun.com/developer/technicalarticles/javase/swingworker/

windows - what gotchas using cygwin for java development? -

we're using windows, linux , solaris our development. currently, on windows, we're using windows shell , batch(.bat) scripts run build related scripts. use subversion our version control tool. we want standardize on bash scripts work same on windows, linux , solaris. issues can expect if want move windows dev environment cmd.exe cygwin ? also, we're using ant moving maven soon. eclipse our dev environment. if helps @ all, we're developing multi-threaded servers -- product runs in production on solaris or linux(not on windows). thank you, it's easier not use shell scripts or batch files @ all. maven should able put in script, , it's cross-platform.

.net - Visual Studio 2008 performing like VBA -

i know vsto/vsta, , know vba functionality (with .net syntax of course) can done in .net. there learning curve going vba .net without vsto. question though is, can done in vba somehow recreated in .net without vsto? the reason because converting vba application .net several reasons: want take advantage of oo, class libraries better available use, , fun. wouldn't happy if got far in learn of limitations. thank you. i don't believe you'll run actual limitations. however, vba exposes features take substantially more effort within .net. interfacing applications within ms office suite? vba exposes methods this. vba allows simulation of keyboard presses, isn't straightforward in .net.

php - Update field if the ORDER BY is 1 descending? -

is there possible way this: i want update field 'rank' according order place. for example: (pseudocode) if id order place = 1 update rank field place id=get id rank place id 1 1 5 pc 2 2 8 mac is possible? something this? update tbl_name set rank = 1 id = ( select id condition order place desc limit 1 ) or comment (i think mysql http://dev.mysql.com/doc/refman/5.0/en/update.html ): update tbl_name set rank = 10 id = 9 order wins desc limit 1 you can select check if these records wish update well: select * tbl_name id = ( select id condition order place desc limit 1 ) or select * tbl_name id = 9 order wins desc limit 1

android - Soft Input pans view but not enough to show full editText -

Image
i have complicated layout, @ bottom huge edittext. when click on keyboard open, slides enough show user typing (as user begins typing 1 line visible, if user goes multiple lines pans little more show 2 lines, etc). pan whole edittext (all blank space) visible. <linearlayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@color/white" android:orientation="vertical"> <edittext android:id="@+id/commentbox" android:layout_width="fill_parent" android:layout_height="100dp" android:textsize="16sp" android:layout_marginleft="6dp" android:layout_margintop="4dp" android:background="@color/transparent" android:textcolor="@color/gray" android:gravity="top" ...

css - button tag vs anchor tag in firefox, problems with text -

what causing problem shown below firefox? first button styled anchor tag , second 1 html5 button tag. in chrome both identical in firefox can see problem "login" text. html: <a href="#" class="buttondark">login<span>›</span></a> <button type="submit" name="submit" class="buttondark">login<span>›</span></button> css here the image showing problem can found here --> image try adding following code: ::-moz-focus-inner { padding:0; border:0; } firefox has button problems galore. fixes them because 'chrome' firefox uses defined padding , border, can't see either, usually. there can have little dotted border around selected inputs.

java - Format milliseconds to simpledate format -

i'm facing weird result when formatting milliseconds simpledate format: output is: start date time: 11/06/30 09:45:48:970 end date time: 11/06/30 09:45:52:831 execution time: 01:00:03:861 script: long datetimestart = system.currenttimemillis(); // script execution here long datetimeend = system.currenttimemillis(); "start date time: " + globalutilities.getdate(datetimestart, "yy/mm/dd hh:mm:ss:sss"); "end date time: " + globalutilities.getdate(datetimeend, "yy/mm/dd hh:mm:ss:sss"); "execution time: " + globalutilities.getdate((datetimeend - datetimestart), "hh:mm:ss:sss"); method: public static string getdate(long milliseconds, string format) { simpledateformat sdf = new simpledateformat(format); return sdf.format(milliseconds); } any idea why execution time value off? should 00:00:03:861, not 01:00:03:861 thanks the executi...

Silverlight RIA Services: DataPager within DataPager -

i have accordion control shows list of employees. when employee selected, accordion control expands , shows list of days when employee off work. since employee list large (10,000+), need show employee list in datapager. when employee selected, daysoff list must shown in datapager. daysoff entity collection property on employee entity. furthermore... the user may search employees last name "doe" , daysoff month of january only. if employee "john doe" off 2 days in january, daysoff datapager list "john doe" show 2 records on first page. want give user ability view daysoff selected employee. though search yielded 2 records of daysoff john doe, user should still able complete list of daysoff john doe. i able apply datapager outer list (of patients) not able find way apply datapager inner daysoff list. help!

Selenium 2 - Server HTTPS Problems -

i'm having strange(?) problem. when run selenium server (2.0rc3), after little while, can no longer connect https site without certificate being flagged invalid/untrusted. anyone else had happen or know why? edit: https url on browser copy url , add under trusted sites in browser. if need this, ( ie8 path) (on browser tools -> internet options -> security tab -> select trusted site -> click sites button -> paste url , click add button )

.net - How to obtain IServiceProvider and IMarkupServices from HTMLDocument (mshtml) -

im doing test creating instance of htmldocument way: object[] pagetext = { "<p>some text...</p>" }; var document = new htmldocumentclass(); var document2 = (ihtmldocument2)document; document2.write(pagetext); and need reference imarkupservices. this code i'm using: guid iid_imarkupservices = new guid("3050f4a0-98b5-11cf-bb82-00aa00bdce0b"); imarkupservices markupservices = getservice<imarkupservices>(document, id_imarkupservices); static guid htmldocumentclassguid = new guid("25336920-03f9-11cf-8fd0-00aa00686f13"); private static t getservice<t>(ihtmldocument2 document, guid riid) { var serviceprovider = (iserviceprovider) document; object service; serviceprovider.queryservice(ref htmldocumentclassguid, ref riid, out service); return (t)service; } when run (it's hosted in console app) following exception thrown: unhandled exception: system.invalidcastexception: unable cast com object of type ...

perl - Returning 2 arrays from subroutine depending on stop list -

this has been moved test case here . re-done: i want return arrays (must references) 2 subroutines, regex used conditional statement isn't working i'd hoped. i've tried doing one, figure easier. to clear, goal have array of matches sorted ( @all_matches ), , add on array ( @all_pronoun_matches ) sorted same way added @ end . this @pronoun_matches subroutine: my ($line, $verbform, $chapternumber, $sentencenumber, $sentence) = @_; @matches; @pronoun_matches; return unless ($line =~ /(\w+)\((\w+)\-\d+\,\s(\w+)\-\d+\)/); #2nd repeat check $grammar_relation = $1; $argument1 = $2; $argument2 = $3; return if (($argument1 =~ /^$argument2/i)||($argument2 =~ /^$argument1/i)); foreach $pronoun (@stoplistnoun) { if ((lc $pronoun eq lc $argument1) || (lc $pronoun eq lc $argument2)) { push (@pronoun_matches, $chapternumber, $sentencenumber, $sentence, $grammar_relation, $argument2, $argument1) if ($argument2 =~ /$verbform/i); pus...

android - ImageButton automatic scaling issue -

i'm trying troubleshoot code small form factor device , imagebuttons i'm using in relativelayout seem automatically scaled larger somehow. i've tried various methods of preventing them scaling, none of them have worked. suggestions? i think have see density considerations preventing scaling. the easiest way avoid pre-scaling put resource in resource directory nodpi configuration qualifier. example: res/drawable-nodpi/icon.png when system uses icon.png bitmap folder, not scale based on current device density. from http://developer.android.com/guide/practices/screens_support.html#densityconsiderations

asp.net mvc - Recommended (Microsoft-based) framework for SaS? -

i'm investigating technologies build commercial sas site shop predominantly uses microsoft technologies. the idea site have pluggable modules, features either free or paid. customers able chop & change between features, & have billing adjusted automagically so. if rolling myself, i'd use: .net 4 / vs2010 / c# / resharper / nunit / moq ndependencyinjection sql server linq sql asp.net mvc 3 authorize.net (or possibly billing hand-off sap) selenium ... , hand-roll ioc-based plugin architecture (e.g., there discussion on asp.net mvc plugins here , here ). but @ point i'm wondering - has been done before? i'm imagining sort of vaguely cms-like architecture built-in plug-in, commerce & subscription stuff. of that, rolled 'off shelf' solution, either foss or commercial. can recommend such solution, or 'roll own' job? think dotnetnuke might worth looking at, appreciate feedback people who've used in production sort ...

mysql - how to construct this query? -

i have table holds info videos on website. has fields id (primary key),title, series (int, foreign key constraint), , episode number. there table called "series" indexes video series. example, series "american dad" have series id of 1, , id column in series table same series column in videos table. i trying create query that, when given video id, pulls title , video id of previous , next videos in series, e.g. if input id episode 5 american dad, info episodes 4 , 6. i know how write query find series id when given video id, , know how write query find episodes of series when given series id. having trouble putting in 1 query, , limiting results preceding , following (based on episode number) of given video. hopefully wasn't convoluted. appreciated! if episode numbers sequential, can like select ... (episode = :episode - 1 or episode = :episode + 1) , series = :series

c# - Using async sockets on Windows Server 2008 R2 causes 100% CPU usage -

i have generic c# socket server uses asynchronous methods of socket classes - beginaccept(), beginreceive(), etc. server has been working great last 4 years @ many customer sites running win server 2003. installed on windows server 2008 r2 server, 64-bit. looks fine until first client connects , issues beginreceive() , beginaccept() call in accept handler. when happens, cpu usage spikes 100% , stays way until close listening socket. not sure matters, server running in virtual machine. have done lot of testing, nothing seems help. using process explorer, can see 2 threads spun shortly after beginreceive()/beginaccept() calls, , ones consuming processor. unfortunately, not able reproduce problem on win7 64-bit workstation. i have done lot of research, , have found far following 2 kb articles imply server 2008 r2 may have issue tcp/ip components, available hot fixes: kb2465772 , kb2477730. reluctant have customer install them until more fix issue. has else had problem? ...

c# - Question about ,(?=(?:[^']*'[^']*')*[^']*$) -

c# regex split - commas outside quotes var result = regex.split(samplestring, ",(?=(?:[^\"]*\"[^\"]*')*[^\"]*$)"); i have problems understand how works. specifically, don't know * matches here? ",(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)") ^ does mean there 0 or more of (?=(?:[^\"]*\"[^\"]*') update sample input 2,1016,7/31/2008 14:22,geoff dalgas,6/5/2011 22:21,http://stackoverflow.com,"corvallis, or",7679,351,81,b437f461b3fd27387c5d8ab47a293d35,34 use following code test: string samplestring = "2,1016,7/31/2008 14:22,geoff dalgas,6/5/2011 22:21,http://stackoverflow.com,\"corvallis, or\",7679,351,81,b437f461b3fd27387c5d8ab47a293d35,34"; it means group (?:[^']*'[^']*') matched 0 or more times. , // match 1 comma (?= // start positive lookahead assertion (?: // start non-capturing group [^...

sql - stored procedure parameters -

how can pass these 2 value combination separated and/ parameter value stored procedure: "8033301552*" or "08033301552*" or "taiwo*" , "ayedun*" i mean need create string , pass parameter? officially not supported. a workaround can found at http://groups.google.com/group/microsoft.public.sqlserver.reportingsvcs/browse_thread/thread/a5e0fdb24323aa13/e0fcc4c2d38883ec%23e0fcc4c2d38883ec?pli=1 what doesn't work has nothing rs has stored procedures in sql server. cannot following in stored procedure. let's have parameter called @myparams can map parameter multi-value parameter if in stored procedure try this: select * sometable somefield in (@myparams) won't work. try it. create stored procedure , try pass multi-value parameter stored procedure. won't work. can have string parameter passed multivalue parameter , change string table. technique told me sql server mvp, erland sommarskog example have do...

internet explorer 9 - Count number of words in string using JavaScript -

i trying count number of words in given string using following code: var t = document.getelementbyid('mso_contenttable').textcontent; if (t == undefined) { var total = document.getelementbyid('mso_contenttable').innertext; } else { var total = document.getelementbyid('mso_contenttable').textcontent; } counttotal = cword(total); function cword(w) { var count = 0; var words = w.split(" "); (i = 0; < words.length; i++) { // inner loop -- count if (words[i] != "") { count += 1; } } return (count); } in code getting data div tag , sending cword() function counting. though return value different in ie , firefox. there change required in regular expression? 1 thing show both browser send same string there problem inside cword() function. you can make clever use of replace() method although not replacing anything. var str = "the long text have..."; var co...

c# - problem to run my project in windows phone 7.1 update -

i trying code push notification(which has sender windows phone client , wcf service) in windows phone 7.0. i install windows phone 7.1 beta update and run same code but m getting "connection failed because of invalid command-line arguments." error. i want know how solve issue...... it seems have either have misconfigured project or failed installation of updated sdk. your first choice creating new wp7 application targets 7.0 systems (if still needed). see if can launch through emulator (which assuming issue). try reloading same project again. in extreme case, remove wp7 dev-related , re-install dev tools.

java - How do I map a BigDecimal in Hibernate so I get back the same scale I put in? -

in java, new bigdecimal("1.0") != new bigdecimal("1.00") i.e., scale matters . this apparently not true hibernate/sql server, however. if set scale on bigdecimal particular value, save bigdecimal database via hibernate , re-inflate object, bigdecimal different scale. for instance, value of 1.00 coming 1.000000, assume because we're mapping bigdecimals column defined numeric(19,6) . can't define column required scale need store both dollar , yen values (for example) in same column. need represent bigdecimals numeric types in database benefit of external reporting tools. does there exist hibernate usertype maps bigdecimal "properly", or have write own? just informational sake, can tell creation of bigdecimal coming database done proprietary jdbc driver's implementation of 'getbigdecimal' method of database-specific 'resultset' sub-class. i found out stepping thru hibernate source code debugger, while trying f...

c# - How To Add In List Array Using Loop I am Getting Error? -

hi getting 1 value in list array not adding rows in it.. how add rows in list array ? for(int a=0;a<_dt.rows.count;a++) { double pw =convert.todouble(_dt.rows[a]["power"]); int vol =convert.toint32(_dt.rows[a]["voltage"]); double pv = pw * vol; list<double> res = new list<double>(); res.add(pv); } hopes suggestions.. regards, you adding result list inside loop, must declare bevor loop: list<double> res = new list<double>(); for(int a=0;a<_dt.rows.count;a++) { double pw =convert.todouble(_dt.rows[a]["power"]); int vol =convert.toint32(_dt.rows[a]["voltage"]); double pv = pw * vol; res.add(pv); }

Search page engine PHP with MYSQL database? -

i'm going generalize question other people can use answers. let's have website driven mysql database. database contains 5 tables: events,news,books,articles,tips . every table has among others 2 fields title , details in want search on every page of site have search form (text field , button). after type word or phrase want redirected page called search should see results list links entire database. e.g. book x (link on book found in database) event y article z help: tables innodb engine full text search didn't work i'm having trouble in building select statement searching multiple fields multiple tables like . i've succeded 1 table multiple tables , multiple fields i'm getting error or no data or duplicated data in cases. select statement please. question: how build search engine tables in mysql db? sql injection or other hacking prevention advice appreciated also. my approach situation create view based on tables similar columns (...

iphone - The identifier "EventApp" in your code signature for EventApp must match your app's Bundle ID -

i'm trying publish first iphone app (monotouch) to store following error after uploading: the identifier "eventapp" in code signature eventapp must match app's bundle id "net.mydomain.myappname". i have following settings in monodevelop configured: bundle identifier: net.mydomain.myappname i have tried changing identifier "net.mydomain.myappname.eventapp" (similar screenshot: http://monotouch.net/@api/deki/files/29/=dist-app-settings.png ) can't build anymore because monodevelop shows following error: "build failed. array index out of range" i had in info.plist file in build-output folder. (eventapp.app) what's in there after build: bundle name: eventapp bundle identifier: net.mydomain.myappname executable file: eventapp another trial rename project "myappname" didn't work. is there location somewhere in *.app package identifier be? ideas how fix this? thanks be sure use correct app sto...

javascript - how to valid only digit in textbox in firefox? -

i have problem valid digit in textbox in ie 9 , firefox 4 & 5, 1 know ? try previous question's answer still face problem, want use enter digit in textbox, use asp.net code language. as far i've understood want allow numeric characters in text field , return other characters if not numeric. so, may go through this step1. create javascript function <script language="text/javascript"> function onlynumbers(evt) { var e = window.event || evt; // trans-browser compatibility var charcode = e.which || e.keycode; if (charcode > 31 && (charcode < 48 || charcode > 57)) return false; return true; } </script> step2. onkeypress call function this if call javascript method on event first parameter passed event. ie need catch event window.event. for more clear ideas can visit:- https://developer.mozilla.org/en/dom/event

web services - How to implement REST webservices with basic authentication? -

in rest talk represents resource. (uniform uri). so in case, if want pass sensitive data (ex: credit card number) via browser, need apply authentication after have send request. so how send rest request through url authenticated data? if need more details provide you. please me. regards, sriram. use https use post post sensitive data , encrypt contents of post. make sure authenticate user(basic auth, spnego ..)

internationalization - django translate variable content in template -

i'm using {% trans %} template tag. django docs say: the {% trans %} template tag translates either constant string (enclosed in single or double quotes) or variable content: {% trans "this title." %} {% trans myvar %} https://docs.djangoproject.com/en/1.3/topics/i18n/internationalization/#trans-template-tag i found impossible {% trans myvar %} because myvar doesn't show in django.po file after running makemessages command. am using wrong? me this? you can use blocktrans template tag in case: {% blocktrans %} title: {{ myvar }} {% endblocktrans %}

php - Regex matching if maximum two occurrences of dot and dash -

i need regular expression match string containing @ 2 dashes , 2 dots. there not have dash nor dot, if there 3+ dashes or 3 dots or both 3+ dashes , 3+ dots, regex must not match string. intended use in php. know of easy alternatives using php functions, used in large system allows filtering using regular expressions. example string matched: hello-world.com example string not matched: www.hello-world.easy.com or hello-world-i-win.com is matching expectations? (?!^.*?([.-]).*\1.*\1.*$)^.*$ see here on regexr (?!^.*?([.-]).*\1.*\1.*$) negative lookahead. matches first .- put in capture group 1, , checks if there 2 more of them using hte backreference \1 . found three, expression not match anymore. ^.*$ matches start end, if negative lookahead has not matched.

php - How to Create a Shop Site -

i have site creating/developing include shop section. create own shopping site scratch instead of using 3rd party provider or turn key program, etc. site accept credit cards, checks, , paypal. steps take implement this? i aware need design database, , information system keep track of accounts, items, , manage content. need use process orders. can use paypal api this? looking make professional shop site out of scratch not go third party site. i don't think there's straight forward answer asking. creating commerce platform scratch not simple task. there various issues address, not can answer in simple post. also why want reinvent wheel? there products magento or ubercart (if using drupal) well, why not use them , build on them?

asp.net - Image uploading to DB using jQuery and ASMX web service -

how upload image using jquery (ajax) , asmx web service - asp.net? i searched google simple script nothing... i need server side code (web method) can recive file form jquery json post using html or asp.net file upload conrol if possible. you cannot make ajax file uploads. there several sites make tricks iframes or flash (like gmail does) task. example: http://www.webtoolkit.info/ajax-file-upload.html http://www.ajaxf1.com/tutorial/ajax-file-upload-tutorial.html these examples php, should work asp.net changing server side logic.

android - How to use Rating bar? -

i save state of rating bar rating stars? how go doing this? , how go getting number of stars user has selected? display in textview? thanks from developer.android.com : http://developer.android.com/resources/tutorials/views/hello-formstuff.html#ratingbar other example here.. http://android-er.blogspot.com/2010/02/ratingbar.html if want customize ratingbar eg. displaying other image default star refer how create custom ratings bar in android this example shows toast message when user selects ratings. & have customize according needs (as told want display in textview). you can define textview in xml file & set text property when rating has changed.

Can we zoom in and out using views in appecelerator titanium? -

is possible zoom in , zoom out in view using double tap or pinch functionality? if can still same coordinates or different coordinates after zooming in? if have view of height 100 , width 100 , when click on end of view returns y-position 100. another question have after zoom using pinch or doubletap, return end y co-ordinate 100 or return different value since zoomed-in? if not possible, there an alternative? thank you. you can add view scrollview. when you've done can zoom in , out pinching. var scrollview = titanium.ui.createscrollview({ contentwidth: 'auto', contentheight: 'auto', top: 0, bottom: 0, showverticalscrollindicator: true, showhorizontalscrollindicator: true, //here can determine max , min zoom scale maxzoomscale: 100, minzoomscale: 0.1, //with property can set default zoom zoomscale: 1 }); after create can add view it scrollview.add(view) hope helps! tjeu

android - How to implement this layout? -

Image
i divide current view 4 areas (not divide screen 4, divide view) following: i have following sized layout view: that's horizontally divided half of view each. vertically, upper area has 1/3 view height , lower 2 areas holds 2/3 view height. i successfully divided view 4 equal sized areas by: <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical"> <linearlayout android:id="@+id/top_area" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1" android:orientation="horizontal" > <linearlayout android:id="@+id/top_left_area" android:layout...

php - pushnotification not working when server changes -

i developing application push notification enabled. working in local server (company server - php), when change server client server, push notification not working. i used both development , distribution profile push notification enabled. please me overcome situation. are still using development certificate when client has ad hoc (or app store) provisioned app? if client has app provisioned / signed ad hoc (or app store) need use production certificate send push notifications via apns. need make sure connect apple's production server, , not sandbox alternative. it seems little odd ad hoc has use production versions of certificate , push notification server, that's how is.

Connect to a single WCF service with two different endpoint bindings -

i new wcf , (i hope) i'm having "noob" problem. searched site , did not find answer i'm looking for. apologize if has been answered , missed it. i programmaticly connecting service using channelfactory . problem i'm having client cannot connect first service endpoint, unless comment out second 1 (the msmq one). helps. the contracts different, , i'm specifying correct bindings (wsdualhttpbinding , netmsmqbinding, respectively) on client-side. please let me know if there way fix this, or if more information required. i appreciate help. tyler <services> <service behaviorconfiguration="defaultbehavior" name="[intentionally removed]"> <endpoint address="[intentionally removed]" behaviorconfiguration="defaultendpointbehavior" binding="wsdualhttpbinding" bindingconfiguration="dualbinding" name=...

javascript - How to change the order of which they are called? -

i have quite inconvenient problem. say have following functions function name(namearg){ ... .. } function handlefailed(){ .. .. } function handlecover(){ .. .. } now problem, have alot of hard coded html can't changed calling both functions this <a href="javascript:handlecover();javascript:name('mss')">link</a> <a href="javascript:handlefailed();javascript:name('gps')">link</a> <a href="javascript:handlefailed();javascript:name('nps')">link</a> the problem order of i'm calling functions, first want see function called, either handlefailed() or handlecover(), , want know name sent name function. if have called functions in other way around have done var thename; function name(namearg){ thename = namearg } function handlefailed(){ callotherfunctioninanotherjavascript(getelements(thename + ".failed")); } function handlecover(){ callotherfunctioninanotherjavasc...

r - as.POSIXct gives an unexpected timezone -

i'm trying convert yearmon date (from zoo package) posixct in utc timezone. tried do: > as.posixct(as.yearmon("2010-01-01"), tz="utc") [1] "2010-01-01 01:00:00 cet" i same when convert date: > as.posixct(as.date("2010-01-01"),tz="utc") [1] "2010-01-01 01:00:00 cet" the way work pass character argument: > as.posixct("2010-01-01", tz="utc") [1] "2010-01-01 utc" i looked documentation of datetimeclasses , tzset , timezones . /etc/localtime set europe/amsterdam. couldn't find way set tz utc, other setting tz environment variable: > sys.setenv(tz="utc") > as.posixct(as.date("2010-01-01"),tz="utc") [1] "2010-01-01 utc" is possible directly set timezone when creating posixct yearmon or date? edit: i checked functions as.posixct.yearmon. 1 passes as.posixct.date. > zoo:::as.posixct.yearmon function (x, tz = ...

flash - AS2: Simple class not working -

so i'm trying learn create public class, , in class file: class com.rcn.menu.menu{ public var title:string; public var menuitems:array; public function createmenu(title:string, menuitems:array) { return title; } function createtitlebar(title:string):void { } } and in seperate swf use code: import com.rcn.menu.menu; var accountability:menu = createmenu("hello",[a,b,c,d]); trace(accountability); yet accountability traces undefined, can tell why is? you have use new keyword make instance of class. try this: public class com.rcn.menu.menu{ public var title:string; public var menuitems:array; public function menu(title:string, menuitems:array) { this.title = title; this.menuitems = menuitems; } public function tostring():string{ return title; } } and create instance: import com.rcn.menu.menu; var accountability:menu = new menu("hello",[a,b,c,...

sql server - SQL view, performance and count from one-to-many relationship -

i need forming basic sql-views bunch of tables. here's quick overview i've claimdetail table , has got lookup fields statusid, brandid, salespersonid, etc.. as usual, lookup fields map master tables masterstatus, masterbrand, ... {structure: id, title} also there're 2 other tables comments , files. claim can have multiple comments , multiple files. i need display dashboard list of claims. need display titles master tables , count of comments & files. now, i've 2 views of dashboard 1 users of type customer limited details , 1 detailed view meant internal users. can customer view sub-set of internal view. i see 2 options - opt#1: create single vw_internal view , use fetch data both users. opt#2: create vw_customer has onlt fields required customer , create vw_internal like: vw_customer inner join master tables. in short i'll extend basic vw_customer include more fields. does option#2 make sense speed , performan...

c++ - LINK : fatal error LNK1104: cannot open file 'libboost_system-vc90-mt-1_45.lib' -

i getting error when tried build/compile code vs2008 c++. weird thing installed boost 1.46.1 error boost 1.45. link : fatal error lnk1104: cannot open file 'libboost_system-vc90-mt-1_45.lib' tried looking on different sources. unfortunately unable solve yet. although included paths libraries , include files. please guidence in regard highly appreciated. many thanks. muhammad this nothing have installed (or not). happening vc++ expects library cannot find it. check "included libraries" in project settings. perhaps project supposed use 1.45 version.

ruby - Does Rails have a way to convert checkboxes from "on" to true? -

when controller receives params of checked checkbox comes "on" if box checked. in case i'm trying store value boolean, typically want values checkboxes. question is, rails have way automatically convert "on" (or exists) true/false or need following? value = params[my_checkbox] && params[my_checkbox] == "on" ? true : false you can use: value = !params[:my_checkbox].nil? as checkbox not return value if not checked (implied forum )

php - connecting to multiple databases -

i using sphinx site search , works great trying connect 2 mysql databases same exact structure , db2 continuance of db1 info should flow smoothly. can results switching db name in code how can select both @ once? here code im using $conf['sphinx_host'] = 'localhost'; $conf['sphinx_port'] = 9312; $conf['mysql_host'] = "localhost"; $conf['mysql_username'] = "user"; $conf['mysql_password'] = "password"; $conf['mysql_database'] = "db1"; $conf['sphinx_index'] = "index index2"; $db = mysql_connect($conf['mysql_host'],$conf['mysql_username'],$conf['mysql_password']) or die("error: unable connect database"); mysql_select_db($conf['mysql_database'], $db) or die("error: unable select database"); $sql = str_replace('$ids',implode(',',$ids),$conf['mysql_query']); $result = mysql_query($sql) or die($...

Controlling rotation axis with webkit 3d transform -

i'm creating card-flip effect using webkit transformations. have working in 1 section, have div rotates around center axis giving of card flipping over. i want add same effect page transition. i'm using same css , html structure, in case i'm not getting effect rotates around center axis. instead, looks transformation rotating along y axis anchored left of object rather center (so looks door opening, rather card flipping). i've been reading through spec's can't figure out property controls rotation axis' position. need add or change flip working? html structure: <div id="frontbackwrapper"> <div id="front"></div> <div id="back"></div> </div> and css (.flip being added via jquery start effect) #frontbackwrapper { position: absolute; -webkit-perspective: 1000; -webkit-transition-duration: 1s; -webkit-transform-style: preserve-3d; -webkit-transition: 1s...

c# - Maintain Control focus across post backs using PostBackOptions.TrackFocus -

maintaining focus across post backs apparently difficult task. searching google, find ton of people desire same thing, hook differently, , mostly, custom-ly. avoid custom implementation, if there's way it's supported .net. after deep searching, did come across postbackoptions.trackfocus, mentioned quietly in stack overflow post. according msdn: gets or sets value indicating whether postback event should return page current scroll position , return focus current control." holy crap, supported .net 4? awesome. have ton of custom controls, how .net know how set focus on control? have no idea. looking msdn documentation system.web.ui.control, there's interesting method: public virtual void focus() "use focus method set initial focus of web page control. page opened in browser control selected." alright, overridable. recommended method of doing so? returns void. no examples. unable find examples of people overriding method in implementati...

c++ - Problem with Boost bidirectionnal iterator not writable -

i try make bidirectionnal iterators boost iterator. have implemented functions suggested in documentation here . i have parent class functions implement declared pure virtual (i need polymorphic iterators). moment, have 1 inherited class functions implemented. moreover, use boost::bidirectional_traversal_tag. the dereference() function implemented follows in inherited class: template <typename t> t& imageiterator_notplanar<t>::dereference() const { return *((t*)buffer); } to read values following example, works perfectly: for (; !iter.isendreached(); ++iter) cout << "iterator inc: " << *iter << endl; (where isendreached() personal function). problem following code doesn't works: *iter = 3; g++ returns following error: lvalue required left operand of assignment what wrong ? thanks we need see exactly error generated. also, have assume have proper non-const version could need have template <typ...

c# - Problem communicating with Janrain "auth_info" service in WCF -

so i'm stuck @ point. trying communicate janrain's "auth_info" service. in fact, start, i'm trying "error" message/object/'.jsthingy' when surf directly in browser: https://rpxnow.com/api/v2/auth_info but want wcf call. according fiddler, content type of information @ url text/javascript . however, can tell, wcf doesn't give me option when calling through wcf. 2 options: webmessageformat.json , or webmessageformat.xml . i following error in visual studio: invalidoperationexception unhandled user code - incoming message has unexpected message format 'raw'. expected message formats operation 'xml', 'json'. can because webcontenttypemapper has not been configured on binding. see documentation of webcontenttypemapper more details. wtf? can wcf do this? (i suspect more manual solution ahead) janrain's online code examples little bit lacking in c# examples. their documentation link on auth_info...

erlang - open_port doesn't work when `exit_status` option not used -

when call open_port without exit_status in example below unusable: eshell v5.7.5 (abort ^g) 1> p = open_port({spawn, "cat >bar"}, [stream, use_stdio]). #port<0.498> 2> port_command(p, "hello\n"). ** exception error: bad argument in function port_command/2 called port_command(#port<0.498>,"hello\n") but when add exit_status , leave same works: eshell v5.7.5 (abort ^g) 1> p = open_port({spawn, "cat >bar"}, [stream, use_stdio, exit_status]). #port<0.498> 2> port_command(p, "hello\n"). true from documentation don't understand difference in behaviour. when redirect output in file in cat >bar command shell closes stdout , erlang closes port in case because ports try consume command output default , close on eof . right way fix use out option butter71 suggested. options out , exit_status , error_to_stdout tell ports not bother stdout .

delphi - CreateFile Hook -

i trying create hook createfile, when process tryies create file hookdll created notify user that: "this process xx.exe trying create xx.exe, want proceceed?" so far here, need modify in code: library createfilehook; uses windows, dialogs, sysutils; type oldcode = packed record one: dword; two: word; end; far_jmp = packed record puhsop: byte; pusharg: pointer; retop: byte; end; var jmpcfw, jmpcfa: far_jmp; oldcfw, oldcfa: oldcode; cfwadr, cfaadr: pointer; function newcreatefilea(lpfilename: pchar; dwdesiredaccess: dword; dwsharemode: dword; lpsecurityattributes: psecurityattributes; dwcreationdisposition: dword; dwflagsandattributes: dword; htemplatefile: thandle): thandle; stdcall; var file_name: pwidechar; name_len: dword; begin name_len := lstrlen(lpfilename) * sizeof(widechar) + 2; getmem(file_name, name...

c# - Complex Regex problem with hyperlink not matching "?" -

i working in replacing text hyperlink in c#. problem here link has question mark case 1:no problem input: asass123 output: asass123 case 2:problem here input: asasq123 output: asasq123 ">asasq123 (note: first occurrence of asass123 hyperlink , replaced http://stack.com/temp/test?order=sam&identifier=<a href= , second occurrence plain text) preferred output: asasq123 how can rectify problem. code here reference: mailitem.htmlbody = regex.replace( mailitem.htmlbody, "(?<!http://stack.com/temp/test?order=sam&identifier=)asa[a-z][a-z][0-9][0-9][0-9](?!</a>)", "<a href=\"http://stack.com/temp/test?order=sam&identifier=$&\">$&</a>"); the problem here "?" found in second argument. if rid of "?" in both 2nd , 3rd arguments, works fine. but cannot rid of "?", because needed url function. how can solve problem? i tried escape se...

java - What does comparing accuracy to Float.MAX_VALUE mean? -

while reading android developers blog post on location , came across bit of code (cut & paste blog): list<string> matchingproviders = locationmanager.getallproviders(); (string provider: matchingproviders) { location location = locationmanager.getlastknownlocation(provider); if (location != null) { float accuracy = location.getaccuracy(); long time = location.gettime(); if ((time > mintime && accuracy < bestaccuracy)) { bestresult = location; bestaccuracy = accuracy; besttime = time; } else if (time < mintime && bestaccuracy == float.max_value && time > besttime){ bestresult = location; besttime = time; } } } while rest pretty clear, line has me stumped: else if (time < mintime && bestaccuracy == float.max_value && time > besttime){ 'time' has within acceptable latency period & more recent previous besttime. ma...

c# - Windows Network Information Manipulation -

Image
i working trainee engineer in networking firm , getting annoyed having change ip information time time. i in need of building software me change these details easily. have managed set ip information. still have problems. i need run program administrator [right click], there way program prompt @ startup? how can change adapter dhcp? the code quite long, , hope not fill bore it. have been using management management class management base object management object collection in development. i'd prefer make own program develop programming skills. if there application it, don't mind knowing. i hope answer gives insisght , direction go. okay, network adapter 1 isn't that straight forward, believe can achieve wmi, specially wmi object here . msdn documentation tells properties, methods (which there setting dhcp etc) , datatypes , values takes. may 1 approach using wmi through c# pretty easy. wish provide example, i've never used specific wmi cla...

rspec - After Rails 3 upgrade rake db:test:prepare not working? -

i have gone through process of upgrading rails 2.3.11 app uses test unit rails 3.1.rc4 , have set rspec-rails 2.6.1. i switch test connection in database.yml use sqlite instead of postgres. i can run rake db:migrate , db:test:prepare day, in model tests "could not find table 'model_name'". has else ran this? i did encounter before. try rebuilding scratch: rake db:drop rails_env=test rake db:create rails_env=test rake db:migrate rails_env=test

Does anyone know a way to build a Windows Installer program for a Perl script and its dependent libraries? -

i work part-time computer tech @ local high school. needed system keep track of computers in district (things physical location of machines , serial numbers inventory), , told me keep on budget. sat down , wrote little thousand-line script in perl/tk, accesses postgresql database on local server. i wrote launcher in c++ , compiled bcc32, can single-click launcher executable start program without having type dos. works fine, , can load program myself manually installing dependencies hand. i build setup program automatically load postgresql application, strawberry perl, tk, , dbd::pg libraries, , finally, of course, folder application stored in. it'd nice able create desktop shortcuts or start menu items too. has had success software generate .msi files windows installer on windows xp , above? if so, did use, , did cost money? alternatively, need begin reading in order write own setup program? nullsoft scriptable install system

R - fastest way to detect if vector has at least 1 NA? -

wondering fastest way detect if vector has @ least 1 na? i've been using: sum( is.na( data ) ) > 0 requires examining each element, coercion , , sum function. the newer versions of r have anyna() option. on atomic vectors stop after first na instead of going through entire vector case any(is.na()) . borrowing joran's example: x <- y <- runif(1e7) x[1e4] <- na y[1e7] <- na microbenchmark::microbenchmark(any(is.na(x)), anyna(x), any(is.na(y)), anyna(y), times=10) # unit: microseconds # expr min lq mean median uq # any(is.na(x)) 13444.674 13509.454 21191.9025 13639.3065 13917.592 # anyna(x) 6.840 13.187 13.5283 14.1705 14.774 # any(is.na(y)) 165030.942 168258.159 178954.6499 169966.1440 197591.168 # anyna(y) 7193.784 7285.107 7694.1785 7497.9265 7865.064 notice how substantially faster when modify last value of vector. big part of savings, in additi...

python - How do I run a twisted trial in Windows? -

i'm new python, twisted , , trial... , windows users setup process isn't clear. right now, have python 2.7 installed, along twisted. python gui, can run reactor, i'm convinced things set ok. can't figure out how run trial command line run unit tests. don't see executable anywhere it. this post gives me hint patch needs installed in twisted setup.py ... although don't know file located. comments mention should use twisted cmd shell, again, don't know at. any pointers appreciated. there's nothing terribly special running trial on windows. run python script: c:\python27\python.exe c:\python27\scripts\trial.py [additional arguments] or if have .py associated python interpreter already: c:\python27\scripts\trial.py [additional arguments] or if have python scripts folder in %path% already: trial.py [additional arguments] or if have folder on %path% , '.py' in %pathext% already: trial [additional arguments]