Posts

Showing posts from January, 2012

search - jqGrid multiple filters and searchoptions -

we have grid allows multiple filter search: $("#"+gridid).jqgrid({ colnames: ['a', 'b'], colmodel :[ {name:'a', index:'a', stype:'select', search: true, searchoptions: {sopt: ['eq','ne'], dataurl: '/api/a'}}, {name:'b', index:'b', stype:'select', search: true, searchoptions: {sopt: ['eq','ne'], dataurl: '/api/b'}} ], pager: '#div-pos-pager', loadonce: true, ignorecase: true }).navgrid('#div-pos-pager', {search:true, edit:false, add:false, del:false, refresh:false}, null, null, null, searchoptions); the search works great there 1 issue: you click search button in toolbar you select search column b, column b's data options appear then click minus sign beside b search row now have 1 line in existence column selected column b's search options still listed is there away around this? see column sele...

css - IE7 showing background-color in div with bg img despite stating 'transparent' -

i'm trying site behave in ie7 (how starting hate ie can't begin explain). here's site: http://tiger.directrouter.co.uk/~millbank/?page_id=21 as can see, quotes have grey background in ie7 not in other browsers. idea how can around this? quotes aren't fading in when first visit page should (this works in other browsers). thanks, osu just remove this background-color: rgb(77, 77, 79); from 5 divs. when remove in-line style, grey background removed in ie7. fading in ie9.

architecture - Is UML Class diagrams that great? -

so have been on couple research projects teacher of mine , loves uml class diagrams. after using them build complex data structure kept in database (representing graph can change based on physics of real world problem) i found uml not great use beyond initial stages. found 5 people, multidisciplinary, uml built. when programming starts, uml have changed. on , on , on , over... happened uml lag beyond projects progress due demands , worse thing happened happens... stale comments. do other people feel same way? there better tool? next project have decided go different route. define flow diagram of different user interactions. program programmed flow diagrams dictate rather structure of uml diagram. have found not have change structure of either 1 , new comers understand program quicker. is approach program grows above 30k lines of code? 50k? 100k? in uml defense this. building program in uml allow spot design patterns quicker. nice. does have input? ...

c++ - MPI_Barrier and recursion -

i'm trying use mpi_barrier (openmpi) force process in same depth of recursive call. this code #include <iostream> #include <fstream> #include <stdio.h> #include <mpi.h> using namespace std; void recursive_function(int,int,int); int main(int argc, char *argv[]) { int rank, size; mpi_init(&argc, &argv); mpi_comm_rank(mpi_comm_world, &rank); mpi_comm_size(mpi_comm_world, &size); recursive_function(0,3,rank); mpi_finalize(); } void recursive_function(int depth, int limit, int rank) { printf("depth: %d, processor %d\n", depth, rank); mpi_barrier(mpi_comm_world); if(depth == limit) return; else recursive_function(depth+1,limit,rank); } what (running mpirun -np 2 barrier) depth: 0, processor 0 depth: 1, processor 0 depth: 2, processor 0 depth: 3, processor 0 depth: 0, processor 1 depth: 1, processor 1 depth: 2, processor 1 depth: 3, processor 1 while expect depth: 0, proces...

ldap - Access to manage-account commands in OpenDS -

opends provides command-line access many necessary account functions via manage-account utility. example, disable account: manage-account set-account-is-disabled --operationvalue true --basedn uid=someuser,ou=people,dc=example,dc=com" --hostname hostname --port 389 --binddn "cn=directory manager" --bindpassword password this fine , dandy have sysadmin administer ldap server in scenario have 1000s of users on globe becomes problem (imagine user locked out of account in japan while sysadmin asleep in us). we'd able programmatically tie of these manage-account functions can provide local admins/managers ability manage own users. can provide insight on if possible , if how? writing in c# , can't find examples on it. looking @ .net api docs thought system.directoryservices.protocols.extendedrequest looked promising cannot figure out how use it. any appreciated, thanks! the manage-account tool uses ldap extended operation, code in opends/src/serv...

javascript - Looking for DUAL slideshow/carousel options -

