Posts

Showing posts from February, 2010

jquery - Pass additional information back through postback -

jquery - Pass additional information back through postback - i having problem using jquery asp.net. have html img , asp:button , asp:fileupload . <img src="images/12345.png" data-id="12345" /> <asp:fileupload id="fup" runat="server" /> <asp:button id="btn" runat="server" /> i trying pass image id html img . thought of how force info element commandargument or something? i can't have html image runat="server", because setting dynamically client-side. plugins i tried using plugins, nil working out way had planned: this 1 takes multiple files, need limited one. don't need back upwards dragging or fancy. http://valums.com/ajax-upload/ uploadify uses flash, trying shy away that. http://www.uploadify.com/ this 1 uses ugly iframes , stuff, not looking nice. also, spelling mistakes on site little off-putting. http://www.phpletter.com/demo/ajaxfileupload-demo/ i...

Java - how to make an image represent which tile to draw in a game? -

Java - how to make an image represent which tile to draw in a game? - i trying figure out how create game draw tile in specific spot using image represent each spot. if pixel of image color reddish specified picture(tile) draw in game, , each pixel greenish stood different specified image. have seen people create games dont know how , dont know name it. if need more info can seek explain want more. please help? that may slower in long run. recommend utilize byte array represent tiles, i.e. byte[width][height]. faster, easier manage , easier extend spritedata[width][height] if single byte not supply plenty info anymore. however, if insist on using image store game data, can utilize following: file file = new file("mygamedata.jpg"); bufferedimage image = imageio.read(file); // getting pixel color @ position x, y (width, height) int colour = image.getrgb(x ,y); int reddish = (colour & 0x00ff0000) >> 16; int greenish = (colour ...

iphone - check if pinch is released in UIPinchGestureRecognizer -

