Posts

Showing posts from June, 2014

C# catch control's change event from its container -

in project have settings form. if changes happen have notify user if wants leave page without saving changes. @ time doing catching every control change event. sure there better way - catching change event container. possible? you have right solution, may want generic catching change events. example, try right after initializecomponent(); line in constructor: foreach(control c in controls) { c.textchanged += new eventhandler(generictextbox_textchanged); } generictextbox_textchanged set form-wide haschanged flag true, or basic that. may need make recursive function loops through of children of c if has child controls.

code analysis - Howto overcome Unit Test Regression Problems...? -

i looking kind of solution software development teams spend time handling unit test regression problems (about 30% of time in case!!!), i.e., dealing unit tests fails on day day basis. following 1 solution i'm familiar with, analyzes of latest code changes caused unit test fail: unit test regression analysis tool i wanted know if knows similar tools can benchmark them. well, if can recommand approach handle annoying problem. thanks @ advanced you have our sympathy. sounds have brittle test syndrome . ideally, single change unit test should break single test-- , should real problem. said, "ideally". type of behavior common , treatable. i recommend spending time team doing root cause analysis of why these tests breaking. yep, there fancy tools keep track of tests fail often, , ones fail together. continuous integration servers have built in. that's great. suspect if ask each other, you'll know. i've been though , team knows experience. ...

iphone - how to remove a particular sign from a string? -

i have string gpbusd~buy~~~~update~hit 40 pips~hit 110 pips~~gpbusd~buy~~~break even~update~hit~100+~~gpbusd~buy~1.5500/25~1.5455~~new~40~100+~~gpbusd~buy~~~~update~close 0 10 pips n~~~gpbusd~buy~1.5335/50~1.5320~~new~40~80+~~gpbusd~buy~~~~update~~15-20 pips close~keep open~gpbusd~buy~1.5530/50~~1.5505~update~hit~80~keep open~gpbusd~buy~1.5530/50~1.5465~~new~40~80~100+~gbpjpy~sell~131.05/.130.75~132.15~~new~60~100~keep open~eurusd~sell~1.2840/20~1.2870~stop~update~~~~ i want remove delimeter sign , separate words between them ?how can it? splitting string: nsarray *parts = [string componentsseparatedbystring: @"~"]; assembling string array: nsstring *string = [parts componentsjoinedbystring: @" "]; sanitizing string, replacing occurences of ~ whitespace: nsstring *string = [string stringbyreplacingoccurrencesofstring: @"~"\ withstring:@" " ]

vb.net - Adding entry to Registry for startup of application -

i took following method make registry key in setup project. when run setup, says could not write value run key. verify have sufficient access key, or contact support personnel. " please advise how fix this. thanks below have copied code took forum after have built own application project, right click "solution" "add new project", of cource project type setup , deployment project. add "project outputs" setup project, here, can own application, most of important step: open "regstry" view of setup project, add new keys in "hkey_local_machine" according information mentioned. below key "run", can add new string value. in value's "properties" view, enter "[targetdir]yourapplicationname.exe" . install application using msi file created setup project, restart computer, can see result. you try write registry under current user instead of local machine. end result similar , ...

iphone - Dynamically declare function name? -

