Posts

Showing posts from 2015

c - Backtrace for GNU make -

is there way gnu make print "backtrace" of targets led command being executed when fails? regularly deal heavily obfuscated makefiles while resolving portability issues building software on new system, , seems should extremely simple thing make aid in debugging, can't find way request it. i'd see like: gcc: error: ... make[2]: error: gcc ... make[2]: error building target bar make[2]: error building dependency bar target foo make[1]: error: make -c subdir make[1]: error building target subdir make[1]: error building dependency subdir target ... showing entire dependency path how failed command ended getting executed. is there way this? make -p , make -d provide interesting information, not precisely asking for. see make's man page .

objective c - force UIScrollView to update -

i'm stuck problem have serie of pages of characterview class going straight uiscrollview. loading part performance intensive, because of reason tried manage aid of threading scenario. intention load requested page (es. 5th page out of 10) , starting load pages of uiscrollview there , showing on screen, recurring somehow , load +1 / -1 (respectively 6 , 4) , show'em on screen , in second recursion load +2 / -2 ( 7th , 3rd ) , show'em on screen , on.. this code: -(void)loadpagesdrillingfrompage:(nsinteger) page { self.viewcontrollers = [[[nsmutablearray alloc] init] autorelease]; (unsigned = 0; < [pageids count]; i++) { [self.viewcontrollers addobject:[nsnull null]]; } pagecontrol.numberofpages = [pageids count]; didpreparepagescontainer = yes; if (kpreloadallpages && !threadisloadingpages) { threadisloadingpages = yes; nsnumber *startingpage = [nsnumber numberwithint:page]; nsmutablearray *preloa...

CUDA shared memory -

i need know cuda shared memory. let's assign 50 blocks 10 threads per block in g80 card. each sm processor of g80 can handle 8 blocks simultaneously. assume that, after doing calculations, shared memory occupied. what values in shared memory when next 8 new blocks arrive? previous values reside there? or previous values copied global memory , shared memory refreshed next 8 blocks? it states type qualifiers: variables in registers thread, stays in kernel variables in global memory thread, stays in kernel __device__ __shared__ type variable in shared memory block, stays in kernel __device__ type variable in global memory grid, stays until application exits __device__ __constant__ type variable grid, stays until application exits thus reference, answer question memory should refreshed next 8 blocks if reside in shared memory of device.

Unit Testing in XCode: Test rig '[...]/usr/bin/otest' exited abnormally with code 134 -

