Posts

Showing posts from August, 2010

BitmapEncoder/ decoder, memory stream and NotSupportedException c# .net -

BitmapEncoder/ decoder, memory stream and NotSupportedException c# .net - i have next code: memorystream imagestream; public imagevideoframe(bitmapsource frame) { imagestream = new memorystream(); bitmapencoder encoder = new pngbitmapencoder(); encoder.frames.add(bitmapframe.create(frame)); encoder.save(imagestream); imagestream.seek(0, seekorigin.begin); } public bitmapsource frame { bitmapdecoder decoder = new pngbitmapdecoder(image, bitmapcreateoptions.none, bitmapcacheoption.onload); bitmapsource bitmapsource = decoder.frames.first(); homecoming bitmapsource; } used compress images in memory cut down memory usage. problem above code notsupportedexcpetion constructing pngbitmapdecoder. when debugging position of imagestream shown be c# .net visual-studio memorystr...

c++ - Copy constructor for point -

c++ - Copy constructor for point - is re-create constructor correct? class gpspoint { private: double lat, lon, h; char *label; public: gpspoint (const gpspoint &p) { if (this != &p) { lat = p.lat; lon = p.lon; h = p.h; if ( label != null ) { delete [] label; label = null; } if (p.label != null ) { label = new char [ strlen( p.label ) + 1 ]; strcpy ( label, p.label ); } } } } if have pointer in class doing wrong. it improve re-write as: class gpspoint { private: double lat; double lon; double h; std::string label; public: gpspoint (gpspoint const& copy) : lat(copy.lat) , lon(copy.lon) , h(copy.h) , label(copy.label) {} // should have assignment operator gpspoint& ...

c - Communicate between two systems using only MAC address -

c - Communicate between two systems using only MAC address - i want know how communicate between 2 systems using mac address using c program (without using ip address). think raw ethernet communication. requirement send info client server using mac address. may can done creating our own raw ethernet frame. please help me regarding this. if has written code in c, please share. this link may help you, http://aschauf.landshut.org/fh/linux/udp_vs_raw/ch01s03.html the libpcap library allows assemble raw ethernet packets , send them straight adapter: hardest part beingness discovery of right adapter. designed c/c++ usage on platforms (win pcap etc.). be sure want though: have seen several projects raw ethernet packet interfaces have been used, more , more protocol set in place re-transmission , windowing etc. until end own version of tcp/ip (only 1 hasn't been tested millions of people using windows/linux or whatever platform is). ethernet chips have functions acc...

php - Acl in CakePHP - Removing this functionality -

php - Acl in CakePHP - Removing this functionality - i built project acl enabled - used cakephp tutorial on website this. however, project no longer needs functionality. i've removed reference of acl , aco in controllers, models , views (if fact did tutorial in reverse remove everything) , deleted 3 database tables generated in process. however, still error: error: database table acos model aco not found. on of controllers. did acl baking process add together files don't know about? how rid of functionality? try emptying app/tmp/cache . model relations may caches there. after that, grep through app directory references aco , aro . may have missed one. edit: also, create sure auth component not set auth->authorize actions (which uses acl) else appropriate. see auth::authorize in cakephp manual. php mysql cakephp acl

java - How to manage catches with the same behavior -

java - How to manage catches with the same behavior - i have piece of code can throw 3 different types of exceptions. 2 of these exceptions handled in way while 3rd handled in way. there idiom not cutting , pasting in manner? what is: try { anobject.dangerousmethod(); } grab {aexception or bexception e) { /*do something*/ } grab {cexception e) { /*do else*/ } there in jdk 7, not in before java versions. in jdk 7 code this: try { anobject.dangerousmethod(); } grab {aexception | bexception e) { /*do something*/ } grab {cexception e) { /*do else*/ } java exception

wcf - c# rest webservice without IIS -

wcf - c# rest webservice without IIS - is there example/tutorial on how create , run wcf rest webservice without iis ? i want have console application that'll run webservice , not host in iis. just self host service system.servicemodel.web.webservicehost in console application. wire appropriate endpoint behavior / binding. c# wcf web-services rest

javascript - Regular expression to match Date -

javascript - Regular expression to match Date - i trying validate next date format through regexp, still didn't ant working solution- ex.- oct-12-2011 feb-06-1995 how can using regexp. thanks in advance!! ... not sure how strictly want this. var months = [ 'jan','feb','mar','apr','may','jun','jul','aug','sep','oct','nov','dec' ], regvalidate = regexp('^(?:' + months.join('|') + ')-[0-3][0-9]-\\d{4}$'); alert(regvalidate.test('oct-12-2011')); javascript regex

graphics - game background file of just 2KB ...how? -

graphics - game background file of just 2KB ...how? - i making game mobile phone , have little knowledge of creating graphics games. making graphics using coreldraw & photoshop. i made flash.png using above 2 software's & squeeze size 47kb only..... but came across 1 game has file size 2kb background (bg0 & bg1.png) i want know how create such beautiful graphics without increasing size of file... i assume gamer must have hand sketched, scanned & used 1 of above software's fill colors.....but not sure it... plz help there several ways cut down size of png: reduce colour depth. don't utilize rgb true/24 bit colour, utilize indexed colour image. need add together palette image, each pixel 1 byte, not two. once have indexed colour image, cut down number of colours in palette. there limit how many colours can cut down - fewer colours, lower image quality. remove unnecessary png chunks. fine art packages may add together additio...

java - Override attributes -

java - Override attributes - when override method must maintain method's signature , can't cut down visibility. tried happends when attributes. surprised - works! yourself: public class { public integer myattribute; } public class b extends { public string myattribute; } public class main { public static void main(string[] args) { b b = new b(); b.myattribute = "mystring"; ((a) b).myattribute = 1337; system.out.println(b.myattribute); system.out.println(((a)b).myattribute); } } so possible write attribute in subclass same attibute name in superclass, can utilize different visibility (modifier) , type. attributes in superclass , subclass independend each other. now if utilize same attribute name in superclass , subclass hide superclass's attribute. when accessing attribute using subclass, subclass's attribute. superclass's attribute there, too! have perform cast access supe...

which c# event will be fired after the webpage gets loaded? -

which c# event will be fired after the webpage gets loaded? - i want activity on backend means want run code after page gets loaded in browser,which c# event gets fired when page loading completes? or in c# event should write code ? please help , suggest.. you can not run code on backend after page loaded in browser. you can activity in browser using javascript. c#

php - Product name limit in magento -

php - Product name limit in magento - i need limit length of product name on front end end. i using magento 1.4.2, can help? you can in template files... assuming want limit name on product view page, re-create app/design/frontend/base/default/template/catalog/product/view.phtml theme in e.g. app/design/frontend/interface/theme/template/catalog/product/view.phtml . in line 52, have like <h1><?php echo $_helper->productattribute($_product, $_product->getname(), 'name') ?></h1> you can alter in: <h1> <?php // define maximum length of product name here $maxlength = 10; $productname = $_helper->productattribute($_product, $_product->getname(), 'name'); echo substr($productname, 0, $maxlength); ?> </h1> please seek describe question in more detail next time... hope helps. php mysql magento-1.4 magento

git - How do I add my whole project on GitHub? -

git - How do I add my whole project on GitHub? - i have github account. fixed everything, i'm ready uploads. github's help on creating repo covers uploading single readme file, want upload entire project. how can step step? thank you! create new repository here https://github.com/repositories/new git clone local folder, add together files of project and "git add together ." "git commit" & "git push" maybe must add together ssh key github panel(i dont remeber) git github

Create a REST API From a PHP API -

Create a REST API From a PHP API - i beginner php know of basics. have api website, coded myself, of can phone call different methods different parameters , scour databases relevant information. however want convert rest. so instead of having requests http://mywebsite.com/api/?param=allposts have http://mywebsite.com/api/posts/. each of 23 different params. how this? one way utilize micro framework routing. 'point' url request patterns relevant php files (controllers) manage requests , serve content (or perform crud operations, or whatever api does). there's post here give-and-take , farther links. simplest php routing framework .. ? i'm in process of using framework silex exact purpose http://silex-project.org/ it may wish convert php application utilize 1 of many frameworks out there (which handle routing amongst other things). the usual suspects are cakephp codeigniter symfony lithium and there many more... php api rest...

editor - JSFiddle's Syntax Highlighter engine -

editor - JSFiddle's Syntax Highlighter engine - what jsfiddle's syntax highlighter engine? hope re-use in project. assume open-source component, did not find on website. i believe codemirror. editor syntax-highlighting web-based

Java - convert date formatted String from SQL db to date object for comparison -

Java - convert date formatted String from SQL db to date object for comparison - i have string stored in database (example: sat jul 09 14:20:31 edt 2011 ) this stored string (i aware of sqls date capabilities, i'm not exploring @ point). i want pull strong , compare current time using date.compare function date currentdate = new date(); // new current time value mcursor.getstring(mcursor.getcolumnindex(timecolumn) //the old stored time value, pulled sql database from database have string value formatted proper date. don't have obvious function compare current date date object. i need know if 1 greater than, less than, or equal to, other. date compare function allow this, object needs date object. i have tried simpledateformat seeded string's date format, parse exception "unparsable date", perhaps because formatted? date currentdate = new date(); simpledateformat datetest = new simpledateformat("e m d hh:mm:ss z y"); if(currentd...

java - Working with Hibernate relationships -

java - Working with Hibernate relationships - i'm working in hibernate. got 3 entities, that's relationship among them: user 1 -> n orders 1 -> n order details how add together row in table "order details" of specific order given user? i know how add together new row in table orders , order details, that: user user=(user)session.get(user.class, username); order order=new order(); orderdetails orderdetails=new orderdetails(); orderdetails.setamount(1); order.addorderdetails(orderdetails); user.addorder(order); session.save(user); transaction.commit(); it correct? but happen when want add together row in table addorderdetails of specific order given user? this? list<order> o=session.createcriteria(order.class) .add( restrictions.eq("iduser", user) ); o.get(0).addorderdetails(orderdetails); actually don't know how work tables orders , orders details, should user table? how? using criteria user table can list of user...

java - Introduction to Support vector machines -

java - Introduction to Support vector machines - hi every 1 m doing pos tagging using svm tool dont understand how build feature vector training corpus.can help me matter. a feature vector series of numbers, each of representing measurement or categorical index @ given position, e.g. v1 = (1,0,2,5,5,0,-2,2.9) , v2 = (0.2,1,1,8,0,0,4,7) , etc. java perl svm pos-tagger

java - Seleneium IDE Problem -

java - Seleneium IDE Problem - hy. have problem selenium. illustration have table entries(names). @ each name have button "edit". problem is, edit buttons have same id. know how can click edit button 10. person in table example. thanx. we had related problem using selenium, difference beingness don't know value of id attribute ajax enabled components. because utilize wicket, , generates dynamic ids in situation. what did wicket add together name attribute, , have selenium select on attribute instead of id. java table ide selenium clickable

apache poi - Cell comment does not get displayed on MS office though it comes on open office -

apache poi - Cell comment does not get displayed on MS office though it comes on open office - here sample code create tool tip cell org.apache.poi.ss.usermodel.comment comment = drawing.createcellcomment(anchor); richtextstring strcmt = factory.createrichtextstring("tool tipssssssssssss"); comment.setstring(strcmt); comment.setauthor("rinkalkumar"); this part of code sets tool tip cell problem gets displayed on open office not on ms office any solutions overcome problem? i using poi-3.6. as noted in comments, trick solve problem upgrade newer re-create of poi (3.7 @ minimum, ideally 3.8 out, or 1 of it's betas now) apache-poi

objective c - how to replace any view in UITableViewCell? (iphone) -

objective c - how to replace any view in UITableViewCell? (iphone) - i have made tableview programatically. in every cell have made button in that.. now want when press button of first cell..that cellone should replaced new view. can tell me how that? i mean when press button of cell no 1...only particular cell should replace new view not other cell add flag in datasource corresponding each row (e.g in array utilize populate table)... in cellforrowatindexpath method conditional cell content population.. i.e. if flag corresponding row set, add together view else add together button... when press button, set flag corresponding row... , reload table view... its pretty straight forward.. iphone objective-c uiview uitableview

spring - Is it possible for Http Session Invalidation to occur because of an overload on the Server? -

spring - Is it possible for Http Session Invalidation to occur because of an overload on the Server? - i have reaccuring random invalidations of user http sessions resulting in loss of temporary info on oracle ias 10.1.2 oracle container java j2ee container. (java 1.4) framework spring 2.5. invalidation occuring 2 concurrent users. multiple tests not reproduce error far. i wondering if possible session invalidation might caused cpu overload or reaching maximum allowed number of threads on server. spring java-ee cpu-usage httpsession

c# - How can I get a single file name by searching for the extension alone? -

c# - How can I get a single file name by searching for the extension alone? - i'm using c# winforms , want single file name searching extension alone? know directory.getfiles method, i'm looking single file. i'm using... string[] files = directory.getfiles(@"c:\tpro", "*.fdn"); string test = files.getvalue(0).tostring(); this works name of file ends .fdn. works because file in directory ends .fdn. using index "0" in case works. doesn't sit down me. there improve way go it? thanks no; sane way it. however, you're misusing array; should write string test = files[0] . in .net 4.0, can utilize iterator version avoid fetching more files needed: ienumerable<string> files = directory.enumeratefiles(@"c:\tpro", "*.fdn"); string test = files.first(); this much faster enormous directories. c# file-io filesystems

Intranet deployment for Android apps -

Intranet deployment for Android apps - could give me advice on how can deploy android app remotely? things take note are: 1).no access android market (it run on intranet) 2).about 300 devices 3).i don't want user many steps update app. if there no easy way deployment, can manually(probably downwards load intranet website , manually run it) first time subsequent updates, there way update application itself? i don't think there's in standard device this; android market client doesn't provide kind of flexibility. can download , install .apk files through browser (provided server offering them right mime type), doesn't solve update problem. the approach can think of amazon did: write own app management app. run service periodically check updates (or, better, receive force notifications of updates) , download , install them in background. it's lot of work, straightforward do. android deployment intranet

