Posts

Showing posts from August, 2011

java - Debugging ant UnsupportedClassVersionError -

i'm getting following exception trace result of running ant package (this supposed create jboss .ear package): $ ant package buildfile: /usr/local/src/appname/build.xml init: [echo] classpath = ${java.classpath} build: package: build failed /usr/local/src/appname/build.xml:369: java.lang.unsupportedclassversionerror: bad version number in .class file @ java.lang.classloader.defineclass1(native method) @ java.lang.classloader.defineclass(classloader.java:621) @ java.security.secureclassloader.defineclass(secureclassloader.java:124) @ java.net.urlclassloader.defineclass(urlclassloader.java:260) @ java.net.urlclassloader.access$100(urlclassloader.java:56) @ java.net.urlclassloader$1.run(urlclassloader.java:195) @ java.security.accesscontroller.doprivileged(native method) @ java.net.urlclassloader.findclass(urlclassloader.java:188) @ java.lang.classloader.loadclass(classloader.java:307) @ java.lang.classloader.loadclass(classload...

performance - Questions on the Azure scalability targets and the use of multiple Azure storage accounts? -

the windows azure storage abstractions , scalability targets blog post indicates there 5,000 entities/second transaction limit single storage account, , there 500 entities/second limit single table partition. , meet first limit 1 should used multiple accounts, , partition limit 1 should design partitions carefully. i'd ask others have experience on 5000 limit single storage account. right now, i'm designing community of blogs/wikis , 1 day site becomes popular , attracts lot of traffic. should split user related tables 1 storage account , blog related tables account , yet wiki related tables prevent limit right now? or should add more accounts there need, way there way transfer azure storage tables 1 account another? article says when hit limit “503 server busy” responses, there way know limit getting close in advance without accully resulting 503 errors? i haven't hit account limit overall, have hit limit number of transactions on queue trying set numbe...

python - Zip a set of blobs from appengine datastore -

i need zip set of blobs available in data store. these can of different types html/images/swf/ etc. these available in datastore blob. i tried implement solution: zipping dynamic files in app engine (python) ? tried static texts worked great, able create zip set of files respective content not trace out issue when making zip query. z.writestr(fil.template_name, my_data.encode('utf-8')) file "c:\python25\lib\zipfile.py", line 626, in writestr self.fp.write(zinfo.fileheader()) file "c:\python25\lib\zipfile.py", line 260, in fileheader return header + self.filename + unicodedecodeerror: 'ascii' codec can't decode byte 0xde in position 12: ordinal not in range(128) this error part of code class filesdb(db.model) template_file = db.blobproperty() template_name= db.stringproperty() output = stringio.stringio() z = zipfile.zipfile(output,'w') files = filesdb.all(...

How can I force the execution of a PHP file in a global scope? -