a client wants share slides presentation on site, matching set of "annotations" alongside, requiring double, synchronized slideshow. i've managed find single jquery plugin, dualslider , this. seems suspicious wondered if might missing other options due naming, description, etc. aware of others? jquery preferred not absolute requirement. both panes should accept arbitrary content. the ability pull directly flickr galleries make happy, realize uncommon. i'm aware each set of slides composited single image file, etc. trying avoid moment. most single sliders offer way control sliders. for example, jquery cycle plugin (see: http://jquery.malsup.com/cycle/ ), can easialy accomplished creating 2 lists, giving them same timings , speed, , create buttons this: <div id="gallery1">... slideshow images/divs here</div> <div id="gallery1">... second slideshow images/divs here</div> <div id="nextbutton...

iPhone - UISegmentedControl segment width = 0? -

i have uisegmentedcontrol 3 segments , want change width of 1 segment 1 when user chooses segment. here code: // uisegmentedcontrol created [segmentedcontrol addtarget:self action:@selector(changeit:) forcontrolevents:uicontroleventvaluechanged]; //... // , changeit method: - (void) changeit:(id)sender { // discover original width of segment 1, restore later uisegmentedcontrol *seg = (uisegmentedcontrol*)sender; cgfloat segwidth = [seg widthforsegmentatindex:1]; // @ point segwidth = 0 ????????????????? // note: seg not nil @ point. printing seg console shows // valid uisegmentedcontrol... } any clues? thanks. documentation says "the default value {0.0}, tells uisegmentedcontrol automatically size segment."

indexing - Increase speed of a mySQL query -

i have table this. create table `accounthistory` ( `id` int(11) not null auto_increment, `date` datetime default null, `change_ammount` float default null, `account_id` int(11) default null, primary key (`id`), ) its list of account daily chargings. if need balance of account use select sum(change_ammount) accounthistory account_id=; quite fast becouse added index on account_id column. but need find time when account went in minus (date when sum(change_ammount)<0) use query: select main.date date accounthistory main main.account_id=484368430 , (select sum(change_ammount) accounthistory sub sub.account_id=484368430 , sub.date < main.date)<0 order main.date desc limit 1; but works slow. can propose beter solution? maybe need indexes (not on account_id)? the way make query faster use denormalization : store current account balance on every record. achieve this, you'll have 3 th...

Reasons file permissions may not match argument given to mkdir in php? -

i'm trying debug strange file permission issue involving php, , have exhausted obvious problems. note i'm not experienced php, might dead-obvious. i want user able create folder , files via web interface, , able work files separate user account on server backend work. problem created folders , files have no write or execute permissions other users. i don't have lot of knowledge in area, best hacky try see if explicitly passing 0777, though it's default, relevant mkdir fixed it. , every other mkdir call. , every chmod call. as far can tell, folder , files should created right permissions. know reasons permissions might differ naively expect? if unix need check umask web server user, if windows, ignores permissions. http://us.php.net/umask

vb.net - What is the equivalent of My.Resources in Visual-C++? -

i need iterate through resources in project , output names. have done in vb. can't figure out equivalent of my.resources.resourcemanager in vc++. here's vb code. dim objresourcemanager resources.resourcemanager = my.resources.resourcemanager dim objresourceset resources.resourceset = objresourcemanager.getresourceset(cultureinfo.currentculture, true, true) dim iterator idictionaryenumerator = objresourceset.getenumerator() private sub go() dim s string = iterator.key debug.writeline(s) end sub private sub button1_click(byval sender system.object, byval e system.eventargs) handles button1.click if iterator.movenext go() else iterator.reset() if iterator.movenext go() else throw new exception("no elements display") end if end if end sub and how far in vc++. private: resources::resourcemanager^ rmgnr; resources::resourceset^ rset; public: form1(v...

html4 - Is there any fixed size of the webpage? -

i have started html. making tables in it. tried breaking webpage 2 adding sidebar @ left confused size. standard size of webpage? here code, <!doctype html public "-//w3c//dtd html 4.01 transitional//en" "http://www.w3.org/tr/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <title>inter notes homepage</title> </head> <body> <table> <tr height="50"> <td width="200" height="610"></td> <td width="800" ></td> </tr> </table> </body> </html> there no standard size webiste such vary according screen size of user. can 1 of 2 things. can work in % based measurements, tables sizes can set stretch full browser size example 100%, or other size matter....

Very Slow Page Load - ASP/PHP CSS file latency -

i've searched this, can't find - maybe i'm describing badly!? anyway - have website (on iis 6 server) pages loads 2 or 3 css files, these css files asp files response headers set accordingly. the asp in files reads query string set colours of various css rules based on user preferences. i've noticed pages loading slowly, , using dev tools in chrome (although seems apply in browsers) see page load stalling on these css files, reported latency can 2 minutes - else takes few milliseconds. i've tried using php files instead of asp files, makes no difference! the website behind password can't demo - although try , set if - although isn't consistent, seem happen of time, can quite fast! any ideas try? thanks a couple of things can try using google's page speed or yahoo's yslow - both generate suggestions improve performance.

sparql - Import RDF data in SQL? -

i quite comfortable using sql having impossible time understanding sparql . starters, don't understand how @ structure of data (in mysql describe <table name> ) can query appropriate fields. is there way me import entire rdf dataset respective tables in mysql database? barring that, there way select * all tables (or whatever equivalent descriptor is) such can output data csv (and take there?) the rdf dataset trying query has sparql endpoint , guide on how sparql having hard time understanding it. for example: prefix meannot: <http://rdf.myexperiment.org/ontologies/annotations/> prefix sioc: <http://rdfs.org/sioc/ns#> prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> prefix mebase: <http://rdf.myexperiment.org/ontologies/base/> select distinct ?annotator_name { ?comment mebase:annotates <http://www.myexperiment.org/workflows/52> . ?comment rdf:type meannot:comment . ?comment mebase:has-annotator ?annotator ?anno...

libnotify - Can I customize the action GNU Screen takes when it alerts after monitoring for silence or noise? -

specifically, i'm looking able set screen monitor silence or noise in window, , instead of popping notification in terminal, send notification libnotify can see whether or not i'm in terminal. haven't been able find whether or not possible.

integer - JSON values 1 or 0 - int or boolean -

does json treat these same? or mix of integers , booleans? var data = { "zero" : 0, "one" : 1, "false" : 0, "true" : 1, "0" : false, "1" : true } json format transferring data. has no notion of equality. json parsers treat booleans , numbers distinct types.

entity framework - OData service does not return custom objects -

here want do: i have existing database need data. i created data contracts map them respective tables using entity framework. in example, have 3 tables - tblorder, tblproduct , tblcustomer. created 3 data contracts map these tables. entity framework annotations added data contratcs. wrote unit test test out data contracts. works expected direct entity framework calls. see unit test 1 below. added dataservicekey annotation each data contract. , wrap them odata service adding order context , data service svc. see below. wrote unit test access existing order data via odata sevice. problem: odata service returns non-custom data types on order object. returns null on custome data type fields, such customerinfo , productlist. am doing wrong? there special have odata calls work on objects using ef retrieval? [dataservicekey("id")] [table("tblorder", schema = "schonlinesale")] public class order { [column(...

Are there ASP.NET Session design patterns? -

are there ways of structuring session storage in asp? put string key, i'm thinking of taking more stringent measures. the issue has come because have application has use session heavily 2 reasons: the application has perform operations on data before presenting user. the application has validate choices before writing changes. my strategy has been build lists , store them in session on page load. i'm running several problems this. keep getting reports of things being 'entered users,' namely 1 of lists build , store in session shows values entered before they've had chance add them. i'm not sure why keeps happening, given rebuild lists stored in session on each load. suspect there lot of button pushing. are there ways design session storage lists stored unique instance of page? or, failing that, way of designing session storage unique page? generally, use session data can shared between pages, , specific user. what you're desc...

ios - How do I get properties out of NSDictionary? -

i have webservice returns data client application in json. using touchjson deserialize data nsdictionary. great. dictionary contains key, "results" , results contains nsarray of objects. these objects when printed log i.e nslog(@"results contents: %@",[resultsarray objectatindex:0 ]); outputs: results contents: { creationdate = "2011-06-29 22:03:24"; id = 1; notes = "this test item"; title = "test item"; "users_id" = 1; } i can't determine type object is. how properties , values object? thanks! to content of nsdictionary have supply key value want retrieve. i.e: nsstring *notes = [[resultsarray objectatindex:0] valueforkey:@"notes"];

java - Maven "Could not resolve dependencies" for openid4java -

summary: running "mvn war:war" fails errors including: "the following artifacts not resolved: org.openid4java:openid4java:jar:0.9.6". i'd chalk fact i'm maven noob see other people have posted openid4java web site stating jars missing maven central openid4java. details: i'm trying speed openid4java running simple-openid sample app that's included in latest version of openid4java (0.9.6.662). according readme "this demo requires apache maven2 build". readme states "the mvn war:war task should create war file can deployed copying war file". up i've been getting ant , mavent ant tasks figured i'd bite bullet today , install maven 3.0.3. followed install instructions , can run "mvn --version" when run "mvn war:war" number of files indeed downloaded local repository build fails following excerpted message: [error] failed execute goal on project simple-openid: not resolve dependencies ...

perl - Random Lookup Methodology -

i have postgres database table contains rows want @ pseudorandom intervals. want once hour, once day, , once week. lookups @ pseudorandom intervals inside time window. so, want once day should happen @ different time each time runs. i suspect there easier way this, here's rough plan have: have settings column each lookup item. when script starts, randomizes epoch time each lookup , sets in settings column, identifying time next lookup. run continuous loop wait 1 see if epoch time matches of requested lookups. upon running lookup, recalculate when next lookup should be. my questions: in design phase, looks it's going duct tape , twine routine. what's right way this? if chance, idea right way this, idea of repeating loop wait 1 right way go? if had 2 lookups back, there's chance miss 1 can live that. thanks help! add column table nextchecktime. use either timestamp or integer raw epoch time. add (non-unique) index on nextchecktime. when ad...

c# - How to split csv whose columns may contain , -

given 2,1016,7/31/2008 14:22,geoff dalgas,6/5/2011 22:21, http://stackoverflow.com ,"corvallis, or",7679,351,81,b437f461b3fd27387c5d8ab47a293d35,34 how use c# split above information strings follows: 2 1016 7/31/2008 14:22 geoff dalgas 6/5/2011 22:21 http://stackoverflow.com corvallis, or 7679 351 81 b437f461b3fd27387c5d8ab47a293d35 34 as can see 1 of column contains , <= (corvallis, or) // update // based on c# regex split - commas outside quotes string[] result = regex.split(samplestring, ",(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)"); use microsoft.visualbasic.fileio.textfieldparser class. handle parsing delimited file, textreader or stream fields enclosed in quotes , not. for example: using microsoft.visualbasic.fileio; string csv = "2,1016,7/31/2008 14:22,geoff dalgas,6/5/2011 22:21,http://stackoverflow.com,\"corvallis, or\",7679,351,81,b437f461b3fd27387c5d8ab47a293d35,34"; text...

php - SQL Count Down Timer -

i'm creating own penny auction script. i'm trying countdown timer work. since div refreshes every second anyway, don't need use jquery timer can go time of last bid. i'm able time of last bid using sql call $strfind="select * penny_bids `pennyid`=\"$pid\" order id desc limit 1"; $result=mysql_query($strfind) or die(mysql_error()); $row=mysql_fetch_array($result); $memname=$row['memname']; $btime=$row['time']; i thought current time minus btime give me time in seconds doesn't. $time=time()-$btime; gets me time stamp. how can get me 30 digits? counting down. each time div refreshes 29, 28, etc. when dates , times out of mysql they'll typically come in yyyy-mm-dd hh:mm:ss format. if want php computations on them you'll have convert them timestamps strtotime(). alternativly, can mysql computation you. functions subtime or date_diff might useful you.

android - ListView with custom arrayadapter won't update properly after call to onDestroy() then onCreate() -

i have listview custom array adapter: public class smsmessageadapter extends arrayadapter<contactmessage> { private arraylist<contactmessage> items; public smsmessageadapter(context context, int textviewresourceid, arraylist<contactmessage> items) { super(context, textviewresourceid, items); this.items = items; } @override public view getview(int position, view convertview, viewgroup parent) { view v = convertview; if(v == null) { layoutinflater vi = (layoutinflater)getcontext().getsystemservice(context.layout_inflater_service); v = vi.inflate(r.layout.message, null); } contactmessage c = items.get(position); if(c != null) { string name = c.getcontact(); if(name.equals("me")) v.setbackgroundresource(r.drawable.sms_history_outgoing_background_gradient); else v.setbackgroundresource(r.drawable.sms_history_incoming_background_gradient); textview contactname = (textview) v.findv...

c++ - same number is displayed for a single output but the output is as expected when there is more than 1 output -

this small program: #include <iostream> #include <cstdlib> using namespace std; int main() { long x = rand(); cout << x << endl; } it displays 41 .but if modify program , #include <iostream> #include <cstdlib> using namespace std; int main() { for( int = 0 ; <= 9 ; i++ ) { long x = rand(); cout << x << endl; } } the output expected.the set of random numbers. output : 41 18467 6334 26500 19169 15724 11478 29358 26962 24464 but why same number when run first program how rand function ? the random number generator built in compilers pseudo random number generator. typically use recursive equation generate next random number , use seed generate first random number. check link . to avoid having same random number first one, need change seed. again, same seed give same initial random number same random number sequence. should change seed every time run program/thread. to s...

eclipse - How to develop an android app on EclipseIDE using Maven framework? -

i have been stuck problem 3 days. want develop android app in maven framework using eclipse. have no idea maven framework. using apache maven. followed instructions in installing, it's showing version etc, when try set path repo, getting this c:\users\377759>cd mvn -declipse.workspace=<c:\users\377759\desktop\repo> eclipse:add-maven-repo access denied. and if give path without angular brackets, get.. c:\users\377759>mvn -declipse.workspace=c:\users\377759\desktop\repo eclipse:add-maven-repo [info] scanning projects... [info] searching repository plugin prefix: 'eclipse'. [info] org.apache.maven.plugins: checking updates central [warning] repository metadata for: 'org.apache.maven.plugins' not retrieved repository: central due error: error transferring file: repo1.maven.org [info] repository 'central' blacklisted [info] ------------------------------------------------------------------------ [error] build error [info] -------------------...

java - How to parse string to int? -

my string 743.4445 , want show 743 has parse double , parse int try this (int)(double.valueof(743.4445); (actually 743.4445 server don't know value) what suppose do? why not google "java whole number" double d = double.valueof(s.trim()).doublevalue(); heck, matter why not use indexof on string looking .? :)

html - How i can say browser to stop caching the mine page in Firefox? -

i have web-page load second page using jquery ajax , page load css load jquery code instead of embeded html code [in head tag]. the problem both chrome , firefox not refresh partial page if make change. in partial page partial.html if change , make refresh none of them change them in chrome it's work using ctrl +r firefox not know page goes changed still produce old things. that's problem have. how can told browser firefox stop caching page. this problem classically solved changing url of loaded data every time use it. instance, add parameter of random data url this: var url = "http://example.com/page.php?foo=bar&random=" + math.random(); to create url different every time, leads same data.

sql server 2008 return value getting shortened when using ISNULL and NULLIF -

i have select statement check whether phone number in null or empty , if return 'no phone number available'. this select name, isnull(nullif(phone, ''), 'no phone number available') phone person but when phone number null or empty not getting full text 'no phone number available'. first 20 characters getting returned. length of phone field 20. think returning text depending on length of phone field. is there way correct without changing field length? you correct. isnull uses datatype , length of first parameter. coalesce takes "highest precedence" one. so: coalesce(nullif(phone, ''), 'no phone number available') phone or isnull(nullif(cast(phone varchar(30)), ''), 'no phone number available') phone

c# - System.ArgumentException: Invalid postback or callback argument -

invalid postback or callback argument. event validation enabled using in configuration or <%@ page enableeventvalidation="true" %> in page. security purposes, feature verifies arguments postback or callback events originate server control rendered them. if data valid , expected, use clientscriptmanager.registerforeventvalidation method in order register postback or callback data validation. your code-generated (java)script contains xml or html markup, not allowed asp.net built-in xss validation.

Creating .NET web service with client certificate authentication -

i want limit access .net web service specific list of clients. attach client certificate every request , proper response if "on list". but how , best way implement this? on iis (7.0) can set require client certificate option, specify client certificates allow access? need public part of client certificates in certificate store of web server machine? or must setup handled in code, somehow extract client certificate id , match local list? or way? one way create wcf service on iis7 security requirements follows. in order host wcf service may need run following command on web server: "%windir%\microsoft.net\framework\v3.0\windows communication foundation\servicemodelreg.exe" -r –y on iis set site https binding (only) , under ssl settings set require ssl , require client certificates. this alone allow access service (and wsdl) client certificate valid , issuer trusted web server. in order restrict access specific certificates setup wcf conf...

Android opengles animated text logic? -

i have gotten text render using opengl es on android , trying find out how "animate" in pokemon games "reveals" characters left right @ speed. how done? basically, "text-sliding-in" other animations. for example, @ sample code: public class gameobject { // each element in char array contains // single character, representing serie of text. private char[] mtext; // frames before new character appears. private int mframes; // current frame. private int mcurrentframe; // current index (which character last). private int mindex; public gameobject(string defaulttext, int framespercharacter) { final int textlength = defaulttext.length(); mtext = new char[textlength]; (int x = 0; x < textlength; x++) { mtext[x] = defaulttext.charat(x); } mframes = framespercharacter; } public void drawtext() { // not have room enough explain ...

iphone - How to draw a triangle with QUARTZ 2D? -

i'm developing iphone app 3.1.3 sdk. i'm trying draw triangle transparent fill 1px black stroke code: cgcontextmovetopoint(ctx, position.x, position.y - (size.height / 2)); cgcontextaddlinetopoint(ctx, position.x - (size.width / 2), position.y + (size.height / 2)); cgcontextaddlinetopoint(ctx, position.x + (size.width / 2), position.y + (size.height / 2)); cgcontextfillpath(ctx); cgcontextsetlinewidth(ctx, 1.0); cgcontextstrokepath(ctx); cgcontextsetfillcolorwithcolor(ctx, [[uicolor clearcolor] cgcolor]); but black filled triangle. what doing wrong? if want draw path transparent fill - don't need fill - stroke when draw, seems cgcontextfillpath method redundant - remove it: cgcontextmovetopoint(ctx, position.x, position.y - (size.height / 2)); cgcontextaddlinetopoint(ctx, position.x - (size.width / 2), position.y + (size.height / 2)); cgcontextaddlinetopoint(ctx, position.x + (size.width / 2), position.y + (size.height / 2)); cgcontextsetlinewidth(ctx...

Add customize criteria in Drupal views -

i have created views wherein need list nodes based on package criteria content type.. these packages entered in content type text field , possible values platinum, gold , silver..... nodes listed should based on package values entered in content types higher package should appear first... in case platinum,, gold , silver... thanks in advance. in field configuration, set allowed values key|label. allow store different value against package shown user i.e. platinum can stored 'a', gold can stored 'b' etc. in views, add sort criteria sort field.

c# - Should I use the ReSharper rules for naming? -

i have small , new mvc application working on. installed trial edition of resharper , suggesting few (many) name changes. in particular it's suggesting method name changes getstorageaccount getstorageaccount , local variable name changes _questiontable questiontable , on. i application conform as possible. suggest spend hour changing it's done way resharper suggests. have time , time it. yes. resharper suggest. iirc resharper follwing .net naming guidelines resharper docs says default var usage is: can change explicit 'var' , vice versa, specifically: in iterators: uses var except simple types. in local variables: uses var when initializer has type usage

machine learning - Naive Bayes Classifier Biased Output? -

i'm using emgu cv implement machine learning technique in c# classify pixels of image 3 different categories. everything works perfect far, problem is automatic. want make semi-automatic mean user can "give weight" each of 3 outcomes. give user ability well-tune outcome. any idea how? the first thing can think of modify input in way have bias 1 of outputs (for example make more red modifying red channel). though maybe there generic way of doing i'm not aware of. thanks. usually you'd adapting prior probabilities in classification rule (what gaussian distributions likelyhood), seems implementation in emgucv not allow that.

Display list items on different sharepoint portal -

what think best way display items custom list (on sharepoint 2010) different portal on sharepoint 2007 minimum or not @ programming? i tried rss , not need, stuck iframe pointing custom page on sp2010 shows list items. under sharepoint 2007, can try tu use bdc feature (known business connectivity services(bcs) sharepoint 2010). it provides ability sharepoint 2007 consume external datas sap. describe in msdn complete tutorial: business data catalog

android - Could not find class error when trying to upload a video to YouTube using the gdata API -

i writing part of android application upload video youtube using google data api. have latest version of api google code, , have copied example developer's guide time being. everything compiles no warnings or errors, , app runs fine. when call service.insert(...) following stack trace: error/dalvikvm(19489): not find class 'com.google.gdata.data.media.mediabodypart$mediasourcedatahandler', referenced method com.google.gdata.data.media.mediabodypart.initmediadatahandler error/dalvikvm(19489): not find class 'javax.activation.datahandler', referenced method com.google.gdata.data.media.mediabodypart.initmediadatahandler error/dalvikvm(19489): not find class 'javax.mail.internet.mimebodypart$mimepartdatahandler', referenced method javax.mail.internet.mimebodypart.writeto error/dalvikvm(19489): not find class 'javax.activation.datahandler', referenced method javax.mail.internet.mimebodypart.attachfile error/dalvikvm(19489): not find class 'ja...

Sharp Architecture inheritance problem -

my problem inheritance. i have actor class using system.collections.generic; using sharparch.core; using sharparch.core.domainmodel; namespace proteria.net.common.domain { public class actor : entity { public actor() { init(); } private void init() { addresses = new list<address>(); } public virtual account account { get; set; } public virtual string number { get; set; } public virtual string telephone { get; set; } public virtual string fax { get; set; } public virtual string email { get; set; } public virtual string idnumber { get; set; } public virtual countrycode country { get; set; } public virtual ilist<address> addresses { get; set; } public virtual void addaddress(address address) { address.actor = this; addresses.add(address); } } } and 2 derived classes, using system.collections.generic; using sharparch.core; using sharp...

iphone - How to reach the current selected cell in didSelectRowAtIndexPath? -

i want change accessory view type of cell through method: didselectrowatindexpath , i.e. when row selected want change accessory view type, can inside method ? you can cell didselectrowatindexpath: method using indexpath this. uitableviewcell *cell = [tableview cellforrowatindexpath:indexpath];

Joomla JCE editor not loading in page loaded with Ajax -

Image
i have joomla 1.5 component uses call editor class display jce editor joomla instead of textbox. code part of 4 step form each step loading using ajax. last step contains message field users can write free text , calling using following code: $editor =& jfactory::geteditor(); echo $editor->display('description', $description, '100%', '150', '40', '30'); when step displayed, shows simple textbox without buttons format text etc. understand must issue javascript, having hard time finding how can trigger proper code textbox formatted properly. i have attached screenshot of how field looks like. and here html generated firebug: <!-- start editor --><label aria-visible="false" style="display:none;" for="description">description_textarea</label><textarea wrap="off" class="wfeditor source" style="width:100%;height:150px;" rows="30" cols="...

INSTALL_FAILED_MISSING_SHARED_LIBRARY:Android Open Accessory -

i know question has been posted many times unable clear answer anywhere. started separate post. problem install_failed_missing_shared_library , logcat shows shared library com.android.future.usb.accessory.jar missing. downloaded jar file separately , did adb push location system/framework , location looks ls system/framework ls system/framework sqlite-jdbc.jar com.android.future.usb.accessory.jar ext.jar pm.jar com.google.android.maps.jar services.jar core.jar svc.jar am.jar bouncycastle.jar android.test.runner.jar framework-res.apk ime.jar input.jar core-junit.jar android.policy.jar framework.jar monkey.jar com.android.location.provider.jar bmgr.jar javax.obex.jar # but still getting same error!! android version 2.3.4 , trying install demokit.apk available in developers website. i have running on htc g1, changes listed in this github thread : you must register library at: /etc/permissio...

python - multithreading performance issue -

possible duplicate: multithreading performance overhead i have piece of code run slower on multithread , faster while using 1 thread. output 1 thread : batch 0 finished in 0.0970576110595 batch 1 finished in 0.712632355587 batch 2 finished in 2.16707853982 batch 3 finished in 5.13259954359 batch 4 finished in 9.54205263734 total running time approx 17second output using multi-thread thread 0 finished in 60.4911733611 thread 1 finished in 62.5297083217 thread 2 finished in 65.5614617838 thread 3 finished in 66.8199233683 thread 4 finished in 66.8426577103 total running time 66 second. what being done in each process take 100 lines of text, split tokens, remove stopwords , generate patterns using algorithm, have experience or ways me identify went wrong? @mac's answer covers why, we'll need of code give more help. may want try, use multiprocessing instead of threading, have data access issues... threading in python on non-blocking io you hav...

iphone - TableViewCell Alignment Issue -

Image
i want align tableviewcell content below screenshot but alignment below only.. please 1 me do.. here code top aligning of label text. unfortunately there no directly method vertical alignment got uilabel. //code top aligning text of uilabel cgsize maximumsize = cgsizemake(290, 35); nsstring *datestring =[[[reviewdic valueforkey:@"reviews"] objectatindex:[indexpath row]] objectforkey:@"summary"]; uifont *datefont = [uifont fontwithname:@"helvetica" size:14]; cgsize datestringsize = [datestring sizewithfont:datefont constrainedtosize:maximumsize linebreakmode:reviewlabel.linebreakmode]; cgrect dateframe = cgrectmake(5, 17, 290, datestringsize.height); reviewlabel.frame = dateframe; ***reviewlabel repalced label , have make adjustments according need. hope help

Maven archetype to modify an existing project? -

i'm trying create archetype add data in existing pom file. actually, archetype specify distributionmanagement project not configured that. i know allowpartial attribute in archetype.xml file allow that, didn't figure out how it. is there way ? have use existing plugin ? have create own ? thanks in advance ! you run archetype:generate command in directory of project want update (with parameters - equal groupid/artifactid/version of existing project). note, apart <allowpartial>true</allowpartial> need <archetype-descriptor partial="true"> in archetype-metadata.xml

How can I predict which Wicket components will have their tags rendered in the final page? -

for wicket components, if call setoutputmarkupid(true) warn when rendered. markup id set on component not rendered markup. i'd output id every component end in html in order can find them xpath testing. how can predict class or properties of component whether sensible setoutputmarkupid(true) ? more detail - in application i'm overriding protected void init() { super.init(); addcomponentinstantiationlistener(new icomponentinstantiationlistener() { public void oninstantiation(component component) { if (!(component instanceof webmarkupcontainer)) return; if (component instanceof webmarkupcontainerwithassociatedmarkup) return; if (component instanceof border.borderbodycontainer) return; webmarkupcontainer container = (webmarkupcontainer) component; if (container.istransparentresolver()) return; component.setoutputmarkupid(true); }}); for sample of pages, arbitrary gub...

magento - Getting the reviews page URL for a product in the product page sidebar -

i trying url products reviews page in sidebar on products page. know can't difficult, defeating me @ moment.. i can product page url (basically url page sidebar on) not reviews page... same url -reviews.htm @ end instead of .htm where going wrong? call have make? in (your theme) catalog.xml file find section beginning <catalog_product_view translate="label"> look <reference name="right"> . if template not have right section in product view, add 1 in below content , enter: <reference name="right"> <block type="review/product_view_list" name="product.info.product_additional_data" as="reviews" template="review/product/view/list.phtml"/> </reference> make sure have cache off, load product page (hopefully product review on there) , should have necessary. you'll wanting have 'add review' box on product page make easier people add re...

Bindmodel to binded model? Cakephp -

Image
i bind productsphoto children using bindmodel method: $this->category->bindmodel(array ('hasmany' => array( 'productsphoto' => array... how can bind productsphoto every product item? or maybe other solution suggestion? in controller ,write below code $this->productsphoto->bindmodel('hasmany' => array('product.productphoto_id' => 'productphoto.id'); in productphoto model, var $hasmany = array( 'product' => array( 'classname' => 'productphoto', 'foreignkey' => 'productphoto_id', 'conditions' => '', 'fields' => '', 'order' => '', 'countercache' => '' ), );

c# - Better Way To Expose Api for Asp.net Website -

need help...... trying expose api's auction website(asp.net 4.0) using c# allow our customer create sale , add products own applications , let them published on our website. want know best way expose api in terms of security , compatibility our technologies php , java,so can consume api's. if can suggest patterns or example references great. build rest based web service. benefit of rest based web service can consumed large variety of languages. security can use basic authentication on ssl. this can starting point rest in windows communication foundation

objective c - How to get combined feeds for Artist and Fan Tweets in iPhone? -

i need artist tweets , fan tweets combined. how combined feeds artist , fan tweets in iphone? fan tweets link : http://search.twitter.com/search.atom?q=<artistname> artist tweets link: https://api.twitter.com/1/statuses/user_timeline.rss?screen_name=<twitternameforartist>&count=50&page=1 parse them , combine them in nsdictionary or whatever prefer.

android - layout with text surrounding a button -

Image
could 1 suggest me how implement layout following: that's multiple lines of texts surrounding button. linear layout? you have create two linear layouts inner layout horizontal orientation ( 1 textview , 1 button) outer layout verticalr orientation wil have textview wrap content similar following <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <linearlayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="fill_parent"> <textview android:id="@+id/list" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <button android:id="@+id/button1" android:layout_width=...

visual studio - SQL Server 2005 + Entity Designer -- Foreign Key constraint error? -

using entity designer in vs2010 build database sql server 2005. having problem when try build tables via sql generated "generate database model"; tables created correctly, croaks on foreign key constraints. the entities @ issue laid out here: world: world_id [int32] (primary key) name [string] zone: world_id [int32] (primary key, fk on world.world_id) zone_id [int32] (primary key) name [string] region: world_id [int32] (primary key, fk on zone.world_id) zone_id [int32] (primary key, fk on zone.zone_id) region_id [int32] (primary key) name [string] this part of generated sql code problem: -- creating foreign key on [zone_id], [world_id] in table 'regions' alter table [dbo].[regions] add constraint [fk_zoneregion] foreign key ([zone_id], [world_id]) references [dbo].[zones] ([zone_id], [world_id]) on delete no action on update no action; the error this: there no primary or candidate keys in referenced table ...

list - How to set workflow on survey creation in SharePoint -

i want set workflow on survey creation create list item, like, when create survey, want item of list created automatically. list contains title, creation date, created by, survey link. on survey creation want create list item filled title , survey link column automatically. possible? in sharepoint 2007, workflow tied library or list. can't tied workflow survey creation statement. a survey list diferent content type. did consider build webpart fields title, date,... , action button. click on button create both entry in list , frame survey.

objective c - How do I left pad an NSString to fit it in a fixed width? -

i have nsstring strings represent times in hh:mm:ss hh , digit of mm may omitted. i need align columns of these values this: 1:01:43 43:23 7:00 what's easiest way this? make use of stringwithformat method provided in nsstring class. this: nsstring * datestr = @"05:30"; nsstring * formattedstr = [nsstring stringwithformat:@"%8s", [str utf8string]]; the 8 in %8s number of precision digits (or in case characters) want in formatted string. input strings shorter specified precision left padded spaces, strings longer truncated. can read more format strings printf here . edit @peter pointing out. there (minor) differences between format specifiers in standard c, vs objective c. refer apples documentation on format string specifiers here .

asp.net config transforms - don't apply for normal builds, only publish -

we have number of config transforms enable publish particular environment correct options specified in web.config. however, useful run application locally while specifying particular build configuration. enable run app locally , have connected live database, example - quite handy when tracking down bugs, example. however, when press f5 run app locally, regardless of build configuration selected, no transform of web.config file appears occur. is normal behaviour , possible change it? reposted comment: yes, normal behaviour. it's nuisance because makes whole thing feel half-a-job-ish , agree there should option opt-in same transformations being applied during standard build. haven't found vs extensions can yet, though imagine done. make ".local" version of build configs , publish local iis can attach quickly/easily if want use diffferent environment/config's web.config. requires duplication, job thanks david

geolocation - SQL Distance Query without Trigonometry -

i have sqlite database, not support trig functions. sort set of lat,lng pairs in table distance compared second lat,lng pair. i'm familiar standard haversine distance formula sorting lat,lng pairs distance. in case don't care particularly precision, points separated large distances, don't mind rounding off distances treating curves straight lines. my question, there accepted formula kind of query? remember no trig functions! if points within reasonable distance of each other (i.e. not across half world, , not across date line), can make correction difference between latitude , longitude (as longitude degree shorter, except @ equator), , calculate distance if earth flat. as want sort values, don't have use square root, can add squares of differences. example, @lat , @lng current position, , 2 difference correction: select * points order (lat - @lat) * (lat - @lat) + ((lng - @lng) * 2) * ((lng - @lng) * 2) you can calculate difference corre...

programming in javascript with Visual Studio (2010)? -

whether forced code javascript in visual studio 2010, or insist on using visual studio 2010 instead of ide, i'm wondering has done improve javascript development experience in vs2010. i'm asking since javascript support lacking in visual studio 2010. don't kind of support if developing silverlight apps in c# , xaml. example, intellisense doesn't support javascript 1.8.5 (or 1.6 functions i.e. json.parse), it's difficult navigate function or object definitions (no go definition), no object browser, call hierarchy, , list can go on. what have you done compensate vs2010 features don't exist javascript? also, feature request support javascript development; vs2010 should add extension or future release? also, there suggestions manage .js code large projects? a few things have helped me far jscript editor extensions, , web standards update . also, when working in .js files rely on bookmarks key places, since functions of file aren't visible (as in c...

iphone - How to fix border for map in mapkit with custom overlay method -

i working mapkit application.in have made custom overlay detail specific location when touched location.in @ when touch @ map's border location image out of map view bound.(gray image out of map view).so suggest me how can make in map's bound , how can handle it. thank all.

asp.net mvc 3 - MVC3 EditorForModel Dropdown -

i using @html.editorformodel() in several places, , wondering if there simple attribute specify should dropdownlist in view model? approximate example of looking be... public class myviewmodel { [dropdown("red", "blue", "green")] public string lasers { get; set; } } i know there have been similar questions asked, , i know can make custom template implement this ... wondering if seemingly simple functionality existed, or if there sort of nuget package added functionality. seems basic not exist somewhere , , might have make nuget package myself if there isn't already. thanks in advance everybody! follow link http://weblogs.asp.net/scottgu/archive/2009/07/31/asp-net-mvc-v2-preview-1-released.aspx search "countrydropdown" on page answer