android - How to show one layout on top of the other programmatically in my case? -

android - How to show one layout on top of the other programmatically in my case? - my main layout main.xml contains 2 linearlayouts: the 1st linearlayout hosts videoview , button , the 2nd linearlayout hosts edittext , , linearlayout has set visibility value "gone" ( android:visibility="gone" ) like below: <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="fill_parent" android:layout_width="fill_parent" android:orientation="vertical" > <linearlayout android:id="@+id/first_ll" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal" > <videoview android:id="@+id/my_video" android:layout_width="wrap_content" android:layout_height="wrap...

cakephp - Looking up column in related model -

cakephp - Looking up column in related model - i have 3 tables. here columns: result : id, title prospect: id, result_id, customer_id customer: id, name, address result hasmany prospect. prospect belongsto customer. customer hasmany prospect. everything's ok. if view result, display fine along related model prospect. in related model, i'd display customer name instead of customer_id (by looking up). how that? , how paginate related model? thank much! add in prospect belongsto result , able info both directions. if want more crazy things finding results based on client name might need read on following linkable behavior bindmodel adhoc-joins cakephp cakephp-1.3

c# - System.Web.UI.DataVisualization.Charting missing error in .net 4.0? -

c# - System.Web.UI.DataVisualization.Charting missing error in .net 4.0? - i'm trying utilize chart command in asp.net 4.0. while know required separate install part of 3.5, it's included default 4.0. i can see chart command in toolbox, , can drag designer , see preview of chart. however, when seek compile website, error stating: the type or namespace name 'datavisualization' not exist in namespace 'system.web.ui' (are missing assembly reference?) i receive same error when take brand new page , add together following: using system.web.ui.datavisualization; any ideas? can understand why error in 3.5, no clue why receive in 4.0, when can see command in toolbox. click on add together references in project , in .net components tab add system.web.datavisualization. should solve problem. c# asp.net

