Posts

Showing posts from May, 2013

.net - Can I prevent WCF from rolling back the transaction when a fault is thrown? -

consider following wcf service participates in distributed transaction. normal behavior of wcf roll transaction if fault occurs. there way override behavior? service contract: [servicecontract] public interface itestservice { [operationcontract] [faultcontract(typeof(testservicefault))] void throwerror(); [operationcontract] void dosomething(); [operationcontract] void dosomethingelse(); } [datacontract] public class testservicefault{} service implementation: class testservice : itestservice { [operationbehavior(transactionscoperequired = true)] [transactionflow(transactionflowoption.mandatory)] public void throwerror() { throw new faultexception<testservicefault>(new testservicefault()); } [operationbehavior(transactionscoperequired = true)] [transactionflow(transactionflowoption.mandatory)] public void dosomething() { // // ... // } [operationbehavior(transactionscoper...

Rails getting undefined method for existing field in database -

so have field in question table, called is_public..i migrated database, restarted , when error everytime call is_public record in question records. undefined method `is_public' #<question:0x7e9aa780> any ideas why happening ? are using attr_accessible? if so, add :is_public list.

.htaccess - html w/php powered pages not displaying; downloadable? -

when try load php inside html page, somepage.html ... brings download box. addhandler application/x-httpd-php .html addtype application/x-httpd-php html those generated in cpanel still shows download box instead of code. what do? also additional information: apache version 2.2.17 php version 5.3.4 not sure, can try: addtype application/x-httpd-php .php .htm .html addhandler x-httpd-php .php .htm .html took blog post. edit: saw you're using php inside .html files. can't change extension?

ODBC and DB2 stored procedures from C#: Routine not found -

i seem have come across short coming odbc , db2 when running stored procedures. seems not possible return data stored procedure, , have prexisting query need use. has got around particular issue? thanks in advance update the code calling follows (assuming connection opened): string basesql = "call b6009822.o#04666803.put"; odbccommand command = new odbccommand(basesql, myconnection); command.commandtype = commandtype.storedprocedure; command.parameters.add("@owner", odbctype.varchar).value = "mh"; int rows = command.executenonquery(); myconnection.close(); i following error .. error [hy000] [ibm][system access odbc driver][db2 i5/os]sql0440 - routine put in o#04666803 not found specified parameters. it seems objecting catalog/library , procedure name. idea on need procedure called ? second update - real example string basesql = "{ call b6009822.o#04666803.put(?,?,?,?,?,?,?,?,?) }"; odbccommand command = myconnection.cr...

entity framework - Code First CTP5 Many To Many Binding -

i have been using code first approach entity framework. have event class, band class , eventbands class maps many many relationship. code first approach worked fine (when didn't have eventbands class) decided wanted many many table store additional values. error message: system.data.edm.edmentitytype: : entitytype 'eventbands' has no key defined. define key entitytype. system.data.edm.edmentityset: entitytype: entityset eventbands based on type eventbands has no keys defined. it obvious error message means. resolution isn't obvious. think have override model binding method not entirely sure how map keys approach. any appreciated, have included classes in question below. thanks in advance, jon event: #region properties private int eventid; public int eventid { { return eventid; } set { eventid = value; } } private string name; public string name { ...

java - Velocity + Spring -

i attempting setup webapp above components. i've jumped last hurdle integrating spring & velocity tools. saw this post morning, , updated different answer provided. however, once attempted add in parametertool 1 of templates so: #foreach( $key in $params.keyset() ) $key = $params.getvalue($key) <br /> #end i receive npe java.lang.unsupportedoperationexception: request null. parametertool must initialized first! according i've read means tooling configured properly, doesn't have access request. note: receive error accepted solution well. has been able use these tools spring? seems it's known deficiency there open jira open jira spr-5514 a modified version of the accepted answer this question resolves issue. instead of returning viewcontext need return viewtoolcontext. need prepare toolboxes , set them on session / request applicable: you need initialize toolcontext in whichever manner need (look @ provided answer here on ho...

jQuery Hover Problems -

i've got problem jquery. want display div when hover on element , hide when aren't on it. $(function() { $('#projects').hover(function() { $('#projects .pane').show(200), $('#projects .pane').hide(200); }) }); when hover disappears same time. thanks :) your code should this: $(function() { $('#projects').hover(function() { $('#projects .pane').show(200); }, function(){ $('#projects .pane').hide(200); }); }); the hover expects 2 function parameters. 1 when mouse on , other 1 when mouse away.

Compiling a Java applet (Mac OSX) -

i'm working on applet works fourier's series. doesn't matter because question java applet compilers. is there way compile .java files on mac osx. tried terminal can't find why code doesn't compile well. i'm trying open-source code http://www.falstad.com/fourier/ if you, java devs take @ this, thankful ! perhaps worth read, apple's java development documentation . essentially, basics need creating applets (compiler, api, docs) present on mac. rather trying run things through terminal though, should consider perhaps installing ide make things bit simpler you. popular choices on mac osx include (in no particular order) xcode , netbeans , eclipse , , intellij . prefer netbeans, haven't tried intellij can't comment ease of use.

c# - Is it a good practice to have a package/namespace and class within with the same name? -

i creating new namespace , apt name 1 of class seems same name namespace. practice? if not, alternative? for example: com.person |--- person.(java/cs) |--- persondetailchecker.(java/cs) |--- personnamegenerator.(java/cs) related questions discussing same issue: should class have same name namespace? how avoid having same name class , it's namespace, such technology.technology? i try avoid that, since can make code harder read eric lippert has written article this, can find here: part 1 , part 2 , part 3 part 4 i've made mistake myself few times, , made harder read of code.

mysql - Database design - best way to store templates and instances -

our database calls having templates, instance having meeting template group of people attend meeting along base meeting name. meeting can "instantiated" can make copies of meeting , modify attributes. best ways can think of doing to: store "instances" in same table , store related information similarly. make different tables same attributes , store templates in 1 table , "instances" in table. how using 1 table, adding flag field "istemplate" table, serve identify record default or 'template' record. you create new record has default parameters, , set istemplate "1" or true or yes or whatever. when creating new meeting, create copy of template, so: insert meetings(place,people,time) (select place,people,time meetings istemplate = '1') if have multiple templates, list of available templates as: select * meetings istemplate = '1' and instantiate 1 of templates primary key rather 'is...

C# Remote application execution -

i'm trying create sort of remote application execution programs. situation have script on remote pc need execute. ideally being able tell remote pc execute script though @ locally. if possible executable without need login pc (such sending login details etc). i'm going using .net c#. the best code code don't have write yourself. take @ psexec microsoft (sysinternals). assuming have common credentials remote machine (either virtue of domain login or same password , username), should "just work".

C++, copy set to vector -

i need copy std::set std::vector : std::set <double> input; input.insert(5); input.insert(6); std::vector <double> output; std::copy(input.begin(), input.end(), output.begin()); //error: vector iterator not dereferencable where problem? you need use back_inserter : std::copy(input.begin(), input.end(), std::back_inserter(output)); std::copy doesn't add elements container inserting: can't; has iterator container. because of this, if pass output iterator directly std::copy , must make sure points range @ least large enough hold input range. std::back_inserter creates output iterator calls push_back on container each element, each element inserted container. alternatively, have created sufficient number of elements in std::vector hold range being copied: std::vector<double> output(input.size()); std::copy(input.begin(), input.end(), output.begin()); or, use std::vector range constructor: std::vector<double> output(inpu...

Java performance multi-core testing environment -

i interested in learning as can tuning multi-threaded java server on multi-core machine. wanted write test servers use test different scenarios. example thread pool sizing. unfortunately don't have access large multi-core unix (linux or solaris) machine. have duo-core mac laptop. are there lease options dedicated, 8 16 core machine, distribute java test servers? get amazon ec2 quadruple large (u$d 1.60 per hour). dual quad core computer, , each core can run 2 threads, total of 16 threads. you can more information here http://aws.amazon.com/ec2/pricing/ http://aws.amazon.com/ec2/hpc-applications/

Looking for a testing pattern/approach capable of handling different platforms/versions -

there 'code', being developed continuously. there testing server, server uses 'test code' test 'code' in different platforms. question involves 'test code'. as said, server tests different platforms. happen, test code needs able handle different platforms. getting hard keep track of little 'differences' arise because of usage of different platforms. , gets more complicated, because platforms can have different versions and.. have test mixing of interchangeably. right now, doing like: test1() if(platform == 'a' && version == '1.4') assert('bla',bla) else if(platform == 'a' && version == '1.5') assert('ble',bla) else if(version == '1.6') assert('blu',bla) ..... now, imagine 100x more complicated, , may see dealing right now. asking if out there knows pattern/approach handle more elegantly or robustly, if involves codin...

Issue with image having transparent background in Android -

Image
i'm creating custom dialog background image has rounded corners. remove white border using custom style, it's displayed if black rectangle of same size behind image, shown below (the background image of dialog brown one): how can keep transparent background of image round corners? layout of dialog: <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/confirmation" android:orientation="vertical" android:background="@drawable/dialog_background" android:layout_width="279dp" android:layout_height="130dp" > ... i remove white border applying following style dialog: <style name="theme_dialog_translucent" parent="android:theme.dialog"> <item name="android:windowbackground">@null</item> </style> my customdialog class is: public class customdialog extends dialog implements onclicklistener { button okbutton; ...

parsing - Using Regex to find values in a file -

i'm not looking syntax help, per say, approach advice. here's need do: i need read text in file containing moves (this part of chess game project) , print out move performed. here's example text i'm using text file: edit: clarify, these each represent move. i.e. rla1 means white room moved a1, nlb1 means white knight b1, etc. rla1 nlb1 blc1 qld1 kle1 blf1 nlg1 rlh1 pla2 plb2 plc2 pld2 ple2 plf2 plg2 plh2 rda8 ndb8 bdc8 qdd8 kde8 bdf8 ndg8 rdh8 pda7 pdb7 pdc7 pdd7 pde7 pdf7 pdg7 pdh7 b1 c3* b2 b3 d8 h4 and here should output example input: a white rook placed on a1 , white knight placed on b1 ... etc white pawn ... etc black rook ... etc black pawn ... etc piece on b1 moves c3 , captures piece there , piece on b2 moves b3 , piece on d8 moves h4 obviously i'll use tostring() method override print moves out, need know how should go parsing input regex determine each move is. again, not looking syntax advice on how should approach problem (pseudo) ...

mysql - Match single input and two database fields -

i'm building search form website, single input fields (name , lastname) , need match against 2 database fields (name_field , lname_field). users can type in name first or lastname (or lastname) prefer. thank you assuming user inputs null when not used: select * yourtable name_field = coalesce(@name, name_field) , lname_field = coalesce(@lastname, lname_field)

excel - Help with VBA Script -

firstly newbie vba pseudocode trying is: open excel files copy values in colomns a,b, c , d append tab 1 of output.xls i appreciate pointers in right direction. thanks sometimes best way learn record macro. tools > macros - choose record. then workbook, select columns a,b,c,d ctrl+c, open new tab , ctrl+v. stop recording macro, alt+f11 see generated code, should give starter ten. if need understanding generated code / come , can explain.

asp.net - Precompilation for Deployment -

after exploring precompilation deployment topic want enhance build process. now, is: prepare web site using web 1 click publish, instance c:\www\app directory, , directory available in iis via app ( localhost/app ) i launch aspnet_compiler.exe -v app c:\www\appprecompiled -f now have ready precompiled application in c:\www\appprecompiled , fine. application quite big, , publishing (step 1) take 5 minutes scratch. wonder if possible avoid step 1 , , perform step 2 (precompilation) source folder pointing solution folder. tried this: aspnet_compiler.exe -v codeapp c:\code\app -f where c:\code\app folder web.config etc files, it's project web site , folder avaliable via http://localhost/codeapp . but when launching command, errors missing global.asax or web.config errors: c:\code\app\obj\debug\package\packagetmp\web.config(18): error aspconfig: error use section registered allowdefinition='machinetoapplication' beyond application level. error...

optimization - Optimizing assignments based on many variables -

i talking in resource management , discussed problem of assigning developers projects when there many variables consider (of possibly different weights), e.g.: the developer's skills & technology/domain of project the developer's travel preferences & location of project the developer's interests , nature of project the basic problem rm person had deal on regular basis this: given x developers each developers has unique set of attributes/preferences, assign them y projects each project has own set of unique attributes/requirements. it seems clear me mathematical problem; reminds me of old optimization problems algebra and/or calculus (i don't remember which) in high school: know, find optimal dimensions container hold maximum volume given amount of material—that sort of thing. my question isn't math, rather whether there software projects/libraries out there designed address kind of problem. know of any? my question isn't math, ...

sql - oracle: why cant i insert into view -

i created simple view columns single table. when try insert values table, ora_01732 error dml not legal on view. have order clause in view definition i've gathered not allowed inherently updatable , i'm seeing have use instead of type clause in view definition. can show me how build view updatable way? here create view statement: create view cust_view select customer#,firstname,lastname,state book_customer order state, lastname; are sure order by cause observation? i can insert on view order clause: create table tq84_table ( number, b number ); create view tq84_updateable_view select a, b tq84_table order a; insert tq84_table values (4,1); insert tq84_table values (1,4); insert tq84_table values (3,9); insert tq84_table values (7,5); select * tq84_updateable_view; insert tq84_updateable_view values (1,9); select * tq84_updateable_view; the above statements run no problem on oracle 11 r2. you might want check user_updatable_columns columns c...

objective c - Cocos2d update:(ccTime)dt giving screwed up values -

inside of class subclasses ccnode , have scheduled -update:(cctime)dt method. have bunch of behavior objects don't subclass ccnode , have -update:(cctime)dt method. here's inside of ccnode 's update method: -(void)update:(cctime)dt{ for(behavior *currentbehavior in behaviors){ [currentbehavior update:dt]; } } when nslog dt value passed ccnode 's update , prints out normal values (0.116699, 0.162726). however, when nslog dt value inside behaviors' update methods, printed numbers of sudden screwed (0.000, 36893488147419103232, -2.000). it's strangest thing. when debug it, i'll see first dt value normal, , i'll step inside behavior's update , , value change crazy. what's going on? i figured out. didn't have -update:(cctime)dt in behavior class's .m file, , theory took complier time method selector, therefore screwed cctime.

rest - Proper Routing in Rails for a diverse set of tools -

i trying clean routes , have situation not sure with: i have number of tools & reports spread across variety of controllers basicially collections revolve around 2 parameters: divisions , term. i wanted this: resources :divisions resources :terms scope "/tools" #something redirect controller "carriers" , action "carrier_distribution" #something redirect controller "courses" , action "secour monitor" end end end most of resources interested in nested within division. it clean & helpful have url this: /divisions/1/terms/1/tools/carrier_distribution i have option make "tools" controller kick stuff off. not sure appropriate (like if should stick passing term parameter). thanks! personally i'd go toolscontroller, , map in routes: map.connect "/divisions/:division_id/terms/:term_id/tools/:action", :controller => "tools" then toolscontroller c...

Azure Diagnostics doesnt transfer IIS logs to blob storage -

ok, have been banging head on 1 while, figure ask if has encountered before. my configuration , setup below. when deployed staging environment. know logging happening because enabled rdp , able go in , can see iis logs created. not transfer blob storage, though other diagnostics logs without problem. in infrastructure logs can see following error, i'm told proxy , not relevant: winhttpgetproxyforurl(http://mystorage.blob.core.windows.net) failed error_winhttp_autodetection_failed (12180) the other warning see in event viewer is: -<event> -<system> <provider name="microsoft-windows-iis-w3svc-wp"guid="{670080d9-742a-4187-8d16-41143d1290bd}"eventsourcename="w3svc-wp"/> <eventid qualifiers="32768">2283</eventid> <version>0</version> <level>3</level> <task>0</task> <opcode>0</opcode> <keywords>0x80000000000000</keywords> <timecreated...

continuous integration - XmlMassUpdate Multiple Values (MSBuild Community Tasks) -

say have config file following settings: <somenode> <node>value a</node> <node>value b</node> <node>value c</node> </somenode> for life of me, can't figure out how xmlmassupdate inject following: <somenode> <node>value 1</node> <node>value 2</node> <node>value 3</node> </somenode> the result looks this: <somenode> <node>value 1</node> <node>value b</node> <node>value c</node> </somenode> what i'm shooting is: <somenode> <node>value a</node> <node>value b</node> <node>value c</node> <node>value 1</node> <node>value 2</node> <node>value 3</node> </somenode> edit: found temporary solution (see below)... still interested in better, though. <somenode> ...

java - Using round robin algorithm to calculate time needed -

maybe out there feeling friendly , find brain teaser interesting.. feel maybe started confusing myself. the object of calculate, using round robin algorithm, time take of processes complete. have prompt user time quantum, , how many processes calculate. there, throw statement based on many processes there assign process arival time , burst time. for arent familiar, time quantum how many cycles process before switches next, burst how many cycles takes complete process, , of course arival time how many cycles have completed before arives. simple algorithm, it's show how cpu's schedule. if @ fantastic! i'm lost. wanted in c#, programming skills less sufficent in c# that. the 2 problems having in if statements, started lose myself, , whatever reason, gives me error when compiling dif < parrive.get[ii] or dif < parrive.get(ii) or assigning parrive.get[ii] variable @ beginning of if statements , using variable(as shown)... import java.io.*; import java.util.*; ...

How to stop Wpf Tabcontrol to unload Visual tree on Tab change -

hi usercontrols placed in tabs unloaded , loaded every time tabs changed.it creates unnecessary lag in application.i looking way fix behavior.i know have subclass tabcontrol change behavior how..? you can find 2 different approaches prevent in stackoverflow question: wpf tabcontrol - how preserve control state within tab items (mvvm pattern) i recommend: keeping wpf tab control destroying children

How do I match something like this using perl regex? -

the file looks like [n computer end] [m whatever] [n look] [n why not] i need words in bracket start [n here want computer end why not may or may not in same line i tried this: if($line =~/\[n(.+?)\]/) but match first 1 of each line. use g modifier on regular expression "g"lobal matches. either this: while ($line =~ /\[n(.+?)\]/g) { # $1 contains text between "[n" , "]" } or this: my @matches = $line =~ /\[n(.+?)\]/g; # @matches contains of matching items of text

.net - Inbuilt richtextox shortcuts -

i once discovered overview of inbuilt richtextbox shortcuts somewhere on microsoft.com website, can't find it. contained useful hotkeys, ctrl+shift+l switching bullet style. where can find list of inbuilt richtextbox shortcuts? (i need know hotkey changing line spacing.) found it! http://msdn.microsoft.com/en-us/library/bb787873(v=vs.85).aspx#rich_edit_shortcut_keys

regex - What is wrong with this perl regular expression? -

i'm trying go through file, , print out words without specific letter, specified in character class. if ( $+ =~ [^aa] ) { print $_; } but doesn't work. doing wrong? above example should give list of words without 'a' or 'a' in them, doesn't seem working. the regular expression says "include character not or a" not "includes characters not or a". it missing delimiters. $+ =~ /^[^aa]*$/ or $+ !~ /[aa]/

css cascade - Different levels of CSS and the priority over each other -

i reading decent article here on topic: http://www.plus2net.com/html_tutorial/css-types.php came out highest ranked google search term css style sheets priorities. think site misinforms , incomplete! can confirm suspicions? 1) user defined style second lowest priority. in order override other styles it, need use !important move highest. 2) fails mention relative priorities of <link> versus @import , @import within <link> a more precise ordering (1 wins on 2 etc) : user defined (browser prefs !important - [not google chrome!]) inline style sheet (style attribute on html node) internal style sheet (<style> in <head>) external style sheet (@import) external style sheet (<link>) external style sheet (@import inside <link>) user defined - (browser prefs - [not google chrome!]) browser default - (shipped browser) michael bowers pro css & html design patterns source too. fails mention inline. is there else missing? ps: inferri...

Java problem-Whats the reason behind and what will be probable output -

1.) long milli=24*60*60*1000; long micro=24*60*60*1000*1000; long result=micro/milli; the result should 1000 it's not. please can tell me output , explain it? 2) int i=0; for(a=0;a<=integer.max_val;a++) { i++; } s.o.p(i); normally went infine loop why because there max value should come out of loop. @ conditions executed sucessfully , excepted value. .....anyone can tell me vm... handing of nummbers in java you need put l in there long-conversion long micro=24*60*60*1000*1000l

asp.net mvc - jQuery Validation on entire page -

i have webpage developed in asp.net mvc 3 , using jquery validator validate fields. $.validator.setdefaults({ errorcontainer: "#validationsummary, #validationnotice", highlight: function (element, errorclass) { $(element).css("border", "1px dotted red"); }, unhighlight: function (element, errorclass) { $(element).css("border", "1px solid black"); } }); this give fields "red dotted border" when aren't valid. i have text want show if fields valid in page . <div class="readytosend" style="margin-top:50px;"> fields valid. </div> so want hide "readytosend" if page isn't valid , show if of fields on page valid. try this $.validator.setdefaults({ errorcontainer: "#validationsummary, #validationnotice", highlight: function (element, errorclass) { $(element).css(...

twitter in android -

is there sdk of twitter available through can implement twitter in our application? want application load on his/her twitter account , tweet should sent his/her account, cannot find simple examples. something facebook android sdk i'm for. you can use twitter4j . site contains usage examples . unfortunately introduction of oauth, login no longer trivial. have register application twitter (go account, applications , add app there). give consumer key/token pair, need logging in , need keep secret. i've implemented in android-client called zwitscher . you can have @ login procedure in loginactivity (of v0.65 tag).

eclipse PDT: How to enable content/code assist for personal PHP libraries -

i struggeling getting content/code assist work php libraries (other zend) in zend framework project folder: library doctrine zend (<-works code assist...) zendx content assist remains blank when using libraries... any suggestions? thanks, udo content assist available compatible resources in include path. right click project folder. include path . configure include path . window appear. configure needed resources. further information in zend studio manual: adding elements project include path include paths code assist concept

How to prevent Apache hangs when PHP APC cache completely fills up? -

when apc cache full, hangs apache. apache responds requests, waits forever apc cache free resources, never happen. i run every 10 minutes cron job own small expunge script, deletes expired entries apc. ok, add more memory apc and/or run expunge script more often. that's not real solution, looking new way how deal issue. i find setting ttl changes apc's behavior when cache full. default, if ttl 0, apc has empty cache when gets full. manual: in event of cache running out of available memory,the cache expunged if ttl equal 0. otherwise, if ttl greater 0, apc attempt remove expired entries.

html - Is it possible to overwrite the action-value in a form? -

is possible overwrite action-value of 1 searchfield when submitting value of second searchfield? i'm in need of adding searchfield <input type="search" id="id2"> <input type="submit" value="value2" /> to: <form method="get" action="/../.." id="search"> <div> <input type="search" id="id1"> <input type="submit" value="value1" /> </div> </form> by pressing enter in second searchfield, i'm forwarded link of first searchfield because has action-value. can change behaviour? using javascript : function setaction(){ document.getelementbyid('search').setattribute('action',document.getelementbyid('id2').value } you need set onclick event of 'id2' setaction().

How to read cookie in Android 1.6? -

i face prob in add & read cookie default browser. want save value in user default browser , next time want dat value m setting cookie basicclientcookie c = new basicclientcookie("appn", "cookn"); c.setvalue("value"); c.setdomain("new domain"); c.setpath("/newpath"); c.setcomment("new comment"); c.setexpirydate(new date("11/02/2012")); string s = c.tostring(); cookiesyncmanager.createinstance(this); cookiemanager cookiemanager = cookiemanager.getinstance(); cookiemanager.setcookie("http://www.myssec.com",s); is ok if yes den can u write code read cookie else how add cookie plz m new in android i face prob in add & read cookie default browser. that not possible, sorry. i want save value in user default browser , next time want dat value m setting cookie that not possible, sorry.

jquery - Timed scrolling in javascript -

i need script scrolls automatically throught page without buttons,i want scroll down every 10 seconds , return top when done,how in javascript? thanks, lee you want use combination of jquery scrollto () plugin , javascript settimeout () function. (pseudocode): settimeout(scrollmypage, 10000) { if (at bottom of page) { scroll top } else { scroll down height of browser window/a page } }

partitioning - How to partition a table in MySQL which has 2 million records -

i having 1 table having around 2 million records. records same node. can't partition based on date, continuously data deleted , inserted every day. , remaining data in string format. every 15mins, out application taking backup table (only partial data got collected 15mins) , while doing operation, table getting locked , not able access table. how use partition here.

c# - Cannot load a spriteFont in XNA4 -

im goofing around xna , i've come part need load font in. easy enough right? font1 = content.load<spritefont>("arial"); is code i'm using load font. <?xml version="1.0" encoding="utf-8"?> <!-- file contains xml description of font, , read xna framework content pipeline. follow comments customize appearance of font in game, , change characters available draw with. --> <xnacontent xmlns:graphics="microsoft.xna.framework.content.pipeline.graphics"> <asset type="graphics:fontdescription"> <!-- modify string change font imported. --> <fontname>arial</fontname> <!-- size float value, measured in points. modify value change size of font. --> <size>14</size> <!-- spacing float value, measured in pixels. modify value change amount of spacing in between characters. --> <spacing>0</spacing...

css - How to style the alt tooltip in html? -

this question has answer here: is possible format html tooltip (title attribute)? 10 answers is possible style tooltip alt attribute? i wish style background, font color etc html alt attribute. can me please? you use new html5 custom data- attribute: semantic tooltips pure css3 , html5.

zend framework - Generate class diagrams from PHP classes automatically? -

i have build web application in zend framework , desperately need tool/plugin can generate class diagram of zend controllers (classes). i uses zend studio , eclipse if know plugin job please let me know. all , comments appreciated. many vishal autodia easy use if bit basic. handles range of languages , makes nice job of mysql well. see php uml generator

c++ - EnterCriticalSection Deadlock -

having appears dead-lock situation multi-threaded logging application. little background: my main application has 4-6 threads running. main thread responsible monitoring health of various things i'm doing, updating guis, etc... have transmit thread , receive thread. transmit , receive threads talk physical hardware. need debug data transmit , receive threads seeing; i.e. print console without interrupting them due time critical nature of data. data, way, on usb bus. due threading nature of application, want create debug console can send messages other threads. debug consule runs low priority thread , implements ring buffer such when print debug console, message stored ring buffer , sets , event. debug console's thread sits waitingonsingleobject events in bound messages come in. when event detected, console thread updates gui display message. simple eh? printing calls , console thread use critical section control access. note: can adjust ring buffer size ...

ruby on rails - Indicate to an ajax process that the delayed job has completed -

i have rails 3 app uses delayed_job fetch data (with class method) when user hits page. how can indicate ajax process class method has run (so can stop polling)? edit: to clarify, want know when delayed_job has run, not when ajax process has succeeded. want pass delayed_job completed status running ajax process. typically, best way store, in database, indication of job's progress. instance: class user def perform_calculation begin self.update_attributes :calculation_status => 'started' do_something_complex self.update_attributes :calculation_status => 'success' rescue exception => e self.update_attributes :calculation_status => 'error' end end end so when enqueue job: user.update_attributes :calculation_status => 'enqueued' user.send_later :perform_calculation you can query, in controller, status of job: def check_status @user = user.find(params[:id]) render :json...

c# - Entity framework: StoreGeneratedPattern="Computed" property -

i have datetime property. need property's default value datetime.now . , found out can specify attribute storegeneratedpattern="computed" , set (getdate()) in sql. works successfully. can't change property in code. need change property datetime value. changes not saved. setting property computed telling ef cannot set value directly. how you? property exists sake of computed columns, definition not saved database. unfortunately, ef's "default value" property can set values known @ compile-time, , not datetime.now this link provides decent workaround: setting default value of datetime property datetime.now inside system.componentmodel default value attrbute you can handle savingchanges event on context, , add default values there, happens when call savechanges() , not when object created. partial void oncontextcreated() { this.savingchanges += new eventhandler(accrualtrackingentities_savingchanges); } v...

python - (Django) Trim whitespaces from charField -

how strip whitespaces (trim) end of charfield in django? here model, can see i've tried putting in clean methods these never run. i've tried doing name.strip() , models.charfield().strip() these not work either. is there way force charfield trim automatically me? thanks. from django.db import models django.forms import modelform django.core.exceptions import validationerror import datetime class employee(models.model): """(workers, staff, etc)""" name = models.charfield(blank=true, null=true, max_length=100) def save(self, *args, **kwargs): try: # line doesn't anything?? #self.full_clean() employee.clean(self) except validationerror, e: print e.message_dict super(employee, self).save(*args, **kwargs) # real save # if uncomment this, typeerror: unsubscriptable object #def clean(self): # return self.clean['name...

java - How to: Run maven integration tests against a test environment (database) -

i'm using maven , maven-failsafe-plugin start jetty during integration-test lifecycle phase. execute number of (*it.java) junit tests against running webapp. working expected. however, connect test database integration tests. storing url in ${basedir}/src/test/resources/jdbc.properties when jetty plugin runs (jetty:run), uses ${basedir}/src/main/resources/jdbc.propertes instead. tried reconfiguring jetty plugin via classesdirectory property use ${project.build.testoutputdirectory} but test-classes directory missing actual compiled project classes, resources stored in ${basedir}/src/main/resources note: surefire adds test resources classpath, followed main resources, such found in both use test version because found first in classpath. any ideas on how set correctly? thanks! edit: well, seems there configuration properties on jetty-plugin deal this: testclassesdirectory : directory containing generated test classes. usetestclasspath : if t...

android - NFC listener trigger based on tag -

i doing research on nfc , use, i've started simple proof of concept creating nfc application android. when tag scanned, sends rest request tag's id see whether registered service, , if is, content downloaded , played on phone. the problem tags' id sequential, requirement have unique random information stored avoid possible complications , security issues. question is, should data be? there standard on subject? the idea store x,y x trigger identifier , y random unique number. work? can custom activity started based on x value? any , references appreciated. there cake. you want check out page, describes latest dispatch process newly-detected tag: http://developer.android.com/reference/android/nfc/tag.html . makes difference if tag-detecting app expected running @ time tag scanned. if it's in foreground, can sure activity going first crack @ scanned tag, whatever tag detected. if app not running installed on device, intent filter(s) in androidmanifes...

java - h:message elements with for attribute do not present messages in JSF 2 -

i have following authentication form in jsf running on glassfish 3: <h:messages globalonly="true" errorclass="erro" /> <h:form id="form-login"> <h:outputtext value="user" /> <h:message for="login-user" /> <h:inputtext id="login-user" value="#{authenticationbean.user}" showmessages="true" /> <h:outputtext value="password" /> <h:inputsecret id="login-password" value="#{authenticationbean.password}" /> <h:commandbutton id="log in" action="#{authenticationbean.login}" value="autenticar-se" /> </h:form> the authentication.login method 1 below: public string login() { user = userdao.authenticate(user, password); if (user != null) { facesmessage message = new facesmessage("welcome!"); message.setseverity(f...