Posts

Showing posts from June, 2011

jquery - Opentip read table td element title attribute and display as content -

jquery - Opentip read table td element title attribute and display as content - <table id="universal-radio-program" title="uzej ar pelīti uz nosaukumu, lai redzētu aprakstu..."> <thead> <tr><th>&nbsp;</th><th scope="col">pirmdiena</th><th scope="col">otrdiena</th><th scope="col">tre&scaron;diena</th><th scope="col">ceturtdiena</th><th scope="col">piektdiena</th><th scope="col">sestdiena</th><th scope="col">svētdiena</th><th>&nbsp;</th></tr> </thead> <tbody> <tr> <td>00</td> <td title="dance / hands up, trance, new tunes..." rowspan="2" colspan="4">prepare morning</td> <td title="presents universal radio x sel...

ios - how to pass an image from collection view to detail view in iphone -

ios - how to pass an image from collection view to detail view in iphone - retrieving info remote xml, can show images in collection view. collection view i'm trying display detailed view controller, if image clicked in collection view controller should display image in detailed view. got stuck here can't show detail view controller. going wrong? kindly guide me. below collection view controller, - (void)viewdidload { [super viewdidload]; xmlparser = [[myxmlparser alloc] loadxmlbyurl:@"http://myxml.com/sample.xml"]; myarray = xmlparser.arrayofimages; } -(nsinteger)numberofsectionsincollectionview:(uicollectionview *)collectionview { homecoming 1; } -(nsinteger)collectionview:(uicollectionview *)collectionview numberofitemsinsection:(nsinteger)section { homecoming [myarray count]; } - (uicollectionviewcell *)collectionview:(uicollectionview *)collectionview cellforitematindexpath:(nsindexpath *)indexpath { mycollect...

java - Difference between SomeInterface.class and SomeClass.class? -

java - Difference between SomeInterface.class and SomeClass.class? - i looking out difference between someinterface.class , someclass.class in java. can explain this? edit: someclass implements someinterface . classes in java used hold info , provide operations on data. interfaces used implment polymorphism. define operations implmenting classes musst provide have similar behaviours thier mutual parts. can think of interface kind of contract. let's have vehicles , want each vehicle know how many wheels has. car, motorcycle , othe vehicle dont know how many wheels has , have count them first. can utilize interface forcefulness each vehicle provide number of wheels has. interface vehicle { // define contract int getnumberofwheels(); } class auto implements vehicle { // respect contract prividing implmentation method getnumberofwheels() public int getnumberofwheels() { homecoming 4; } } class motorcycle implements vehicle { ...

ruby - What can I check to see if rspec is running? -

ruby - What can I check to see if rspec is running? - so ruby libraries double executables, using trick: if __file__ == $0 # deed executable... end i'm writing mini-library, , wondering if there similar trick utilize embed rspec tests in file. sort of constant or check, like: if rspec_target == $0 describe 'foo' "should foo" #... end end argv contains name of script. utilize next in modules: if argv.include? file.basename(__file__) # unit tests here end ruby rspec

Link prepended to div with jQuery can't be used as selector for another bind -

Link prepended to div with jQuery can't be used as selector for another bind - i trying implement feature can pin elements main content area smaller div. feature works expected. $('.pin').bind('click', function() { $('#sbstar').prepend($(this).parent().parent().parent('.leaf').clone(true)); }); edit: changing clone() clone(true), per vega's suggestion, fixed before problem (below), has not resolved completely. trying expand button different behaviour depending on whether in #sbstar or in main content area. unfortunately, ('#sbstar .expand') still doesn't work. $('#sbstar .expand').bind('click', function() { console.log('expand'); }); for reference, html: <article class="leaf"> <footer> <aside class="left"> <a href="#" class="expand">e</a> <a href="#sbstar" class="pin">p</...

android - execute other app method from reflection -

android - execute other app method from reflection - i have 1 app a, , installed device. public class a1 extends activity { void oncreate() ... void onresume() ... void showtoast() { toast.maketext(this, "showa1", toast.length_short).show(); } } and wrote app b, want execute a1.showtoast(), encounter nullpointerexception @ a1.showtoast(). @suppresswarnings("unchecked") @override public void onclick(view v) { string packagepath = "a"; string classpath = "a.a1"; seek { string apkname = getpackagemanager().getapplicationinfo( packagepath, 0).sourcedir; pathclassloader pathclassloader = new pathclassloader(apkname, classloader.getsystemclassloader()); class<activity> handler = (class<activity>) class.forname( classpath, true, pathclassloader); method[] mm = handler.getdeclaredmethods(); (method m : m...

sass - undefined method `perform' for nil:NilClass -

sass - undefined method `perform' for nil:NilClass - i'm trying update font-awesome lastly release using .scss. when seek compile using campass throws error: >>> alter detected @ 17:51:13 to: ui/_font_awesome.scss nomethoderror on line ["323"] of /usr/local/lib/ruby/gems/1.9.1/gems/sass-3.2.0.alpha.64/lib/sass/tree/visitors/perform.rb: undefined method `perform' nil:nilclass /usr/local/lib/ruby/gems/1.9.1/gems/sass-3.2.0.alpha.64/lib/sass/tree/visitors/perform.rb:321:in `map' /usr/local/lib/ruby/gems/1.9.1/gems/sass-3.2.0.alpha.64/lib/sass/tree/visitors/perform.rb:321:in `run_interp_no_strip' /usr/local/lib/ruby/gems/1.9.1/gems/sass-3.2.0.alpha.64/lib/sass/tree/visitors/perform.rb:331:in `run_interp' /usr/local/lib/ruby/gems/1.9.1/gems/sass-3.2.0.alpha.64/lib/sass/tree/visitors/perform.rb:295:in `visit_directive' /usr/local/lib/ruby/gems/1.9.1/gems/sass-3.2.0.alpha.64/lib/sass/tree/visitors/base.rb:37:in `visit'...

wordpress - Create php function to use inside while loop -

wordpress - Create php function to use inside while loop - how can create function utilize within while loop. the_title() or the_meta() in wordpress? simple sample enough. you utilize globals. example, assuming have global array, here (obviously need add together more robustness such error checking. plus how utilize on wordpress depend on doing) $post= array( 0=>array('title'=>'the title', 'content'=>'this content'), 1=>array('title'=>'the sec title','content'=>'we love seconds'), ); $array_index=0; the_title(); the_post(); next_post(); the_title(); the_post(); function the_title() { global $post, $array_index; echo $posts[$array_index]['title']; } function the_post() { global $post, $array_index; echo $posts[$array_index]['title']; } function next_post() { global $post, $array_index; $array_index++; } php wordpress...

c# - Upload pdf with parametrs HTTPWebrequest -

c# - Upload pdf with parametrs HTTPWebrequest - i want upload pdf parameters: string[] file = {"c:\test.pdf"}; string filename = "test.pdf"; string processid = "myid"; string document = result; string url = "serviceurl"; and there illustration of using : namevaluecollection nvc = new namevaluecollection(); nvc.add("filename", filename); nvc.add("processid", processid); nvc.add("document", result); httpupload.uploadfilestoremoteurl(url, file, "file", nvc); took above code , fixed because throws internal server error 500. there problems \r\n badly positioned , spaces etc. applied refactoring memory stream, writing straight request stream. here result: public static void uploadfilestoremoteurl(string url, string[] files, string logpath, namevaluecollection ...

content management system - In CQ How disable the topmost node of a tag -

content management system - In CQ How disable the topmost node of a tag - is there way disable topmost node of tag when adding tag. it suppose have dialog in there field xtype= tags , tag xyz under a, b, c kid nodes. i want author select or b or c. can not select xyz. how can implement this. in tagging_field.js thanks. sorry replying after long time, might helpful others. can achieved this, if user/author selects xyz tag value gets added tag field, can array of values added in tag field using getvalue method , if array contains xyz value delete value , setvalue tag field using setvalue method here link api docs tag field refer. tag field api docs regards, yash ahuja. content-management-system cq5

properties - Apache Java Configuration API - configuration profiles (inheritance)? -

properties - Apache Java Configuration API - configuration profiles (inheritance)? - when working zend framework, used have .ini configuration files, this: [production] setting1 = abc setting2 = def [development : production] setting1 = ghi and when turned on development application profile setting1 had value of ghi , whereas in prdouction mode abc . is possible define such inherited settings in apache commons configuration? i know can define multiple configuration files , create compositeconfiuration them, how tell application should include specific files in different modes? not have thought how set these application profiles yet setting called profile should work me. if possible, not want split settings in multiple files. i can't find info how should done in java. apache configuration reads config options file memory info structure. besides variable expansion, there no farther post processing default. options are: put options in default confi...

c# - Deserialize a list having extra properties with XmlSerializer -

c# - Deserialize a list having extra properties with XmlSerializer - i want deserialize next xml... <mytype> <items> <itemsum> <value>3</value> </itemsum> <item> <value>1</value> </item> <item> <value>2</value> </item> </items> </mytype> ...into type of next structure... [xmlroot("mytype")] public class mytype { [xmlarray("items")] [xmlarrayitem("item")] public citems items { get; set; } public class citems : list<citem> { [xmlelement("itemsum")] public citem itemsum { get; set; } } public class citem { [xmlelement("value")] public int value { get; set; } } } however, if seek using c#'s xmlserializer , itemsum property null . ideas doing wrong? h...

Can't Upload SSL Self-Signed Certificate Files to Heroku -

Can't Upload SSL Self-Signed Certificate Files to Heroku - i'm next guide deploy heroku: https://gist.github.com/harlantwood/3792692 i've created files required (site.key, site.csr, final.crt). when run heroku domains:add myapp.herokuapp.com response 'myapp.herokuapp.com in utilize app'. what mean , how can stop whatever app using it? heroku ssl-certificate

java - Recording network traffic for test driven development -

java - Recording network traffic for test driven development - i ruby there great https://github.com/vcr/vcr gem, works ruby http libraries. there tool can used record , play network traffic, scheme level, or @ to the lowest degree in java?? if not, give me proof of concept how create such tool (only linux)? you can utilize tcprelay play network packets captured in libpcap format. if using protocol sip, can utilize sipp, other alternative utilize mts-project. java ruby linux networking

passing array as paramter in URL using jquery/javascript? -

passing array as paramter in URL using jquery/javascript? - i making url(for viewing specific customer) in customerlist.jsp below customer_message request attribute array. when inspect customer_message in customerlist see array containing 2 float values var custurl="<s:url namespace="/customer action="view-customer" method="viewcustomer"/>?customer_message=<s:property value="#request['customer_message']"/>"; but when request in view-customer action , request.getparameter("customer_message") , see containing 1 value. am doing error in passing customer_message array? in struts2 utilize <s:param> tag within <s:url> tag add together parameters. <s:url namespace="/customer" action="view-customer" method="viewcustomer"> <s:param name="customer_message" value="#request['customer_message']"/> </s:url...

mvvm - Communicating between MEF objects -

mvvm - Communicating between MEF objects - i'm building workbench/ide style application uses mef locate , load tools workbench @ start up. i'm using mvvm lite build workbench , separate tools. i've got point want tools able communicate each other , workbench. i don't mean direct communication, more "hey have info here if anyone's interested" , interested tools can pick data. this looks much c# events , know can export interface tool(s) defines event(s) i'm wondering using mvvm lite messenger provide communication. i've seen on here people using eventaggregator prism same thing , messenger mvvm lite analogous figured utilize it. i'm after advice really, has used messenger mef - mef object , advocate on plain old c# events. what looking @ here mediator pattern. utilize plain old c# events same thing... right end implementing own kind of pub/sub pattern. , if going that, why re-invent wheel? i using prism's eve...

nuget - what purpose does 'package restore' serve? -

nuget - what purpose does 'package restore' serve? - i understand nuget's bundle restore downloads , 'installs' various required packages before building project. can't work out purpose serves. as far can tell, 'installation' of bundle during bundle restore, isn't same package's actual installation - example, if following: install jquery bundle (note adds jquery script files project's 'scripts' directory) delete added jquery script files delete 'packages' directory (steps 2 & 3 simulate state on build machine, or other dev's machine) do build (triggering bundle restore) at point build states 2> installed 'jquery 1.9.1'. however, jquery package's script files not added 'scripts' folder, , files not added project. this means have check these files source command anyway. which means when update package, have manage adding/removing new/old files (since different, versione...

ember.js - What type of controller should I use to represent a complex object which is not a (persisting) model? -

ember.js - What type of controller should I use to represent a complex object which is not a (persisting) model? - i'm writing calendar application, need display events month. while i'll need create objects represent calendar months, take these these calendermonth objects should not ' models ' (in ember terminology), since calendarmonth objects won't persist server (whereas event objects will). instead, calendarmonths 'objects' , build calendarmonth 'class' , extending ember.object so then, sort of controller utilize proxy (frequently changing) calendarmonth object? ( vanilla ) controller? objectcontroller ? arraycontroller ? objectcontroller seems way go, since intention the controller deed proxy single object. think i'm thrown fact in corresponding route object, i'd assigning calendarmonth object controller's model. when, it's not model, it's object. put way, question is: is bad practice assign ember obj...

wordpress - Convert these rewrite apache rules to nginx -

wordpress - Convert these rewrite apache rules to nginx - in wordpress, changed posts permalinks structure. in order don't 404 erros old links, redirect old permalinks new permalinks. according this, next code must added in .htacess can redirect working old posts links new posts link: redirectmatch 301 ^/([0-9]{4})/([0-9]{2})/([^/]+).html$ http://myurl.com/$3 that's good, however, don't utilize apache – utilize nginx. how can convert rules nginx? i've tried apache nginx online converter, no success. thanks! i believe want. "permanent" 301 according this page. rewrite "^/([0-9]{4})/([0-9]{2})/([^/]+).html$" http://myurl.com/$3 permanent; wordpress apache .htaccess nginx

Java openGL - drawing a 3D object -

Java openGL - drawing a 3D object - im looking draw 3d object in opengl whats best way approach this? thinking of drawing side profile of in 2d , maybe fleshing out become 3d possible? think easier way go straight 3d if cant id wasting time. i cant figure out how add together sky , maybe sea reflection, done? gl.glclear(gl.gl_color_buffer_bit); gl.glcolor3f(1.0f, 1.0f, 1.0f); gl.glpushmatrix(); gl.gltranslatef(-1.0f, 0.0f, 0.0f); gl.glrotatef((float) shoulder, 0.0f, 0.0f, 1.0f); gl.gltranslatef(1.0f, 0.0f, 0.0f); // gl.glpushmatrix(); gl.glscalef(2.0f, 0.4f, 1.0f); glut.glutwirecube(1.0f); // gl.glpopmatrix(); gl.gltranslatef(1.0f, 0.0f, 0.0f); gl.glrotatef((float) elbow, 0.0f, 0.0f, 1.0f); gl.gltranslatef(1.0f, 0.0f, 0.0f); // gl.glpushmatrix(); gl.glscalef(2.0f, 0.4f, 1.0f); glut.glutwirecube(1.0f); // gl.glpopmatrix(); gl.gltranslatef(1.0f, 1.0f, 1.0f); gl.glrotatef((float) hand, 0.0f, 0.0f, 1.0f); gl.gltran...

c++ - Pixel width using glPointSize - no effect -

c++ - Pixel width using glPointSize - no effect - i have code dropping points. want increment point size. right utilize command glpointsize nil happens. point size default. not increase. how can increment point size? glbegin(gl_points); glcolor3f (a, b, c); glpointsize(20.0f); glvertex2i(px, py); glend(); glpointsize(20.0f); has set before glbegin() , otherwise won't have effect. this: glpointsize(20.0f); glbegin(gl_points); glcolor3f (a, b, c); glvertex2i(px, py); glend(); in opengl documentation, can read that: only subset of gl commands can used between glbegin , glend. commands glvertex, glcolor, glindex, glnormal, gltexcoord, glevalcoord, glevalpoint, glarrayelement, glmaterial, , gledgeflag. also, acceptable utilize glcalllist or glcalllists execute display lists include preceding commands. if other gl command executed between glbegin , glend, error flag set , command ignored. c++ c visual-c++ opengl

java - copy / write contents of csv file to an array -

java - copy / write contents of csv file to an array - i learning java , need know easiest way re-create contents of csv file array , 1 time again re-create contents of array csv file. have csv file employee.csv contains following: name,company,experience. now need retrieve employees experience greater 2 , set them in array contains name, experience. i want write array .csv file called results.csv what best way accomplish this? instead of using library task you, think should seek write code yourself. parsing csv file exercise "currently learning java." below class hold employees , method parse file. there should more error checking code. if file has line without 2 commas in it, programme crash. didn't handle experience value check you. can either check create employees , add together new object array if meet experience requirement, or check value before writing file. simplify output file, wrote csvstring method in employee. public class...

Android ListView data is not repeating -

Android ListView data is not repeating - i trying show info in listview .but showing info lastly position. here code: public class listdetailsactivity extends activity { /** called when activity first created. */ private context con; private string pos = ""; private imageview cphoto; private textview cname, aname, atext; private cacheimagedownloader downloader; private bitmap defaultbit; private progressdialog pdialog; private citydetailslist cd; private listview clist; private hotelmenuadapter madapter; private string response = ""; @override protected void oncreate(bundle savedinstancestate) { // todo auto-generated method stub super.oncreate(savedinstancestate); requestwindowfeature(window.feature_no_title); setcontentview(r.layout.detailslayout); con = this; initui(); } private void initui() { // todo auto-generated method stu...

iphone - Best practices for mutable collections as properties -

iphone - Best practices for mutable collections as properties - i planning utilize nsmutabledictionary property storing game info (such score, settings, etc...). @property (nonatomic, copy) nsmutabledictionary *gamedata; in researching why there no "mutablecopy" alternative properties found this discussion, accepted reply states: the right way not create mutable array property what best way handle mutable collections properties in modern objective-c? it quite seldom pattern class expose mutable property collection object seems break encapsulation. nevertheless there are occasions when might create sense: could, illustration homecoming kvo proxy internally managed collection (using kvc's mutablearrayvalueforkey: ). in these cases not matter whether or not declare getter property or plain method. in case of properties should not copy property, though. to create little clearer here's example. have class declares single public ...

php - I came across this in my sever. What does this do? -

php - I came across this in my sever. What does this do? - i came across in sever. , wondering these php codes do. <?php $request_method = $_server["request_method"]; if($request_method == "get"){ $query_vars = $_get; } elseif ($request_method == "post"){ $query_vars = $_post; } reset($query_vars); $t = date("u"); $file = $_server['document_root'] . "/../data/gdform_" . $t; $fp = fopen($file,"w"); while (list ($key, $val) = each ($query_vars)) { fputs($fp,"<gdform_variable name=$key start>\n"); fputs($fp,"$val\n"); fputs($fp,"<gdform_variable name=$key end>\n"); if ($key == "redirect") { $landing_page = $val;} } fclose($fp); if ($landing_page != ""){ header("location: http://".$_server["http_host"]."/$landing_page"); } else { ...

symfony2 - Symfony 2 error handling exceptions vs flashbag -

symfony2 - Symfony 2 error handling exceptions vs flashbag - i see in symfony 2 examples when eg record not exist, symfony 2 throws exception. not find such approach friendly end user. why should prefer throwing exception , not add together error messages @ flashbag? in examples throws exception throw $this->createnotfoundexception('message'); which redirects user 404 error page. in cms, if record not found want show user 404 page opposed adding error flash handbag , redirecting them to, lets say, homepage. i guess depends on applications needs, , how want handle it. symfony2 error-handling

c++ - Where's the proper (resource handling) Rule of Zero? -

c++ - Where's the proper (resource handling) Rule of Zero? - here's article talks idiom named rule of zero. here's excerpt: class module { public: explicit module(std::wstring const& name) : handle { ::loadlibrary(name.c_str()), &::freelibrary } {} // other module related functions go here private: using module_handle = std::unique_ptr<void, decltype(&::freelibrary)>; module_handle handle; }; it reuses unique_ptr raii features don't need care implementing daunting , verbose rule of 5 wrapper. presented way (managing handle based resources unique_ptr , way), looks hack me, not best solution it's trying solve. many assumptions beingness implicitly assumed: one able peer , utilize basic type #define (or typedef ) handle built upon. me should hidden knowledge, , solution based exclusively on interface makes available: handle . handles, can anything, they're not required pointer types. i'd utilize...

c++ - How to see the informations and compiler flags for .o files in linux? -

c++ - How to see the informations and compiler flags for .o files in linux? - i using centos 6.02 64 bit. want see info , used compiler flags in .o files. there command or way see that? have seen architecture of .a file using objdump. couldn't seen info .o files. there no general way extract compiler flags object file. can see compiling twice , without no-op switch -fverbose-asm (gcc flag affects generation of asm) , comparing objects - identical. there compiler specific extensions allow insert them during compile e.g. -frecord-gcc-switches in newer versions of gcc, places flags used in section .gcc.command.line . there various info inserted different compilers .comment section e.g. compile gcc 4.7.2 shows: $objdump -s -j.comment <objfile> objfile: file format elf64-x86-64 contents of section .comment: 0000 00474343 3a202847 4e552920 342e372e .gcc: (gnu) 4.7. 0010 3200 2. you can of course of study architecture i...

java - Put request using rest -

java - Put request using rest - i have begun studyin restlet interface. don t know how translate method set using restlet interface. curl -x set http://ip:port/testdb2 how can translate request? far , have code : clientresource resource = new clientresource("http://"+this.ip+":5984/"); // send http request representation r=resource.get(); if (resource.getstatus().issuccess()) { resource.getresponseentity().write(system.out); } resource.put(null); if (resource.getstatus().issuccess()){ resource.getresponseentity().write(system.out); } else system.out.println("error put"); how specify new url? need request create couchdb database. rephrasing question, i'll utilize "how issue set request url ..." per http://www.restlet.org/documentation/2.0/firstresource#part07 perhaps like clientresource dbresource =...

php - Remove HTML from Error Message In CodeIgniter -

php - Remove HTML from Error Message In CodeIgniter - i have in codeigniter model $query = $this->db->insert('something',$data); if($query) { homecoming true; } else { homecoming $this->db->_error_message(); } what much know is, how can remove html error template generated codeigniter, when _error_message() function returned, keeping plain error message text? any ideas? return strip_tags($this->db->_error_message()); it strip in between <> didnt know there css on page can parse html dom parser , homecoming plaintext div id or class want php codeigniter error-handling

javascript - How to make "navbar-fixed-bottom" slide up when button is clicked in responsive mode? (bootstrap) -

javascript - How to make "navbar-fixed-bottom" slide up when button is clicked in responsive mode? (bootstrap) - currently twitter bootstrap's navbar @ bottom (used footer) slides "down" when button pushed on phone screen or narrow window. i want menu slide "up" instead of default "down".. ideas on how can twitter bootstrap? the code used in view layer of navbar footer follows: <footer id="footer" class="navbar navbar-fixed-bottom"> <div class="navbar-inner"> <div class="container"> <button type="button" class="btn btn-navbar dropup" data-toggle="collapse" data-target=".show-footer"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </...

php - Possible to send username that we use in session? -

php - Possible to send username that we use in session? - i want send user id stored in session variable. when user submits form, database should receive info user submits , userid database. here have: session_start(); if (!isset($_session['username'])); { header('location: index.php'); } <p>welcome, <b> echo $_session['username'];</b> if(isset($_post['submit'])) { $dbhost = 'localhost'; $dbuser = 'root'; $dbpass = ''; $conn = mysql_connect($dbhost, $dbuser, $dbpass); if(! $conn ) { die('could not connect: ' . mysql_error()); } if(! get_magic_quotes_gpc() ) { $complaint = addslashes ($_post['complaint']); } else { $complaint = $_post['complaint']; }$sql = "insert employee ". "(complaint) ". "values('$complaint')"; mysql_select_db('sistempinjaman'); $retval = mysql_query( $sql, $conn ); if(! $retval ) { ...

R gWidgets remove parameters and passing arguments -

R gWidgets remove parameters and passing arguments - i’m new r world , i’m having difficulties working gwidgets , hope out there can help me. first of r version 2.15.2., , i’m using windows 7 32-bit. i want create gui input/output , selection (yes, no), if user selects (using gradio) “yes”, display set of parameters, if “no”, should disappear (those parameters), or grayness out. , finally, if user click ok button, pass parameters utilize (later on) phone call function. here questions: do have thought how can remove parameters when user selects “no”, right now, if click no, prints want, when click “yes” again, displays 3 parameters. do know how can pass arguments when user click “ok”, later when click ok, phone call (or source) function in different r code many in advance help cesar p.s. below code: require(gwidgets) options("guitoolkit"="rgtk2") #options(expressions=500000) w <- gwindow("") g <- ggroup(horizontal = false, con...

c# - Calling stored procedure entity framework dynamic result set using complex type -

c# - Calling stored procedure entity framework dynamic result set using complex type - i've stored proc calls view 100 columns stored proc called set of columns user want's view , returns selected columns. entity framework cannot handle because complex type defined expects 100 columns. let's phone call stored proc 'personname, personcity' possible other 98 types defined in complex type set null? you can't utilize entity framework this. should utilize ado.net , datatable calling sp , inspecting returned info structure. this: var cmd = new sqlcommand("spname", db); cmd.commandtype=commandtype.storedprocedure; cmd.parameters.addwithvalue("@columnnames", "a,b,c"); var da = new sqldataadapter(cmd); datatable dt = new datatable(); da.fill(dt); foreach (datacolumn dc in dt.columns) { //now have info results column...

Why does javascript interpret these identical dates differently -

Why does javascript interpret these identical dates differently - what's going on here: > new date('apr 15 2013'); mon apr 15 2013 00:00:00 gmt+0100 (gmt daylight time) > new date('04/15/2013'); mon apr 15 2013 00:00:00 gmt+0100 (gmt daylight time) > new date('2013-04-15'); mon apr 15 2013 01:00:00 gmt+0100 (gmt daylight time) obviously, 1 beingness interpreted utc time, while other 2 beingness interpreted local time. causes difference in parsing? from specification: the string may interpreted local time, utc time, or time in other time zone, depending on contents of string. function first attempts parse format of string according rules called out in date time string format (15.9.1.15). if string not conform format function may fall implementation-specific heuristics or implementation-specific date formats. of formats provided, '2013-04-15' officially supported, others seem fall implementation-dependent behavior....

c# - Checking if child exists but still get NullReferenceException -

c# - Checking if child exists but still get NullReferenceException - this question has reply here: what nullreferenceexception , how prepare it? 21 answers i trying read xml document. nodes not contain kid , whenever programme runs across this, crashes follow error: system.nullreferenceexception: object reference not set instance of object. i checking null next way: var test = node.selectsinglenode("ele:group", ns).innertext; if(test != null) response.write(test.tostring()); but still error above. why this? resolved: right code: if (node.selectsinglenode("ddf:additionalconstraint", ddfnamespace) != null) check if node null before getting innertext. c# asp.net xml visual-studio-2012

php - Should I generate each thumbnail dynamically every time it is requested, or store them on image upload? -

php - Should I generate each thumbnail dynamically every time it is requested, or store them on image upload? - this question has reply here: php image resize on fly vs storing resized images 4 answers problem - wanted set image-uploading feature in website. wanted show both- original image , little thumbnail of image. choices - way improve - create separate image (thumbnail) in directory when image uploaded or show smaller version reducing height , width in fixed ratio every time image requested? how doing currently - later 1 sounds improve me because won't taking much size on disk has resize image 1 time again , again. 1 think better? this general question web application, no language in specific. any thought how facebook or google it? question - question how generate thumbnails , show them on website - creating re-create of original image smalle...

Cross development aspects between different Java EE implementations (especially Glassfish and JBoss) -

Cross development aspects between different Java EE implementations (especially Glassfish and JBoss) - i working on addon web application existing enterprise application deployed on jboss 4 instance. maintain easy using glassfish application server delivered in netbeans. theprototype, packing every library utilize war file want deploy, hibernate , basic libraries. in future want utilize server delivered libraries , features jndi database connection lookup, session , entity beans , on. my questions: are there aspects deploying simple web application in war file packed glassfish on jboss, can hard solve problem? are ejb interfaces accessed in similar way on both implementations? means, able access session bean on jboss when developed code doing on glassfish server? is jndi querying performed similar on both implementations? other aspects? i have say, experienced in developing simple servlets. know theoretical stuff java ee , ejb , want deeper in this. know nil implementat...

c - warning: illegal conversion of pointer to integer with char and structure to string -

c - warning: illegal conversion of pointer to integer with char and structure to string - i have annoying problem... i have able display text construction onto lcd display micro controller. these affected areas: struct menu_id { char id; char menu[11]; char submenu; }; void main (void){ struct menu_id mainmenu[5] = { {0, "chnl1", 1}, {0, "chnl2", 2}, {0, "mal codes", 3}, {1, "chnl1...", 0}, {2, "chnl2...", 0}, }; print(mainmenu[0].id, mainmenu[0].menu); } void print (char line1, char line2) { char temp[11]; lcd_register_com(); //set command register outputchar(lcd_line0); //line 0,0 lcd_register_data(); //set info register sprintf(temp, "%c", line1); outputstring(temp); lcd_register_com(); ...

google calendar api with php -

google calendar api with php - i need integrate google calendar api show logged in users google calendar in php website , same functions have in google calendar , there possible way this? working https://developers.google.com/google-apps/calendar/ kindly allow me know suggestions . check out links, calendar api how access google calendar php using google api google apis client library php integrate php application google calendar google calendar api : php adding/deleting events google calendar api add-2-google-cal new json format google calendar api may help you. php google-calendar

Splitting the full name and writing it to another table in SQL Server 2008 -

Splitting the full name and writing it to another table in SQL Server 2008 - i have table, a, in there column fullname. values stored under column in format of "surname name middle_name" (with 1 space between each). , have table b, in have columns surname, name , middlename. best way take of fullname cells table a, split them accordingly , insert them table b? thanks you can combine functions searching occurence in string (which homecoming index) substring function, besides need left , right functions for illustration in sql server find functions: charindex ( expressiontofind ,expressiontosearch [ , start_location ] ) substring ( look ,start , length ) left ( character_expression , integer_expression ) right ( character_expression , integer_expression ) steps: use left 1st word (integer_expression = index of 1st emtpy space) use substring middle word (start index of 1st emtpy space + 1 , length entire length - sec index of emtpy space, utiliz...

javascript - asp.net webpage web service only working on local machine -

javascript - asp.net webpage web service only working on local machine - i have asp.net webpage couple divs on it. of work done through javascript, json, , webservice running on same page. my webservice has 3 different functions use. functions perform select statement same database, database beingness queried located on same machine website on. i started working on webpage on local machine , run webservice functions correctly , response. however, trying move page server having no luck. when on server page loads correctly, requires phone call first function (this works fine). on click of button sec phone call function made timeout error. i tried running functions straight server, , first function works fine, other 2 not, give me page error code 500. ideas causing this? i figured out issue. had code on 2 functions trying hostname ip address webpage beingness hosted on computer in network outside of domain. getting exception when trying convert ip hos...

How to use file system function 'exists' in symfony2? -

How to use file system function 'exists' in symfony2? - i checked symfony2 api docs here, few file scheme functions available in symfony\component\filesystem\filesystem i used 'mkdir' , worked fine but, unable utilize 'exists' function public boolean exists(string|array|traversable $files) it gives error fatal error: phone call undefined function survey\blogbundle\controller\exists() are sure not bool file_exists ( string $filename ) http://php.net/manual/de/function.file-exists.php looking @ docs see there exists function. maybe have missed add together utilize statement use symfony\component\filesystem\filesystem; however can still utilize file_exists detailed info on how utilize filesystem http://symfony.com/doc/master/components/filesystem.html new in version 2.1: filesystem component new symfony 2.1. previously, filesystem class located in httpkernel component. symfony2

c - Handing out addresses in a custom memory allocator w.r.t. cache conflicts -

c - Handing out addresses in a custom memory allocator w.r.t. cache conflicts - i've spent afternoon reading on processor caches after reading the effect powerfulness of twos can have on cache conflicts. wish apply new knowledge memory allocator multi-threaded programs. however, don't understand yet. i under impression processors loved powers of two, allocator rounds requested sizes next powerfulness of 2 , slices pages multiples of size , hands them out. when page full, maps new page , slices same way. leads similar , predictable offsets pages. to extent should adapt allocator avoid issue? example, should seek randomize addresses or screwed using powers of 2 in first place? thanks! until have uncontrovertible proof this performance critical, leave be. complication not worth it. everybody should read (and understand!) bentley's "writing efficient programs" (sadly out of print now, "programming pearls" contains summary, , worth read...

javascript - invoke primefaces context menu from java script -

javascript - invoke primefaces context menu from java script - i have svg on webpage. elements when right clicked on should display context menu info fetched database. elements written in such way right click event triggers js function on page. , need invoke context menu java script. can please help me this. have been stuck issue 3 days. element : <rect/><text>l</text></g><g id="118" onmousedown="rightclickexecute(event,118)"> java script : function rightclickexecute(event, id) { if (event.button == 2) {document.getelementbyid("myform:selectedentityid").value = id; document.getelementbyid("myform:selectedobjecttype").value = 'entity'; document.getelementbyid("myform:rightaction").click(); } } function showcontextmenu(){ document.getelementbyid("myform:contextmenuitemid").click(); } xhtml: <p:contextmenu id=...

Apache Httppost retrieve image from server Java -

Apache Httppost retrieve image from server Java - right using httppost post parameters in form of xml server. when post occurs, geotiff or .tif file downloaded. have posted document server , downloaded file attaching parameters url can't seem combine two. have utilize post because using url leaves out elevation info in geotiff. in short, not sure how simultaneously post , retrieve image of post. have far... // target url string strurl = post; // file posted string strxmlfilename = xml_path; file input = new file(strxmlfilename); // prepare http post httppost post = new httppost(strurl); post.setentity(new inputstreamentity( new fileinputstream(input), input.length())); // specify content type , encoding post.setheader( "content-type", "text/xml"); // http client httpclient httpclient = new defaulthttpclient(); //locat...

asp.net mvc - Orchard and news / announcements -

asp.net mvc - Orchard and news / announcements - is there build in orchard or modules available news , announcements management? seems mutual thing have been unable find it. i place on start page give head ups of latest news (the items stored on sql server compact). in table structure. logged in users should able post news well. any recommendations on approach or documents should read appreciated, not waste time using wrong approach or not taking advantage of orchard has offer. thanks. you don't need module that. create new contenttype called "news" title , bodypart attached it. can add together widget stereotype , become available in list of widgets. can create new widget of type. can place widget "homepage" layerrule. asp.net-mvc orchardcms

design patterns - Automatic generation of immutable class and matching builder class of a Java interface -

design patterns - Automatic generation of immutable class and matching builder class of a Java interface - what tools or libraries exists java take interface accessor method definitions , automatically generate immutable object class , "builder" class incrementally building new instances or changing existing instances creating new ones? example input: public interface auto { string getmodelname(); int getwheelcount(); } example output: import javax.annotation.concurrent.immutable; import javax.annotation.concurrent.notthreadsafe; @immutable public final class immutablecar implements auto { @notthreadsafe public static final class builder implements auto { private string modelname; private int wheelcount; public builder() { } public builder(final auto car) { modelname = car.getmodelname(); wheelcount = car.getwheelcount(); } public immutablecar build() { ...

android - How do I handle my database within one class and securely close it in the end? -

android - How do I handle my database within one class and securely close it in the end? - i have class database access. holds reference sqlitedatabase. 30 or functions this: public boolean updatesomething(long a, int b, long c) { contentvalues values = new contentvalues(); values.put(col_a, a); ... homecoming database.update(table, values, col_id + "=?", new string[]{id}) > 0; } many stackoverflows suggest this: public boolean updatesomething(long a, int b, long c) { sqlitedatabase database = dbhelper.getwritabledatabase(); contentvalues values = new contentvalues(); values.put(col_a, a); ... boolean success = database.update(table, values, col_id + "=?", new string[]{id}) > 0; database.close(); homecoming success; } but have functions homecoming cursors exactly because need cursor on 10k rows of database , can't re-create stuff array , close database. others open database in onresume , ...

java - xerces stalls on getting xhtml1-transitional DTD -

java - xerces stalls on getting xhtml1-transitional DTD - this question has reply here: xerces dom parser incredibly slow? 2 answers i'd perform xpath queries on xml document online. i've set inputstreams retrieve content , append <?xml ...?> header declares encoding nowadays in charset field of http requests. although works, it's painfully slow. //bis bufferedinputstream content part of http reply docbuilder = docbuilderfactory.newdocumentbuilder(); // throws exception. document doc = docbuilder.parse (new prependinputstream(bis, "<?xml version='1.0' encoding='"+charset+"' ?>\r\n")); (please allow me not set whole source time: i'm preparing assignment students). some strace analysis revealed programme stalls when contacting w3.org: send(8, "get /tr/xhtml1/dtd/x...

jquery - How to get variable values at runtime in Ajax call -

jquery - How to get variable values at runtime in Ajax call - i declare varaiable in java script code value of fields of filtertoolbar in jqgrid. here variable declaration: var filter = $("#gridid").jqgrid('getgridparam', 'postdata').filters; console.log(filter); initially filter toolbar empty while loading grid giving {"groupop":"and","rules":[]} in console output. ok not changing response when come in value filtering after loading of grid. no response getting filter event in firebug.. here finish code: $(function () { var griddata = null; var nn = null; $.ajax({ url: 'default.aspx/mymethod', datatype: 'json', contenttype: "application/json; charset=utf-8", type: 'post', success: function (reportdatanew, textstatus, xmlhttprequest) { //debugger; griddata = json.parse(reportdatanew.d); //console.log(griddata); //alert(griddata.l...