i have php file, include.php has following contents: <?php $myvar = "foo"; ?> now, want create class, called globalinclude, can include file in global scope: class globalinclude { public function include( $file="include.php" ) { #do smart include $file #do smart } } in it's current form, $myvar variable available inside scope of include function. want like: globalinclude::include( "include.php" ); echo $myvar; output foo any ideas on how can accomplish this? see php: "global" include .

jquery - Embedded iframe within SVG element -

the problem having trying embed iframe within svg element using jquery, , unable iframe drawn. here example stack overflow similar want, except display html snippet: possible embed youtube video in svg? my jquery code this, function showtexttoolbar(selectedgroup){ console.log("here"); var x = +$($(selectedgroup).children().get(0)).attr("x"); var y = +$($(selectedgroup).children().get(0)).attr("y") - 30; console.log(x); console.log(y); var newfosvg = svgeditor.canvas.addsvgelementfromjson({ "element": "foreignobject", "id": "texttool", "attr":{ "x":x, "y":y, "width":"360", "height":"30" } }); var newiframesvg = svged...

Multicore and operating systems -

what changes, if any, operating system need implement take full advantage of multicore systems? ask because i'm doing research on parallel algorithms , scheduler, example, gets in way of more theoretically-driven work. there other issues? thanks. besides has taking full advantage of smp, it's convenient able have knowledge of hierarchy , relative costs, see lwn article scheduling domains .

actionscript - Error playing a frame for the third time -

i have flash file first frame contains 2 buttons, 1 of takes user second frame, , other takes them third frame. @ each of frames, various text fields , variables can manipulated via simplebuttons. both frame 2 , frame 3 have "back" buttons take them frame 1. currently when user navigates frame 1 second time (thus playing third time), second button appears no longer exist, , receive error. both buttons on frame 1 placed via flash ide. why button popping out of existence, when did fine previous 2 times? below code frame 1. "back" buttons simple remove event listeners , call gotoandstop(1) var inited:boolean; var cache:sharedobject; var libsans:font = new libsansreg(); this.addeventlistener(event.enter_frame, frameenter); stats.addeventlistener(mouseevent.click, statsclicked); modules.addeventlistener(mouseevent.click, modsclicked); function initcache():void { this.cache = sharedobject.getlocal("rpg_shooter") } function frameenter(e:event):void...

android - Speed up JSON objects -

i'm using org.json.* library turning web services' result (obviously json) json objects. problem jsonobject , jsonarray constructors take long time build out objects. i'm not passing large amount of data (anywhere between 1 , 100 array items 3-5 keys each), 4 or 5 takes few seconds constructor finish. is there way speed up? there faster library using? there's not whole lot of code show. jsonarray arrayjson = new jsonarray(json); where json string. you might give gson try. article seems indicate has pretty performance on android vs other alternatives. jackson might alternative.

python - Help with creating a custom create and a custom get method -

i have 2 models so: class visit(models.model): id = models.autofield(primary_key=true) name = models.charfield(max_length=65535, null=false) class session: id = models.autofield(primary_key=true) visit = models.foreignkey(visit) sequence_no = models.integerfield(null = false) i'd 2 write custom create method in session model when write this: visitor = vistor.objects.get(id=1) new_session = session.objects.create_new_session(visit=visitor) ...i new record in session table next consecutive sequence number visitor i.e. 3. here's sample data visitor sequence_no ------- ----------- 1 1 1 2 2 1 2 2 1 3 (this row created) the other writing custom method in session model write: visitor = vistor.objects.get(id=1) new_session = session.objects.get_session(visit=visitor, sequence_no=3) ...i previous record of visitor highest sequence number. here's sample data visitor sequence_no ------- --------...

php - Delay in server response, apache2 codeigniter -

noticing long delay in server processing time. application environment is: apache2 ubuntu 10.04 php 5.3 codeigniter 2.1 first call after time causes significant delay codeigniter profiler enabled , gives feedback loading time: base classes 2.7587 controller execution time ( home / index ) 7.2188 total execution time 9.9777 there 2 database active record queries both taking less 10th of second. not using kind of cache. same page on refreshing yields codeigniter profiler loading time: base classes 0.0074 controller execution time ( home / index ) 0.1471 total execution time 0.1545 from +9 seconds tenth of second. time there 2 more database queries (codeigniter session fetch , updtate) there can modify to reduce time when new session started? codeigniter in opposite zend lighted. try comment unused libraries.

Looking for a good GIT solution for Web Project maintained with Visual Studio -

in our environment serving combination of asp , asp.net pages on windows 2003 servers running iis. use visual studio edit pages via frontpage extentions. we enjoy ability make quick edits , save , web updated immediately. don't worry, have development server test of our changes before moving them production server. we not want use "publish site" option if @ possible. i have been using git android (eclipse) projects lately , i'm enjoying it, use git our web site if @ possible. i've have gitextentions installed, along vs plugin , have tried git source control provider. keeping distributed vc mindset, i'd have repo on (and each of developers) pc , commit necessary. the problem is, since editing via http/frontpage (master mode) files not stored locally. i wondering if else in type of environment has implemented successful git workflow. thank you, my solution isn't ideal situation, given dont want step of publishing... i have fi...

cron - How to add a Crontab without user input? -

i trying create program set crontab run program checks server's health. there way create new crontab without user input? i've tried bunch of ambitious things consisting of along lines of $echo "* * * * * /example" >> ~/crontab when run code permission denied error, when running under sudo call. know question similar has been asked on website, there no functional answer. there way automate adding crontabs? or necessary use contab -e , add via text editor? crontab regular text file, can add entries tried. permission issue. either change crontab file permission or set caller script +s permission. p.s. ~/crontab means file located in home directory. if call web user, home located in /var/www

logging - How to log all API calls in Windows the same way Wine does in Linux? -

im debugging windows application in linux using wine (eudora), using winedebugger=+relay create (rather massive) log of api calls. i've spotted problem is, want run same application in native windows (well, virtualbox), see how behaves , compare differences (if any). i know there several windows tools can trace api calls, need 1 can generate same kind of log wine does, can use same workflow: configure logger/tracer exclude given list of functions (as in kernel32.setlasterror; kernel32.getlasterror; kernel32.flsgetvalue; ntdll.rtlentercriticalsection; ntdll.rtlleavecriticalsection , equivalent wine's debug\relayexclude registry entry. crucial, since differnce between 30mb logfile , 1.3 gb one all other calls must traced, regardless of library/module/dll/whatever. must not sorted or filtered module, since order calls made crucial me (so can backtrack , not lost) start tracer tracer c:\programfiles\eudora\eudora.exe 2> hugelogfile.txt it launches eudora, perfor...

javascript - Scope inside constructor -

i have instance of constructor called slideshow , wanted know scope of variable key word var be. understand refers object not sure scope itemwidth be. presume local function if function global mean var inside too? can var itemwidth accessed anywhere else? function slideshow( width, height ){ this.width = width; this.height = height; var itemwidth = 400; } i presume var inside update method part of objects prototype object local function , not global. slideshow.prototype.update = function( dir ){ var dir = value; } function defines scope. declared inside function var local, , visible inside function (or functions declared inside it). in both of examples, var in question visible inside function.

Reading file starting at end in MATLAB -

i wondering if knows how open , read file in matlab begin reading end of file. file being updated (at nonconstant rate between reads) , want read last 6 lines of file each time. i include test verify don't reread same lines twice. each line formatted follows (each variable floating point number): timestamp accx accy accz gyrox gyroy gyroz magx magy magz i trying use fseek, change position last line of file, allows me read last line of file think, not read file backwards unless specify number of bytes, wouldn't know number of bytes exactly. if you're on unix based system (linux/mac), can directly use system commands want. here's sample test file: 12345 accx accy accz gyrox gyroy gyroz magx magy magz 23456 accx accy accz gyrox gyroy gyroz magx magy magz 34567 accx accy accz gyrox gyroy gyroz magx magy magz 45678 accx accy accz gyrox gyroy gyroz magx magy magz 56789 accx accy accz gyrox gyroy gyroz magx magy magz 67890 accx accy accz gyrox gyroy gyro...

How do I get a simple jQuery code to replace my current Javascript -

goal : when click link on navigation show spinning image until script loaded. function ahah(url, target) { document.getelementbyid(target).innerhtml = '<img src="loading.gif" />'; if (window.xmlhttprequest) { req = new xmlhttprequest(); } else if (window.activexobject) { req = new activexobject("microsoft.xmlhttp"); } if (req != undefined) { req.onreadystatechange = function() {ahahdone(url, target);}; req.open("get", url, true); req.send(""); } } function ahahdone(url, target) { if (req.readystate == 4) { // if req "loaded" if (req.status == 200) { // if "ok" document.getelementbyid(target).innerhtml = req.responsetext; } else { document.getelementbyid(target).innerhtml=" ahah error:\n"+ req.status + "\n" +req.statustext; } } } function load(name, div) { ahah(name,div); return false; } on link <a href="w...

linux - Difference between using - and -- as options to set while setting positional params -

in man bash mentioned set has 2 options - , -- i wondering if there difference while using - , -- options set while setting positional parameters. i not find big difference mentioned in man bash when comes usage in setting positional params. the bash(1) man page 4.1.5(1) says: -- if no arguments follow option, positional parameters unset. otherwise, positional parame‐ ters set args, if of them begin -. - signal end of options, cause remaining args assigned positional parameters. -x , -v options turned off. if there no args, posi‐ tional parameters remain unchanged. the first difference when there no arguments after - or -- . former, existing positional parameters unchanged. latter, positional parameters cleared. so set -- clears positional parameters , set - no-op. the -v , -x settings may modified set - ... . so, if had set -v turned on (which causes shell print input lines read), ...

How to access the image at a .jpeg url to a Base64 encoding javascript -

i trying have image insertion system. i've been able local images , images url, need base64 encode url images before transmission server. there anyway it? the local images encoded automatically when read them readasurl. how handle urls in similar fashion? if understand correctly want take url image on web , turn base64-encoded data: url (similarly readasdataurl() return). won't possible because of same-origin policy - images load other sites might contain sensitive data, allowed show them user not read out data. might able if other site cooperates (via cors) doubt want rely on it. won't able implement on client side - should send url server , server should download image.

HTML: Why does Android browser show "Go" instead of "Next" in keyboard? -

i have html login form contains following elements (in order): input type=text (user name input) input type=password (password) input type=submit (login button) why android browser show "go" button in soft keyboard instead of "next" button when focus in text input ? causes user fail login because after entering user name, user presses bottom right button in keyboard (usually correct action) , form submitted empty password, not going work. [this behavior make sense in case browser set remember passwords , password manager able fill in password. however, not case here can test below.] i'd have input type text have "next" button , input type password (the last input before submit) have "go" button. an example of problematic form @ https://peda.net/:login (this form contains code detect "enter" key input , prevents submitting form unless last visible form input focused). do know real fix issue? know if implementing...

iphone - UIWebView stringByEvaluatingJavaScriptFromString Issue -

i working on uiwebview. want add div content loaded webview. that, have written code follows : nsstring *strinputjs = [nsstring stringwithformat:@"var newdiv = document.createelement('div');newdiv.innerhtml = '<h1>hi there!</h1>';document.body.appendchild(newdiv);newdiv.style.height = 100 + 'px';"]; nsstring *strresult = [_webview stringbyevaluatingjavascriptfromstring:strinputjs]; but not working. tried same javascript html page follows : <html> <head> <title>jstrial</title> </head> <body> <script> var newdiv = document.createelement('div'); newdiv.innerhtml = '<h1>hi there!</h1>'; document.body.appendchild(newdiv); newdiv.style.height = 100 + 'px'; </script> </body> </html> i opened html page in safari browser, safari browser in iphone simulator. worked well. the web v...

javascript - group radio buttons and toggle input controls using jQuery -

i want show textboxes of selected radiobutton only. works such. problem when click on textbox type anything, toggle. , radio button selection doesn;t change current selection. please find detailed code below <html> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"> </script> <script> $(document).ready(function() { $(".userid_textbox").hide(); $(".userid").click(function() { var kid=$(this).children(".userid_textbox"); var dad=$(this).parent(); var toggledkid = $(dad).find('.toggle'); $(kid).addclass("toggle").show('slow'); $(toggledkid).hide('slow').removeclass('toggle'); }); }); </script> </head> <body> <div class="contentbox tp"> <h1 class="heading">sites list</h1> <div style="float:left;margin-right:185px;" class="useri...

c# - Difference between System.DateTime and System.DateTimeOffset -

can explain difference between system.datetime , system.datetimeoffset in c#.net? best suited building web apps users different time zones? a datetime value defines particular date , time, includes kind property provides limited information time zone date , time belongs. the datetimeoffset structure represents date , time value, offset indicates how value differs utc. thus, value unambiguously identifies single point in time. datetimeoffset should considered default date , time type application development uses datetimeoffset values more common datetime values. see more info, code examples at: http://msdn.microsoft.com/en-us/library/bb384267.aspx

No Method Error - Rails 3 -

currently working on project, , have ran dead end following error: you have nil object when didn't expect it! might have expected instance of array. error occurred while evaluating nil.each i did research , found possibly because of pluralization. code follows: <h1>listing expectedd schedules</h1> <table> <tr> <th>from</th> <th>to</th> <th>state</th> <th>delivery time</th> <th>collection time</th></> <th>edit</th> </tr> <% @schedules.each |schedule| %> <tr> <td><%= schedule.from_location_id %></td> <td><%= schedule.to_location_id %></td> <td><%= schedule.schedule_type %></td> <td><%= schedule.delivery_time %></td> <td><%= schedule.collection_time%></td> ...

jsf 2 - Browser-dependent CSS switch with JSF -

i need browser specific css in jsf2 application (mojarra 2.1, tomcat 7). i tried adding template: <!--[if ie 8]> <link rel="stylesheet" type="text/css" href="#{cfgs.externalcssurlie8}" /> <![endif]--> but comments not rendered since use: <context-param> <!-- removes comments rendered html pages. --> <param-name>javax.faces.facelets_skip_comments</param-name> <param-value>true</param-value> </context-param> my problem... when disable `javax.faces.facelets_skip_comments, bunch of other problems.. don't think source-code comments belong generated pages. i tried put switch in cdata like: <![cdata[ <!--[if ie 7]> <link rel="stylesheet" type="text/css" href="#{cfgs.externalcssurlie7}" /> <![endif]--> ]]> but inner < rendered html entities.. :-/, not working. question: there other solu...

ios - How to simply store some files -

i'm developing app needs show logos. these logos 8kb png files, , i'm going handle little amount of them (10-20 @ most). however, these downloaded internet because might change. so, i'm trying achieve is, making app download them (done), storing them file system, , downloading again whenever change (might months). everyone seems use core data, in opinion designed bigger , more complex things, because files have same name plus don't have relations between them. is file system way go? tutorial? yes, file system best option this. you've implemented downloading. how have done so? nsurlconnection ? if so, @ point, have nsdata object. has couple of write ... methods can use save data file on filesystem. sure save files in right place , app sandboxed , can't write anywhere like.

asp.net - Event of dynamically created Control not firing -

i'm having problem web control dynamically created , inserted in page. create couple of linkbuttons, depending on data of search made, , i'm trying add event handler each of buttons, filter result. the controls initialized properly, event never fired. private sub page_init(byval sender system.object, byval e system.eventargs) handles mybase.init controls.clear() dim btn controls.localizablelinkbutton each element generic.keyvaluepair(of string, resultfilterdata) in m_list btn = new localizablelinkbutton btn.id = m_name & "$lnk" & count btn.label = element.value.label.append(" (" + cstr(element.value.count) + ")") btn.commandargument = element.value.key addhandler btn.click, addressof me.btn_click controls.add(btn) next end sub since code in page_init controls should recreated on postback. (the localizablelinkbutton extension of linkbutton add multilingual features text). the problem method btn_...

image - take picture from android camera and send it to web server -

im build apps call camera activity.. im take picture apps , send web server.. but can't image path.. im getting nullexception error when try image path.. here's code when calling camera activity : intent camera = new intent(mediastore.action_image_capture); this.startactivityforresult(camera, picture_result); and code activity result : @override protected void onactivityresult(int requestcode, int resultcode, intent data) { if (requestcode == picture_result){ if (resultcode == activity.result_ok) { takepicture(data); } else if (resultcode == activity.result_canceled) { } } } protected void takepicture(intent data) { bundle b = data.getextras(); pic = (bitmap) b.get("data"); if (pic != null) { imagepicture.setimagebitmap(pic); } } is there wrong code? thanks ok, see problem. you're not setting path begin with. please @ doc. http://developer.android.com/referen...

python - DLL not loaded from documented search path -

i have process loading dll place not listed in documented search order (docs linked below). want know why. here's description of setup: i have folder 'c:\foo' containing a.dll , b.dll. i have python script stored in c:\foo. the python script loadlibrary('c:/foo/a.dll') (via ctypes) a.dll linked against import library b.dll (ie using implicit linking). i run python script current directory of, say, c:. anything. b.dll loaded c:\foo, though isn't on search path. looking @ process monitor trace, can see documented search paths tried first, , failed. python process tried , failed open "c:\windows\assembly\gac\microsoft.vc80.crt.mui\8.0.50727.4053_en-us_1fc8b3b9a1e18e3b\microsoft.vc80.crt.mui.dll", then opened c:\foo\b.dll. so, seems a.dll's directory being searched b.dll though docs don't should be. also, happens after looking on system path, mad. can shed light on this? the same thing happens matlab script uses a.dll. i'm...

javascript - Change direction of animation -

i using cloud effect http://solidgiant.com/2011/02/awesome-cloud-effect/ want change direction of cloud movement. want them move right left, can me this i done change in direction told nishchay sharma, still 1 problem there, clouds doesnt run in loop.. gte stuck when reach left side :( in clouds.css, change: #cloud { ... left: 5%; ... } to #cloud { ... left: 80%; ... } and in clouds.js change $("#cloud") .animate( { left: $("#sky").width() }, cloudmoved ? 180000 : 150000, "linear", function() { $(this) .css("left", parseint($(this).css("width"))) cloudmoved = true; cloudmove(); } ) to $("#cloud") .animate( { left: 0 }, cloudmoved ? 18...

android - How do I start another activity from UncaughtExceptionHandler.uncaughtException() method? -

possible duplicate: using global exception handling “setuncaughtexceptionhandler” , “toast” i have implemented uncaughtexceptionhandler in oncreate() in 1 of activities. in uncaughtexception() method trying open activity erroractivity parameter (error msg , stacktrace). activity should show (ment globaly) alertdialog , handle logs etc. can 1 tell me why erroractivity doesnt open while code in oncoughtexception gets executed? suspect problem thread related. here first activity (simulating exception in oncreate() ) public class mainactivity extends activity { globalsettings settings; @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); thread.currentthread().setuncaughtexceptionhandler( new uncaughtexceptionhandler() { @override public void uncaughtexception(thread thread, throwable ex) { intent intent =...

Can PHP be set to never cache a response, and always send something fresh to the page? -

i have webpage pulls in xml news feed , don't want page cache xml feed displayed recent. i tried cache reset every 1800 seconds: $header[] = "cache-control: max-age=1800"; didn't seem work. so try make webpage auto refresh xml in php? try this, <?php header("cache-control: no-cache, must-revalidate"); // http/1.1 header("expires: sat, 26 jul 1997 05:00:00 gmt"); // date in past ?> this prevent page being cached on user's machine.

wpf - Silverlight: Missing DependencyObject.CoerceValue -

in silverlight there no dependencyobject.coercevalue. looking alternative, following wpf-code in silverlight. the situation: there class range, has several dependencyproperties: minimumproperty, maximumproperty, lowervalueproperty , uppervalueproperty. minimum may never greater maximum, maximum never smaller minimum. lowervalue , uppervalue have in between minimum , maximum, whereas lowervalue smaller uppervalue. all dependencyproperties implemented (in wpf): public static new readonly dependencyproperty minimumproperty = dependencyproperty.register("minimum", typeof(double), typeof(range), new frameworkpropertymetadata(0d, new propertychangedcallback(range.onminimumchanged), new coercevaluecallback(range.coerceminimum)), new validatevaluecallback(range.validateminimum)); public new double minimum { { return (double)base.getvalue(minimumproperty); } set { base.setvalue(minimumproperty, value); } } the c...

objective c - Creating a NSSortDescriptor using a given locale -

i'm using nsfetchrequest access persistent store, pass nssortdescriptor. content sorted in norwegian, want always sort using "nb-no" locale, no matter user preferences. right i'm using system locale determine sorting: nssortdescriptor *sorting = [nssortdescriptor sortdescriptorwithkey:@"title" ascending:yes selector:@selector(localizedcaseinsensitivecompare:)]; what's simplest/cleanest way this? select project--> info ---> set "localization native development region" "nb-no". dont forget add specific localisaation files project. :) if want sort according device language below code // using fetch request -(nsfetchrequest*)returnfetchrequest:(nsfetchrequest*)fetchrequest { nsentitydescription *entity = [nsentitydescription entityforname:@"your entity name" inmanagedobjectcontext:your context]; [fetchrequest setentity:entity]; // edit sort key appropriate. nssortdescriptor *sortde...

mysql - PHP first active button -

i have little question you! i make selection mysql buttons example: $query = mysql_query("select * navigation"); while ($row = mysql_fetch_assoc($query)) { echo '<a href="?id=$row['id']">$row['name']</a>'; } so call navigation mysql , have class in css called .active, class make active button when click it, how can make first button active? $query = mysql_query("select * navigation"); while ($row = mysql_fetch_assoc($query)) { if ($row['id'] == $_get['id'])) { echo '<a class="active" href="?id=$row['id']">$row['name']</a>'; } else { echo '<a href="?id=$row['id']">$row['name']</a>'; } } try this. <?php $query = mysql_query("select * navigation"); $first = true; while($row = mysql_fetch_assoc($query)) { if ((!array_key_exists...

asp.net - "The name 'HTML' does not exist in the current context" in MVC 3 Views -

i´m starting use "mvc 3" i´m facing little problems. in views, when code this: @if(request.isauthenticated) { <text>welcome <b>@context.user.identity.name</b>! [ @html.actionlink("log off", "logoff", "account") ]</text> } else { @:[ @html.actionlink("log on", "logon", "account") ] } the objects @request , @html indicating error: the name 'html' not exist in current context . the same occurs @context, @viewbag, @layout, @url , others. see: image http://i56.tinypic.com/28s1smp.jpg but code correctly compiled no errors. problem cannot use intellisense theses objects in views. normal? (i don´t think so). happening? i have reinstalled mvc 3 framework same still occurs. note: new project scratch, not mvc 2 migration. occurs both razor engine , aspx. this web.config in views folder: <?xml version="1.0"?> <configuration> <configse...

javascript - To get the details of action performed on HTML element by jQuery -

i have page lot of html elements , want script captures action , on element performed. <script type="text/javascript"> $(document).ready(function() { $('*').bind('click dblclick mousedown mouseenter mouseleave', detectevent); function detectevent(e) { alert(e.type); } }); </script> but script doesn't provide requirement. check out visual event . give events attached on page loads of information them

javascript - Extending the defaults of a Model superclass in Backbone.js -

i pose question this answer can't seem so, apologize. extending defaults subclass reflected in superclass. seems defeat purpose , i'm more apt explicitly list superclass' defaults in subclass structure i'm looking for. var inventory = backbone.model.extend({ defaults: { cat: 3, dog: 5 } }); var extendedinventory = inventory.extend({ }); _.extend(extendedinventory.prototype.defaults, {rabbit: 25}); var = new inventory(); var ei = new extendedinventory(); console.log(i.attributes); console.log(ei.attributes); this outputs: {cat: 3, dog: 5, rabbit: 25} {cat: 3, dog: 5, rabbit: 25} not (nor, assume, op ) want: {cat: 3, dog: 5} {cat: 3, dog: 5, rabbit: 25} the problem inventory.prototype.defaults , extended.prototype.defaults has same reference, because have not override reference. so can in 2 ways, maybe more found 2: edit: first example incorrect (see comments); please refer second. var extendedinventory = inve...

c++ - Finding out name decoration -

Image
i have activex dll integrating standard third party client. achieve this, had include custom def file, proxy linker, , self-initialize com libraries. when test activex dll client created, run fine. however, when include activex dll third party client, crashes in function calls. believe crashing result of mismatch in naming decoration. is there way can verify name decoration third party client program requires? thanks, dependency walker can show exported dlls: http://dependencywalker.com/ however, if there name mismatch error or exception. more passing bad parameter. [edit] dependency walker shows external functions being called , tries match them dll:

java - SQLite DB is locked exception, how do I unlock it if I haven't ever toyed with it? -

java.sql.sqlexception: database locked @ org.sqlite.db.throwex(db.java:288) @ org.sqlite.nesteddb.prepare(nesteddb.java:115) @ org.sqlite.db.prepare(db.java:114) @ org.sqlite.stmt.executequery(stmt.java:89) when make query exception. read on on sa , google, , common conclusion started making query never finished. problem i'm having i've never made query on db on machine before. downloaded db file hosted (i created earlier) , haven't done it, don't know why locked. when query using program called sqlite database browser, works fine. help, i'll provide more info if need be, let me know. adapter = new dbadapter(); resultset info; resultset attributes; (int = 1; < 668; i++) { if (i%50 == 0) { system.out.print('.'); } info = adapter.makequery("select * vehicles id = '" + + "'"); attributes = adapter.makequery("select * vehicle_moves vehicle_id = '" + + "'");...

javascript - Convert number from text field to proper USD -

i have script on leaving text field onblur="fora();" converts user input number "number + usd" looks unprofessional. script is: <script type="text/javascript"> function fora() { document.getelementbyid('field1').value = document.getelementbyid('field2').value +" usd"; } </script> so converts " 12345.75 " " 12345.75 usd ". ughh. do know how can convert number proper self? 12345.75 $12,345.75 my second, related question in same vain... onclick="document.getelementbyid('field1').value = (math.round((parsefloat(document.getelementbyid('11091').value,2)*100))/100 + math.round((parsefloat(document.getelementbyid('1254.75').value,2)*100))/100).tofixed(2);" can value field1 (12345.75) converted "$12,345.75" thanks in advance. function fora() { document.getelementbyid('field1').value = "$" + addcommas(doc...

flex3 - setting Flex Panel title and status colors dynamically -

i updating older project, written in flex 3 new functionality , cant figure out how appears simple. i passing in data panel via xml , binding properties of panel xml, example: <mx:panel label="{_data.@label}" title="{_data.@title}" bordercolor="{_data.@bordercolor}"/> my question simple: how set panel title , status colors using data passed in xml? you can set titlestylename name of styledeclaration no styles titlecolor or statuscolor. you use statusstylename , titlestylename specify css style name can specify color.

openxml - How can I use an existing styles.xml without writing code to recreate it -

i'm generating word document using open xml sdk. right have function generates style definitions in code. since these styles going change infrequently , have no real meaning code there way can include existing styles.xml in wordprocessing document? overload of style constructor accepts string containing xml throws exception when feed existing file.

jquery - adjusting width of a main div after hide/show of another div -

i have main div contains 2 divs. 1 main content , 1 sidebar content. sidebar content hidden/shown on clicking 1 link. when sidebar hidden, want content div occupy whole space container div. when sidebar content shown, should give space sidebar on left , adjust itself. here code . right implementing using jquery. not sure if there better way it. thanks you're there. i've updated code. want put sidebar first, float them both left, , rid of width defined on main content. <div id="container"> <div id="sidebar"> sidebar content </div> <div id="maincontent"> main content </div> </div> #maincontent { float: left; border: 1px solid green; height: 400px; } #sidebar{ float:left; width:200px; border: 1px solid blue; top:10px; height: 200px; }

documentation - sproutcore 2 docs -

i'm experimenting sproutcore 2, looking @ example find many classes not covered in docs. i know project still alpha docs not complete. wondering if there way know classes , methods there! there other docs around or solution @ source? thanks the possibilities know official blog posts , github repository sproutcore 2.0. if open tag beta1 , navigate package directory know modules moved sproutcore 2. moreover, can generate 2.0 api documentation on on. see readme in docs folder on github further details. there generated docs , guides http://docs.sproutcore20.com/ http://guides.sproutcore20.com/ that cover 2.0 stuff, take care api docs example generated on may, 25 2.0 alpha. there chance things changed. if generate docs on own, latest version.

c++ - Overlapping source and destination blocks in memcpy with boost -

can explain me why on c++ simple code valgrind returns this . first problem boost:regex. when use subpattern question mark (for optional matching) valgrind return: source , destination overlap in memcpy (line 8) second problem std::string::erase. i have no idea doing wrong. seems library code using memcpy when, strictly portable, should using memmove . for compiler's library, std::string, ok code doesn't have portable other compilers, , can use knowledge how specific implementation works. with boost library, have trust know doing. library has lot of configurations different compilers , might use specific g++ extension.

c# - Windows Forms: Binding DataGridView RowCount property to a label -

i'm trying bind rowcount property label output current number of rows displayed in datagridview user. i tried following: lblarticlecount.databindings.add("text", datagrid, "rowcount"); first seems gonna working way want when datagridview gets updated , more or less rows in it, label still stays same. not display new count of rows. looks i'm on wrong way. how solve it? aim avoid react events set new count label manually. isn't there way? thanks. you must implement http://msdn.microsoft.com/en-us/library/system.componentmodel.inotifypropertychanged.aspx

How to use COUNT to get zero values with mysql? -

i read several questions issue on stackoverflow : seems count should used right joining display sums of every items, including ones summing zero. i'm not able make case, after several hours of headache... well, have 2 tables. first 1 called "words2", list of words. second 1 called "links2". it's linking 2 words : idword1 , idword2. (there no links linking 2 identical words) for each word, know how many links used, if there no link. this query : select *, count(*) qty ( select * words2 left outer join links2 linksa on words2.idword = linksa.idword1 union select * words2 left outer join links2 linksb on words2.idword = linksb.idword2 ) tmp iduser = 3 , linktype = 'individual' group word order word it works fine unless don't have results unused words, not displayed. thank help! to original query change count call count(idword1) . cause count number of times idword1 not null. right counting...

security - Where do I salt and hash my Passwords? At the client or at the host? -

i think smarter salt , hash passwords directly on client's machine. reason is, never want password of user. string should secret him, not both of us. argued, want keep salt secret, can not send in clear text on channel. apparently, not case . don't see reason, why shouldn't request hash client side. think? edit discuss issue of sending clients password host not directly issue. issue client send password out of computer @ all. optimistic client may assume computer save territory. going out of cable (or antenna) eve's territory. can never too paranoid in security scenario. again: password should never leave clients computer! sending either passphrase or hash lets attacker record hash , use in replay attack. you want use challenge/response protocol, means send out random number. client encrypts (or keyed hash on) random number using hash of passphrase key, , sends result. same, , see of 2 match. this lets verify matching keys without every sending ke...

javascript - Invoking a function in an iframe from the parent window -

i can't figure out i'm doing wrong here. i building website no server-side have main page iframe , on button click want iframe's src change , function in invoked passed parameter. the function not called reason. here's code: the iframe: <iframe id="main_area_frame" name="main_area_frame" src="" frameborder="0" width="100%" height="100%"></iframe> the onclick function: function onsubmenuclick(images) { //set images frame main_area = document.getelementbyid("main_area_frame"); main_area.src = "imagesframe.html"; main_area.contentwindow.initializeimages(images); } the function in iframe(imagesframe.html): function initializeimages(imagesstr) { alert("initializeimages"); ... } some weird things noticed that when adding alert before main_area.contentwindow.initializeimages(images); function somehow called successfully. ...

Android screen never turns off -

i have problem android app, doesn't seem let screen turn off ever. cause it? isn't screen supposed turn off depending on user's settings? thanks help! are sure none of views uses android:keepscreenon

javascript - Rendering and jaggering -

i have html 5 canvas using 2d context. able 120 frames per second, rendering can jagged, animation jumps. know ideas may causing it, such high (but pointless) frame rate? known ways or smoothing out animation well? the thing come mind, actual drawing not being accounted for. while updating , drawing functions can run quickly, painting onto canvas stacked later. imply not geting true frames per second. although, can 120 frames per seconds means nothing. because using settimeout , have not guarantees time constant, thus, when jagger, because frame rate, moment, has dropped significantly. however, there alternative in works, managed found. i'm bit surprised how hard find. http://paulirish.com/2011/requestanimationframe-for-smart-animating/ https://developer.mozilla.org/en/dom/window.mozrequestanimationframe http://dev.chromium.org/developers/design-documents/requestanimationframe-implementation from can understand, function allows browser optimise animations. in ...