exception - jquery error: "missing : after property id" (JavaScript object) -

exception - jquery error: "missing : after property id" (JavaScript object) - i have code: $.each(properties, function(i, key) { obj.css({'-webkit-border-' + key + '-radius': value+'px', '-moz-border-' + key + '-radius': value+'px', 'border-' + key + '-radius': value+'px'}); }); it's giving error on first + key can't create keys (with appending data) or doing else wrong? thanks, wesley can't create keys (with appending data) or doing else wrong? nope, should getting syntax error. you can build object before passing css function: var styles = {}; styles['-webkit-border-' + key + '-radius'] = value+'px'; styles['-moz-border-' + key + '-radius'] = value+'px'; styles['border-' + key + '-radius'] = value+'px'; obj.css(styles); jquery exception

https - Why does this SSL_pending call always return zero? -

https - Why does this SSL_pending call always return zero? - this code https server using blocking sockets: request := ''; start := gettickcount; repeat if ssl_pending(ssl) > 0 begin bytesin := ssl_read(ssl, buffer, sizeof(buffer)-1); if bytesin > 0 begin buffer[bytesin] := #0; request := request + buffer; end else break; // read failed end; // pending until (gettickcount - start) > largetimeout; // "request" ready, though perchance empty ssl_pending() always returns 0 , ssl_read() never reached. if ssl_pending() phone call removed, ssl_read() executed. why doesn't ssl_pending() indicate how many bytes available? note if phone call ssl_read() , number of bytes returned less buffer size, you've read , done. if incoming info larger buffer size, first ssl_read() phone call fills buffer, , can repeat calling ssl_read() until can't fill buffer. but if...

iteration - Haskell iteratee: simple worked example of stripping trailing whitespace -