iphone - check if pinch is released in UIPinchGestureRecognizer - how check if pinch has been released? tried - (ibaction)resizeimage:(uipinchgesturerecognizer *)sender { if (sender.delaystouchesended) //here } and didn't work out you need check sender.state == uigesturerecognizerstateended , perchance sender.state == uigesturerecognizerstatecancelled iphone objective-c ios ipad

java - How to show images in motion on browser other than applet -

java - How to show images in motion on browser other than applet - i have been working on project on video surveillance in java through rmi , struts hibernate. in have image frames stored in server database. want show them in motion give video on web browser. since applets run on client can't achive applets.. how can this? you can utilize javascript that. depending on size of images , resolution performance may issue. java image video

flex - Get The Items Under An Expanded Node in AdvancedDataGrid -

flex - Get The Items Under An Expanded Node in AdvancedDataGrid - is there way items under expanded adg tree node? given sample tree node: - atlantic celtics nets knicks sixers raptors + central + southeast + southwest + northwest + pacific i planning capture info in adg's itemopen event. private function myadg_itemopen(event:advanceddatagridevent) :void { // codes set here next teams: // celtics, nets, knicks, sixers, raptors } update: managed pull off codes somehow provides me object containing teams: var ihd:ihierarchicaldata = ihierarchicalcollectionview(myadg.dataprovider).source; if(ihd.haschildren(evt.item)) { var objgetchildren:object = ihd.getchildren(evt.item); var datastring:string = objectutil.tostring(objgetchildren); // here, able parse datastring array, able team name. } you can adg advanceddatagridevent , can seek cast dataprovider ihierarchicalcollectionview . if worked can...

how to include a php function in a class? -

how to include a php function in a class? - i have class: class connect { public function auth() { ... } } and have function: getfile.php <?php require_once($globals['path']."connect.php"); ?> the have the: connect.php <?php function connect( $host, $database ) { database connection here } ?> how can utilize functions within class this: class connect { require_once("getfile.php"); public function auth() { connect( $host, $database ) ... query } } is possible? thanks functions declared in global scope available globally. don't have include need it, include file function in origin of script. secondly, class connect { require_once("getfile.php"); public function auth() { connect( $host, $database ) ... query } } this jibberish; can't execute within class outside of methods. if want included when s...

ios - multiple "content views" on the same xib -

ios - multiple "content views" on the same xib - i have viewcontroller (with navigation) needs show 7 different content layouts. want maintain same background , nav, thing needs change central uiview . if have 7 different uiviews on same xib/storyboard, can hide ones i'm not using or ding performance? using segues won't work either because create mess out of custom navigation , animations. is there improve way accomplish trying do? thanks suggestions solution my design custom using view controller containment decided mimic thought custom uiviewcontroller , 2 uiview s. it's not bad , works rather quickly. you should using view controller containment, can load views separate nib files , still provide custom navigation , animations container view controller. note: supported ios 5. ios

c# - About Generics and Inheritance (forgive my bad title) -

c# - About Generics and Inheritance (forgive my bad title) - as don't know how problem called, cannot guarantee, nobody has asked same question or @ all. i did notice, there quite few threads similar title, don't seem relevant problem. i have custom list class, implements generics. class mylist<t> { public void add(t item) // adds item list { /* code */ } public void add(mylist<t> list) // attaches existing list end of current 1 { /* code */ } } i have classes: class apple : fruit and class banana : fruit now, comes relevant code: mylist<fruit> fruitlist = new mylist<fruit>(); // fill fruitlist fruitlist.add(new apple()); // works, of course of study fruitlist.add(new banana()); // works well, of course of study mylist<apple> applelist = new mylist<apple>(); // fill applelist fruitlist.add(applelist); // doesn't work. why? even though applelist mylist(of apple) , apple fruit, visualstu...

How to merge files in ClearCase with files from other directory? -

How to merge files in ClearCase with files from other directory? - i have files in directory /vobs/project/code_dir_staff/code in branch , want to: merge branch branch put files in directory /vobs/project/sub_project/code example. the destination ' code ' directory exist , have history. don't need source directory in destination branch. how simple? i would: first, classic merge. then in destination branch, move (through clearcase explorer) file existing code directory finally remove (through clearcase explorer) directories not want see. that work base of operations clearcase, not ucm (unless in vob component): cannot move files (with history) 1 component another. moving files clearcase explorer preserve history of files, checkout source parent directory , un-catalogued files, , checkout destination directory reference same files. clearcase

qt - How to prevent user from resizing columns of QTableWidget? -

qt - How to prevent user from resizing columns of QTableWidget? - i'd manage width of columns in table personally, after resizing them code, cannot figure out way prevent user resizing them manually. found out qtableview has columnresized() slot, , ways see either subclassing qtablewidget or resizing columns 1 time again , 1 time again on timer event. might there easier way? it can done using : void qheaderview::setsectionresizemode (resizemode mode) void qheaderview::setsectionresizemode (int logicalindex, resizemode mode) the horizontal header reachable qtablewidget using horizontalheader() . this it: ui->tmeal->horizontalheader()->setsectionresizemode (qheaderview::fixed); note legacy (qt4) applications should utilize setresizemode() . qt qtablewidget

SQL Multiple COUNT() from two tables, within a LEFT JOIN -

SQL Multiple COUNT() from two tables, within a LEFT JOIN - i have 3 tables, want select info 1 of tables, , collect count of how many times specific row of info linked in other 2 tables. so, select info site_projects. homecoming count of site_project_members site_projects . id = site_project_members . pid , homecoming count of site_project_tasks site_projects . id = site_project_members . pid i hope i'm making sense, query, looks correct. , querys database (mysql) no problems. except returns sum of both of counts both things. (see below table structures) site_projects id | title | desc | start | deadline | progress 1 | project 1 | project | 1321748906 | 1329847200 | 20 site_project_members id | pid | uid | img | hidden 1 | 1 | 1 | 1 | 0 2 | 1 | 2 | 2 | 0 site_project_tasks id | pid | desc | completed 1 | 1 | task 1 | 1 1 | 1 | task 2 | 0 here query: select p.`id`, p.`title`, p.`desc`, p.`progress`, p...

vb.net - Unable to to locate and click a submit button using mshtml.HTMLInputElement -

vb.net - Unable to to locate and click a submit button using mshtml.HTMLInputElement - below is html form , below that, vb procedure, "loginexamp" enters in username , password. unable locate button , click since not seem show mshtml.htmlinputelement. "htmlinput.click()" never runs. how can adjust loginexamp code button clicked. help. <form id="loginform" name="loginform" method="post" action=""> <input id="username" class="formfield" type="text" value="user name" maxlength="40" name="xusername"> <input id="password" class="formfield" type="password" onfocus="cleardefault(this)" maxlength="40" name="xpassword"> <button class="subbutton" onclick="javascript: submitform()">submit!</button> </form> with below code public sub loginexamp() d...

jquery - How can I simulate hoverIntent on this block of code? -

jquery - How can I simulate hoverIntent on this block of code? - i have asked same in previous topic said should open this. here goes: i'm animating ribbon behind navigation , problem want maintain animated element in previous place instead of going starting position , coming next element. able accomplish this, without utilize of hoverintent. ribbon pick every single motion on navigation. how can prevent this? correct me if i'm wrong delay() , settimeout() did not create sense @ point since fire lastly animation regardless of stops. how can prevent mouseenter firing if mouse passing by? maybe if clause on mouseover if mouse stable on hovering block more 300 ms? note: i'm running noconflict script, hence j = $. function rbhover(){ j("#nav li a") .on('mouseenter', function() { var l = j(this).parent().position().left; var w = j(this).parent().width(); var rbw = math.round(w/4); var rbh = math...

How get generic parameter in scala -

How get generic parameter in scala - i able perform next code: abstract class a[t <: anyref]{ def whichclass: class[_] = classof[t] } case class x() object b extends a[x] object main{ def main(args: array[string]){ b.whichclass //should homecoming classof[x] } } clearly, doesn't work in form, since classof[t] can assignged class, not type. got error: error: class type required t found def whichclass: class[_] = classof[t] any thought how solve problem in way? use classmanifest. abstract class a[t <: anyref : classmanifest] { def whichclass = classmanifest[t].erasure } case class x() object b extends a[x] object main{ def main(args: array[string]): unit = { println(b.whichclass) // prints 'class x' } } generics scala

sql - Changing the maximum length of a varchar column? -

sql - Changing the maximum length of a varchar column? - i'm trying update length of varchar column 255 characters 500 without losing contents. i've dropped , re-created tables before i've never been exposed alter statement believe need utilize this. found documentation here: alter table (transfact-sql) can't create heads or tails of it. i have next far (essentially nil unfortunately): alter table [progennet_dev].progen.le alter column ur_value_3 how approach this? there improve documentation statement out there (i did searches illustration statement came empty)? remember specify not null explicitly if desired. otherwise default null regardless of original specification is. alter table [progennet_dev].progen.le alter column ur_value_3 varchar (500) [not null] please note square brackets indicate bit of syntax optional, sql run in ssms: alter table [progennet_dev].progen.le alter column ur_value_3 varchar (500) not null sq...

android - optimize the project code -

android - optimize the project code - i have working on 1 project complex , contain much space many images java files . somewhere have read proguard optimize code . i have used still not effect on final apk file . might have made error somewhere . have next http://developer.android.com/guide/developing/tools/proguard.html. can 1 suggest me how can optimize code . you can add together default.properties. i've been adding manually without having problem far. if add together line: proguard.config=proguard.cfg as said utilize proguard when exporting signed application (android tools => export signed application) if start project sdk before android 2.3 proguard.cfg file not created (next default.properties in 2.3>). to enable automatic creation of it, update sdk of android 2.3 , create new project existing sources (which sources of project have). automagically proguard.cfg fill created. without optimizations compiler produces dumb code - ...

asp.net - How to hash a password and save into a database table? -

asp.net - How to hash a password and save into a database table? - i have form register.aspx , login function , using vb.net in register.aspx have 2 textboxes, user name , password , submit button. if user click's on submit button, password hashed , stored username in database table called customer i know- 1) how hash password? 2) how compare hashed value in database password entered in textbox while login? to reply questions in order. you utilize 1 of crypto classes, next documentaion. you store hashed value in database, when query database, utilize hash. psuedo code: function getuser(name, password) hashedpassword = hash(password) sqlcmd = 'select userkey user username = @name , password = @pass' add together cmd parameter ('@name', name) add together cmd parameter ('@pass', hashedpassword) userkey = cmd.executequry homecoming userkey end function that said, don't if can implement open...

html - How to make Play font from Google Fonts smoother? -

html - How to make Play font from Google Fonts smoother? - i'm trying create titles using play font google fonts can't create smooth. here example: http://dl.dropbox.com/u/15358757/123.jpg is there anyway create smoother? or it's problem font , need chose other one? html google-chrome embedded-fonts

c++ - Should std::bind be compatible with boost::asio? -

c++ - Should std::bind be compatible with boost::asio? - i trying adapt 1 of boost::asio examples utilize c++11 / tr1 libraries possible. original code looks this: void start_accept() { tcp_connection::pointer new_connection = tcp_connection::create(acceptor_.get_io_service()); acceptor_.async_accept(new_connection->socket(), boost::bind(&tcp_server::handle_accept, this, new_connection, boost::asio::placeholders::error)); } if replace boost::bind std::bind follows: void start_accept() { tcp_connection::pointer new_connection = tcp_connection::create(acceptor_.get_io_service()); acceptor_.async_accept(new_connection->socket(), std::bind(&tcp_server::handle_accept, this, new_connection, boost::asio::placeholders::error ) ); // std::bind(&tcp_server::handle_accept, this, new_connection, _1 ) ); } i big error message, ends with: /usr/include/c++/4.4/tr1_impl/functional:1137: error: ret...

mysql - Determine total amount of top result returned -

mysql - Determine total amount of top result returned - i determine 2 things single query: most prevalent column in table the amount of times such column located upon querying table example table: user_id some_field 1 info 2 info 1 info the above homecoming user_id # 1 beingness prevalent in table, , homecoming (2) total amount of times located in table. i have done research , came across 2 types of queries. group user_id order count(*) desc sum the problem can't figure out how utilize these 2 queries in conjunction 1 another. example, consider next query returns prevalent column. $top_user = "select user_id table_name grouping user_id order count(*) desc"; the above query returns "1" based on illustration table shown above. now, able homecoming "2" total amount of times user_id (1) found in table. is chance possible? thanks, evan you ca...

java - resizing JDialog box -

java - resizing JDialog box - i'm having problem dialog created. packs in cutting off border titles , input boxes. i've tried setting size of panel , of components, no avail; size never changes. help appreciated in beingness able modify dimensions of dialog. jtextfield business relationship = new jtextfield(6); account.setdocument(new jtextfieldlimit(6)); account.setborder(new titledborder("account")); string[] firstdigitlist = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9"}; jcombobox firstdigitcombo = new jcombobox(firstdigitlist); firstdigitcombo.setselectedindex(0); firstdigitcombo.setborder(new titledborder("leading digit change")); jpanel panel = new jpanel(); panel.add(account); panel.add(firstdigitcombo); int result = joptionpane.showconfirmdialog(null, panel, "please come in values", joptionpane.ok_cancel_option); t...

web - How to disable Android Dialer auto show? -

web - How to disable Android Dialer auto show? - i have web app in jsp/servlet. don't know why touch on image in webpage, android dialer auto show filled contact's numbers such 72000, 36000 .... can help me solve problems ? i had problem. adding webkit-specific meta tag worked me: <meta name="format-detection" content="telephone=no"> android web

c - Sequence points and order of evaluation -

c - Sequence points and order of evaluation - i reading through k&r , came across illustration uncertainty in behavior while evaluating look a[i]=i++ ; c99 spec in $6.5.2 says that between previous , next sequence point object shall have stored value modified @ 1 time evaluation of expression. furthermore, prior value shall read determine value stored. the above illustration k&r holds on first statement. please explain how fail on second. does standard says order of evaluation of sub-expressions in case of sequence points beingness involved. eg. a[i++] || b[i++] . know these evaluated left right how can derived above statement or explicitly stated in standard somewhere ? does standard says order of evaluation of sub-expressions in case of sequence points? the order of evaluation defined in case of conditional operators && || , reason short circuiting works. it explicitly specified c99 standard. reference: c99 standard annex j: ...

html - Scroll lag in WebKit browsers from ul/li structure -

html - Scroll lag in WebKit browsers from ul/li structure - i've got web page showing schedule on weekly basis. schedule made of 7 ul:s, 1 each day of week, , each ul have number of li:s show different activities during day. for reason ul/li construction create scrolling in chrome , safari lag lot. if create browser window smaller, or if open developer tools of chrome, gets better. have seen box , text shadows might cause these problems, not using that. other suggestions might prepare this? thanks, mattias html css google-chrome safari webkit

c# - Store image in database and retrieve it -

c# - Store image in database and retrieve it - my code inserting image in database follows: memorystream ms =new memorystream(); byte[] photobyte=null; photobyte=ms.toarray(); picturebox1.image.save(ms, imageformat.jpeg); photobyte =ms.toarray(); str = "insert experimmm values('" + photobyte + "','" + textbox1.text + "')"; conn.open(); cmd.connection = conn; cmd.commandtext = str; cmd.executenonquery(); conn.close(); which going well. can see binary info in ma database table <binary data> code retrieving info is: str ="select * experimmm id = '" +textbox2.text + "'"; conn.open(); cmd.connection = conn; cmd.commandtext = str; dr = cmd.executereader(); if (dr.read()) { label1.text = dr.getvalue(1).tostring(); byte[] photobyte = (byte[])dr.getvalue(0); memorystream mem = new memorystream(photobyte, 0, photobyte.length); //but error takes place on next line "parameter not valid." ...

how to use jquery UI dialog -

how to use jquery UI dialog - i'm wondering need have basic jquery dialog appear on screen. here code below. help why none of ui properties beingness rendered when executing code below? happens if user clicks on "show dialog" plain html text appears, without ui css or actual dialog box. have included jquery ui scripts downloaded http://jqueryui.com/download perhaps didn't download , utilize right ui scripts? thanks! master page code: <%@ master language="c#" autoeventwireup="true" codefile="site.master.cs" inherits="sitemaster" %> <!doctype html public "-//w3c//dtd xhtml 1.0 strict//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1- strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head runat="server"> <title></title> <link href="~/styles/site.css" rel="stylesheet" type="text/css...

python - How to login to external machine? -

python - How to login to external machine? - im running osx, , every time reboot have select remote servers, nail "connect as", come in username , password, , login in order utilize of scripts access files on them. i need... a simple way in python process (login on remote server using using user , password) a simple way check if i'm connected selected machine. i utilize ssh. can utilize public key authentication. enables password less logins. , can utilize ssh python paramiko library. but this: "2. simple way check if i'm connected selected machine." not easy. need this? python login login-script

c# - Regular expressions match not working accurately with semicolon -

c# - Regular expressions match not working accurately with semicolon - i have string of codes like: 0926;0941;0917;0930;094d; i want search for: 0930;094d; in above string. using code find string fragment: static bool exactmatch(string input, string match) { homecoming regex.ismatch(input, string.format(@"\b{0}\b", regex.escape(match))); } the problem code works , not. if match single code example: 0930; , works when add together 094d; , skips match. how refine code work accurately semicolons? try this, have tested.. string val = "0926;0941;0917;0930;094d;"; string match = "0930;094d;"; // or match = "0930;" both found if (regex.ismatch(val,match)) console.write("found"); else console.write("not found"); c# c#-4.0 .net-4.0

Migrating On From HTML --> JavaScript --> CSS -->? -

Migrating On From HTML --> JavaScript --> CSS -->? - we have programme developed via combination of html, javascript, css. works fine, there lot of stand-alone files , we're thinking of moving on new development platform. what selling points move on vs 2010, .net, c# .net, jscript ? thanks well, lot of files should not reason want move :) .net , other server technologies provide ability utilize server-side computing , gives lot of advantages client-side access. you able read/write disc, utilize databases store info , configuration, utilize smarter technologies create templates html files , css (this might limit number of files :) ). the languages provide richer api, accomplish more. javascript html css

php - Internal Server Error Zend Query -

php - Internal Server Error Zend Query - is wrong query server encountered internal error or misconfiguration , unable finish request. please contact server administrator, @@serveradmin@@ , inform them of time error occurred, , might have done may have caused error. more info error may available in server error log. $sql = $db->query( "insert users (user_id, title, first_name, last_name, user_identity_id, email_id, password, office_phone_number, public_id, session_id, address_id, created_by, last_modified_by, created_on, last_modified_on, is_activated, is_deprecated, middle_name, cell_phone_number, superviser_name, superviser_email, superviser_phone_number) values( :p_user_id,:p_title,:p_first_name,:p_last_name,:p_user_identity_id,:p_email_id,:p_password,:p_office_phone_number,:p_public_id,:p_session_id,:p_address_id,:p_created_by,:p_last_modified_by,:p_created_on,:p_last_modified_on,:p_is_activated,:p_is_deprecated,:p_middle_name,:p_cell_phone_number,:p_supervis...

How can i make a cross domain DELETE request from JavaScript? -

How can i make a cross domain DELETE request from JavaScript? - i writing piece of javascript needs phone call google latitude api delete point. the request google latitude of form: delete https://www.googleapis.com/latitude/v1/location/locationid is there way of doing straight javascript, or have create request server side? i don't believe it's possible because of browser's same origin policy. with javascript can set requests dynamically generated scripts tags , images or post requests submitting form. javascript cross-domain

xml - Error in excel file -

xml - Error in excel file - i have generated excel file. when seek open it, error "problems came in next areas during load: table". open log , found xml error in table reason: bad value file: c:\test.xml group: cell tag: info value: 5 xml error in table reason: bad value file: c:\test.xml group: cell tag: info value: 5 xml error in table reason: bad value file: c:\test.xml group: cell tag: info value: 5 xml error in table reason: bad value file: c:\test.xml group: cell tag: info value: 5 how can found error? it's big file 80 mb. possible exist tools show info error more accurate. you can start openinng xml file in text editor , finding places <cell><data>...</data></cell> has value "5" or similar (with regex <cell.*>[\r\n\s]*<data.*>5.*</data>[\r\n\s]*</cell> example). after identify rows causing error can compare them ones don't. think problem c...

php - How to implement priorities in SQL (postgres) -

php - How to implement priorities in SQL (postgres) - i'm writing software requires storing items in database, items need have 'priority' end with id | name | priority --------+--------------+---------- 1 | pear | 4 2 | apple | 2 3 | orange | 1 4 | banana | 3 so now, top priority fruit orange, apple banana pear. now, want create pear number 1 priority pear, orange, apple, banana. table like: id | name | priority --------+--------------+---------- 1 | pear | 1 2 | apple | 3 3 | orange | 2 4 | banana | 4 whats best way accomplish php , postgres. given table not going more 12-13 items i've thought selecting entire table , rewriting priorities before updating back. * of import * the priorities can changed in order, priority 7 set priority 3 (thus moving below priority 3 downwards notch), , need close gap item p...

web services - client server communication in Java -

web services - client server communication in Java - i trying set webserver on old machine of mine. have installed ubuntu server edition , aim utilize following: i want run java programme on server. want able retrieve info programme computer/phone using net connection. want able give programme data, , response saying whether or not info has been received correctly. so example: a .jar programme runs on server , holds variable x i want able query value of x device (over internet). i want able set value of x remotely device, , response saying successful in altering value. what options here? seek , maintain things simple. perhaps worth mentioning 1 using system. server used exclusively dealing 2 requests outline above. is case of creating java programme listens out incoming requests , running on server? as mentioned, can start custom serversocket wrapper decode incoming requests , it's bid. currently, whole frameworks done encapsulate mutual co...

struts2 - Struts 2.0 pass selected checkbox mapping value to JavaScript function -

struts2 - Struts 2.0 pass selected checkbox mapping value to JavaScript function - i using struts 2 framework , iterating 4 fields (checkbox,rollnumber,name,location) in jsp. working fine. need delete selected checkbox record, require rollnumber(which primary key in table) object pass javascript function. how can pass rollnumber object javascript function. have pass checkbox object(document.myform.subcheckbox) java script function, need pass 1 more rollnumber object. <table border="1"> <tr> <s:if test="%{mode != 'view'}"> <td><input type="checkbox" id="maincheckbox" onclick="return checkall(document.myform.subcheckbox)"/></td> </s:if> <th>roll number</th> <td>name</td> <td>location</td> </tr> <s:iterator value="b...

r - Splitting axis labels with expressions -

r - Splitting axis labels with expressions - i have plot long label containing look , want split on 2 lines. adding "\n" within look result not expected. ylabel <- expression("a long label text , \n expression"*(alpha+beta) [ij]*" long label text , expression") curve(x^3 - 3*x, -2, 2, xlab=xlabel) any help appreciated. thanks here solution, relying on atop did @andrest in edit. note cannot utilize command character \n in expression, explains why using expression(paste("...\n", alpha[i], "....")) not produce desired output. xlabel <- expression(atop("a long label text , expression", paste((alpha+beta)[ij], " long label ..."))) curve(x^3 - 3*x, -2, 2, sub=xlabel, xlab="") note used sub instead of xlab avoid collision x tick marks. r graph axis

sql server - Set SQL CLR assembly PERMISSION_SET in Visual Studio -

sql server - Set SQL CLR assembly PERMISSION_SET in Visual Studio - is possible me have deployment / scripts within visual studio generate assembly "permission_set" set "external_access" instead of "safe". can build project , modify script, have setting can re-build deploy development instance. probably looking over, can't seem find set build property assembly creation. thanks, s when assembly deployed ssas project (in 1 solution) can alter permission: sql-server visual-studio-2010 sql-server-2008 sqlclr

php - How can I compare a DateTime object with doctrine 2.0 DateTime -

php - How can I compare a DateTime object with doctrine 2.0 DateTime - i'm working on filter query homecoming posts between dates, however, i'm unable figure out way compare php datetime object datetime in database. filter component gives me date in m/d/y format, , datetime in database in m/d/y h:i:s format. $posted_before = \datetime::createfromformat("m/d/y", $posted_before); $posted_before->format("m/d/y h:i:s"); $query .= " , t.posted_date >= $posted_before"; i'm using doctrine 2.0 looks me injecting object string, seek storing homecoming value of format(); . format date according mysql formatting: $posted_before = \datetime::createfromformat("m/d/y", $posted_before); $posted_date = $posted_before->format("y-m-d h:i:s"); $query .= " , t.posted_date >= $posted_date"; php doctrine

jQuery how to select iframe? -

jQuery how to select iframe? - i'm trying select closest iframe jquery. there lot of these windows so, i'd select nearest iframe. i'd expect closest() work, no luck. javascript: $(document).ready(function(){ var d = $(document); d.on('click', 'a.load_url', function() { var myframe = $(this).closest("iframe").attr("class"); alert("myframe: " + myframe); }); }); html: <div id="window2"> <div class="navbar_top"> <span class="float_left"> <a href="#" class="load_url">click here</a> </span> </div> <div class="window_content" style="border: solid 2px blue; overflow:hidden;"> <iframe class="classy_iframe" src="http://mx7racing.com"> </iframe> </div> </div> .closest traverses dom (parents) , f...

java - Enforcing generics on a map -

java - Enforcing generics on a map - i'm trying write simple caching class. cache map class list. want declare map in way enforce list item class same class of key. following: class cache { private static map<class<? extends codedentity>, list<? extends codedentity>> map; } is not plenty because won't enforce (in decleration) want. map needs static , there no point in declaring class t because don't want limited single type. there syntactic way accomplish this? you map private, why don't enforce need in accessor , mutator methods? public <t extends codedentity> void addtocache(class<t> key, list<t> values) { map.put(key, values); } public <t extends codedentit> list<t> getfromcache(class<t> key) { homecoming (list<t>) map.get(key); } java generics

php - Flat file vs MySQL for very simple data -

php - Flat file vs MySQL for very simple data - from pure performance standpoint improve storing simple info (predefined messages). it's more work open file handle, json_decode "subject" , "body", , close file or query database (select subject , body predefine id='message1' assuming id primary key). have 5-10 predefined messages want assume hundreds of users may using application concurrently. reading flat file extremely fast little files... performance advantages of databases come when effort seek specific data. if you're grabbing specific file (say, based on filename: msg_1.txt , msg_2.txt , etc) you're going improve off flatfile system. that said, jb nizet has pointed out, if you're dealing few messages don't bother... utilize constant or create array in php file can include_once() ed when need definition: $msg = array( 'msg1'=>array('sub'=>"subject",'body'=>...

c# - String equals does not work with string formatted numbers -

c# - String equals does not work with string formatted numbers - how can strings have different hash codes same text value of "16 777 216"? the test method not pass: using system; using system.text; using system.collections.generic; using system.linq; using microsoft.visualstudio.testtools.unittesting; namespace unitteststringequals { [testclass] public class formattertests { [testmethod] public void double_test_1() { assert.areequal("16 777 216", formatdoublewiththousandseparator(16777216, 0)); } public string formatdoublewiththousandseparator(double value, int digits) { double result = math.round((double)value, digits); system.globalization.numberformatinfo nfi = (system.globalization.numberformatinfo)system.globalization.numberformatinfo.invariantinfo.clone(); nfi.numbergroupseparator = " "; homecoming result.tostring("###,###,###,###,###,###,##0.#####", nfi); } }...

c# - what happens when an object derives from MarshalByRefObject and is also marked [Serializable]? -

c# - what happens when an object derives from MarshalByRefObject and is also marked [Serializable]? - i'm working on first project uses appdomains , i'm wondering happens when object derives marshalbyrefobject , marked [serializable]? for example: [serializable] public class dummyclass: marshalbyrefobject { } it gets marshalled reference, can still serialised other use-cases serialisation. there's implementation detail interesting plenty worth noting: formatter serialising remoting uses surrogateselector produce proxy marshalbyrefobject serialises, hence serialising still result in marshalling reference. other serialisation uses won't have surrogateselector , won't have effect. c# .net appdomain .net-remoting

HTTPS with self-signed SSL certificate server and embedding CSS in an HTML file -

HTTPS with self-signed SSL certificate server and embedding CSS in an HTML file - i'm using self-signed ssl certificate private https server. problem is cannot load .css file embedded by <style type="text/stylesheet" src="/default.css"></style> i think related security something. should create browser load css file? the issue syntax. that's how include javascript, css files linked <link> element or @import : <link rel="stylesheet" type="text/css" href="/default.css" /> html css

Are there examples of authenticating Desire2Learn api's using Flex or similar Adobe platform? -

Are there examples of authenticating Desire2Learn api's using Flex or similar Adobe platform? - i'm new flex, not new web services, not sure how started authenticating user against desire2learn api within flex platform. some examples help, , maybe promote of great tablet apps developed. there public samples out there? if not flex, similar platforms? looking here: http://code.google.com/p/desire2learn-valence/ there no samples provided desire2learn @ point. however, source code other platforms posted. take c# code , combine wiki docs in order move flash/flex. (also, javascript samples should coming downwards pipe) if create please sense free contribute project site. flex api desire2learn

php - I cant get header("Location: http://www.google.com/") to work :( -

php - I cant get header("Location: http://www.google.com/") to work :( - i have form points php file. php file redirects user specific page. cannot seem work , im not sure doing wrong. <form method="post" action="processregister.php"> user name: <input type="text" name="username" maxlength="32"><br> password: <input type="password" name="userpassword" maxlength="32"><br> <input type="submit"> </form> processregister.php <?php // processregister.php ////////////////////// header("location: http://www.google.com/"); /* // first include class definition include('userclass.php'); // next, create instance of class $newuser = new user; // phone call registeruser() method, passing in required variables if ($newuser->registeruser($username, $userpassword)) { header('location: www.google.com'...

What are the different code comment practices? -

What are the different code comment practices? - reading on code commenting, there seems general back upwards comments not explain code can explain. sources (not many, few still) have looked comments should explaining code on higher level of abstraction. however, experts in field socialise , work supporting more comments improve not enough, if comments explain reader/coder can decipher code, there different levels of this, , people may decipher code faster others, safe improve comment code meaning not painfully obvious; after all, "it help you, coder, when don't have read actual code, , can understand function in english, rather seek , decipher code. sometimes, might help writing function out in comments , pseudocode before coding it; help constant reminder of function supposed do." these 2 quite different schools of thought far comments go. begs question: what different schools of thought code commenting, , popular (so avoid asking best ones, subjec...

objective c - What happens if we make an allocated pointer to an object as nil? -

objective c - What happens if we make an allocated pointer to an object as nil? - i have seen code in couple of places. xyz *xyz = [[xyz alloc] init]; but in dealloc instead of [xyz release] ; people have used self.xyz = nil ; won't cause memory leak? edit : not xyz = nil wrote initially, self.xyz = nil , property. yes, memory leak, if xyz declared property eg @property (nonatomic, retain) xyz* xyz; - (void)dealloc { self.xyz = nil; [super dealloc]; } this not memory leak, maybe ones saw this? edit: not memory leak, reason being, setter created property, it'll similar 1 below - (void)setxyz:(xyz *)newxyz { [xyz release]; xyz = [newxyz retain]; } because newxyz nil, sending retain nil nothing, while old xyz beingness released setter. memory managed in case objective-c

c# - How do I serialize/deserialize an HTML table in .NET -

c# - How do I serialize/deserialize an HTML table in .NET - i trying write class serialize/deserialize simple as: <table border="1"> <tr> <td>row 1, cell 1</td> <td>row 1, cell 2</td> </tr> <tr> <td>row 2, cell 1</td> <td>row 2, cell 2</td> </tr> </table> i have gotten point of (see below) can't generate table xml correctly: imports system.xml.serialization <xmlroot("table")> public class htmltable <xmlarray("")> <xmlarrayitem(gettype(htmltablerow), elementname:="tr")> public property rows new list(of htmltablerow) <xmltype("tr")> public class htmltablerow <xmlarray("td")> public property cells new list(of htmltablecell) end class <xmltype("td")> public class htmltablecell <xmltext()> public prope...

ipad - Different height sliding drawer div using different negative margins with different screensizes in jQuery? -

ipad - Different height sliding drawer div using different negative margins with different screensizes in jQuery? - i have slideshow using supersized plugin has sliding drawer header div horizontal top navigation want hide off screen while slides playing. little strip @ bottom of div visible user can hover on have div slide downwards revealing navigation buttons. however, there big number of buttons , on smaller screens, ipad example, causes problems. on smaller screens buttons stack vertically instead. because of sliding drawer div needs 2 different sizes, 1 screens above 1024px , 1 screens below 1024px. the negative margin on sliding drawer needs increment accommodate taller div sliding when screen resized below 1024px. because it's hover effect mouse there needs ability slide div on touch device. so far have this... $(document).ready(function() { if ( screen.width < 1025 ){ $('#header_wrapper').stop().delay(4000).animate({'margintop...

mysql - Difference between rows -

mysql - Difference between rows - i add together existent query 2 new columns. in first one, create diff between current row , next 1 , in next 1 count values between rows. my current query is: select *, sum(minute(rest_time)) times routes routes left bring together sales on (routes.departure_poi_code = sales.client_code , routes.departure_date = sales.`date`) (routes.departure_poi_code 'c0%' or routes.departure_poi_code 'mp%') , routes.`car_no` = 'bh-07-ewr' , routes.departure_date = '2011-10-14' grouping routes.departure_address, reports.routes.departure_poi_code, reports.routes.car_no, reports.routes.departure_date order routes.car_no limit 500000 and result of current query like: car_numbr str_time cod_nr km bh-07-ewr 08:59:00 c00425 7000 bh-07-ewr 10:29:00 c00149 8500 bh-07-ewr 14:27:00 c01075 9200 bh-07-ewr 15:07:00 c00305 9800 bh-07-ewr 16:08:00 c02572 9...

sql server 2005 - SQL grouping and sum -

sql server 2005 - SQL grouping and sum - i know how next result set out of current result set. my query this: select substring(col1, 1, 3) 'series', b.col2, cast(c.price * c.qty money) total tablename inner bring together .... ... date between '1/1/2012' , '1/31/2012' , b in ('c50', 'c51', 'c52', 'c53', 'c54') grouping col1, b.col2, c.price, c.qty and returns result set: series col2 total ---------- ---------- ---------- 105 c50 5.00 105 c50 15.00 105 c53 20.00 105 c53 20.00 105 c53 20.00 and how work: series col2 total ---------- ---------- ---------- 105 c50 20.00 105 c53 60.00 thank you group computed column : substring(col1, 1, 3) . select sub.series, sub.col2, sum(sub.total) ( select substring(col1, 1, 3) 'series', b.col2, ...

Generate merged entity class files with symfony2 -

Generate merged entity class files with symfony2 - i'm little bit stuck poor knowledge of symfony2 , doctrine. here i'm trying do: have 2 different files containing class definition of same class. want merge these 2 new class file. i have existing entity class file foo.php : /** * @orm\entity * @orm\table(name="foo") */ class foo { /** * @orm\id * @orm\column(type="integer") * @orm\generatedvalue * * @var int */ protected $id; /** * @orm\column(type="string") * * @var string */ protected $name; /** * @param string $name * @return void */ public function setname($name) { $this->name = (string) $name; } /** * @return string name */ public function getname() { homecoming $this->name; } protected function somemagic($in) { die('no magic happens.'); } } and sec...

eclipse - Undefined reference in C with gcrypt.h -

eclipse - Undefined reference in C with gcrypt.h - i'm trying utilize library gcrypt.h show error: undefined reference `gcry_md_get_algo_dlen' the code is: int algo = gcry_md_sha1; unsigned int hash_len = gcry_md_get_algo_dlen(algo); unsigned char hash[hash_len]; how can prepare it? make sure have recent version of library http://www.gnupg.org/download/#libgcrypt if have right version create sure added library linker settings in eclipse. to so: right-click on project -> properties / c/c++build / settings / gcc c++ linker / libraries there add together libraries "gcrypt" ( don't @ "lib" ) , create sure ( if lib isnt under scheme path ) add together path library lies. c eclipse

changing/stripping off url pointed by image using javascript -

changing/stripping off url pointed by image using javascript - might simple javascript injection question, have image html tag: <a href="myfile.htm"><img src="rainbow.gif"></a> i wanted perform javascript, such when clicked on image, doesn't go myfile.htm. in other words, wanted strip href surrounds img. how can in javascript? have next reference image tag: document.elementfrompoint(%f, %f) f can replaced double/float value if have reference img element, parent ( parentnode ) link (in construction you've given). 3 options: remove link entirely disable link change link's href 1. remove link entirely you can remove link exclusively doing this: var link = img.parentnode, linkparent = link.parentnode; linkparent.insertbefore(img, link); linkparent.removechild(link); that uses parentnode find parent , grandparent, insertbefore move image, , removechild remove link. note assumes image thi...

c++ - Derived class inherit base class assignment operator? -

c++ - Derived class inherit base class assignment operator? - it seems me derived class don't inherit base of operations class assignment operator if derived class inherit base of operations class assignment operator , can please explain next illustration in next code overriding base of operations class operator= in derived, derived class default assignment operator calls overloaded operator= #include <iostream> using namespace std; class base of operations { public: base(int lx = 0):x(lx) { } virtual base& operator=( const base of operations &rhs) { cout << "calling assignment operator in base" << endl; homecoming *this; } private: int x; }; class derived : public base of operations { public: derived(int lx, int ly): base(lx),y(ly) { } base& operator=(const base of operations &rhs) { ...

python - Alter module variables in one module while it doesn't change in the original -

python - Alter module variables in one module while it doesn't change in the original - i'm using foo module includes few module level variables dictate behavior. 1 of these variables sanitize. i want able utilize foo in 2 ways, foo.parse() , foo2.parse(), difference foo has sanitize=false , foo2 has sanitize=true i want while not having re-create paste code. example #foo module sanitize='foo' def parse(): print sanitize #foo2 module import foo foo.sanitize='foo2' #test script import foo import foo2 foo2.foo.parse() #i want print 'foo2' foo.parse() #i want print 'foo' however, above illustration print 'foo2' both times. there way accomplish behavior? thanks! if your code, solution not depend in module level variables, in other way maintain state of objects. modules in python "singletons" - means 1 time imported module, there 1 version of then, interpreter wide - behavior want, example, get, ...

php - Notice: Undefined index on line 5 -

php - Notice: Undefined index on line 5 - i getting next error on php & mysql application murach's php , mysql book: notice: undefined index: category_id in c:\xampp\htdocs\book_apps\ch04_product_viewer\index.php on line 5 i didn't modified code whatsoever (yet), assumed should work out of box. application displays products database should, problem annoying error. here php code of index.php file: <?php require 'database.php'; // category id $category_id = $_get['category_id']; if (!isset($category_id)) { $category_id = 1; } // name current category $query = "select * categories categoryid = $category_id"; $category = $db->query($query); $category = $category->fetch(); $category_name = $category['categoryname']; // categories $query = 'select * categories order categoryid'; $categories = $db->query($query); // products selected category $query = "select * products ...

change value when python is in infinite loop -

change value when python is in infinite loop - can done in python? start print infinite loop , changing values in between loops. x = 5 while ( true ): print x x = 3 # regain command of interpreter , set new value expected output: 5 5 5 ...... 3 3 3 no, code have written not work. statement after non-terminating loop never executed. try following: x = 5 while true: if (some-condition): x = 3 print x alternatively, utilize threading, , alter value of x in sec thread: def changex(): global x x = 3 x = 5 import threading threading.timer(3, changex).start() # executes changex after 3 seconds in sec thread while true: print x python

javascript - HTML5 video behavior on mobile devices -

javascript - HTML5 video behavior on mobile devices - i building site have several <video> elements (looped animations) deed part of design (not actual video). works quite in desktop browsers, yet in problem on mobile devices.when display site on android or ios devices (ie. mobile webkit) os's video player appearance , videos open in sort of popup when click them. know can bypass autoplay restrictions doing sth like: window.onload = function() { var pelement = document.getelementbyid("myvideo"); pelement.load(); pelement.play(); }; but 1 time again open video(s) in seperate window... does know of possibility emulate / enable desktop-like behavior on mobile devices? thanks! edit: markup basic <video> -syntax btw: <video autoplay loop> <source src="vid.mp4" type="video/mp4" /> <source src="vid.ogg" type="video/ogg" /> <source src="vid.webm" type=...

powerbuilder - Report Detail Band Not Populating -

powerbuilder - Report Detail Band Not Populating - i new pb , retrieving report. header , footer populate not detail band. arguments seem working correctly. ideas: powerbuilder datawindow

How to bind content with JSON in Ember.js -

How to bind content with JSON in Ember.js - all examples using fixed info source in arraycontroller.content, while using dynamic info source generated anther web service , returns json, won't create object declared in ember, here code sample: et.appyear = ember.object.extend({ text:null, value:null }); et.emailtypes = ember.object.extend(); et.appyearcontroller = ember.arraycontroller.create({ content: [], loadyears: function (year) { if (year != null) { (var = -5; < 5; i++) { this.pushobject({ text: year + i, value: year + }); //.appyear.create({ text: year + i, value: year + }); } } } }); et.selectedappyearcontroller = ember.object.create({ selectedappyear: '2011', alertchange: function(){ ale...