Posts

Showing posts from July, 2013

javascript - Simplest way to convert a JSON object to a newly structured JSON object? -

i've got json object structured this: { "xaxis": [ "foo", "bar", "baz" ], "yaxis": [ 333, 992, 1365 ] } from i'd create json object stuctured this: { "piegraph": [ ["foo",333], ["bar",992], ["baz",1365] ] } doing conversion in client-side javascript save me additional development , server round-trip fetch same data. i can employ jquery library if help. assuming first json string parsed object, have iterate on elements of of 2 arrays, build result: var result = { piegraph: [] }; // initialize piegraph empty array var l = obj.xaxis.length; while(l--) { result.piegraph[l] = [ obj.xaxis[l], obj.yaxis[l] ]; } // result this: // {"piegraph":[["foo",333],["bar",992],["baz",1365]]} no libraries needed, plain sequential loop. ;)

ssl - WCF, GET and HTTPS -

i have wcf rest service access. i'd make obligatory use ssl on several of service functions. how can accomplished? thanks! intermixing http , https on same svc file isn't possible. need have svc file talks https , 1 talks http. experience trying specific wcf svc respond in mixed manner has been impossible.

iphone - good examples of model-view-controller -

i'm new objective-c , iphone , thought getting hang of until, after many play apps, ran basic problem around mvcs, nibs , ib. there clear explained examples of how follow framework go to? @interface test1viewcontroller : uiviewcontroller { iboutlet myview *myview; iboutlet mymodel *mymodel; } both views , models linked in iboutlets instantiating model object either kills application or produces object not respond messages. i unclear carry best out initialisations. on viewdidload in view controller. there standard way , simulator start in same way? should 1 use awakefromnib? make difference if use plain code or ib? , if have use ib, should include model object? the mvc idea make sense me here because have potentially several views , view controllers feeding - , sharing - 1 common central data model. references or advance on newbie problem more welcome! ib makes functionality invisible. don't , don't use ib more, preferring have in code. when @ c

PHP/HTML on Safari from Mac Os 10.6.5 works very slowly -