iteration - Haskell iteratee: simple worked example of stripping trailing whitespace - i'm trying understand how utilize iteratee library haskell. of articles i've seen far seem focus on building intuition how iteratees built, helpful, want downwards , utilize them, sense bit @ sea. looking @ source code iteratees has been of limited value me. let's have function trims trailing whitespace line: import data.bytestring.char8 rstrip :: bytestring -> bytestring rstrip = fst . spanend isspace what i'd is: create iteratee, read file , write out somewhere else trailing whitespace stripped each line. how go structuring iteratees? see there's enumlinesbs function in data.iteratee.char plumb this, don't know if should utilize mapchunks or convstream or how repackage function above iteratee. if want code, it's this: procfile' ifile ofile = filedriver (joini $ enumlinesbs ><> mapchunks (map rstrip) $ i.mapm_ (b.a...

asp.net mvc 2 - MVC2 / nHibernate / nUnit Test Failed on Build Server -

asp.net mvc 2 - MVC2 / nHibernate / nUnit Test Failed on Build Server - i have c# 4.0 mvc 2 application using nunit 2.5, nhibernate 2.1. i have testfixture passes when ran locally (windows 7 (64bit)), fails when compiled on build server (windows server 2003 (64bit)) the code test fails on defined in [setup]: _session = nhibernatesession.getdefaultsessionfactory().opensession(); new schemaexport(configuration).execute(false, true, false, _session.connection, null); the error is: database not configured through database method. ----> hibernate.hibernateexception : not create driver nhibernate.driver.sqlite20driver. any help appreciated!! thanks you have install sqlite on server running unit test. or @ to the lowest degree add together dll gac. nhibernate asp.net-mvc-2 nunit 64bit cvs

android - stuck with getting camera pic when using the tab Activity -

android - stuck with getting camera pic when using the tab Activity - intent cameraintent = new intent(android.provider.mediastore.action_image_capture); startactivityforresult(cameraintent,camera_pic_request); intent takepictureintent = new intent(getparent(),takepicture.class); takepictureintent.putextra("image",thumbnail); openbeeactivitygroup opentactivity = (openbeeactivitygroup)getparent(); opentactivity.startchildactivity("takepicture activity",takepictureintent); as understand question is, happen while using activitygroup . since starting activity result within kid activity (i.e takepicture.class ), , android allow single nested layer of kid activity (ies) (means kid activity cannot nest kid activity ). , handling result in kid activity (i.e takepicture.class ). so solution problem handle result within parent activity ( openbeeactivitygroup )'s onacti...

iphone - “loading” spinner not leaving the TTTableViewController -

iphone - “loading” spinner not leaving the TTTableViewController - i had tttableviewcontroller used in ipad , want empty. when first loads calls: - (id)initwithnavigatorurl:(nsurl*)url query:(nsdictionary*)query { if (self = [super init]) { self.datasource = nil; } homecoming self; } however, "loading" spinner stays in there , won't go away. why this? thought happen because init wasn't called, indeed is. need help. when tttableviewcontroller presented on screen, accesses it's model. if there's no model set, in case creates model in [ttmodelviewcontroller createinterstitialmodel] . default ttmodel (the class not protocol), in turn nil appearing loading. in createmodel implementation need create model want , assign self.model. also note, creating datasources , / or model in initializer not optimal, consider creating datasources / models in createmodel . created when needed (when view appears on screen). iphone ...

android - How to make a home/default application widget compatible -

android - How to make a home/default application widget compatible - i making alternative home application , fine. however, thought enabling widgets on application create alot better. don't know how this. question how can create application widget compatible. want able long click screen , have widget dialog come , able select one. how can go doing this? android default widget home

c# - Designing set of rules that use dependencies -

c# - Designing set of rules that use dependencies - i have service reads emails received in specific mailbox. issue based on email contains have 1 or many actions. have mess below. i've shortened quite bit. actual application has far more corner cases. var email = new email { body = "some random email body text..." }; if(email.body.startswith("a")) { // requires dependency on inotifier console.writeline("notifying administrator"); } if (email.body.startswith("b")) { // requires dependency on iparser , irepository console.writeline("parsing email , adding database"); } if (email.body.endswith("c")) { // requires dependency on isender , inotifier console.writeline("forwarding email , notifying administrator"); } if (email.body.endswith("c")) { // requires dependency on inotifier console.writeline("ignoring email"); } essentially, if criteria met associ...

hardware - Can I return back to the natural keyboard after getting used to ergonomic keyboards? -

hardware - Can I return back to the natural keyboard after getting used to ergonomic keyboards? - i hope inquire question in right place. whatever we're programmers. i got new ergonomic keyboard (microsoft natural ergonomic keyboard 4000) yesterday. it's bit wired now, i'm sure normal in next few days. i'm worry if can work natural keyboards after that. there worked such keyboards. please help me in regard. -- edit -- i asked question here because wana know programmers (coders) ideas. writing , editing programme different writing letter. thanks in advance. i have keyboard @ home , normal 1 @ work. have no difficulty typing on either one. seems based on individual though. keyboard hardware ergonomics

Bash redirection -

Bash redirection - following redirect stdout , stderr logfile : $ command &> logfile how do redirection without overwrite logfile during next run of command . >> if plain redirection. you attach stderr (2) stdout (1) , redirect stdout in append-mode: command >> logfile 2>&1 the 2>&1 bit attaches stderr stdout , redirect stdout append logfile in usual manner. bash

Is this an appropriate use of generics and C#'s dynamic data type? -

Is this an appropriate use of generics and C#'s dynamic data type? - the problem i'm having thus, we're building info access layer using our existing orm (it's old 1 called gentle) thought of moving fluent nhibernate. there few queries have add together custom clauses sqlbuilder in our existing setup, instance when retrieving person objects might adding clause like: "personid in (select personid orders ordervalue > " + ordervalue + " , ordername = " + ordername the point beingness parameters beingness added straight in string rather parameterised query, possible in gentle add together parameterised query , i've been working on. our dals inherit base of operations gentledal , class constructs gentle query, adds clauses , parameters etc. add together parameterised clause in gentle have 2 things sqlbuilder object, have phone call sb.addconstraint(string clause) add together clause, , each parameter have phone call sb.addp...

javascript - jQuery animation function timing -

javascript - jQuery animation function timing - feel i'm overlooking obvious here... i've got several vars set so: var productone = function () { $(".product2").fadein(200).animate({"right": "+=75px"}, 500, "easeoutelastic").delay(3000).fadeout(200).css("right", "0"); $(".product-text.two").fadein(200).delay(3500).fadeout(200); } var producttwo = function () { $(".product2").fadein(200).animate({"right": "+=75px"}, 500, "easeoutelastic").delay(3000).fadeout(200).css("right", "0"); $(".product-text.two").fadein(200).delay(3500).fadeout(200); } etc...then want fire them in order, so, , loop first: window.setinterval(function() { $(producttwo); $(productthree); //and on }, 5000); but fire @ same time. how can set specific num...

iPad UISplitViewController view frame -

iPad UISplitViewController view frame - i wonder how can alter splitview.view.frame ? in app i'm using tabbarcontroller display differents splitviews tab. need leave empty space between tabbar , splitview set view. i tried alter splitview.view.frame doesn't work... thought ? this split view controller section of view controller programming guide ios, "the uisplitviewcontroller class container view controller manages 2 panes of information. first pane has fixed width of 320 points , height matches visible window height. sec pane fills remaining space." so, i'd can't it. maybe else has solution this. word of advice, though: don't complicate interface. seek , think of improve way accomplish thinking of showing in intermediate view. maybe place somewhere else or nowadays in other way. ipad view uitabbarcontroller uisplitviewcontroller

c# - Serialization Issue with WF4 -

c# - Serialization Issue with WF4 - i have peculiar issue variable in workflow service. array of datacontract rest service, contactcontract[] . when array empty great , workflow continues on correctly. however, if there items in array stack overflow occurs outside of activities, can't pinpoint specific spot unfortunately. so, having seen before datacontractserializer when cycles exist in object graph wrote unit test seek out. test fails next exception: system.xaml.xamlobjectreaderexception: unable serialize type 'system.runtime.serialization.extensiondataobject'. verify type public , either has default constructor or instance descriptor. and test: [testmethod] public void contactarrayserialize() { var ser = new datacontractserializer(typeof(contactcontract[])); var reader = new stringreader(strings.serialized_contact_list); var xmlreader = xmlreader.create(reader); var list = ser.readobject(xmlreader) contactcontract[]; var s...

java - String Tokenizer issue -

java - String Tokenizer issue - am using string tokenizer delimit string response ^ 12/30/2011 12:00:00 am^president^^^159^true^true^true^true^true^false^false^true^true^3/18/2011 12:00:00 am^true^jujama, inc.^^^^true^true but problem when ^ delimiter consecutively skipping 1 , adding in array. want add together space if 2 ^ delimiters comes. how that? my code is: stringtokenizer tokens = new stringtokenizer(partid, "^"); while(tokens.hasmoretokens()){ string value=tokens.nexttoken(); uservalues.add(value); system.out.println("..."+value); } user string.split("^") instead. split receives regex, can want within 1 line. java stringtokenizer

Sending SMS/email from SQL Server with queued users -

Sending SMS/email from SQL Server with queued users - we need send email/sms users notifying changes in table in database. there can issue of queuing. so, thinking of using windows service or sql server trigger. service can poll database , send sms / e-mail , delete notified rows send sms/email , same functionality trigger your suggestions please. service broker? push details onto queue trigger (or stored proc?) some process reads these , sends email/sms. can separate sql server sql-server

iphone - ASIFormDataRequest returning error -

iphone - ASIFormDataRequest returning error - i getting problem when request server upload , uimage nsstring *jpgpath = [nshomedirectory() stringbyappendingpathcomponent:@"documents/image.jpg"]; //uiimage *img = pickerimage; [uiimagejpegrepresentation(postingimage, 0.5) writetofile:jpgpath atomically:yes]; nsdata *imagedata = uiimagejpegrepresentation(postingimage, 0.5); nsurl *url = [nsurl urlwithstring:serverurl]; asiformdatarequest *request = [asiformdatarequest requestwithurl:url]; [request setdata:imagedata withfilename:@"image.jpg" andcontenttype:@"image/jpeg" forkey:@"photo"]; [request startsynchronous]; nslog(@"responsestatuscode %i",[request responsestatuscode]); nslog(@"responsestatusstring %@",[request responsestring]); it giving responses responsestatuscode 200 responsestatusstring error: no file uploaded do 1 know this, doing mistake, your help much ...

javascript - Missing Element Confusion -

javascript - Missing Element Confusion - i'm creating script produces content locker after x number of minutes. problem is, content within likebutton not display. modal popup displays fine, title , instructions. not likebutton content. if take code block out of timer, works. i'm little confused. thought whats going on? var title = 'please press like'; var instructions = 'like our videos? bring together our fanpage. takes 1 second.'; var lockdelay = 100; // 1200000 = 20 minutes /* stop editing */ var boxy; $(document).ready(function() { // create button settimeout(function() { // create button var likebutton = '<div id="likebutton"><fb:like href="" send="false" layout="box_count" width="70" show_faces="false" font=""></fb:like></div>'; // display modal boxy = new boxy('<p id="ins...

debugging - What does this Javascript syntax mean? -

debugging - What does this Javascript syntax mean? - i working ros construction , facing problem debugging, , found snippet: ros.visualization.glnode = class.extend({ init: function () { this.meshgroupids = [ ]; this.matrix = sglidentitym4(); this.children = [ ]; }, }); what these lines mean? ros.visualization.glnode :: trying load files? . represent? class.extend:: do? trying extend class, , if one? in way glnode . this.matrix:: have doubts when see this command do? init : function() :: function mean in js? keyword? if not why utilize in onloadbody or window.onload() ? ros.visualization.glnode = class.extend({ this definition of new class (or type of object) using sort of javascript library has function class.extend() in it. init: function () { this definition of attribute on new class called "init". type of attribute "function" means works method , can called. this.mesh...

xml - Parse Error in php -

xml - Parse Error in php - bellow statement showing parse error echo $xmlarray[ota_hotelavailrs][properties][property][0_attr][hotelcitycode]; error: syntax error, unexpected t_string, expecting ']' how solve this? php assumes unquoted literals constants , constant names can't start numbers. results 0_attr beingness parsed number 0 followed constant _attr - not amke sense. always quote array indices. echo $xmlarray['ota_hotelavailrs']['properties']['property']['0_attr']['hotelcitycode']; php xml arrays

php - Trying to prevent form re-submission upon refresh, can't modify header information -

php - Trying to prevent form re-submission upon refresh, can't modify header information - i'm trying create page redirect same page avoid resending same form information. however, using header('location: guestbook.php'); gives me error: warning: cannot modify header info - headers sent (output started @ /test/guestbook.php:1) in /test/guestbook.php on line 29 i'm not sure if i'm putting header in right place, i'm not extremely familiar using it: <?php $gb_str = ""; // $gb_str string we'll append entries $pgetitle = "view , sign guestbook"; // if form submitted, insert db if (!empty($http_post_vars["submit"])) { // initiate vars $dbhost = ; $dbuser = ; $dbpass = ; $dbdatabase = ; $li = mysql_connect($dbhost, $dbuser, $dbpass) or die("could not connect"); mysql_select_db($dbdatabase, $li) or die ("could not select db"); $name = mysql_real_escape_string...

c# - Access modifier for default constructor in LINQ2SQL generated classes -

c# - Access modifier for default constructor in LINQ2SQL generated classes - just origin linq2sql here , have few questions. i have db single table customer, run sqlmetal , generates orm class me. i'd apply rules in constructor of customer, maybe firstname, lastname members of client have supplied. i created new constructor in sqlmetal generated client class take 2 parameters firstname, secondname , marked default parameterless constructor internal don't want expose whatever consumes assembly. my code began complain when tried submitchanges() because of new protection level of parameterless constructor public internal. list<customer> customerlist = new list<customer>(); customerlist = dbinstance.customer.tolist(); client customertodelete = customerlist.where(c => c.customer_id == 100).first(); dbinstance.customer.deleteonsubmit(customertodelete); dbinstance.submitchanges(); <-- error thrown "no parameterless constructor defined ob...

php - INSERT into FOREIGN KEY related tables -

php - INSERT into FOREIGN KEY related tables - i have 2 tables. first song library , other playlist..i have songid primary in library , foreign in other table. want while inserting or creating playlist songid first table automatically fetched , stored in othertable. filling title in first table. how or queries if want insert respective foreign key in sec table. , implemented if want apply using array. filling songtiltle array. id | title __________ 55 | abc 56 | zyx other table playlist.. idlist | tltle ______________ 1 | 55 2 | 56 php mysql

css - Making an HTML table column as small as possible but no smaller -

css - Making an HTML table column as small as possible but no smaller - i have column labels , corresponding text boxes, viz: <table> <tr> <td>label:</td> <td><input type="text"></input></td> </tr> <tr> <td>longer label:</td> <td><input type="text"></input></td> etc... i want ensure first column wide plenty allow text in 1 line, no wider necessary, allow maximum space input boxes (which set width 100%). don't want set specific percentage or explicit width, "as little possible no smaller." is there way in raw html/css or have resort javascript? (obviously if page narrow not achievable, i'm not worried narrow browsers.) as long don't set width table , tr or td , td 's text in 1 line. if space not plenty can utilize td {white-space:nowrap} . not allow text go sec line, show scrollbar. demo: http://jsfidd...

animation - Jquery .show not animating properly and not grabbing all links in target -

animation - Jquery .show not animating properly and not grabbing all links in target - essentially i'm trying load content div, link within div. works degree. code far grabs links target div , on click animates 'content' div out , replaces 'content' div @ target link. //target links , phone call on click $('#scrollbox li a').click(function(){ //define load paramaters var toload = $(this).attr('href')+' #content'; //hide content $('#content').hide('fast',loadcontent); //remove load bar $('#load').remove(); //show load bar $('#wrapper').append('<span id="load">loading...</span>'); $('#load').fadein('normal'); function loadcontent() { $('#content').empty().load(toload,'',shownewcontent()) } function shownewcontent() { $('#content').show('slow',hideloader()); } function hideloader() { $('#...

jquery - Javascript sync scroll iframes -

jquery - Javascript sync scroll iframes - i have page 3 iframes , 1 has horizontal scrollbar while other 2 frames need synced per horizontal scrolling.. could u please suggest cross browser script sync iframe scrolling..please note these frames , not div... javascript jquery html iframe scroll

environment variables - Problems with using setenv and then making the dlopen call -

environment variables - Problems with using setenv and then making the dlopen call - i using setenv set dyld_library_path when dlopen() have right paths find .dylib, when dlopen() doesn't seem search paths added dyld_library_path. from can gather changes dyld_library_path won't take effect until re-execute process happens. correct? also if correct, there way set dyld_library_path , having changes work out doing reset of process. oh yeah writing code on mac osx. thanks in advance. i don't know mac os, on linux, loader reads value of getenv("ld_library_path") once, , saves away, long before first instruction of executable runs. subsequent modification of ld_library_path programme affects children execve() s, not process itself. imagine it's similar on mac os. the usual way around either re- execve proces (java this), or utilize shell wrapper sets environment , exec's real binary (firefox that). there might mac os specific way ...

relative javascript issues for ajax calls -

relative javascript issues for ajax calls - we using relative paths load js file thorough ajax. can see js files loading absolutely fine. but, js files can't able see debuggers in browsers. in firefox browser, if utilize firebug , trying see our js couldn't see js files. i'm pretty sure js files loading 1 time nail page. if utilize absolute path, js files loading. per requirement, shouldn't utilize absolute paths. please give suggestions one option. utilize absolute paths when debugging. switch relative paths final testing , deployment. it's mutual alter number of things between debug environment , final test/production (like minimizing code). javascript ajax

regex - Escaped Periods In R Regular Expressions -

regex - Escaped Periods In R Regular Expressions - unless missing something, regex seems pretty straightforward: grepl("processor\.[0-9]+\..*processor\.time", names(web02)) however, doesn't escaped periods, \. intent literal period: error: '\.' unrecognized escape in character string starting "processor\." what misunderstanding regex syntax? my r-fu weak point of beingness non-existent think know what's up. the string handling part of r processor has peek within strings convert \n , related escape sequences character equivalents. r doesn't know \. means complains. want escaped dot downwards regex engine need single \ past string mangler. usual way of doing sort of thing escape escape: grepl("processor\\.[0-9]+\\..*processor\\.time", names(web02)) embedding 1 language (regular expressions) within language (r) bit messy , more when both languages utilize same escaping syntax. regex r

asp.net - Horizontal Table design using Gridview, Repeater etc -

asp.net - Horizontal Table design using Gridview, Repeater etc - im looking build nice form supplier can quote prices on. form have labels downwards left hand side , column per requested product/quantity buyer. have n number of columns. because of way html tables coded need build row @ time. (i want maintain 1 table neat html) before go ahead , create repeater each row of info user needs enter. way able create sorta grid view instead of each records pass going create new row. create new column , define first column header column? my table sort design (txtb stands textbox , lbl stands label updated values entered) quantity 500 1000 2000 delivery cost txtb txtb txtb pricing txtb txtb txtb total cost lbl lbl lbl exchange rate txtb txtb txtb thanks may suggest using ul tags (unordered lists). suite requirement much more easier, i've done in similar situation. table cause many pains downwards way. ...

android - Check two drawable images -

android - Check two drawable images - all i have created frame animation using animation drawable. have 25 images in animation. have compare image current frame in animation 1 stored in res/drawable folder. how compare 2 drawables?? == , .equals methods wont work drawables. please give me reply possible. you can provide id drawable image using "imageview.setid" , seek compare given id of images using "imageview.getid"(use int id) android

.net - Elegant averaging of arrays from different instances of an object in C# -

.net - Elegant averaging of arrays from different instances of an object in C# - i have list of objects of same type each has property array of floats. taking list input, easiest way homecoming new array average of arrays in list? the input objects this: class mydatas { float [] datavalues; } ... list<mydatas> inputlist; float [] result; the datavalues arrays guaranteed have same length. each element of result array average of corresponding elements in array of each fellow member of list. example: result[0] = (inputlist[0].datavalues[0] + inputlist[1].datavalues[0] + ... ) / inputlist.count of course of study brute forcefulness foreach within loop , loop after seems me should doable 1 or 2 lines of linq. advice? float[] result = inputlist.select(c => c.datavalues) .transpose() .select(r => r.average()) .toarray(); using transpose here. c# .net arrays...

c# - Looking for pattern to combine partial classes from different assembly's -

c# - Looking for pattern to combine partial classes from different assembly's - i having next problem. have main project, , projects have similar functionality. for example: have mvc website, class library project "a" "settingshelper". defines static wrappers configuration settings can used propertys. then have class library project "b", also contains "settingshelper class". how can merge these settingshelpers in main project, can use: settingshelper.property both modular projects. i able plug class libraries 1 project. sounds pretty much dependency injection. expose settingshelper interface (your contract), , programme against that. di container, such ninject, structuremap, or windsor plug implementation of interface relevant parts of code based on configuration. this allow code against known contract , provide different libraries depending on circumstances, di framework utilize library concrete implementation of i...

c++ - How to execute unary function objects of different parameter type in sequence? -

c++ - How to execute unary function objects of different parameter type in sequence? - i'm designing mechanism execute set of unary function objects in sequence. these function objects assigned during runtime, , problem is: parameter type of these function objects different. what want this: class command_sequence { private: /* kind of container */ public: void add( func_obj &func, param val ); void run(void); }; class check_temperature { public: void operator() (int celsius) { if(celsius > 26) { cooler.switch_on(); } } }; class log_usage { public: void operator() (std::string username) { username.append(" logged in"); syslog(log_notice,username.c_str()); } }; command_sequence sequence; log_usage logger; check_temperature checker; sequence.add(logger, std::string("administrator")); sequence.add(checker, lobbymeter.read_temperature()); sequence.add(logger, std::string("...

flex - Drawable Canvas -

flex - Drawable Canvas - i upgraded flash builder burrito 4.5 premium. trying create (drawing demo) in latest version of flex, on blackberry playbook, getting errors: code <?xml version="1.0" encoding="utf-8"?> <s:application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark"> <s:panel layout="absolute" title="draw test" backgroundcolor="#ffffff"> <mx:canvas backgroundcolor="#ffffff"> <mh:drawablecanvas id="main" backgroundcolor="#ffff80" backgroundalpha="0" width="100%" height="100%" y="0" x="0"> </mh:drawablecanvas> </mx:canvas> </s:panel> </s:application> the error the prefix "mx" element "mx:canvas" not bound. have tried adding "xmlns:mx="http://www.adobe.com/2006/mxml" head...

PHP Signature Image Generator -

PHP Signature Image Generator - basically trying include image on background of signature although every time seek error saying: resource id 4 i thankful help receive on this.. <?php header("content-type: image/png"); $image = imagecreatefrompng("../imgs/bisig1.png"); $other = imagecreatefrompng("../imgs/avatar.png"); //imagecolorallocate($image, r, g, b) in hex values $font_black = imagecolorallocate($image, 2, 1, 8); $font_blue = imagecolorallocate($image, 25, 0, 255); $list = "name.txt"; $string = "account name"; $string2 = "<img src='$other'>"; //($image, fontsize, rightindent, downindent, data, txtcolour) imagestring($image, 3, 12, 3, "t17", $font_blue); imagestring($image, 1, 86, 6, "sotw", $font_black); imagestring($image, 1, 110, 6, $string, $font_black); imagestring($image, 4, 110, 50, $other, $font_blue); imagepng($image); imagedestroy($image); imagepng($oth...

Specify ASP.NET MVC 3 Routes symbolically -

Specify ASP.NET MVC 3 Routes symbolically - i asp.net mvc 3 framework. or @ least, sure incomparably improve trying fool asp.net 3.5 or 4.0. however, confused something. why did take specify routes strings? iow, told specify routes (for instance): ... new { controller = "products", action = "list", id = urlparameter.optional } this route matches productscontroller.list() method. let's i'm in refactoring mood , want rename productscontroller inventorycontroller. after using renaming tool of choice, have open global.aspx , go through routes , alter these stupid strings "inventory". might respond can find , replace... come on! sense such last-generation answer. i love refactoring code come understand domain better. don't want utilize stupid (i stupid because have no significance compiler) strings refer symbolic/semantic code constructs correspond type , method names stored in symbol table. point? why bother types @ a...

radcombobox - Telerik on first selection of any item other than first is always resetting to first item -

radcombobox - Telerik <RadCombo> on first selection of any item other than first is always resetting to first item - telerik on first selection of item other first resetting first item , not fire selectedindexchange event. however, when combobox selected sec time, event fires. does have suggestions why occurs? right fires when item changes, first item not technically alter of selection since defaults zero. workaround add together default blank item, , forcefulness selection through requiredfieldvalidator control. telerik radcombobox

plugins - Eclipse Maven Jetty -

plugins - Eclipse Maven Jetty - i seek download projects http://svn.codehaus.org/jetty svn received error: no marketplace entries found handle execution exec-plugin-doc, in modules/jspc-maven-plugin/pom.xml in eclipse. what doesn't mean marketplace? may doesn't right install eclipse or svn connectors? thanks. with limited info in question, looks similar problem this one. if so, may want seek older version of eclipse. eclipse plugins maven jetty exec

url - Make a local link global /test.php -> example.com/test.php -

url - Make a local link global /test.php -> example.com/test.php - i've been working on spider algorithm , have been having issues links. example of how works: got content -> example.com/bob/index.php?page=funny+faces content : class="lang-html prettyprint-override"> <html> <a href="../jack/index.php"> link 1 </a> <a href="/bob_more_info"> link 2 </a> <a href="http://www.youtube.com"> link 3 </a> </html> pass content through links function links function returned [0] = ../jack/index.php [1] = /bob_more_info [2] = http://www.youtube.com now need create these links urls page got them on (example.com/bob/index.php?page=funny+faces) so [0] -> ../jack/index.php into example.com/jack/index.php [1] -> /bob_more_info into example.com/bob/bob_more_info [2] -> http://www.youtube.com what asking function can conversion. mine, ...

java - How to get all attributes names(nested or not) in Servlet Context and iterate if it's a map or list? -

java - How to get all attributes names(nested or not) in Servlet Context and iterate if it's a map or list? - i've tried attributenames of ill-maintained context, utilize names reflection. here's pseudo code rough idea. e.g. have arraylist , hashmap in context. enum = getservletcontext().getattributenames(); (; enum.hasmoreelements(); ) { string name = (string)enum.nextelement(); // value of attribute object value = getservletcontext().getattribute(name); if (value instanceof hashmap){ hashmap hmap = (hashmap) value; //iterate , print key value pair here }else if(value instanceof arraylist){ //do arraylist iterate here , print } } here's code want: enumeration<?> e = getservletcontext().getattributenames(); while (e.hasmoreelements()) { string name = (string) e.nextelement(); // value of attribute object value = getservletcontext().getattribute(name); if (value instanceof map) { ...

Passing PHP variable outside PHP OOP class (from separate PHP file) onto node value of a HTML tag in a JQuery function -

Passing PHP variable outside PHP OOP class (from separate PHP file) onto node value of a HTML <span> tag in a JQuery function - it possible pass reference in php variable taken within scope of instantiated object class (php) jquery function, in order render number or string display number of items added? have code here this: <!--in cart.php--> $(document).ready(function() { $('div#cart').replacewith('<div id=\'cart2\'><span><?php echo ('.**$itemcount**.'); ?> </span> <a href=\'viewcart.html\' class=\'view-cart\'>view cart</a><a class=\'checkout\' href=\'checkout.html\'>checkout</a></div>'); }); where $itemcount stored variable in php external file called store.php many assistance! an interesting question least... lets store.php looks this: <?php class store { private $_itemcount = 0; public function getitemcount()...

c# - How to setup Quartz.NET for scheduling Emails -

c# - How to setup Quartz.NET for scheduling Emails - there 2 solutions quartz.server.2008.sln , quartz.2008.sln in downloaded quartz.net library. have setup recurring job. there table in database schedules defined (like first fri of month, each 5 in month, each sunday 12 am...etc). have method executed on schedule. how can utilize quartz.net schedule database , set method execute? proper steps? i think can create windows service running in background. can read schedulefromdatabase varaible database , pass quartz. this little illustration console app: static void main(string[] args) { ischedulerfactory schedfact = new stdschedulerfactory(); ischeduler sched = schedfact.getscheduler(); sched.start(); jobdetail jobdetail = new jobdetail("myjob", null, typeof(hellojob)); //read string database string schedulefromdatabase="0 11 16 ? * fri,sun"; crontrigger trigger = new crontrigger...

java - Which is scalable? Simple CRUD Webapp vs Webapp talking to a REST service -

java - Which is scalable? Simple CRUD Webapp vs Webapp talking to a REST service - i think title says clearly. no scalability guru. on verge of creating web application needs scale big info sets , perchance many (wont exaggerate here, lets thousands of) concurrent users. mongodb info repository , torn between writing simple play! webapp talking mongodb versus play! app talking rest service app (in scala) heavy lifting of business logic , persistence. part of me thinks having business logic wrapped service future proof , allows deploying webapp in multiple nodes (scaling). come java ee stack , play! rebel in java web frameworks. approach assures me can move away play! if needed. part of me thinks play! app + scala service app additional complexity , mayn't fruitful in long run. any suggestions appreciated. note: newbie scala, mongodb , play!. pardon me if question silly. scalability engineering science art. means have lots of parameters , apply exper...

nosql - Clarifying questions about MongoDB -

nosql - Clarifying questions about MongoDB - these newb questions, i'm sure, let's out of way sooner rather later: i'm new mongodb. does mongodb guarantee entry saved? e.g. if have process load 1,000,000 objects mongodb, guaranteed load or @ to the lowest degree retry / raise error when error occurs? is numberlong integers? if wanted utilize high precision decimals? i know v8 / spidermonkey can fast c, has done benchmarks calculations of info in mongodb? example, if wanted find average on 1,000,000 items loaded in 1, in map-reduce way programming language... have people run in problem using javascript mongodb? think? most mongo drivers allow insert info "safe-mode" waits insert finish sucessfully, or raises error on failure. done behind scenes calling getlasterror command after insert. mongodb's underlying storage format bson doesn't back upwards high-percision decimals, 64-bit floating point numbers. javascript in mongo...

How to make search functionality in android? -

How to make search functionality in android? - hello making little application in want search functionality had done surfing on net didn't useful. give tutorial or can made search functionality in application. you should take close search section on android developper website. basically need create searchable activity in application declaring in manifest : <activity android:name="searchactivity" android:excludefromrecents="true"> <intent-filter> <action android:name="android.intent.action.search" /> </intent-filter> <meta-data android:name="android.app.searchable" android:resource="@xml/searchable" /> </activity> this activity handle search request made when user uses phone's search button. search query (what user typed in text field) appear in intent calling search activity. can utilize in activity onresume() method : intent intent = getintent(); ...