i creating list of bar buttons action functions ( sfuncname below), dynamically changed. when user clicks on button, sfuncname called. for(int = 0; < 3 ; i++){ nsstring* sfuncname = [nsstring stringwithformat:@"onfunc_%d:", ]; barbuttonitem = [[uibarbuttonitem alloc] initwithbarbuttonsystemitem:systemitem target:self action:nsselectorfromstring(sfuncname)]; } the question is: have got way dynamically declare sfuncname respond buttons? example: for(int = 0; < 3 ; i++){ nsstring* sfuncname = [nsstring stringwithformat:@"onfunc_%d:", ]; - (void)sfuncname: (id)sender; //sfuncname: onfunc_0, onfunc_1, onfunc_2 } i don't see advantage of creating method declaration dynamically, code within these methods wouldn't dynamic either. so should rather declare single method called every button, pass tag or reference sender (button) or other value enables method tell button has been ...

MySQL error 1109 (Unknown table) when calling procedure -

i have error-code 1109 in call procedure in mysql. error code: 1109 unknown table 'chaindb.credit_trans' in field list can me, please? your error telling in database chaindb table credit_trans does not exist. i suggest verifying have table named correctly. if indeed, need post more information.

Use git "log" command in another folder -

i have php files in folder (which git project). in these php file want execute "git log" folder b. folder b git project (so log different between , b). how can shell command ? from, man git : you can --git-dir parameter, before passing commands. git --git-dir /foo/bar/.git log

javascript - How can we keep OpenX from blocking page load? -

we're using openx serve ads on number of sites. if openx server has problems, however, blocks page loads on these sites. i'd rather have sites fail gracefully, i.e. load pages without ads , fill them in when become available. we're using openx's single page call , , we're giving divs explicit size in css can laid out without contents, still loading script blocks page load. there other best practices speeding pages openx? openx has documentation on how make tags load asynchronously: http://docs.openx.com/ad_server/adtagguide_synchjs_implementing_async.html i've tested it, , works in current chrome/firefox. it takes manual tweaking of ad code. example of how ad tags should end up: <html> <head></head> <body> content here. ad goes here. <!-- preserve space while rest of page loads. --> <div id="placeholderid" style="width:728px;height:90px"> <!-- fallback mechanism use if unable l...

Determine if asp.net application support load balancing environment -

i new asp.net, have been tasked upgrade physical architecture load balancing environment support application. i done reading session state should configure out-process instead of in-proc support load balancing. is there other issues need take note asp.net web application run in load balanced environment? if going have session out of proc, session objects should serializable. if want quick solution, sticky sessions option. can read here

c# - How to dynamically subscribe to an event? -

related watch control determine events being fired? i need detect when event fired. trying subscribe dynamically on event. the problem have different types of delegates, not events have same signature. solutions provided in here , here expects object sender, eventargs e , not using, exception telling types doesn't match. here examples of delegates have: public delegate void oneventa(int id); public delegate void oneventb(double num, string name); how can create correct delegate? eventinfo has method addeventhandler can use. if don't have delegate instance, can create delegate dynamically using delegate.createdelegate : var eh = delegate.createdelegate(ei.eventhandlertype, target, methodinfo); ei.addeventhandler(owner, eh); in example target target object delegate , methodinfo methodinfo of method in target object. finally, owner object event ei belongs.

internationalization - How to change FxCop language? -

is possible change language of fxcop dictionary other english? how can done? fxcop comes own dictionary. can add custom dictionaries have words language. this site shows how add custom dictionary: http://blogs.msdn.com/fxcop/archive/2007/08/20/new-for-visual-studio-2008-custom-dictionaries.aspx this site mentions fxcop has support other languages. http://davesbox.com/archive/2008/06/08/fxcop-now-ships-with-the-spell-checker-libraries.aspx you can tell fxcop use non-american varieties choose project -> options -> spelling & analysis , changing spelling language drop-down. default user's default culture, if locale set australia, language default english (australia).

lisp - How to defun a function within a defun? -

for example, pass function name function (personal-function 'func-name '(attr1 attr2 ...)) and want (defun personal-function (func-name) (defun func-name '(attr1 attr2 ...) (dosomething))) however, said can't defun symbol... should do? use (setf (symbol-function my-symbol) some-function) create new function with (compile nil (list 'lambda args body)) where args , body have meaningful values.

forms - Any good FDF tutorial? -

does 1 know of tutorial on how fill pdf document fields using fdf file format? find in php (which don't know). if it's in of following programming languages, that'll great: vb6 c# vb.net visual foxpro thanks in advance, egb nevermind! fdf toolkit has several sample projects , documentation. it can downloaded from: http://www.adobe.com/devnet/acrobat/fdftoolkit.html

html5 - Where could some html tags be necessary? -

i walking through new html 5 features , saw , tried lot of new tags see kind of affect have on browser didn't see difference. so lets talk <time> tag example : if write down <time>10:00</time> shows 10:00 on page mean expecting advanced formatting. example, if write <time>10</time> format 10:00 instead of showing 10 on page. also example can <time datetime="2008-02-14">valentines day</time> shows valentine days on page , nothing more. no tooltip, not fancy animation nothing them. they tags this, , if needed use span or else , use kinda js code make more appealing , that's all. so not talking <time> tag here, other tags that. eventually, question why , need use them. my best guess make source code more readable codes , crawlers maybe or can used semantic web. these answers didn't satisfy me. they used adding semantic meaning markup. instance: <div cl...

powershell - Access SQL - WMI Namespaces from Remote Machine -

i playing powershell , sql wmi events , wondering if can stuff remotely admin notebook: i'd query "root\microsoft\sqlserver\serverevents\mssqlserver" namespace: on sqlserver directly: get-wmiobject -list -namespace "root\microsoft\sqlserver" >> works! get-wmiobject -list -namespace "root\microsoft\sqlserver\serverevents\mssqlserver" >> works ! on adminmachine: get-wmiobject -list -namespace "root\microsoft\sqlserver" >> works! get-wmiobject -list -namespace "root\microsoft\sqlserver\serverevents\mssqlserver" >> error: invalid namespace. is there trick running? have additional install sth? still on sql 2005. thanks! use computername name parameter. get-wmiobject -computername z002 -list -namespace "root\microsoft\sqlserver\serverevents\mssqlserver" also keep in mind mssqlserver available if server has default instance. if server uses named instance you...

Is there any way to get smooth (preferably Windows default) animations in my .NET winforms app? -

in application i'd provide animations while lengthy operation in progress. i'm @ "connecting server" stage, typically takes on 5 seconds. during i'd display animation user. i've implemented popular solution picturebox , ajax loading gif, don't find pretty enough. imo it's not smooth enough , pretty loading gifs hard come by. not mention lack of proper alpha makes blending awkward. ideally i'd borrow animations windows , display windows does, if there better-looking, too. , wouldn't surprised if windows animations not publicly available either. so - possible without effort (animations not app about, pass time)? , secondary question - hands on pretty animations? if using visual studio, take @ animations installed it. should located under vs folder: ...\microsoft visual studio 10.0\common7\vs2010imagelibrary\1033\vs2010imagelibrary\animations if don't have folder, can run installer again - installation feature, , think...

webforms - Does anyone have an insight into ASP.NET WebFormsMVP? -

recently ran open source project asp.net webformsmvp . it seems alternative asp.net mvc , quick way introduce testability existing webforms applications. (without having go through pain of rewriting bunch of code make work asp.net mvc) of couse community support , open-source projects abandonment concern when trying new things, moving on fears, has giving serious try @ framework? if so, can share insight pros/cons , if it's worth trying it? thanks lot! webformsmvp included in dotnetnuke now, have started using indirectly part of custom module development within dnn. i don't think we're utilizing framework capable of, have had no problems date. implementation clean , simple implement, , retrofitting existing webforms code straightforward. learning curve has been minimal. we have run number of cases aren't of "right" way things, , have found pretty limited guidance online. (try might avoid it, have poke stuff viewstate.) but, being us...

How to escape '/' in codeigniter, php? -

hey guys. i'm having silly issue inserting text forwardslash cart in codeigniter. when it's plain string it's fine when inserting, say, "compact / compact" it's not doing it. guess '/' needs somehow escaped. tried hmtlspecialchars(), htmlentities() , addslashes() - none of worked. know how in php? when i'm inserting cart, i'm doing this: $release_barcode = $this->uri->segment(3); $release = $this->lists_model->get_release_by_barcode($release_barcode); foreach($release $row): { $barcode = $row->ean_upc; $price = $row->product_price; $currency = $row->product_currency; $artist_name = $row->artist_name; $label_name = $row->label_name; $release_name = $row->title; $cover = $row->cover; $item_name = $artist_name.', '.$release_name....

jpa - JSF + Hyperjaxb3 + Hibernate LazyInitializationException accross requests -

i have jsf application trinidad components , jaxb/jpa entity beans generated hyperjaxb3. in ui use trinidad combo box component has jpa object values. the scenario is: user make selection in combo box user clicks on control sends request server , returned same form data form submitted , selection in combo box should user did in step 1. equals() method called on combo box items (jpa objects) , exception thrown: org.hibernate.lazyinitializationexception: failed lazily initialize collection of role: package.anobject.items, no session or session closed @ org.hibernate.collection.abstractpersistentcollection.throwlazyinitializationexception(abstractpersistentcollection.java:358) @ org.hibernate.collection.abstractpersistentcollection.throwlazyinitializationexceptionifnotconnected(abstractpersistentcollection.java:350) @ org.hibernate.collection.abstractpersistentcollection.readsize(abstractpersistentcollection.java:97) @ org.hibernate.collection.persistentb...

java - Corupt ZIP file servlet response for multiple file archive -

i'm trying zip bundle of file's , return zip through servlet. works fine if have 1 file when try add more seems being appended first zipentry , zip archive gets corrupted. private void writezipresponse(httpservletresponse response, list<file> bundle) { try { bytearrayoutputstream bout=new bytearrayoutputstream(); zipoutputstream zout = new zipoutputstream(bout); servletoutputstream out =response.getoutputstream(); (file file : bundle) { fileinputstream fi = new fileinputstream(file); byte bytes[] = new byte[(int)file.length()]; // read in bytes int offset = 0; int numread = 0; while (offset < bytes.length && (numread=fi.read(bytes, offset, bytes.length-offset)) >= 0) { offset += numread; } // ensure bytes have been read in if (offset < bytes.length) { throw new ioexception("could not read file "+file.getname()); ...

objective c - SNMP Library for iPhone -

are there open source libraries doing snmp get/sets using objective c/cocoa touch (for iphone)? although there no snmp implementations in objective-c (that aware of). there in c & c++. i've had success @ using snmp++v2.8a . drop .h , . cpp files required static libsnmp++.a x-code iphone project. , make necessary tweaks build. had add: "-d_xpg4_extended -dgcc -dlinux" project settings 'other c++ flags', , make changes files. file using c++ objects from, rename .m .mm, tell x-code file contains mixture of objective-c , c++.

html - footer does not inherit the positioning property? -

i going smooth html , css codes until problem facing , don't know happening. my html patterns this. in top <div id="header"> not have fixed width. have used image , used repeat-x property. , in header have navigation menu wrapped in container of 940px; in middle <div id="content"> wrapped container of same 940px; till content div codes fine. facing problem in positioning footer correctly. footer should not have fixed width , should not wrapped in container. defined footer div outside of content , container div right before closing of body , html tag. when footer image have dimension of 50px x 290px; goes upward , placed content div. not come bottom. using temporarily margin-top:1600px; position correctly wrong. why not inheriting position, tried giving every position attribute. not working :(, what missing? p.s: code lil lengthy didnt post here, instead explained happening. if still want see code can try , put minimal code. ...

Using Raphael javascript for hovering with arrays -

using raphael, i'm trying shape appear when hover on invisible area near shape. following code not work - going wrong? each shape has 2 raphael paths associated it: 1 visible shape, , other invisible area. <script type="text/javascript" charset="utf-8"> $("document").ready(function() { var rm = raphael("canvas", 1000, 500); var attr = { // visible shapes fill: "#bbb", "fill-opacity": 1, stroke: "#222", "stroke-width": 0.3, }; var attr2 = { // invisible hovering areas fill: "green", "fill-opacity": 0.0, stroke: "red", "stroke-width": 0, }; var things = {}; /* square */ things.square = [ rm.path("m 154.21525,71.431259 74.32805,0 0,70.496711 -74.32805,0 0,-70.496711 z").attr(attr), ...

C - what is the return value of a semicolon? -

im curious following example #include<stdio.h> int test(); int test(){ // int = 5; // int b = a+1; return ; } int main(){ printf("%u\n",test()); return 0; } i compiled 'gcc -wall -o semicolon semicolon.c' create executable , 'gcc -wall -s semicolon.c' assembler code is: .file "semicolon.c" .text .globl test .type test, @function test: pushl %ebp movl %esp, %ebp subl $4, %esp leave ret .size test, .-test .section .rodata .lc0: .string "%u\n" .text .globl main .type main, @function main: leal 4(%esp), %ecx andl $-16, %esp pushl -4(%ecx) pushl %ebp movl %esp, %ebp pushl %ecx subl $20, %esp call test movl %eax, 4(%esp) movl $.lc0, (%esp) call printf movl $0, %eax addl $20, %esp popl %ecx popl %ebp leal -4(%ecx), %e...

Netbeans custom component properties -

this might stupid question possible netbeans ide add custom properties custom component have placed in palette , if how? have been looking on internet , haven't found me figure out. thanks, martin s. let me state requirement in words first. you need custom swing components in palette you need new custom properties custom components you want new properties appear in properties panel can set them in design time the above mentioned things possible in netbeans ide. netbeans ide allows add custom components palette. need follow rules follows: the custom component shall have no arguments constructor the custom component shall in compiled state, palette manager uses class file add it. the new properties automatically shown in properties panel, provided have valid getter , setter methods according java bean standards. i have not written method of adding custom component palette have done mentioned you. netbeans palette allows create new palette categorie...

Javascript FAB framework on Node.js -

Image
i've seen slide presented fab , node.js framework. is javascript? could explain going on in code? i'm lost. is plain javascript, function chaining pattern. the first line, ( fab = require("fab") ) includes fab function , returns reference it. all subsequent parentheses function calls, each function invocation returns same function again , again. the pattern looks simplified example: var foo = function (arg) { // detect argument if (typeof arg == 'function') { // arg console.log('function: '+arg()); } else if (arg instanceof regexp) { // arg regexp... console.log('a regexp: '+arg); } else if (typeof arg == "string") { // arg string console.log('a string: '+arg); } return foo; // return reference }; (foo) (function() { return "foo "; }) (/bar/) (" baz!"); outputs: function: foo regexp: /bar/ string: baz!

c# - How can you draw 32bppargb images with the Win32 AlphaBlend function? -

i've been fussing better part of night, maybe 1 of can give me hand. i have found gdi+ drawimage in c# far slow i'm trying render, , looks of forums, it's same other people well. i decided try using alphablend or bitblt win32 api better performance. anyway, i've gotten images display fine except 1 small detail—no matter image format use, can't white background disappear (transparent) graphics. i've tried bmp , png formats far, , verified loaded 32bppargb images in c#. here's call i'm making: // draw tile screen. win32graphicsinterop.alphablend(graphicscanvas, destination.x, destination.y, this.tilesize, this.tilesize, this.imagegraphicspointer, tile.upperleftcorner.x, tile.upperleftcorner.y, this.tilesize, this.tilesize, new win32graphicsinterop.blendfunction(win32graphicsinterop.ac_src_over, 0, ...

c++ - my_thread_global_end threads didn't exit, error? -

i using mysql c++ connector (1.0.5) , moved get_driver_instance() , connect() methods secondary thread getting below error. error in my_thread_global_end(): 1 threads didn't exit after googling found mysql thread isn't exiting. there method in c++ wrapper cleanup? after googling came know mysql_thread_end () solve problem. way linking against libmysqlclient.a included mysql.h file , called mysql_thread_end before exiting secondary thread, problem solved.

nscharacterset - how to print characterSet in objective c? -

i'm using gnustep shell programming objective-c. i'm able convert string character set. unable print converted character set in console. please tell me way print it. in advance. this first 65536 characters in unicode, situations. believe unicode can go higher (2^32?), take longer log. + (void) logcharacterset:(nscharacterset*)characterset { unichar unicharbuffer[20]; int index = 0; (unichar uc = 0; uc < (0xffff); uc ++) { if ([characterset characterismember:uc]) { unicharbuffer[index] = uc; index ++; if (index == 20) { nsstring * characters = [nsstring stringwithcharacters:unicharbuffer length:index]; nslog(@"%@", characters); index = 0; } } } if (index != 0) { nsstring * characters = [nsstring stringwithcharacters:unicharbuffer length:index]; nslog(@"%@", chara...

php - POST to sample URL for PayPal without "form" -

i having issue posting data specific url when testing payment transactions on paypal platform. although more technically understood, chose not use api , nvp platform because of requirement first create transaction, come , have create recurring profile (as opposed @ once - stupid design in opinion). ultimately, trying take data have encrypted specific variable , post data url of choice without having treat form user clicks submit. my html form works - code is: <form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post" target="_blank">'; <input type="hidden" name="cmd" value="_s-xclick"/>'; <input type="hidden" name="encrypted" value="'.$encrypted.'"/>'; <input type="submit" value="go checkout" name="submit" class="cartbutton" />'; </form> where $encrypted encrypted parameters. ...

ASP.NET MVC Routing two parameters with static string in between -

this routing: routes.maproute(null, "shelves/{id1}/products/{action}/{id2}", new { controller = "products", action = "list", id1 = "", id2 = ""}); the thought can this: http://server/shelves/23/products/edit/14 and able edit product 14 on shelf 23. checking route debugger , path matches routing, when try navigate route debugger off, shows me http 404 error. know why happening? well, starters, id1="" line going problematic, because can't make optional that's not @ end. i tried on system, , works fine. this route: routes.maproute( "shelf-route", "shelves/{id1}/products/{action}/{id2}", new { controller = "products", action = "list", id2 = "" } ); this controller: public class productscontroller : controller { public string list(string id1, string id2) { return string.format("id1 = {0}, id2 = {1}"...

C++ CORBA DII issues -

could corba experts out there please me one. i have multithreaded application code sends message server , waits response back. can see server sending response application doesnt seem receive it. heres part of code. // create request object given message msg.request = serverref->_request("receivecoremessagevia"); msg.request->set_return_type (corba::_tc_short); msg.request->add_in_arg() <<= msg.sourcegateway; msg.request->add_in_arg() <<= msg.octetseq; msg.request->send_deferred(); ... // following code in while loop in different function. uses request reference check response. // check if request has completed if (!msg->request->poll_response()) { clssendlog << debug << "polling..." << endl; return false; // no response yet } // returned result clssendlog << debug << "get response..." << endl; msg->request->get_response(); clss...

expression blend - DataGrid in SketchFlow Blendability -

i trying figure out how show 2 different states of datagrid in blend/sketchflow on page. show datagrid empty on load of page , change show results data using databinding sample data when search key pressed. i have made 2 copies of datagrid - 1 empty , 1 data. can on lay 1 other based on 2 states. best way show behavior, or there better way change items binding or something. as many things, depends on needs , goals. if mockup/prototype, did simplest/fastest route goal. if need make more production ready, should have single datagrid , change datacontext or data source.

php - get number from file with regexp? -

i've got files named 1234_crob.jpg 1234.jpg 2323_örja.bmp 2323.bmp etc. how can retrieve numbers e.g. 1234 , 2323? if file names start numbers there no need use regular expressions, try instead: foreach (glob('/path/to/dir/{0,1,2,3,4,5,6,7,8,9}*', glob_brace) $file) { echo $file . ' = ' . intval(basename($file)) . "<br />\n"; } this updated glob pattern match filenames start digit , requested. @ghostdog74 : you're right. foreach (glob('/path/to/dir/{0,1,2,3,4,5,6,7,8,9}*', glob_brace) $file) { echo $file . ' = ' . filter_var(basename($file), filter_sanitize_number_int) . "<br />\n"; }

Ruby: toggle a boolean inline? -

how can opposite of boolean in ruby (i know converted 0/1) using method inline? say have given instance: class vote def return_opposite self.value end end which doesn't anything, can't seem find method simple , short opposite() or like. exist , i'm not looking @ right place in docs? if 1 doesn't exist there short ternary toggle 1 => 0 or 0 => 1? i use @object.boolean = !@object.boolean

mysql: select max(score) doesn't return the relevant row data -

if have example scores table: user game score timestamp 1 50 50 date 2 60 40 date 3 70 25 date 4 80 18 date and run query: select user, game, max(score), timestamp scores i receive maximum score number 20, rest of columns returned not same row. you using max , aggregate function. aggregate functions have effect of treating multiple rows in table group. if don't special, rows in entire table used 1 big group, , when aggregrate function max there, these rows condensed 1 aggregate row. condensing effect have occurred other aggregate functions min , sum , group_concat , friends (see: http://dev.mysql.com/doc/refman/5.1/en/group-by-functions.html ). can apply specific groupings using group by construct, if don't occurrence of aggregate function bunch rows 1 row (but bunching-up occurs after applying where condition, filtered rows aggregated) now, because of condensing or 'reducing' effect of aggr...

windows authentication - Run asp.net application under domain account without joining the domain? -

my feeling says it's not posible anyway curious if there @ least workaround accomplish this. basically working @ client site , machine not connected domain. want running web application locally under domain account, , using webdev server. webapp uses default authentication, windows authentication is. tried using impersonation domain\user & password got following error could not create windows user token credentials specified in config file. error operating system 'logon failure: unknown user name or bad password. i have mention username , password correct. thanks in advance iulian if cannot access domain controller (or computer not know domain controller use), there no way finding out if password correct or not. windows does, asking dc "does password match account" (simply speaking). in scenario, there no dc. hence, "unknown username".

numpy - ATLAS Linear algebra and openmpi on multicore with python -

i use mpi4py , openmpi on multi-cpu/core machine linear algebra. numpy built using atlas . suppose have 4 core machine , run 4 node python script linear algebra on each node using numpy. how can ensure atlas not use more 1 core when doing linear algebra in each node? when build atlas, there seems no option have configured running on 1 core @ time. intel mkl, think can set omp_num_threads=1, , behavior guaranteed. there way build atlas purpose? there doesn't seem environment variable equivalent. i guessing running several blas operations simultaneously on each core of multicore cpu not strategy. can comment on or give rules of thumb or bad idea? unfortunately maximum number of threads atlas uses cannot controlled environment variable such omp_num_threads. you'll have relink numpy against serial atlas library. see http://math-atlas.sourceforge.net/faq.html#tsafe

html - How to disable a link using only CSS? -

is there way disable link using css? i have class called current-page , want links class disabled no action occurs when clicked. the answer in comments of question. more visibility, copying this solution here: <a href="link.html" class="not-active">link</a> .not-active { pointer-events: none; cursor: default; } example: http://jsfiddle.net/7eqjp for browser support, please see: http://caniuse.com/#search=pointer-events *, if need support ie there workaround, see this answer . warning: use of pointer-events in css non-svg elements experimental. feature used part of css3 ui draft specification but, due many open issues, has been postponed css4.*

c - Passing an array containing pointers to a function properly -

code: /* * code.c */ #include <stdio.h> void printarray(int ixarray, int isize); int main() { int array1[] = {7, 9, 3, 18}; int *array2[] = {array1 + 0, array1 + 1, array1 + 2, array1 + 3}; printarray(array2, 4); return 0; } // should print values in array1 void printarray(int ixarray, int isize) { int icntr; (icntr = 0; icntr < isize; icntr++) { printf("%d ", *ixarray[icntr]); } printf("\n"); } my compiler doesn't approve of code. - [warning] passing arg 1 of `printarray' makes integer pointer without cast - printarray(array2, 4); - [error] subscripted value neither array nor pointer - printf("%d ", *ixarray[icntr]); what doing wrong, , why? how fix this? try this: void printarray(int **ixarray, int isize) ... in example provide array of (int*) reference one, must tell compiler expect array of pointers. by default passing array reference. if change array's c...

python - Serializing objects containing django querysets -

django provides tools serialize querysets (django.core.serializers), serializing querysets living inside other objects (like dictionaries)? i want serialize following dictionary: dictionary = { 'alfa': queryset1, 'beta': queryset2, } i decided using simplejson (comes django). extended simplejson.jsonencoder following way: from django.utils import simplejson django.core import serializers class handlequerysets(simplejson.jsonencoder): """ simplejson.jsonencoder extension: handle querysets """ def default(self, obj): if isinstance(obj, queryset): return serializers.serialize("json", obj, ensure_ascii=false) return simplejson.jsonencoder.default(self, obj) then do: simplejson.dumps( dictionary, cls=handlequerysets) , returned dicionary looks this: { "alfa": "[{\"pk\": 1, \"model\": \"someapp.somemodel\", \"fields\": {\...

r - Convert a matrix to a 1 dimensional array -

i have matrix (32x48). how can convert matrix single dimensional array? if we're talking data.frame, should ask variables of same type? if that's case, can use rapply, or unlist, since data.frames lists, deep down in souls... data(mtcars) unlist(mtcars) rapply(mtcars, c) # stupid , pointless, , slower

c# - Does system.security.cryptography.sha1 use OpenSSL library's implementation of SHA1 algorithm? -

or algorithm custom implemented microsoft? tested sha1 computed using openssl on mac equivalent hash computed in c# using system.security.cryptography.sha1. system.security.cryptography.sha1 abstract class. has 3 implementations: sha1managed : implementation in pure c# sha1cryptoserviceprovider : implementation provided windows sha1cng : ("next generation") implementation provided windows so, no, none of implementations ship .net framework use openssl internally. mono ships different implementations these classes. use the same implementation written in pure c#. the reason why you're getting same result sha1 algorithm deterministic, i.e. produces same result same input.

iphone - resetting to initial value -

can please tell me how reset multiplexlayer scene in cocos2d want position, score , time reset intial value. can please tell me how you can remove , add scene or layer again. if take @ examples comes cocos2d distribution, can see scenes or layers removed , replaced. but achieve have keep "volatile" variables inside layer definition, so, when re add again, values starting ones. cheers, vfn

prism - WPF: Sharing resources across assemblies -

i previously posted question on sharing resources across assemblies using themes/generic.xaml , componentresourcekey markup extension. solution works nicely, requres of shared resources located in generic.xaml resource dictionary. mine getting rather large, thought use merged dictionaries in generic.xaml organize things. i have had no luck far. ran tests using demo previous post, , move resources merged dictionary, componentresourcekey fails, complaining can't find source file merged dictionary. has else gotten working? how? help. you use wpf resource dictionary in separate assembly

Chrome : make non resizable textareas -

by default, chrome makes textareas resizable. wish control , either make them vertically resizable, or not @ all. how can achieve ? rails generate standard textarea tag, safari/chrome (webkit) display (not rails :) textareas resizable. its apperance may disabled css textarea { resize: none; } or, if need vertical resize: textarea { resize: vertical; }

.net - Why does my CLR function keep disappearing -

i rookie sql , here questions. i have clr sql functions , procedures. when deploy 1st one, fine. after 2nd 1 deployed, first 1 disappear. anyone can me out? thanks lot actually, create new sql project in vs, adding new function or stored procedure, click deploy, , can see new function in sql instance. close project , open new one, repeat above steps, ok, 2nd function there instance 1st 1 disappeared or replaced , no longer queryable use. thank reply. all these clr functions , procedures in same instance of database. it sounds have 2 db projects associated same database. each db project saying 'make database project' , therefore deleting existing objects. if you're using vs 2010 following might you... go deploy tab of project properties click edit 'deployment configuration file' uncheck 'always re-create database' uncheck generate drop statements objects in target database not in database project.

html - Indexing ajax loaded contents -

is there used standard way on how index ajax loaded content (for search engines)? for example, indexing html content dynamically inserted page. thanks you may want consider using sort of sitemap generator aggregates content load through ajax. sitemaps particularly beneficial on websites where: some areas of website not available through browsable interface, or webmasters use rich ajax, silverlight, or flash content not processed search engines. from wikipedia - sitemaps remember that: because web crawlers not execute javascript code, publicly indexable web applications should provide alternative means of accessing content retrieved ajax, allow search engines index it. from wikipedia - ajax drawbacks in addition may interested in checking out following articles: official google webmaster central blog - proposal making ajax crawlable softwaredeveloper.com - how to: google , ajax play nice crawling ajax-driven w...

Trouble with SQLite SQL Query -

this question exact duplicate of: sqlite - clause & udfs 4 answers i'm trying run following query in sqlite 3: select *, distance(latitude, longitude, ?, ?) "distance" "country" "id" not ? having "distance" <= ? order "distance" asc; but following error: sqlstate[hy000]: general error: 1 group clause required before having i don't understand why sqlite wants me group results, still tried following: select *, distance(latitude, longitude, ?, ?) "distance" "country" "id" not ? group "id" having "distance" <= ? order "distance" asc; and tried this: select *, distance(latitude, longitude, ?, ?) "distance" "country" "id" not ? group "distance" having "distance" <= ? ...

.net - How to host a console application on Windows Server 2003? -

i have host console program hosts application used asp.net 4.0 , should running. best way host on server? can run console application commandline can closed accidently. windows service not option don't have source code console app. you don't need source code run app service; there several different ways can configure executable run windows service. there's the classic method reskit tool srvany.exe (and yes, works more modern versions of windows), or you can use sc.exe .

syntax - What is the @ operator in MATLAB? -

i've used matlab 6.5 before. got programs using '@'. can tell me it? by way, matlab 6.5 support operator? the @ operator creates function handle, allows create , pass around function call variable. has many nice features, none of available unfortunately. because suspect, not introduced matlab until version 7, release after yours.

Draw parallel lines along a path - PHP GD -

i need draw subway map (multiple routes along same path) using php's image library. here's example: ********* ******** * ******* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ******************** * ********************* ********************** it's easy enough draw 1 line along path. don't know how draw multiple lines follow path have equal amount of space between them. for given point a, , more lines through it, first points you'll have decide whether points go 'inside'(b) track, or 'outside'(c): ********c d******a * q*****b * * * * * * e * now, can calculate offset of point b point path length=offset (5px...

height - Measure highest UL Tag with jQuery -

im trying measure , grab highest of ul tags. markup simple. <ul class="ul_class"> <li>one</li> <li>two</li> <li>three</li> </ul> <ul class="ul_class"> <li>a</li> <li>b</li> <li>c</li> <li>d</li> <li>e</li> </ul> <ul class="ul_class"> <li>a1</li> <li>b1</li> <li>c1</li> <li>d1</li> <li>e1</li> <li>f1</li> </ul> so im displaying ul blocks. highest te 1 has mosl li tags in it, how can height variable? thank in advance you can use $('selector').height() on each 1 , find tallest http://docs.jquery.com/css/height something like var max = 0; $('.ul_class').each(function(){ var h = $(this).height(); if(h > max) max = h; }); // max max here.

c# - Match the pairs search algorithm? -

i found interesting pairs matching game @ http://xepthu.uhm.vn . rule simple, have find , connect 2 identical pokemon path between them not blocked , direction can't not changed 3 times. let's see example: alt text http://img14.imageshack.us/img14/382/16170399.png i've think alot algorithm check if path between 2 selected pokemon valid because i'm newbie can't find solution. can suggest me 1 in c#? you. this path finding problem graph theory . fields in grid nodes, , adjacent fields connected edge. path finding well-known problem, , there many algorithms solve this. since graph quite small, best solution here brute force algorithm. popular path finding algorithm dijkstra's algorithm . brute force: start @ pokemon , explore possible ways see if 1 leads identical pokemon. can stop exploring way if way blocked or has more 2 turns. you'll need "pointer" pointing field in grid. pointer can move left, right, or down, provided fi...

Reading a binary file as text and manipulating it... [C#] Versus [VB.NET] -

well guys in bit of pickle here... i doing exercises on encrypting data. 1 of them binary files. using triple des encrypt , decrypt files both in vb.net , c#... now thing is, once decrypted in vb.net , saved, can execute again... but reason, c# file bigger! 20,4k vb.net 1 19,0. c# file rendered unexecutable... upon closer look. files appear same, c# seems add in few bytes here , there in (seemingly) random places... i using file.readalltext(string filepath, encoding encoding); utf-8 encoding thanks! you you're using file.readalltext ... these binary files. makes me suggest you're treating opaque binary data (e.g. result of encryption) if text (e.g. calling encoding.getstring on it). don't that. basically, encryption works on binary data - binary in, binary out. if need encrypt text text, you'll apply "normal" encoding convert text binary data (e.g. encoding.utf8.getbytes(text) ) , use base64 convert opaque binary data text in los...

c# - LINQ? Refactoring foreach -

is there better way write this? feel i'm getting rusty c# after doing lot of javascript lately. can improved? foreach (var item in this.cartitems) { if (item.effectiveprice != null) { this.cartitems[this.cartitems.indexof(item)].effectiveprice = currencyhelper.getlocalizedcurrency(item.effectiveprice); } } well, could write in linq query syntax from , where , i'm not sure big change; i'd more interested in knowing if lookup unnecessary: this.cartitems[this.cartitems.indexof(item)].effectiveprice = currencyhelper.getlocalizedcurrency(item.effectiveprice); to: item.effectiveprice = currencyhelper.getlocalizedcurrency(item.effectiveprice); other that, i'm not sure worth bother of changing it; i'd leave as: foreach (var item in this.cartitems) { if (item.effectiveprice != null) { item.effectiveprice = currencyhelper.getlocalizedcurrency(item.effectivepri...

html - IE6/7 literally interpret whitespace in list items -

Image
how internet explorer 6 , 7 not literally interpret whitespace , line breaks in html list items? in image below, have marked undesired whitespace in red. prefer not squeeze 1 giant line of code. it's hard read way. there css alternative? <ol> <li> <img> sentence 1 sentence 2 </li> <li> <img> sentence </li> <li> sentence </li> </ol> here useful information closing gaps in ie

jsf - commandButton/commandLink/ajax action/listener method not invoked or input value not set/updated -

Image
sometimes, when using <h:commandlink> , <h:commandbutton> or <f:ajax> , action , actionlistener or listener method associated tag not being invoked. or, bean properties not updated submitted uiinput values. what possible causes , solutions this? introduction whenever uicommand component ( <h:commandxxx> , <p:commandxxx> , etc) fails invoke associated action method, or uiinput component ( <h:inputxxx> , <p:inputxxxx> , etc) fails process submitted values and/or update model values, , aren't seeing googlable exceptions and/or warnings in server log, not when configure ajax exception handler per exception handling in jsf ajax requests , nor when set below context parameter in web.xml , <context-param> <param-name>javax.faces.project_stage</param-name> <param-value>development</param-value> </context-param> and not seeing googlable errors and/or warnings in browser's jav...

.net - LINQ method for adding items to a dictionary -

i'm trying learn bit more linq implementing peter norvig's spelling corrector in c#. the first part involves taking large file of words (about 1 million) , putting dictionary key word , value number of occurrences. i'd so: foreach (var word in allwords) { if (wordcount.containskey(word)) wordcount[word]++; else wordcount.add(word, 1); } where allwords ienumerable<string> in linq i'm doing this: var wordcountlinq = (from word in allwordslinq group word word groups select groups).todictionary(g => g.key, g => g.count()); i compare 2 dictionaries looking @ <key, value> , they're identical, they're producing same results. the foreach loop takes 3.82 secs , linq query takes 4.49 secs i'm timing using stopwatch class , i'm running in release mode. don...