this script: <?php require_once 'swift-mailer/lib/swift_required.php'; $name = $_post['name']; $email = $_post['email']; $form_subject = $_post['form_subject']; $form_message = $_post['form_message']; if (isset($_post['submit'])) { if ($_post['name'] != "") { $_post['name'] = filter_var($_post['name'], filter_sanitize_string); if ($_post['name'] == "") { $errors .= 'please enter valid name.<br/><br/>'; } } else { $errors .= 'please enter name.<br/>'; } if ($_post['email'] != "") { $email = filter_var($_post['email'], filter_sanitize_email); if (!filter_var($email, filter_validate_email)) { $errors .= "$email <strong>not</strong> valid email address.<br/><b

asp.net - Prevent a LinkButton double click inside an UpdatePanel -

i have linkbutton inside updatepanel not want client click more once before updatepanel refreshes contents. right link button initiates partial postback every client side click until update panel has time refresh. particular link fires off expensive process i'd rather not have run unnecessarily. there .net standard way of doing this? whats solution this? thanks. use updatepanelanimationextender. can used create nice experience , prevent further interaction until update panel has finished. combine dgh's server side boolean prevent user refreshing page , submitting again (store boolean in session state). more information updatepanelanimationextender can found here: http://www.asp.net/ajax/ajaxcontroltoolkit/samples/updatepanelanimation/updatepanelanimation.aspx

How to hide div that without id/class by jquery? -

how hide first/second div jquery? div can not id/class! <body> <div> <p>ssssssss</p> </div> <div> <p>ttttttttt></p> </div> <div> <p>fffff</p> </div> </body> to hide first <div> element, do: $("div:eq(0)").hide(); to hide second <div> element, do: $("div:eq(1)").hide(); to hide both first , second <div> elements, do: $("div:lt(2)").hide();

bash - How can I use find to search for symbolic links? -

this have: abc:~/findtests$ ls -l total 0 lrwxrwxrwx 1 abc abc 22 2010-11-30 14:32 link1 -> /home/abc/testpy1.py i trying search link link1 in current directory. i did : abc:~/findtests$ find -l . -lname 'link1' abc:~/findtests$ find -p . -lname 'link1' abc:~/findtests$ find -l . -lname 'test*' abc:~/findtests$ find -p . -lname 'test*' but not output. doing wrong ? to start with, man page: "using -l causes -lname , -ilname predicates return false." the target of symbolic link doesn't match 'test*' because there full path. try '*/test*'.

ReSharper 4.5: Code coloring options don't seem to be applied for me in VS 2008 SP1 -

when go tools->options->fonts , colors able see of resharper options. problem when change color "resharper field identifier" or "resharper local variable identifier" doesn't seem anything. know why be? turn on "use color identifiers" feature in resharper settings.

javascript - Handling clicks outside an element without jquery -

i implement solution this how detect click outside element? but i'm using javascript library $() function defined any suggestions? this easy accomplish. shame load jquery library 1 feature. if other library you're using handles event binding, same thing in library. since didn't indicate other library is, here's native solution: example: http://jsfiddle.net/patrick_dw/wwkjr/1/ window.onload = function() { // clicks inside element document.getelementbyid('myelement').onclick = function(e) { // make sure event doesn't bubble element if (e) { e.stoppropagation(); } else { window.event.cancelbubble = true; } // place code element here alert('this click inside'); }; // clicks elsewhere on page document.onclick = function() { alert('this click outside'); }; };

c# - What's the order of executables looking for DLLs? -

possible duplicate: in order locations searched load referenced dlls? i have executable foo.exe references bar.dll. have put bar.dll in same folder foo.exe or put bar.dll in gac. wondering if can put bar.dll in directory(say bin directory) , ask foo.exe dlls in directory? also, what's order foo.exe looks dlls? current folder first? gac? you'll need handle appdomain.assemblyresolve event if assemblies neither in gac or local directory.

activerecord - Rails model associations, has_many :through and has_one with the same model -

i have 2 models: user , state. state model has records each of 50 states in united states. i each user have 2 attributes: 1 "home" state, , many states "visit". i know have set sort of model associations achieve this, not sure when best approach is. here's have far, know there must wrong have has_many , has_one association same model. #user.rb class user < activerecord::base has_many :visits has_many :states, :through => :visits has_one :state end #visit.rb class visit < activerecord::base belongs_to :user belongs_to :state end #state.rb class state < activerecord::base has many :visits has many :users, :through => :visits belongs_to :user end any suggestions? you can't have has_many , has_one relationship on single model, in case state. 1 solution to: create static model of states, not need database model, static variable on state model: us_states = {'1' => 'ak', '2

Software Code Review -

i need code review group's project , have code review on group project. have never done code review, guys know can find example know has in it? there no 1 way. work, use crucible. amounts commenting on code. things out for: ensure code meets standards (set department perhaps) proper formatting syntax errors (these worst - person must, @ least, have compiled code) logical errors (actual errors in logical flow of code) risky/fragile/error-prone code code hard maintain software antipatterns bad practices/code smells improper naming of variables/methods (self-documenting code important; make sure name methods , variables properly) race conditions (in multithreaded code) buffer overflows infinite recursion edge cases have not been handled there many more; things "don't right". when performing code review: criticize code, not person . don't combative or brusque instead of saying *"you should doing x, y, z! you're doing (a, b,

delphi - MS ACCESS Database Password - How secure? -

i have program written in delphi 7, uses ms access 2000 database backend. i have password protected ms access 2000 database file (*.mdb) 16 character password consisting of misture of numeral, control, uppercase, , lowercase characters. however, looks there number of programs on market claim password can retrieved. purpose of database password if case? there anyway make not retrievable? tighten encryption speak? thanks is there anyway make not retrievable? tighten encryption speak? it depends; can either change database , more secure 1 (e.g. ms sql server compact edition), or if want stay on ms access , security of data important you, go encrypting important fields using encryption algorithm (e.g. aes). if going encrypt fields, can transparently in delphi; each db field in delphi derived tfield class, , has 2 events called ongettext , onsettext. ongettext fired every time try read field's data, , onsettext fired every time try write field. can encr

mysql - MyISAM Selects locks inserts inside procedure only -

we have large myisam table rows inserted bottom of table only. while doing benchmarks, realized selects not (always) lock other inserts same table. however, when inserts coming stored procedure/function locked select. why that? to demonstrate behavior: create table foo ( id int not null auto_increment, bar varchar(200), primary key(id)) engine=myisam; --insert foo 10m rows delimiter $$ drop procedure if exists insertproc$$ create procedure insertproc(in vbar varchar(255)) begin insert foo(bar) values (vbar); end$$ delimiter ; run following query: select count(*) foo instr(bar, 'abcdefg') > 0; while select running, open new connection , run following insert query: insert foo(bar) values ('xyz1234'); that insert run , return right away, if run following query: call insertproc('xyz1234'); now query locks , waits select complete. mysql version: 5.0.51 running on window server 2k3 thank you. -- update here profile

C++ Vectors of Objects and Pointers -

this contrived example illustrates problem i've encountered. basically, create vector of objects, vector of pointers objects, print pointers , dereferenced objects. #include <vector> #include <iostream> using namespace std; namespace { struct myclass { int* myint; myclass(int* i) : myint(i) {} }; struct mybigclass { vector<myclass> allmyclassrecords; // keep myclass instances vector<int> theints; void loadmyclasses(); void readmyclasses(); mybigclass() {} }; } void mybigclass::loadmyclasses() { (int = 0; < 10; ++i) { theints.push_back(i); // create int int *j = &theints[theints.size() - 1]; // create pointer new int allmyclassrecords.push_back(myclass(j)); // create myclass using pointer } } void mybigclass::readmyclasses() { (vector<myclass>::iterator = allmyclassrecords.begin(); != allmyclassrecords.end();

c# - Unexpected Result while joining two datatables? -

object combinedrows = dt1 in dsresults.tables[0].asenumerable() join dt2 in dsresults.tables[1].asenumerable() on dt1.field<string>("methodname") equals dt2.field<string>("methodname") select new { dt1, dt2 }; datatable finaldt = new datatable("finaltable"); finaldt.columns.add(new datacolumn("sp",typeof(string))); finaldt.columns.add(new datacolumn("method",typeof(string))); finaldt.columns.add(new datacolumn("class",typeof(string))); finaldt.columns.add(new datacolumn("bllmethod",typeof(string))); datarow newrow = finaldt.newrow(); finaldt.rows.add((datarow)combinedrows); datagridview5.datasource = finaldt; the above coding gives result in first column follows: system.linq.enumerable+d__61 4[system.data.datarow,system.data.datarow,system.string,<>f__anonymoustype0 2[system.d

visual studio 2010 - Which header file should I include for using _swprintf_s()? -

when used _swprintf() , said might unsafe , should use _swprintf_s instead. but when used _swprintf_s() , said error c3861: '_swprintf_s': identifier not found which header missing? it swprintf() , swprintf_s(). no leading underscore.

WordPress Notice "Undefined Index" -

i getting following notice in wordpress notice: undefined index: _wpnonce in /var/www/vhosts/abc.biz/php/func.php on line 338 any solution? help i found solution, have use isset() check _wpnonce value, before comparing it. if ( isset($_post['_wpnonce']) && $_post['_wpnonce'] = '123456789' ) {} thanks.

Is there a windows registry entry for the original background location? -

is there windows registry entry original background location? @ "hkey_current_user\control panel\desktop", value "wallpaper" "c:\users\currentuser\appdata\roaming\microsoft\windows\themes\transcodedwallpaper.jpg". it depends how wallpaper got there. this works on windows 7, when wallpaper set via control panel , wallpaper slideshows enabled: hkey_current_user\software\microsoft\internet explorer\desktop\general\wallpapersource in other situations, however, key may not exist or may stale. (ignore fact has "internet explorer" in path. knows why is, ie isn't involved!) (fwiw, found/used when making desktop context menu (via vbscript) delete current wallpaper. here is if it's useful.)

Is there a way to toggle the "Hidden" or "Read-Only" switches on a Windows file using PHP? -

updated as title says, there way toggle "hidden" or "read-only" switch on windows using php? i'd without opening shell exec() if possible. a file can't hidden , it's in file system. there's *nix convention files starting . not shown default operations (like ls command), if don't hard enough. same goes windows, windows handles file meta attributes. what can/should use file permissions make folder/file inaccessible has no business accessing it. use chmod , chown , chgrp php. may have learn bit proper file system permissions though.

c - Testing for builtins/intrinsics -

i have code uses gcc intrinsics. include code in case intrinsic missing. how can this? #ifdef __builtin_ctzll does not work. with recent versions of clang possible check if builtin intrinsics exist using __has_builtin() macro e.g. int popcount(int x) { #if __has_builtin(__builtin_popcount) return __builtin_popcount(x); #else int count = 0; (; x != 0; x &= x - 1) count++; return count; #endif } let's hope gcc support __has_builtin() in future.

How to create Design QR codes with Java? -

Image
i create design qr codes java. design qr codes may contain logo in form of graphic. here's example such designed codes. how create such qr codes? i found software makes possible create such qr codes. there's different way put pictures in qr codes. instead of scribbling on redundant pieces , relying on error correction preserve meaning, can engineer encoded values create picture in code no inherent errors, these: the software developed in go , available via http://code.google.com/p/rsc/source/browse/qr the author describes en detail under http://research.swtch.com/qart

xml - Move/Copy node to multiple child nodes with XSLT -

i'm new xslt , need solve 1 of issues. want accomplish this: i have file looking this: <transaction> <date>2010-10-14t12:06:12.164+01:00</date> <production>no</production> <document fun:oid="1.9.101106"> <documenttype xmlns="">monthly a</documenttype> <rangename xmlns="">range name</rangename> <name xmlns="">equity</name> <language xmlns="">english</language> <class xmlns="">a acc</class> <active xmlns="">yes</active> <country xmlns="">uk</country> <country xmlns="">luxembourg</country> <country xmlns="">denmark</country> <country xmlns="">malta</country> <primary fun1:oid="1.9.101106" xmlns="&quo

android - Creating my own Actitivities and XML-based layouts -

i'm developing game in android game engine has custom layouts show data user. don't think why it's done in way. it's example. now, want migrate game unity. my game collaborative game needs show users connected game. game uses rest service communicate others players. also, game splits in challenge, , need list show them. can of unity? may merge actual android project unity project?

xcode - How to show code window full screen next to Groups and Files -

xcode seems split code window , show file name in top segment , code in bottom segment. know how set permanently that code window shown on right , groups , files on left shift+command+e hides top segment. state of window remembered, kind of permanently.

.net - Identifying target machine (32 bit or 64 bit) with ClickOnce deployment -

i have windows forms application , deploying application through clickonce deployment. now, i've third-party dll file , has different versions 32-bit , 64-bit os. is possible deploy different dll files based on target machine (32-bit or 64-bit) through clickonce? [edit] it's not necessary use reflection. can add reference program directly in loader , kick off. did blog post code @ tech , me . include both versions in deployment, name them differently. have loader app check if on 32bit or 64bit system, copy correct dll (eg thirdparty64.dll -> thirdparty.dll) real program linked to, , invoke program loader example assembly.load , use reflection start main method. an easier method compile application run x86, ensuring run in 32bit mode. if don´t rely on specific application being installed on machine in 32/64bit versions best choice.

Set timezone to EST in Google App Engine (Python) -

can advise how change timezone google app engine application? it's running python, need set timezone datetime.now() etc work on est timezone instead of default? thanks! have @ http://timezones.appspot.com/ you can not make datetime.now() use custom time zone can convert time per requirements.

java - Can I set the proxy on the command line when using org.apache.commons.httpclient? -

if application uses java.net.* routines, can set proxy when invoking application this: java -dhttp.proxyhost=proxy.server.com -dhttp.proxyport=8000 <whatever-the-app-is> however, have application (which can't change) using org.apache.commons.httpclient http communication. doesn't specify procxy server, use default httpconnection. there way can tell apache http client command line use proxy server? unfortunately, don't think can. way application read system property , set in defaulthttpparams object. take @ this thread on httpclient-user group more details.

compiler construction - C#: Declare that a function will never return null? -

background: there developer principle "should function return null or throw exception if requested item not exist?" wouldn't discuss here. decided throw exception cases have return value , value wouldn't exist in cases of (programmatically or logically) invalid request. and question: can mark function compiler knows never return null , warn checks if return value null? you can using code contracts . example : public string method1() { contract.ensures(contract.result<string>() != null); // }

jQuery TimePicker - using dd/mm/yyyy -

has used trent richardsons timepicker? it's wonderful plugin, can't seem change format of date dd/mm/yyyy has used control , knows if can done? this works > datepicker2.datepicker({ dateformat: > 'dd/mm/yy', changemonth: true, > changeyear: true, showanim: '', > showtime: true, duration: '' > });

logging - Android desktop log viewer -

Image
my android application may save logcat logs file. log file sent developers analysis. is there nice desktop android log viewer application, visualize these logs? i wasn't able find ready use tool in android sdk. maybe missed there? desktop tool reading android logcat log file, same ddms. the purpose of tool allow developers locate, analyze, problem-solving, rather struggling in log file. feature: http://code.google.com/p/androidlogcatviewer/wiki/keyfeature download: http://code.google.com/p/androidlogcatviewer/downloads/list discuss-group: http://groups.google.com/group/androidlogcatviewer

python - Conversion of miles to latitude and longitude degrees using geopy -

background i want add model manager function filters queryset based on proximity coordinates. found blog posting code doing precisely want. code the snippet below seems make use of geopy functions have since been removed. coarsely narrows down queryset limiting range of latitude , longitude. # prune down set of locations can check precisely rough_distance = geopy.distance.arc_degrees(arcminutes=geopy.distance.nm(miles=distance)) * 2 queryset = queryset.filter( latitude__range=(latitude - rough_distance, latitude + rough_distance), longitude__range=(longitude - rough_distance, longitude + rough_distance) ) problem since of used geopy functions have been removed/moved, i'm trying rewrite stanza. however, not understand calculations---barely passed geometry , research has confused me more helped me. can help? appreciate it. it looks distance in miles being converted nautical miles, each equal minute of arc, 1/60th of arc d

vb6 migration - Class not registered error VB.NET 2008 -

hello, have converted vb 6 project vb.net 2008 1 of forms throws following error in design mode. class not registered (exception hresult: 0x80040154 (regdb_e_classnotreg)) here call stack: at system.windows.forms.unsafenativemethods.cocreateinstance(guid& clsid, object punkouter, int32 context, guid& iid) @ system.windows.forms.axhost.createwithoutlicense(guid clsid) @ system.windows.forms.axhost.createinstancecore(guid clsid) @ system.windows.forms.axhost.createinstance() @ system.windows.forms.axhost.getocxcreate() @ system.windows.forms.axhost.set_site(isite value) @ system.componentmodel.container.add(icomponent component, string name) @ system.componentmodel.design.designerhost.add(icomponent component, string name) @ system.componentmodel.design.designerhost.system.componentmodel.design.idesignerhost.createcomponent(type componenttype, string name) @ system.componentmodel.design.serialization.designerserializationmanager.createinstance(type type, icollection argume

vb.net - opening up web browser from winform -

done quite bit of looking not finding need. win form i'd open web browser passing in url. need provide authentication while doing this. tried using system.diagnostics.process.start("http://userid:pw@site") not work. hoping lend hand. thanks shannon using tip.. here have... dim m new system.security.securestring dim pw string = "mypassword" each c char in pw m.appendchar(c) next dim pis processstartinfo = new processstartinfo("http://test/pagegoingafter.aspx") pis .username = "userid" .password = m .useshellexecute = false end process.start(pis) i'm getting logon failure: unknown user name or password. it's seems strange me.. if in firefox http://userid:mypassword@test/pagegoingafter.aspx can page. if same thing in ie 8... no joy. so there else can done ie work.. cause i'm thinking allow above code work well. you can provide credentials

objective c - Iphone CLLocationCoordinate2D -

i new @ iphone , have problem. i have code for (int i=0; i<2; i++) { datos *datos = (datos *)[arr_datos objectatindex:i]; cllocationcoordinate2d coord; annotationitem *annotationitem = [[annotationitem alloc] init]; coord.latitude =[datos.latitud doublevalue]; coord.longitude = [datos.longitud doublevalue]; nslog(@"coord %f",coord.longitude); nslog(@"coord %f",coord.latitude); [annotationitem setcoordinate:coord]; //[annotationitem setestacion:estacion]; [mapview_ addannotation:annotationitem]; [annotationitem release]; } the problem doesn't done anything but if change coord.latitude=40.444 , coord.longitude=-3.700; this gives me want, don't want this, because have array many latitudes , longitudes. can me this? when put coord.longitude=[datos.longitude floatvalue]; , doesn't work? i'm using xcode 3.2.2 thanks , forgive me english. the problem had change values, putting wr

How can I access other extJS objects from within extJS click events? -

in below code in click event menuitem1 object, how can change html content of rendercontent object when user clicks menu item's header, content in middle of page changes? (in examples at, click events creating new objects not changing existing objects.) ext.onready(function(){ var menuitem1 = new ext.panel({ id: 'panelstart', title: 'start', html: 'this start menu item.', cls:'menuitem' }); var menuitem2 = new ext.panel({ id: 'panelapplication', title: 'application', html: 'this application page', cls:'menuitem' }); var regionmenu = new ext.panel({ region:'west', split:true, width: 210, layout:'accordion', layoutconfig:{ animate:true }, items: [ menuitem1, menuitem2 ] }); var regioncontent = new ext.panel({ region: 'cent

ios4 - If i publish an book in iBooks can I get the buyers information? -

if publish book in ibooks can buyers information? apple offer way information of buyers. want know buyer both , email address can include in specific campaign. apple doesn't allow access information folks have downloaded ibook, won't able email addresses. have access geographic location, , breakdowns week, day, month, etc, give ability see how sales affected other campaigns decide pursue. can find of inside itunes connect.

c# - HLSL Computation - process pixels in order? -

imagine want to, say, compute first 1 million terms of fibonacci sequence using gpu. (i realize exceed precision limit of 32-bit data type - used example) given gpu 40 shaders/stream processors, , cheating using reference book, can break million terms 40 blocks of 250,000 strips, , seed each shader 2 start values: unit 0: 1,1 (which calculates 2,3,5,8,blah blah blah) unit 1: 250,000th term unit 2: 500,000th term ... how, if possible, go ensuring pixels processed in order? if first few pixels in input texture have values (with rgba simplicity) 0,0,0,1 // initial condition 0,0,0,1 // initial condition 0,0,0,2 0,0,0,3 0,0,0,5 ... how can ensure don't try calculate 5th term before first 4 ready? i realize done in multiple passes setting "ready" bit whenever value calculated, seems incredibly inefficient , sort of eliminates benefit of performing type of calculation on gpu. opencl/cuda/etc provide nice ways this, i'm trying (for own

exec - php can't execute any external command? -

we moved slackware centos here, working fine without notice, php stopped executing external calls such calls "wc" , "spamc". such calls appear on error_log as: sh: /usr/bin/spamc: permission denied the paths correct. have permissions set correctly , apache supposed able execute files no problem. we're not on safe_mode , not have base_dir set. not selinux, or @ least sestatus says selinux disabled. summary: php can't execute thru exec() or popen() paths binaries correct. we not in safe mode we don't have base_dir set permissions on binaries allow apache user execute them selinux disabled disable_functions in php.ini empty we have no clue why doesn't work php version 5.3.3 , centos 5.5 anyone has clue of might happening? in advance selinux blocking attempts run them. recommend come rules allow run subset of external commands required , load module.

javascript - making fields observable after ajax retrieval in knockout.js -

i wondering how can make fields observables in knockout.js ajax call without having define whole object in viewmodel. possible? here have far: var viewmodel = { lines: new ko.observablearray([]) }; function refreshlist(ionum) { var data = {}; data['ionum'] = ionum; $.ajax({ url: 'handlers/getlines.ashx', data: data, cache: false, datatype: 'json', success: function(msg) { viewmodel.lines(msg); //here attempting make email address field observable /*for (var = 0; < msg.length; i++) { viewmodel.lines()[i].emailaddress = new ko.observable(msg[i].emailaddress); }*/ //alert(viewmodel.lines[0].emailaddress); //ko.applybindings(viewmodel); } }); } with the mapping plugin knockout can define view model plain javascript object, returned ajax call: var viewmodel = ko.mapping.fromjs(data); // every time data received server: ko.mapping.updatefro

c# - what is the meaning of data hiding -

one of important aspects of oop data hiding. can explain using simple piece of code data hiding , why need it? i'm guessing data hiding mean encapsulation or having variable within object , exposing , modify methods, when want enforce logic setting value? public class customer { private decimal _accountbalance; public decimal getbalance() { return _accountbalance; } public void addcharge(decimal charge) { _accountbalance += charge; if (_accountbalance < 0) { throw new argumentexception( "the charge cannot put customer in credit"); } } } i.e. in example, i'm allowing consuming class balance of customer , i'm not allowing them set directly. i've exposed method allows me modify _accountbalance within class instance adding via charge in addcharge method. here's article may find useful.

Write a Struts2 Plugin -

can suggest me tutorial or documentation write struts2 plugin other official one? thanks! i found tutorial useful - write struts2 plugin

iphone proxy connection -

i need use nsurlconnection throw proxy server, how can this, may body face problem ? i think you'll need use cfurlconnection (the lower-level c style classes) instead of nsurlconnection accomplish this, more information on you're trying helpful.

iterator - Iterating a dataProvider in flex -

i'm wondering... want iterate through dataprovider, in component based on dropdownlist. first thing, didn't work (it compiled, never iterated), was: var o:object; each (var o:object in dataprovider) { } i guess didn't work because ilist doesn't provide objects, or able explain easily. i tried looks horrible efficiency perspective, nonetheless works. it: for (var i:int = 0; < dataprovider.length; i++) { o = dataprovider.getitemat(i); } but horrible felt tempted ask here possible solution. update: i'll try elaborate... i'm making (well, made already) component that, being dropdownlist, bindable, not index (like selectedindex="@{variable}"), value of variable inside of arraycollection. say, have dataprovider 2 objects: {a:'5', nmb:'five', blabla:'cinco'} , {a:'39', nmb:'thirty-nine', blabla:'treinta y nueve'} . this component, if declared this: <com:ddlistn idxname="a&q

CSS Circle border -

<!doctype html> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>1</title> <style type="text/css"> body{margin:100px;} #x { position:relative; width:300px; height:360px; background-color:#07284a; -moz-border-radius: 30px; -webkit-border-radius:30px; -khtml-border-radius:30px; border-radius:30px; border:1px solid #37629b; } #f { background-color:#07284a; width:126px; height:126px; position:absolute; right:-63px; top:-63px; -moz-border-radius: 63px; -webkit-border-radius:63px; -khtml-border-radius:63px; border-radius:63px; border:1px solid red; } </style> </head> <body> <div id="x"> <div id="f"></div> </div> inside block "x" shown red border of circle... how can remove 25% borders circle? s

windows - Powershell pass user input to icacls -

currently writing powershell script automate security measures , have run small problem. icacls mydirectory /inheritance:r /grant:r 'administrators:f' $mygroup + ':f' will fail $mygroup gets tacked onto icacls call , fails add permissions both groups. on windows 7 , context of powershell. the parser sees $mygroup + ':f' 3 individual arguments. can use either: "${mygroup}:f" or ($mygroup + ':f') to provide info parser 1 argument.

object - DDD - Aggregate Root - Example Order and OrderLine -

i trying hands dirty learning ddd (by developing sample ecommerce site entities order , orderlines , product , categories etc). perceive aggregate root concept thought order class should aggregate root orderline . things went fine far, confused when define create order flow ui. when want add order line order object, how should get/create instance of orderline object: should hardcode new orderline() statement in ui/service class should define method parameters productid , quantity etc in order class? also, if want remove hardcoded instantiations ui or order class using di. best approach this? from perceive aggregate root concept thought order class should aggreagrte root orderline. yes, orderline's should under order root, since orderline's make no sense outside of parent order. should hardcode new orderline() statement in ui/service class probably not, though how happens , made work. problem, see it, object construction happe

C# SQLite Parameterized Select Using LIKE -

i trying sql query such select * [table] hostname '%myhostname%'; this works fine in plain sql, when use system.data.sqlite in c#, works literal, not parameter, such string sel = "select * [table] hostname '%@host%'"; ... command.parameters.addwithvalue("@host", "myhostname"); this returns no results. you can't that. parameters must complete values - it's not string substitution sql. instead: string sel = "select * [table] hostname @host"; ... command.parameters.addwithvalue("@host", "%myhostname%");

c# - Debugging weirdness with BeginInvoke -

i have following method: protected void onbarcodescan(barcodescannereventargs e) { if (barcodescan != null) { //barcodescan.begininvoke(e, null, null); barcodescan(e); } } when try step above method works fine. able step in , on parts of method. however, if switch comment (so barcodescan(e) commented out , remove comment on barcodescan.begininvoke(e, null, null) cannot step part of onbarcodescan method (ie break point on if (barcodescan != null) not hit. i tried putting debug statements in there too. long begin invoke call in there not let me step method. i checked output , when try step in says this: a first chance exception of type 'system.notsupportedexception' occurred in scannertest.exe step into: stepping on method without symbols 'symbol.marshaller.symbolmessagewindow.wndproc' step into: stepping on method without symbols 'microsoft.windowsce.forms.messagewindow._wndproc' why whole method un step

java - How to stop Maven's verify phase rebuilding the artifact? -

imagine java project built using maven have: some fast-running unit tests that: developers should run before committing my ci server (hudson, fwiw) should run upon detecting new commit, giving instant feedback in case of failures some slow-running automated acceptance tests that: developers can run if choose, e.g. reproduce , fix failures my ci server should run after running unit tests this seems typical scenario. currently, i'm running: the unit tests in "test" phase the acceptance tests in "verify" phase there 2 ci jobs configured, both pointing project's vcs branch: "commit stage", runs "mvn package" (compile , unit test code, build artifact), if successful, triggers: "automated acceptance tests", runs "mvn verify" (set up, run, , tear down acceptance tests) the problem job 2 unit tests , builds artifact-under-test on again (because verify phase automatically invokes package phase). u

cluster analysis - Data clustering algorithm -

what popular text clustering algorithm deals large dimensions , huge dataset , fast? getting confused after reading many papers , many approaches..now want know 1 used most, have starting point writing clustering application documents. to deal curse of dimensionality can try determine blind sources (ie topics) generated dataset. use principal component analysis or factor analysis reduce dimensionality of feature set , compute useful indexes. pca used in latent semantic indexing , since svd can demonstrated pca : ) remember can lose interpretation when obtain principal components of dataset or factors, maybe wanna go non-negative matrix factorization route. (and here punch! k-means particular nnmf!) in nnmf dataset can explained additive, non-negative components.

wpf - Debugging: Why a data-bound section breaks off when DataContext is reapplied? -

Image
update 2010 06 12 distilled essence out smaller sample - solution available here http://db.tt/v6r45a4 it seems problem related tab control : when data context reapplied (click button), seems works expected. bindings refresh bindings on active tab broken. you can verify selecting tab , clicking button, you'd see controls on tab go kaput. added bunch of logging statements how friend arrived @ synopsis , fix [ set datacontext="{binding}" on tab control ] but we're still not sure why behaves way does... tabcontrol data context set reprotabitembug.mainviewmodel tabpage [lefttabpage] data context set reprotabitembug.leftviewmodel system.windows.data error: 40 : bindingexpression path error: 'middleprop' property not found on 'object' ''mainviewmodel' (hashcode=50608417)'. bindingexpression:path=middleprop; dataitem='mainviewmodel' (hashcode=50608417); target element 'textbox' (name='middletabtextbox'); tar