i have got problem when unit testing class. when running test, compiles without errors crashes (it not fail in sense of assertion not being met), displaying following error message: /developer/tools/runplatformunittests.include:451:0 test rig '/developer/platforms /iphonesimulator.platform/developer/sdks/iphonesimulator4.2.sdk/developer/usr/bin/otest' exited abnormally code 134 (it may have crashed). here's code: the class' interface: @interface abstractactionmodel : nsobject { nsstring* mname; actiontype mtype; // enum float mduration; float mrepeatcount; float mdelay; nsarray* mtriggerareas; } the implementation: - (void) dealloc { [mtriggerareas release]; [super dealloc]; } - (id) initwithconfigdata: (nsdictionary*) theconfigdata { nsassert(nil != theconfigdata, @"theconfigdata cannot nil"); self = [super init]; if (self) { self.name = [theconfigdata objectforkey:action_name]; self.type = ...

shell - SWeave with non-R code chunks? -

i use sweave produce latex documents chunks produced dynamically executing r code. works - possible have code chunks executed in different ways, e.g. executing code in shell, or running perl, , on? helpful able mix things up, things run shell commands fetch data, run perl commands pre-process it, , run r commands analyze it. of course use r chunks , use system() poor-man's substitute, doesn't make pleasant reading in document. it's not directly related sweave, org-babel , part of emacs org-mode , allows mix code chunks of different languages in 1 file, pass data 1 chunk another, execute them, , generate latex or html export output. you can find more informations org-mode here : http://www.orgmode.org/ and see how org-babel works : http://orgmode.org/worg/org-contrib/babel/

python - How to publish (in a server) a pydev app using eclipse? -

i'm new eclipse , in field of web applications. used eclipse wrote django application works inside development server integrated in django. now, using eclipse, want export app work apache2 server. i've installed server , configured inside eclipse (defining server runtime environments preferences , creating server). now, steps have follow export , make app work in server? you using django development server (the manage.py runsrever ) eclipse. eclipse or other ide has little deployment of web application. django documentation explains how deploy application on appache , wsgi quite well. basically need reproduce eclipse configuration in wsgi script. wsgi script python script runned apache mod_wsgi module. here example of wsgi script: import os project_dir = os.path.dirname(__file__) # provided python-paths (places python modules) # in eclipse configuration. you'll need add path's wsgi # script too. os.path.append(project_dir) os.path.append(project...

.net 4.0 - How to flush out suspended WCF workflows from the instancestore? -

we have identified need flush out several different workflows have been suspended/persisted long time (i.e. hung instances). our test environment can flushed clean before acceptance tests re-run. the dirty solution use sql script remove records instancestable , other related tables in database. what's proper solution? these wcf workflows. test rig running xp. using appfabric can use ui, or asume powershell commands, delete individual instanced. development , test purposes recreate database running sqlworkflowinstancestoreschema.sql script again.

Can an applescript "tell" call execute without visibly launching the application? -

i have mail rule set launch following applescript: using terms application "mail" on perform mail action messages themessages rule therule tell application "mail" -- stuff, including... checkaddressbook(thename, theaddress) end tell end perform mail action messages end using terms on checkaddressbook(thename, theaddress) tell application "address book" -- stuff end tell end checkaddressbook whenever mail rule executes, launches address book. not activated, shows on desktop. question is, can tell blocks instructed launch application silently, , quit when complete? applescript can't control application without running. that's way works. there other methods might use access address book database without launching application, if you're using applescript data address book database application has launch. recommendation add quit command suggested fábio.

jQuery clickable div with working mailto link inside -

i have div want clickable need mailto link inside div still work too. when hover on mailto link mailto appears @ bottom of browser clicking activates link attached div. anyway around this? thanks. <div class="directory_search_results"> <img src="images/no_photo.png" /> <ul class="staff_details"> <li class="search_results_name"><a href="http://www.netflix.com">micheal staff</a></li> <li class="search_results_location">university of illinois</li> <li class="search_results_email"><a href="mailto:test@test.org">test@test.com</a></li> <li class="search_results_phone">(407) 555-1212</li> <li class="search_results_office">(407) 555-1212</li> </ul></div> and jquery $(document).ready(function(){ $(".directory_search_results").click(function(){ ...

java - Why is having an abstract subclass of concrete class bad design? -

after java abstract abstract subclass of object. need force subclass implement methods, may have pretty defined hierarchy concrete classes. for example: have functioning hierarchy vehicle<--- car and want add electriccar hierarchy. vehicle<--car<--electriccar. i want different types of electric cars implement behaviors getbatterylife or something- why bad idea make electriccar abstract ? there's nothing wrong in making abstract. if business requires make abstract, it's fine. said, lots of classes in java lib abstract , still extending object.

ruby - Rails link_to with acts_as_taggable_on_steroids -

i using acts_as_taggable_on steroids , having problem piece of code generates link tag: <%= link_to tag, tag_path(:id => tag.name) %> when access url: http://localhost:3000/tags/rails i error: no action responded rails. actions: show however, url works: http://localhost:3000/tags/show/rails i have defined show action in tags_controller.rb class tagscontroller < applicationcontroller def show @stories = story.find_tagged_with(params[:id]) end end i have following routes generated rake:routes : tags /tags(.:format) {:controller=>"tags", :action=>"index"} post /tags(.:format) {:controller=>"tags", :action=>"create"} new_tag /tags/new(.:format) {:controller=>"tags", :action=>"new"} edit_tag /tags/:id/edit(.:format) {:c...

what is this error in android? -

what error ?? 02-17 22:00:54.199: error/androidruntime(338): fatal exception: main 02-17 22:00:54.199: error/androidruntime(338): java.lang.runtimeexception: failure delivering result resultinfo{who=null, request=1, result=-1, data=null} activity {com.dattsmoon.andfbchat/com.dattsmoon.andfbchat.andfbchat}: java.lang.illegalthreadstateexception: thread started. 02-17 22:00:54.199: error/androidruntime(338): @ android.app.activitythread.deliverresults(activitythread.java:2496) 02-17 22:00:54.199: error/androidruntime(338): @ android.app.activitythread.handlesendresult(activitythread.java:2538) 02-17 22:00:54.199: error/androidruntime(338): @ android.app.activitythread.access$2000(activitythread.java:117) 02-17 22:00:54.199: error/androidruntime(338): @ android.app.activitythread$h.handlemessage(activitythread.java:958) 02-17 22:00:54.199: error/androidruntime(338): @ android.os.handler.dispatchmessage(handler.java:99) 02-17 22:00:54.199: error/androidruntime(338...

F# match question -

this have far: type u = {str : string} //some type has property str (for simplicity, one) type du= | of u | b of u // discriminated union carries u then, somewhere have sequence of du doing distinctby , property distinct str. best come this: seq.distinctby (fun d -> match d (a u|b u) -> u.str) the code works, don't having match on , b of discriminated union , replace match something. question is, what? :) edit: in case, , b of discriminated union carry same type u them, 1 solution rid of du , add it's string form type u , simplify whole mess, keep way because going matches , such on , b... how doing match 1 time property of du? type u = {str : string} type du = | of u | b of u member this.u = match (a u | b u) -> u [a {str="hello"}; b {str="world"}; {str="world"}] |> seq.distinctby (fun x -> x.u.str) //val : seq<du> = seq [a {str = "hello";}; b {str = ...

Using json.net from string to datatable in C# -

hopefully can me example, because i'm new in json: webservice receive json string. understand created datatable. how manage in c# deserialize dataset? maybe has me. { "datatojohnson": { "0": { "maat_id": "1", "maat": "11" }, "1": { "maat_id": "2", "maat": "11+" }, "2": { "maat_id": "3", "maat": "12+" }, "3": { "maat_id": "4", "maat": "12/13" } } } thanks! raymond you define model represent json data: public class data { public int maat_id { get; set; } public string maat { get; set; } } public class mymodel { public dictionary<int, data> datatojohnson { get; set; } } and use json.net deserialize string model var json = @"{ ""datato...

multithreading - How to improve Java performace using static variables and threads? -

for sake of not going deep software supposed let me give example of trying solve, make short , sweet. lets have base class called x , implementation of class, call y. class y, naturally, extends base class x. lets have 20 objects instantiating class y via separate thread each object , every instantiation big file loaded memory. of these objects, perhaps, might need use different files make simple, lets need access same file. is there way define object(variable) points these files statically in base class that, though implementation class loaded 20 times via 20 different threads, can share same static object, file needs loaded 1 time??? thanks in advance... if know file ahead of time, open , load file in static initializer block, , store contents in static data member. content accessible instances of class, regardless of thread accessing instance objects. // in base class protected static final string filecontents; static { filecontents = readstufffromfile(); }...

text - Does Flash CS5 automatically embed font characters? -

does flash cs5 automatically embed font characters? use dynamic text flasheff dont change. the best answer embed chars individually needed, if flash doing embedding on own. once char gets embedded not rise file size if embed again.

Registering jquery radio button click event doesn't work -

i trying set hidden form field value of selected radio button. have following code: $(function () { // set hidden form field selected timeslot $('input[name=["timeslot"]').live("click", (function () { var valu = $(this).val(); alert(valu); $("#selectedslot").val(valu); })); }); all radio buttons have name "timeslot", , run function whenever 1 clicked. however, alert box shows blank when click 1 of radio buttons. update: oops! didn't see double square brackets. fixed it: $('input[name="timeslot"]').live("click", (function () { var valu = $(this).val(); alert(valu); $("#selectedslot").val(valu); })); and still having same problem. in fact, alert box not come more reason. update 2: actually, in real code have other events registered in initiation block besides 1 -- i...

CSS styles to superimpose Previous and Next buttons on top of photo -

i looked similar questions, didn't find any. maybe didn't type right words. i need place 2 transparent buttons on top of photo in photo gallery. on left middle there <- , on right middle there -> image buttons. these buttons gallery navigation buttons. anyone has tips or code snippet share? i have .net 4.0 app , using jquery. thanks put links , image inside div element position: relative; . give links position: absolute; , adjust position accordingly top , left , right , or bottom properties.

ios - Multiple UIViewControllers simultaneously -

i have uitableview in navigation controller occupying entire screen. have smaller custom uiview needs slide bottom, squeezing table view 100 pixels. custom view needs static, not moving while user navigates tableview. ive been told not have 2 uiviewcontrollers (vc) managing views on same screen. currently, appdelegate adds subview window vc, loads tableview , custom view [self addsubview:tablviewcontroller.view]; [self addsubview:customviewcontroller.view]; how should implemented? the way structure follows: have uiviewcontroller subclass view takes entire screen. have 2 subviews. first subview: view of uinavigationcontroller contains table view controller. second subview: custom uiview. have uinavigationcontroller's frame set entire bounds of main view controller's view , custom view's frame below visible area of screen. when need slide view, use uiview animation animate changing frame of uinavigationcontroller's view decreasing height , change...

cocoa touch - How do you force audio to come out of the iPhone speaker when a headset is attached? -

i'm trying add loudspeaker feature 1 of iphone apps. created recording functionality, when play recorded audio plays phone headset. what need recorded file played on loudspeaker, if there headset attached. how reroute audio this? you need override default audio properties using audiosessionsetproperty . @ force audio go speaker (note happen if headphones plugged in). osstatus err = 0; uint32 audiorouteoverride = kaudiosessionoverrideaudioroute_speaker; err = audiosessionsetproperty(kaudiosessionproperty_overrideaudioroute,sizeof(audiorouteoverride),&audiorouteoverride); to detect headphones, try (this literally copy/paste code off of post, caveat emptor, works me): /** * tells if headset plugged in */ - (bool) headsetispluggedin { bool returnval = no; uint32 routesize = sizeof(cfstringref); cfstringref route = null; osstatus error = audiosessiongetproperty(kaudiosessionproperty_audioroute, &routesize, &route); if (!error && (...

c# - Update dateTimePicker in another process by DTM_SETSYSTEMTIME -

i trying update datetimecontroller in application using dtm_setsystemtime. bool retval = false; ushort gdt_valid = 0; systemtime td = new systemtime(); td.wyear = 1990; td.wmonth = 4; td.wday = 2; td.wdayofweek = 0; td.whour = 0; td.wmilliseconds = 0; td.wminute = 0; td.wsecond = 0; int erc = sendmessage(handle, dtm_setsystemtime, gdt_valid, ref td); unfortunately attempt failed, picker not updated, every time return value zero. important thing application having datatimepicker gives error message illegal memory access exception after execute sendmessage command. can me fix ? yes, cannot work. 4th argument sendmessage pointer systemtime. pointer value valid in process, not 1 owns control. crashing target app pointer value quite possible. need to call openprocess() on target process obtain handle call virtualallocex() allocate memory in target process call writeprocessmemory() copy systemtime value process target process call sendmessage, using pointer val...

mysql - show profiles doesn't show me a query -

hallo guys. can explain me why show profiles doesn't show me query? output of attempt: mysql> set profiling = 1; query ok, 0 rows affected (0.00 sec) mysql> use slow; database changed mysql> show profiles; +----------+------------+-------------------+ | query_id | duration | query | +----------+------------+-------------------+ | 1 | 0.00024275 | select database() | +----------+------------+-------------------+ 1 row in set (0.00 sec) mysql> select count(*) people; +----------+ | count(*) | +----------+ | 500000 | +----------+ 1 row in set (0.00 sec) mysql> show profiles; +----------+------------+-----------------------------+ | query_id | duration | query | +----------+------------+-----------------------------+ | 1 | 0.00024275 | select database() | | 2 | 0.00030825 | select count(*) people | +----------+------------+-----------------------------+ 2 rows in set (0.00 sec) mysql> sel...

php - CakePHP saving data from Google Analytics -

i've been working plugin: http://www.neilcrookes.com/2009/09/27/get-google-analytics-data-in-your-cakephp/ it's on head. under analytic.php seems usetable set false, however, when it's true throws error. new cake , cake plugins, maybe interacting wrong way. i'd save dimensions , metrics being pulled database using cake. direction appreciated. the model has usetable = false using datasource data. cant set true, , wont work other way. if want save create new model db table normal , following. in new model... $data = classregistry::init('analiticsmodel')->findmethod(); then manipulate how need $this->save($data); its in db... can $this->find() <-- normal cake stuff on new model

ruby on rails - Doc about Query an external HTTP XML API -

i want query api rails. tried use httparty cannot make work rails controller classes not seems self.methodes. i looking doc on subject, not want create api, use it. ok, apparently in rails have activeresource kind of operations. dedicated create model using rest resources.

Calling Code Behind Methods in Padarn -

does padarn support call methods exist in code behind aspx page? for example (pseudo): mypage.cs code behind. protected string getdata() { return("here's data"); } mypage.aspx calls getdata() method lives in code behind... <%= this.getdata() %> when attempt above example, response displayed in browser reads... [translated asp] instead of "here's data". for record, ctacke answered question in cross-post thread @ opennetcf community forum... no, asp 3.0-style code doesn't work. you're better off rendering page in render , calling method there. own request handler did kind of parsing, think way more work worth.

naming - Writing "Code::Blocks" Without the Colons -

this bit of silly question, please bear me. ;) i got code::blocks ide , i'm enjoying thoroughly. however, since : character isn't allowed in windows folder names, i'm unsure of call folder keep projects in. (i name each folder after ide.) should written "code blocks," "codeblocks," or else...? let's see people affiliated project calls it. the official name spelled "code::blocks". in filenames in download section it's spelled "codeblocks". in page title of wiki it's spelled "codeblocks" if remove "illegal" characters official names "codeblocks". however, :: indicates think should separate "code" , "blocks". according this, , considering proper grammar, think should call "code blocks". alternatively "code blocks ide".

visual studio - Forcing MSTest to use a single thread -

given test fixture: [testclass] public class mstestthreads { [testmethod] public void test1() { trace.writeline(thread.currentthread.managedthreadid); } [testmethod] public void test2() { trace.writeline(thread.currentthread.managedthreadid); } } running test mstest through visual studio or command line prints 2 different thread numbers (yet run sequentially anyway). is there way force mstest run them using single thread? i've fought endless hours make mstest run in single threaded mode on large project made heavy use of nhibernate , it's not-thread-safe (not problem, it's not) isession. we ended more time writing code support multi-threaded nature of mstest because -to best of , teams knowledge - not possible run mstest in single threaded mode.

amazon web services - Simplest Ruby code for SQS request signing? -

i working in cool constrained environment of tropo (cloud telephony) ruby scripting. entire app single jruby file. no gems, no requires. i need send simple messages single sqs queue. don't need other sqs operations. before start pulling code out of existing gems this, wanted see if has standalone code sending sqs messages or code http request signing sqs requires. we ended going following super-simple code post message sqs queue exists. no gems required. super_simple_sqs.rb

parsing json in jquery autocomplete -

i've used simon whatley's code autocomplete plugin. now, need in parsing json data. here code: $("#country").autocomplete("data/country.cfm",{ minchars:1, delay:0, autofill:false, matchsubset:false, matchcontains:1, cachelength:10, selectonly:1, datatype: 'json', extraparams: { format: 'json' }, parse: function(data) { var parsed = []; (var = 0; < data.length; i++) { parsed[parsed.length] = { data: data[i], value: data[i].name, result: data[i].name }; } return parsed; }, formatitem: function(item) { return item.name; } }); for example, json string: [{"name":"country1"},{"name":"country2"},{"name":"coun...

asp.net - How Stop Team Build from Precompiling -

i've got asp.net website project in solution, in visual studio 2010. i'm using tfs 2010 build solution. website getting precompiled (no .cs files). / make changes stop site getting precompiled during build? suppose it's using msbuild, , i've made manual tweaks build project file deploy site after build. i'm hoping there's switch somewhere tells system not precompile during tfs build. thanks. i had problem. though wanted automated build perform build, didn't want precompiled version shipped. wanted full source shipped. accomplish this, when modified tfsbuild.proj file transport files used sources folder instead of $(outdir) folder. way site still got precompiled $(outdir) , fail if there problem, version transported website actual .vb , .cs files themselves. note: reason want source files website rather precompiled version sites covered in automated build undergo changes individual pieces , need updateable stand alone items. requireme...

html - wrap a single line of text in a dynamic div -

Image
i have problem css: dynamic div contains single line of text need wrapped every time div resizes width smaller size. but problem text inside table. not pure text, serves directory of contacts somehow paging. please refer images have attached better view of problem. attached part of code have below. see attached image better understanding of problem. i'm not versed in css, i'm hoping can suggest better layout this. hope can me. thank you! :) <div id="divsearch" style="width:350px"> <p style="word-wrap:break-word;white-space:pre-wrap;"> <table id="tblglossary"> <tr> <td class="glossary"><a href="#" >#</a></td> <td align="right">&nbsp;</td> <td class="glossary"><a href="www.abc.com?tag=a'">a</a></td> <td align="right...

c++ - Serial Mac OS X constantly freezes/locks/dissappears for USB to Arduino -

i have problem c++ code running in xcode both amserial library generic c (ioctl, termios). after fresh restart, application works after "kill" program serial (i think) not released. i have checked open files under /dev , have killed connection serial usb there, c++ still can't open usb port. i have narrowed down being low level mac os x issue, regarding blocking port indefinitely, regardless of closing using aforementioned libraries. just context, i'm trying send numbers through usb port, serially arduino duemilanove @ 9600 baud. running serial monitor in arduino fine, however, running through c++ application freezes computer, occasionally, mouse/keyboard freeze up: requiring hard reset. how can problem fixed? seems mac os x not usb friendly! sorry, answered own question while back! after connect arduino, have include sleep(2) ensure serial connected.

continuous integration - Joined console output for "Build other projects" in hudson/jenkins -

i have created 3 jobs [a, b, c] in hudson. job has "build other projects" enabled , invokes jobs [b, c]. works fine want see console output [b, c] in console job a. @ moment looks this: started user anonymous triggering new build of triggering new build of b finished: success can replace "triggering new build of a/b" job output? i don't think so. can't done of standard options, , don't see plugins allow either (just looked @ list). maybe write plugin :)

Should I create separate tables for users and their profiles for a social network database? -

i want design database social network provide profiles users. should use separate tables users , profiles or 1 table users , attributes in it? if want go big, separate 1 users. advantage of users , attributes in same table: simpler sql query. if assumer need attributes, there's 1 less join. advantage of separate tables: in real life, don't need attributes. when need pair other things users don't need attributes.

Not able to get DirContext ctx using Spring Ldap -

hi using spring ldap , after execution below program display here , after nothing happening, program in continue execution mode. public class simpleldapclient { public static void main(string[] args) { hashtable env = new hashtable(); system.out.println("i here"); string principal = "uid="+"a502455"+", ou=people, o=ao, dc=com"; env.put(context.initial_context_factory,"com.sun.jndi.ldap.ldapctxfactory"); env.put(context.provider_url, "myurl"); env.put(context.security_authentication, "simple"); env.put(context.security_principal, principal); env.put(context.security_credentials,"password"); dircontext ctx = null; namingenumeration results = null; try { ctx = new initialdircontext(env); system.out.println(" context" + ctx)...

objective c - How do I hide a button when an IBAction is performed? -

i attempting hide nsbutton performs miniaturize when different nsbutton on interface clicked. attempts far have been unsuccessful, have tried: .h file: @interface appdelegate : nsobject <nsapplicationdelegate> { iboutlet nswindow *window; iboutlet webview *webview; iboutlet nsbutton *dominimize; } @property (assign) iboutlet nswindow *window; @property (assign) iboutlet nsbutton *button; @property (nonatomic, retain) iboutlet webview *webview; .m file: @implementation appdelegate @synthesize window; @synthesize webview; @synthesize dominimize; - (ibaction)togglefullscreen:(id)sender { ... [dominimize setenabled:no]; [dominimize settransparent:yes]; ... } it appears no matter in action try disable , make button transparent, doesn't seem respond anything. have give button it's own class make work? if so, how able modify button ibaction inside of different class? i apologize in advance if question silly, i'm relatively new world of object...

objective c - Where is [super init] method actually located? -

where [super init] method located , happens if negotiate calling super init method? that depends on entirely on superclass. if class derives nsobject , calls -init method in nsobject class. if class derives class parentclass , calls -init method in parentclass . not sure mean "negotiate" calling super init method.

MySQL - Make an existing Field Unique -

i have existing table field should unique not. know because entry made table had same value another, existing, entry , caused problems. how make field accept unique values? alter ignore table mytbl add unique (columnname); for mysql 5.7.4 or later: alter table mytbl add unique (columnname); as of mysql 5.7.4, ignore clause alter table removed , use produces error. so, make sure remove duplicate entries first ignore keyword no longer supported. reference

internet explorer - jQuery hotkeys: prevent IE from running its own shortcuts, like Alt+H -

using jquery hotkeys, try bind shortcuts alt + h , alt + c specific actions in site. event propagation stops (as should) in browsers ie. first of all, possible achieve this? if so, how? here code sample: jquery(document).bind('keydown', 'alt+h', function (event) { $this.togglemenu( 'h' ); if(jquery.browser.msie) { event.cancelbubble = true; } else { event.stoppropagation(); } return false; } ); in ie, line $this.togglemenu( 'h' ); gets executed, cancelbubble seems have no effect (the browser opens "help" menu) this weird thing attempt (due browser's built-in hotkeys, etc), i've had luck using onkeyup event. the problem keydown may sending 1 key @ time. if hit alt it's 1 trigger of keydown, , c second trigger. keypress has probs in environments because modifier keys alt , ctrl don't coun...

jquery: adding effect to changing contents of a selected element -

i trying add animation effect changing contents of selected element. like here's code change contents of div.. $('.message').html('the product has been deleted.'); i want add simple slide down effect process. how should this? $('#check').click(function() { $('.text').html('here text.').hide().slidedown('slow'); // don't forget hide first.... }); demo

sql server - What's the meaning of this SQL statement? -

i new sql transction. what's meaning of following statement? begin tran -- xlock transaction if exists (select 1 dbo.activetransaction (xlock) transactionid = @transactionid) begin (omitted) end commit tran thanks! what's happening here is: a sql transaction begun you check see if dbo.activetransaction table contains record transactionid equal alue in variable @transactionid. if yes, "(omitted)" code any changes made commit'ed database the 'xlock' means that : specifies exclusive locks taken , held until transaction completes. if specified rowlock, paglock, or tablock, exclusive locks apply appropriate level of granularity.

mysql - How to check if Federation is enabled -

i want know command can run in shell find out if federation enabled on mysql server or not? thanks. login mysql server , show engines\g , says on 1 of mysql servers: *************************** 10. row *************************** engine: federated support: no comment: federated mysql storage engine

ms office - Outlook 2007 - appointment -

i'm try set recurrence appointment in caldender 5th working day on every month. i can see can set 1st, 2nd, 3rd, 4th , last day of every month cant see option set 5th day. does know how can this? under 'recurrence pattern', select 'monthly' , put put: day [5] of every [1] month(s) in bit on right -- edit -- right, looks may of use: http://www.websetters.co.uk/wsaddins/wsraii/index.htm outlook can't handle natively far know. you date crunching in excel , import them though

Effective way to implement the number of views on images - PHP -

i've created website users can upload images , i'd record total number of views individual image. now idea on implementation this: store ipaddress of visitor in session, fe: $key = "view_img_".$img->id; if(!isset($_session[$key])) { $_session[$key] = array(); } $visitoripaddress = $_server['remote_address']; $found = false; foreach($ip in $_session[$key]) { if($ip == $visitoripadress) { $found = true; //visitor has visited before in livespan of session break; } } if(!$found) { //do sql update query number of views image $sql = mysql_query("update ") //etc. //add ip list in session $_session[$key][] = $visitoripadress; } now problem this: i'd clear visitor's ipaddress inside $_session[$key] variable after timelimit clear resources. the thing is: of visitors might view image once, , when image gets old might not visited longer, session st...

assembly - sys_read call linux error values -

i new assembly programming.i have written assembly program read characters input file buffer , convert upper-case letter , generate output file.i have used int80h service read character input file.i want add functionality check error values returned sys_read call incase fails read character input file.how that?what register contain error values , values show error? my recollection (it's been awhile since did system-call-level programming) sys_read returns either number of characters read, 0 if @ end of file, or error code less 0 in case of error, , that return value passed via usual %eax register ( %rax on x86-64, think).

Why Java is called more efficient (in terms of resources consumption) but less speedy, and how is that advantageous in context of web applications? -

i have heard lot of times java being more resource efficient being fast language. efficiency in terms of resources consumption means , how beneficial web applications context ? for web applications, raw performance of application code irrelevant (of course if make excessively slow, you're still in trouble) main performance bottlenecks outside application code. they're network, databases, application servers, browser rendering time, etc. etc.. if java slow (it isn't) wouldn't of problem. application consumes inordinate amounts of memory or cpu cycles can bring server knees. again, that's less problem of language use of way use it. example, creating massive memory structure , not disposing of can cause memory problems always. java makes harder not dispose of memory (at cost of tiny bit of performance , maybe hanging on memory longer strictly necessary). similar garbage collection systems can (and have been) built , used other languages well.

google app engine - "=" symbols in GAE TextProperty -

i'm getting strange additional symbols (=) in text property when adding text there via post. example: team unstoppable fury being chased p= olice, alonzo , yuuma. vinnie, shorty , kiro=92s skills put = test. there shouldn't of = symbols in text. co de is: class fileuploadhandler(blobstore_handlers.blobstoreuploadhandler): def post(self): game_file = self.get_uploads()[1] screen_file = self.get_uploads()[0] if not users.get_current_user(): game_file.delete() screen_file.delete() self.redirect(users.create_login_url("/")) return game = game() game.title = self.request.get('title') game.url_name = self.request.get('url') if self.request.get('active') == 'active': game.active = true else: ...

xml - XS:date returns an error with format YYYYMMDD -

<xs:element name="begindate" type="xs:string"> <xs:simpletype> <xs:restriction base="xs:string"> <xs:pattern value="\d{8}"/> </xs:restriction> </xs:simpletype> </xs:element> in xml gave <begindate>20100721</begindate> but returns error ... there problem code here .. using validated code :( so i'm bit blocked you have defined content type twice. have: 1) attribute type on <xs:element> 2) <xs:simpletype> block child of <xs:element> . you can't have both. in case, don't need type attribute.

Data structure for Settlers of Catan map? -

this question has answer here: how represent hextile/hex grid in memory? 7 answers a while asked me if knew of nice way encode information game settlers of catan. require storing hexagonal grid in way each hex can have data associated it. more importantly, though, need way of efficiently looking vertices , edges on sides of these hexagons, since that's action is. my question this: there good, simple data structure storing hexagonal grid while allowing fast lookup of hexagons, edges between hexagons, , vertices @ intersections of hexagons? know general structures winged-edge or quad-edge this, seems massive overkill. a simple structure store hexagonal grid when care hexagons, matrix, hexagon @ (x,y) being neighbor of hexagons @ (x, y±1), (x±1,y), , (x±1,y+1) xs or (x±1,y-1) odd xs. can evolve idea allow fast lookup of edges , vertices. you add 2 o...

annotations - Hibernate error: one-to-one mapping on superclass and subclass -

i'm working on project hibernate , mysql, use annotation mapping database data object model. need mapping one-to-one between superclass , subclass on id primary key of classes. i've modified sample of tutorial: http://www.mkyong.com/hibernate/hibernate-one-to-one-relationship-example/ ddl script: create database if not exists mkyong; use mkyong; -- -- definition of table `stock` -- drop table if exists `stock`; create table `stock` ( `stock_id` int(10) unsigned not null auto_increment, `stock_code` varchar(10) not null, `stock_name` varchar(20) not null, primary key (`stock_id`) using btree, unique key `uni_stock_name` (`stock_name`), unique key `uni_stock_id` (`stock_code`) using btree ) engine=innodb auto_increment=34 default charset=utf8; -- -- definition of table `stock_detail` -- drop table if exists `mkyong`.`stock_detail`; create table `mkyong`.`stock_detail` ( `stock_id` int(10) unsigned not null auto_increment, `comp_name` varchar(100) not n...

What is the best way of accessing a WCF service from Excel? -

i access wcf service through vba functions/macros in excel (2007 or 2010). it seems there number of possibilities, each own particular shortcomings. ... microsoft soap toolkit wcf service moniker com interop vsto excel-dna can advise on best way of doing this? i don't think there clear-cut answer question; depends bit on want data returned service, how intend deploy solution, , how done vba, opposed .net. gut feeling vsto right, because gives full-fledged .net project, convenient handle wcf services. assuming trying retrieve data , give user choices pull , how display it, can build user interface (maybe in task pane), , write results excel, while writing code in visual studio. however, mentioned vba, , not quite sure how want use it. found exceldna easier use if want create vba user-defined function calls .net dll. if vba want focus on, may way go. hope helps!

iphone - Refresh ViewController on TabBarController -

i have tabbarcontroller 3 viewcontrollers on it. when viewcontroller 1 selected , make 90 degrees hide tabbar , have addsubview current view tabbarcontroller, otherwise blank space appears tabbar was. if rotate iphone orientation (the vertical normal position) removefromsuperview view, no view shown on view controller, suppose original view (the 1 before addsubview call) should shown, in fact if select second viewcontroller , later go viewcontroller 1 view appears perfectly. i don´t understand why happens, me? update: i think problem add view on tabbarcontroller (self.view addsubview:vista_as.view]) need make tabbar not visible, , later, when remove view tabbarcontroller loses in way viewcontroller 0 view reference. don´t understand why when change viewcontroller 1 , 0 view ok. there way reload viewcontroller 0 view?? update 2 : included author's code suggested edit answer this code: if(tointerfaceorientation == uiinterfaceorientationlandscapeleft || tointerfaceor...

c# - Getting active tab url from Safari -

i trying active tab url safari, far able url prominent browsers (ie, firefox, chrome, opera) through mix of win32 api calls or dde. the issue safari when enumerate through windows , call getwindowtext it's null. any solutions out there? thanks! public static string getchromeurl() { uint max_path=255; intptr hchrome, haddressbox; hchrome=getforegroundwindow(); haddressbox = findwindowex(hchrome, intptr.zero, "chrome_autocompleteeditview", intptr.zero); stringbuilder sb = new stringbuilder(256); sendmessage(haddressbox, wm_gettext, (intptr)max_path, sb); string s = sb.tostring().trim(new char[] { ' ', '\0', '\n' }); return s; }

web services - How to make an @WebService spring aware -

i have web service trying autowire variable into. here class: package com.xetius.isales.pr7.service; import java.util.arrays; import java.util.list; import javax.jws.webservice; import org.springframework.beans.factory.annotation.autowired; import com.xetius.isales.pr7.domain.pr7product; import com.xetius.isales.pr7.domain.pr7upgrade; import com.xetius.isales.pr7.logic.upgradecontrollerinterface; @webservice(servicename="productrulesservice", portname="productrulesport", endpointinterface="com.xetius.isales.pr7.service.productruleswebservice", targetnamespace="http://pr7.isales.xetius.com") public class productruleswebservice implements productruleswebserviceinterface { @autowired private upgradecontrollerinterface upgradecontroller; @override public list<pr7product> getproducts() { if (upgradecontroller == null) { return arrays.aslist(new pr7product(...

gis - How to use python to turn a .dbf into a shapefile -

i have been scouring internet trying find pythonic (sp?!) way process data.. everyday recieve load of data in .dbf format (hopefully) - need save data shapefile. does have links or suggestions process? to append file's creation_date name, need obtain creation date os.stat() , rename file os.rename() . can format date string date.strftime() . import datetime, os filename = 'original.ext' fileinfo = os.stat(filename) creation_date = datetime.date.fromtimestamp(fileinfo.st_ctime) os.rename(filename, filename + '-' + creation_date.strftime('%y-%m-%d'))

iphone - when application become active then how we load the another view or invoke the root view controller -

i have load mailcomposer on reciving localnotification possible?? you should code follows, - (bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions { uilocalnotification *localnotif = [launchoptions objectforkey:uiapplicationlaunchoptionslocalnotificationkey]; if (localnotif) { //code opening mail composer } -(void) application:(uiapplication *)application didreceivelocalnotification:(uilocalnotification *)notification { //code opening mail composer }

jquery submit on change with a twist -

i have form single select_field gets submitted via jquery whenever select field changed.i use this: $('#scope').change(function() { this.form.submit(); }); where scope id of select_field. works expected. we want change view select field hidden until user clicks link => pops , can select before. the problem: when user clicks link show select field. instantly triggers change event somehow (even though value of select field has not changed). any easy way around overlooking? thanks time, erwin you might want register change event after make select-field visible e.g.: $(the_link_selector).click(function() { $('#scope') .show() .change(function () { this.form.submit(); }); });

how to do a game that is simulated by a loop -

how program game simulated loop in people has repeat goes long takes out reach or pass square 80? doing snake & ladder game , need write code allow happen you need use loop exit condition checks if player has reached square 80 or otherwise won. while ( !hasplayerwon() ) { //continue game } loops in javascript , loops in c++ :d

How to create xml with this style via C# code? -

i want create via c# code xml this: <title> <a> <aa=aa,cc=cc,dd=dd/> </a> <b> <bbbbbbbbbbbbb.udl/> </b> </title> with code should create tree thist? how put symbols "=" , "." inside name? only using stringbuilder, since sample gave not valid xml. did mean use syntax like: <aa foo="bb" bar="cc"/>

Python / Django - If statement in template around extends -

i have template extends conditionally. basically, when variable called "ajax" true not want have template extend another. {% if not ajax %} {% extends "/base.html" %} {% endif %} any clues? you cannot that. can set variable , use choose template extend: {% extends my_template %} then in python code write like: if ajax: template_values['my_template'] = 'base_ajax.html' else: template_values['my_template'] = 'base.html' you may wish refer documentation more information.