Posts

Showing posts from January, 2011

types - SQL Alchemy - schema extraction with TypeDecorator -

i using typedecorator json extraction , model uses 1 of columns. storing python list objects using typedecorator. def process_bind_param(self, value, dialect): # etc... def process_result_value(self, value, dialect): # never gets called!! if value not none: return json.loads(value) return value when store data in model uses decorator bind_param called appropriately. extract schema model using typedecorator via following: table = table(table_name, meta, autoload=true, autoload_with=sengine) now query test (there many ways loop , extract): for record in source.query(table).all(): print type(record.column_using_custom_type_list_object) == str # returns true ... should false ... should of type list # json.loads() returns type list ??? print record.column_using_custom_type_list_object[some_index] # naturally prints character in string, not cell the problem process_result_value() not being called when table queried , object , column fe

networking - Redirect domain name mapped with external IP (modem) to a host in its local network -

Image
i have modem connected router. there 2 computers connected router. want set domain 1 of computers can access web deployment server running in computer internet. used freedns.afraid.org free subdomain. when set up, domain getting mapped external ip address. so, problem when try access set domain, accessing modem's configuration page i.e. external_ip:80 in local network, modem's ip address 192.168.0.1 , router's ip address 192.168.1.1 , computers take ip addresses anywhere between 192.168.1.100 , 192.168.1.148 also, router linksys wrt54g , capable of default ddns configuration dyndns , tzo. since both have become paid services, opted free ddns , i'll use ddns update client update dynamic ip. i don't know how search problem in google. also, came across port forwarding used under similar topics. new this, can suggest me how redirect domain particular host or there reference page can learn procedure from? solved update on question (new issue) since didn&#

c# - What are the benefits of using enum-flags? -

i wonder benefits of using enum-flags instead of boolean fields (besides better performance , cleaner code)... flags enumerations used masking bit fields , doing bitwise comparisons. correct design use when multiple enumeration values can specified @ same time. as metioned above nothing more correct design, guess matters most.

tsql - cant find Varchar Chart of acceptable characters -

does know of simple chart or list show acceptable varchar characters? cannot seem find in googling. what codepage? collation? varchar stores characters assuming specific codepage. lower 127 characters (the ascii subset) standard. higher characters vary codepage. the default codepage used matches collation of column, defaults inherited table,database,server. of defaults can overriden. in sort, there no "simple chart". you'll have check character chart specific codepage, eg. using "character map" utility in windows. it's far, far better use unicode , nvarchar when storing database. if store text data wrong codepage can end mangled , unrecoverable data. way ensure correct codepage used, enforce way client (ie desktop app) application server, down database. even if client/application server uses unicode, difference in locale between server , database can result in faulty codepage conversions , mangled data. on other hand, when use unicode

javascript - My response.jsp won't populate fields properly -

i been working on web app connects database populates designated fields. edit of netbeans tutorial . well, setup database , tested populating table on response page information. problem arises on index.jsp, when pick 1 of titles view list. used titles instead of id numbers select books: select titlefk booklist instead of: select id, titlefk booklist because drop down box show both id , title choices. after selecting book title , clicking submit key, should populate next page corresponding info database. pictures of sites: http://imgur.com/a/kvemn the table above temporary measure check database connected. selected third option on database yet response.jsp keeps populating information of first book. not sure missing on code, hope point me on right direction. <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> <%@taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql"%> <sql:query var="books"

osx - Alternative to GCD dispatch queues -

for several reasons, make application backwards compatible os x 10.5. until now, using lots of gcd dispatch queues added in 10.6 so: dispatch_async(dispatch_get_main_queue(), ^{ [self setstatustext:@"connection established, waiting response ..." withtype:status_msg_info]; }); what easiest alternative don't have re-write code? suggestions welcome! in advance! how following nsobject method: - (void)performselectoronmainthread:(sel)aselector withobject:(id)arg waituntildone:(bool)wait

click - jQuery - hover is triggered even though it shouldn't be -

i have simple jquery drop down this: http://jsfiddle.net/7zvb7/1213/ what want achieve is, if "more" button hovered, drop down menu slidedown, , if cursor leaves "more" or drop down, slideup. it works, however, if add event when of drop down clicked, whole drop down menu should slideup, doens't work. reason trigger "hover" effect make drop down menu keep flashing. html: <div id="table"> <div class="container"> <a href="#" class="smallredbutton manage">more</a> <div class="hidden list"> <ul> <li>1</li> <li>2</li> <li>3</li> </ul> </div> </div> </div> jquery

html - Preventing text from splitting over two pages -

this html @ end of ebook. when converting html mobi, preview ebook on kindle, above text @ end splitted on 2 pages in ebook. last page, want stop text splitting on pages. think should add around text code page-break-before:avoid or page-break-after:avoid property. not sure, 1 suitable use in case, page-break-after:avoid or page-break-before:avoid ? <hr/> <div> <font size=-1>lorem ipsum dolor sit amet, consectetur adipisicing elit, sed eiusmod tempor incididunt ut labore et dolore magna aliqua.</font> </div> </body> </html> for example, should use sample, or page-break-before:avoid ? <div style="page-break-after:avoid"></div> <hr/> <div> <font size=-1>lorem ipsum dolor sit amet, consectetur adipisicing elit, sed eiusmod tempor incididunt ut labore et dolore magna aliqua.</font> </div> <div style="page-break-after:avoid"></div> </body> </html>

xslt - ancestor-or-self wont select self -

there should simple solution cant work. this code: <xsl:value-of select="$currentpage/ancestor-or-self::* [@isdoc , backgroundimage != '' , string(umbraconavihide) != '1']/backgroundimage"/> what want if node has background image attached property backgroundimage, use image. if not have background image, check parent node background image , use that. what happends me checks parents background image, if node has background image. any suggestions on how resolve this? update <site id="1000" ...> <backgroundimage>/media/image.jpg</backgroundimage> <textpage id="1001" ...> <backgroundimage>/media/image2.jpg</backgroundimage> </textpage> <textpage id="1002" ...> <backgroundimage /> </textpage> </site> if i'm on <textpage id="1002"> backgroundimage null image.jpg <site id="1000"

c# - Quick access to elements of user control -

i have user control (e.g.): <usercontrol x:class="tester.uc" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="using:tester" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:ignorable="d" d:designheight="300" d:designwidth="400"> <grid> <textblock name="name" horizontalalignment="left" margin="10,10,0,0" textwrapping="wrap" text="textblock" verticalalignment="top" height="79" width="380" fontsize="50" textalignment="center"/> <button content="button" horizontalalignment="left" margin="152,179,0,0" verticalalignment="top"/> <textbox name="lastn

Sort PHP Array With Two Values -

this question has answer here: php array multiple sort - value key? 9 answers for example, have php array in format: [ {"optionname":"math","optionid":"35741"}, {"optionname":"robotics","optionid":"80229"}, {"optionname":"fndbwoiaghoe","optionid":"1105065296"}, {"optionname":"iphewajgiewohfoidsahg","optionid":"1385274203"}, {"optionname":"wpeogagpoar","optionid":"1030886790"}, {"optionname":"genpwaighipwe","optionid":"1193090269"} ] how can sort array value of "optionname" alphabetically? thanks! i assuming, due code example, have json-encoded array. you want sort not on value on specific property of v

picturebox doubleclick even handler -

i generate picturebox in runtime, add event: picbox.doubleclick += new system.eventhandler(picbox_doubleclick); then this: private void picbox_doubleclick(object sender, eventargs e) { // stuff here not related question } now, when double click on image, never enters picbox_doubleclick function, doing wrong? this works charm: picbox.click += new system.eventhandler(clickpicbox); this.picbox.doubleclick += new system.eventhandler(picbox_doubleclick); in general if it's not working, event not added correct object.

javascript - How can I link to an internal image within a Firefox extension? -

i'm using firefox sdk. the following code works, @ least know working it's supposed to: document.getelementbyid("mydiv").src="http://somesite/externalimage.jpg"; however, mozilla isn't approving version of extension, because i'm linking external image. so have link image inside extension (i uploaded same image inside extension). i tried following code did not work. document.getelementbyid("mydiv").src=" + data.url("externalimage.jpg") + "; so how link image inside extension? first off, syntax wrong , error. should be: document.getelementbyid("mydiv").src = data.url("externalimage.jpg"); are including data module self? var data = require('sdk/self').data; what context in? main sdk code has access data.url function, if in content script, won't have there, you'll need pass in value message in main.js // assuming pagemod here, can worker var data = re

angularjs - Bypassing Angular Routing on <a> tags -

after searching long , far, have not been able determine how hit external routes outside of angular app using tags. need links go other places server serves up. example, <a href="/login", target="_self">login</a> does not render non-angular page want server. takes me same place. however, of note url hit, angular re-renders page. "_self" target trick has worked in past, i'm not sure why it's not working now. does have advice here? html markup: <div data-ng-app="myapp"> <div ng-view> //angular templates, angular stuff, etc... // works fine </div> <a href="/login", target="_self">login</a> // doesn't render page </div> angular code: app.config(['$routeprovider', '$locationprovider', function($routeprovider, $locationprovider) { $routeprovider. when('/', {templateurl: 'templates/dashboard.html',

iphone - Adding an "Open In..." menu -

my ios app handles pdf files , want able open file in application want add "open in..." menu (seen here ). how this? the menu called uidocumentinteractioncontroller. docs here: http://developer.apple.com/library/ios/documentation/uikit/reference/uidocumentinteractioncontroller_class/reference/reference.html you'll want property (otherwise, released before present it) @property (nonatomic, strong) uidocumentinteractioncontroller *documentinteractioncontroller; to display it: self.documentinteractioncontroller = [uidocumentinteractioncontroller interactioncontrollerwithurl:[nsurl fileurlwithpath:mypdfpath]]; [self.documentinteractioncontroller presentopeninmenufrombarbuttonitem:self.actionbutton animated:yes];

Push just part of a git repository to heroku -

i have source code managed git want push heroku. source code contains multiple different products, of have own heroku instance. this: src/ lib-files/ app1/ app2/ app3/ other-files/ package.json so in heroku, have instance app1 , app2. both of these rely on ./lib-files , package.json not on app2 or app3 or other-files. i don't want push entire git repository containing files heroku each app. in other words, don't want app1 instance contain code app2 or app3 or other-files because there lot of data doesn't need , takes ever copy up. i got around creating new git repos each app (one contains stuff app1 needs , 1 app2, etc) , pushing individual repos heroku. works, seems bit hacky because have these other repositories have manage. also, if other devs want able push heroku need make repos available them, maybe checking them git (seems bizarre). what way accomplish this? update: what if created heroku repos contained appropriate stuff each app let heroku

javascript - Underscore.js template throwing syntax error in IE 8/9 only -

the site working on using backbone , underscore in conjunction render out page elements data pulled out of json file. working fine , dandy across browsers, until set ie test in compatibility mode ie 9. (i not test in native ie 9 enviortment - rather using ie 10 developer window , setting browser mode ie9 , document mode ie9 standards). the error specifically: script1002: syntax error with pointer throw e; line of try/catch call @ end of _template function in underscore.js. (this section commented if variable not specified, place data values in local scope) can't imagine why throw call generating actual error, assume there problem somewhere line throwing error in try/catch, , ie returning instead of line made error occur. full source section is: // if variable not specified, place data values in local scope. if (!settings.variable) source = 'with(obj||{}){\n' + source + '}\n'; source = "var __t,__p='',__j=array.prototype.join," +

web scraping - Making a basic web scrapper in Python with only built in libraries - Python newbie -

i'm quite new python, instead of reading tutorials felt completing actual project better way learn. however, means i'd needing quite assistance (: now point. i'm trying make web scrapper without 3rd party libraries, process isn't simplified me, , know doing. looked through several online resources, of have left me confused things. the html looks this, <html> <head>...</head> <body> *lots of other <div> tags* <div class = "want" style="font-family:verdana;font-size:12px;letter-spacing:normal""> <form class ="subform">...</form> <div class = "subdiv1" >...</div> <div class = "subdiv2" >...</div> *lots of other <div> tags* </body> </html> i want scrapper extract <div class = "want"...>*content*</div> , save html file. i have basic idea of how need go this. import urllib urllib impo

How to listen to incoming HDP connection Android bluetooth? -

in bluetooth hdp sample google, seems try initiate connections device (so phone client , health device server). however, health device have (omron 708-bt) designed bluetooth client not server - can initiate connections can't listen incoming connections. how can make phone listen incoming hdp connections similar how it's done spp here ? there sample app based on antidote 11073 stack that: https://github.com/brasileiroaraujo/healthserviceandroid basically need register handler in bluetoothhdpservice (by sending msg_reg_client). in example source, handler name mincominghandler. the handler gets messages bluetoothhdpservice.status_create_channel, when device connects , creates hdp channel. don't forget register data types accept sending bluetoothhdpservice.msg_reg_health_app messages. data type blood pressure 0x1007, think.

regex - I cannot seem to get my regular expressions in Perl to recognize underscore (_) characters -

sorry bring problem simple, trying write series of regular expressions in perl extract types of data file. reason, cannot seem perl match lines of data have underscore ( _ ) in them. if want lines start "ch2 flybase exon " or "ch3 flybase exon " (the white spaces tab characters), following code works well: if ($_ =~ m/^ch[ 2-3] flybase exon /) {print outputfile;} however, if want match lines more complex chromosome names (i.e. more letters 'ch' followed number), such as: ch4_group1 ch4_group2 ch4_group3 ch4_group4 ch4_group5 chxl_group1a chxl_group1e chxl_group3a chxl_group3b chxr_group3a chxr_group5 chxr_group6 chxr_group8 unknown_group_1 unknown_group_10 unknown_group_100 unknown_group_101 i have tried following codes without success: if ($_ =~ m/^ch4_group[1-5] flybase exon /) {print outputfile;} if ($_ =~ m/^chx._group[0-9]+[a-z]* flybase exon /) {print outputfile;} if ($_ =~ m/^unknown_group_[0-9]+ flybas

php - DELETE row entry from database -

good day! totally new php , appreciate coming you. i want delete row in database got error: warning: illegal string offset 'text' in c:\xampp\htdocs\php\deletejoke\jokes.php on line 14 the code seem okay don't know why i'm getting error.please guide me this, lot! please see below code reference: if (isset($_get['deletejoke'])) { try { $sql = 'delete joke id = :id'; $s = $pdo->prepare($sql); $s->bindvalue(':id', $_post['id']); $s->execute(); } catch (pdoexception $e) { $error = 'error deleting joke' . $e->getmessage(); include 'error.php'; exit(); } header('location: .'); exit(); } try { $sql = 'select id, joketext joke'; $result = $pdo->query($sql); } catch (pdoexception $e) { $error = 'error fetching jokes' . $e->getmessage(); include 'error.php'; exit(); }

ios - Performing actions from accelerometer -

i'm new programming in xcode , have hit brick wall. trying sound play if there sufficient acceleration detected. can please advise me on doing wrong? (i suspect everything). code: #import "lzdviewcontroller.h" @interface lzdviewcontroller () @end @implementation lzdviewcontroller - (void)viewdidload;{ [super viewdidload]; // additional setup after loading view, typically nib. cmaccelerometerdata *accelerometerdata = self.motionmanager.accelerometerdata; if (fabsf(accelerometerdata.acceleration.x) > 1.2 || fabsf(accelerometerdata.acceleration.y) > 1.2 || fabsf(accelerometerdata.acceleration.z) > 1.2) { nsurl *url = [nsurl fileurlwithpath:[nsstring stringwithformat:@"%@/audio.wav", [[nsbundle mainbundle] resourcepath]]]; audioplayer = [[avaudioplayer alloc] initwithcontentsofurl:url error:nil]; audioplayer.numberofloops = 0; [audioplayer play]; } } @end edit: here code .h #import <uikit/uikit.h> #import

javascript - Sencha Touch Store Add replaces record 1 -

Image
i extended ext.data.store (i.e users model user) when iterate on custom json response , add each record, replaces first record , store consist of 1 record instead of many here code (in image format) notice in line 215 added model on store on each iteration: and here console output w/c shows 1 on getcount(): i tried many solutions, , includes changing 'id' attribute else , differ user model users model but have store adding fine without problems. edit: tried adding through javascript console , still replaces record 1: the store's add function automatically handle creation of model(s). callback should simple this: callback: function(optionsusers, successusers, responseusers) { loadingloginmodal.hide(); var responseusersjson = ext.json.decode(responseusers.responsetext); userstore.add(responseusersjson); loadingloginmodal.destroy(); that.showhomeview(); }

javascript - Cross Browser: How to restrict refresh, Resizable in Window.showmodal Dialog? -

i using "window.showmodal" open modal window. window.showmodaldialog('/servlet/zservlet?api=loadjobboarddetails&rand='+myrandom,obj,"dialogheight: 600px; dialogwidth: 1100px; dialogtop: px; dialogleft: px; center: yes; help: no; resizable: no; status: no; scroll: yes;"); in i.e, modal works non-draggable , non- resizable window. , not refresh window using f5 or using mouse, in cross browser ( firefox, chrmo, safari ), above features not working. any other way same. ??

php - Writing to CSV Issues -

the output file doesn't seem placing data csv include_once ('database_connection.php');//including our db connection file if(isset($_get['keyword'])){//if url contains parameter "keyword" $keyword = trim($_get['keyword']) ;//remove space $keyword = mysqli_real_escape_string($dbc, $keyword);//some validation $query = "select topictitle,topicdescription topics topictitle '%$keyword%' or topicdescription '%$keyword%'"; //the sql query search word typed user . $result = mysqli_query($dbc,$query);//run query if($result){//if query successfull if(mysqli_affected_rows($dbc)!=0){//and if atleast 1 record found while($row = mysqli_fetch_array($result,mysqli_assoc)){ //display record echo '<p> <b>'.$row['topictitle'].'</b> '.$row['topicdescription'].'</p> <input type="text" value="'.$_get['keyword'].'" /><input

jekyll - Iterate over markdown headers to create navigation menu -

i make single-large-page menu on side links directly sections inside single page. similar the bootstrap manual pages. i write page content in markdown. how can make jekyll automatically create navigation menu headers in markdown page? i.e. loop/iterate on headers insert menu items? i believe can done plugin. because running on github pages, can't use plugins. this method not automatic, achieve same result. _config.yml nav: - page: header 1 permalink: #header-one - page: header 2 permalink: #header-two default.html {% n in site.nav %} <li><a href="{{ n.permalink }}">{{ n.page }}</a></li> {% endfor %}

mysql - ...mysql2/mysql2.so: [BUG] Segmentation fault ruby 2.0.0p247 -

i'm using windows7x64, ruby2.0.0p247, rails4.0.0 , mysql5.5.27. when run $ rails server command, got following error. c:/ruby200-x64/lib/ruby/gems/2.0.0/gems/mysql2-0.3.13/lib/mysql2/mysql2.so: [bug] segmentation fault ruby 2.0.0p247 (2013-06-27) [x64-mingw32] how can rid of error? the libmysql.lib included in mysql connector/c 64 bit not compatible mingw64-gcc compiler. you need generate mingw64 compatible libmysql.lib file. to generate libmysql.lib file, need gendef.exe, can obtain mingw-w64 distribution(i got https://code.google.com/p/structure-svm-map/downloads/detail?name=svm-map-win.zip&can=2&q= ) in lib folder of mysql connector, produce libmysql.lib following steps. gendef.exe libmysql.dll dlltool -v --dllname libmysql.dll --def libmysql.def --output-lib libmysql.lib and running normal gem install command. gem install mysql2 -v '0.3.12b6' -- --with-opt-dir="..." note: in case of mysql connector/c 6.1, due version co

visual studio 2010 - Build Customization in VC++ -

i have following problem software in visual c++. i've set build customization related file in path: $(vctargetspath)\buildcustomizations\progname 4.2.targets on different pc have different version of same file (for ex: progname 5.0.targets); when open vc++ project, have edit *.vcxproj file in order set manually new version of targets. there method avoid problem , make project available different versions of targets file? thank in advance. you might able referencing short cut instead. each machine has short cut in known location refers ever need refer to.

r - Buy & sell after local minima and maxima -

i've got data series of form date. open high low , close (prices). want create local maxima , minima close column of data. further want buy after 2 days of local minima @ close , sell after 2 days of local maxima @ close. further want calculate profit , loss same. code same under. require(quantmod) tckr1<-"^nsei"  start<-sys.date()-200 end<- format(sys.date(),"%y-%m-%d") # yyyy-mm-dd  getsymbols(tckr1, from=start, to=end)  data<- nsei$nsei.close data$n <- 1:nrow(data) data$z <- zigzag(data$nsei.close , change = 2 , percent = t) data$level<- data[c(findpeaks(data$z) , findvalleys(data$z)) - 1 , ] data$nsei.close.1<- null data$n.1<- null data$trade<- lag(data$level,2) now need data column tell me when buy , sell +1 , -1 , calculate profit , loss same. in above mentioned data buy when n= 29 @ 5719.70 , when n=36 @ 5851.20 etc. regards ashish require(quantmod) tckr1<-"^nsei"  start<-sys.date()-200 e

c# - Passing Structures between Managed and Unmanaged Code -

i call c++/cli method c# in method: bool setproperty(element element, node referencepoint, list<materializer> materializers, list<ulong> properties) { // loop on stls (int = 0; < materializers.count; i++) { materializer materializer = materializers[i]; pentaltreenode pentaltreeroot = pentaltreedatasets[i].top; if (materializer.ispointinside(referencepoint.x, referencepoint.y, referencepoint.z, pentaltreeroot)) { element.propertyid = properties[i]; return true; }; } return false; } c++/cli method this: bool ispointinside(double x, double y, double z, pentaltreenode ^root) { int intersectioncount = 0; math3d::m3d raypoints[2], intersectionpoint; raypoints[0].set(x,y,z); raypoints[1].set(x,y,1.0e6); if(_box->iscontainingpoint(x,y,z)) {

WordPress Filter: Replace full content before page renders -

i'm trying mesh mustache templating engine wordpress. far, have been successful using the_content filter parse template tags e.g. {{ }}. however, if let’s say, developer hardcodes template tags directly page template e.g. loop-page, the_content doesn’t capture hardcoded tags. is there filter allow me capture content of whole page template including content? if you're writing plugin, can use php function ob_start() cache whole buffered content. after can use callback function return replaced content. use triggers (action's) init or after_setup_theme script.

unable to enter data in mysql using php jquery and ajax -

my mistake friends...below complete code writing jquery php bases register form code. seems code working fine unable enter data in mysql database. please let me know going wrong. below form: <!doctype html> <html> <head> <link rel="stylesheet" type="text/css" media="all" href="home_style.css"> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <script> $(document).ready(function(){ $("#ajax-contact-form").submit(function(){ var str = $(this).serialize(); $.ajax( { type: "post", url:"contact.php", data: str, success:function(result) { $("#div1").html(result); } }); return false; }); }); </script> </head> <body> <div id="contact_form">

jquery - How do I add a zoom hover effect to my thumbnail -

Image
im using wordpress build portfolio site. need create hover effect triggered when mouse enters either. i'm trying box display on image area contains permalink saying "view project" specific post whilst thumbnail zooms in. site responsive can't use fixed widths or heights this. this im aiming for: im trying replicate fi doing there image hovers here http://blog.f-i.com/ i've posted current markup on http://jsfiddle.net/estx4/ thanks here go...this pure css based. http://jsfiddle.net/2pbg6/ .loop-item { -webkit-transform:translate3d(0, 0, 0); -moz-transform:translate3d(0, 0, 0); -ms-transform:translate3d(0, 0, 0); -o-transform:translate3d(0, 0, 0); transform:translate3d(0, 0, 0); overflow:hidden; position:relative; }

ipad - perform cleanup task while going to background in iOS -

i have perform long running clean operation while application going background. clean operation network transaction , take more 5 seconds using beginbackgroundtaskwithexpirationhandler: api , working fine. below adding code better clarity.. - (void)applicationdidenterbackground:(uiapplication *)application { @synchronized(self) { bgtask = [application beginbackgroundtaskwithexpirationhandler:^{ [application endbackgroundtask:bgtask]; bgtask = uibackgroundtaskinvalid; }]; dispatch_async(dispatch_get_global_queue(dispatch_queue_priority_high, 0), ^{ [self performcleanupoperation]; [application endbackgroundtask:bgtask]; bgtask = uibackgroundtaskinvalid; }); } } - (void) performcleanupoperation { // cleanup network operation [(nsobject *)self performselectoronmainthread:(@selector(cleanupdidfinish)) withobject:nil waituntildone:no]; } - (void) cleanupdidf

jquery - chnage() function not working with Select list Items -

hi friends trying show option value in alert box shows when change in select item list failed code below or can see demo here http://jsfiddle.net/exnkk/1/ html <select name="select" id="editorfont"> <option value="arial">font 1</option> <option value="alex_brushregular">font 2</option> <option value="quicksandregular">font 3</option> </select> script $('select#editorfont').change(function (){ var value = $(this).children('option').val; alert(value); }) please friends thanks in advance.. :) try like $('select#editorfont').on('change',function (){ var value = $(this).val(); alert(value); }); and need put in dom ready .see demo

php - Mysqli oop method call -

i'm new implementing oop using mysqli things, have object(class) named database, real problem how call select method in index.php , how can use it database class.php below: class database{ private $host = null; private $user = null; private $pass = null; private $db = null; public $error = "error po sir!"; public $con; public function connect($host, $user, $pass, $db){ $this->host = $host; $this->user = $user; $this->pass = $pass; $this->db = $db; $this->con = mysqli_connect($this->host, $this->user, $this->pass); if(mysqli_connect_errno()){ echo "connection failed %s\n!", mysqli_connect_error(); exit(); } } public function select($condition){ $query = "select os_user users os_user = {$condition}"; $result = mysqli_query($this->con,$query); return $result; } } this how did implement it: require 'templates/dbclass.php'; $db

Zurb abide check form if only another input is checked -

does know how make zurb abide validate form if input checked? have form billing , shipping inputs , don't want customers enter information twice, have checkbox asks if shipping information same billing. abide checks inputs if have attribute "required". know way make disregard or remove attribute if checkbox checked? thank you!

How to retain the rotation position of objective in android -

i use following code rotate imageview .. how keep last position of image after rotation ? <set xmlns:android="http://schemas.android.com/apk/res/android" android:shareinterpolator="true" > <rotate android:duration="500" android:interpolator="@android:anim/linear_interpolator" android:pivotx="50%" android:pivoty="50%" android:repeatmode="restart" android:repeatcount="1" android:todegrees="-90" /> </set> i mean : don't want imageview go original position after rotation include in rotate element: android:fillafter="true" like this: <set xmlns:android="http://schemas.android.com/apk/res/android" android:shareinterpolator="true" > <rotate android:fillafter="true" android:duration="500" android:interp

android - Where can I find the ActionBar OverFlow button icon -

i've been trying create own action bar, in order have 2 actions bars. native 1 on bottom, , custom 1 @ top. i have overflow (the 3 dots button) button, appears in native action bar, in custom action bar. so here questions: is there way put custom action bar on bottom , native 1 on top ? if answer q1 no, then, there way imitate overflow buttons , behavior ? i prefer questions 1.. i've been searching the overflow button's icon in drawables - couldn't find it. i appreciate or direction, thanks lot! yes, native 1 @ top, , if disable split-actionbar, there no action bar @ bottom. , of course possible "simulate" actionbar @ bottom of application, creating action-bar-look-a-like manually. thought answer 1. yes, might useful else: it's inside android sdk, in platforms/android-xx/data/res/values/style.xml the overflow menu's style definition: <style name="widget.holo.actionbutton.overflow"> <item n

javascript - Grails ajax jquery is not working -

i trying jquery ajax form submit in grails application. not saving result db. using dynamic form fields user can add or delete number of textfields. <script> $(document).ready(function() { $("#add").click(function() { var intid = $("#buildyourform div").length + 1; var fieldwrapper = $("<div class=\"fieldwrapper\" name=\"field" + intid + "\" id=\"field" + intid + "\"/>"); var fname = $("<input type=\"text\" name=\"name" + intid + "\" class=\"fieldname\" id=\"tb"+ intid +"_1\"/>"); var lname = $("<input type=\"text\" name=\"email" + intid + "\" class=\"lastname\" id=\"tb"+ intid +"_2\"/>"); var removebutton = $("<input type=\"button\" class=\"remove\" value=\"-\" />");

neo4j - Not operator in MATCH -

i wanna find nodes not in relation. using while finding nodes in relation current node instance like; @query(value = "start user=node({self}) match (user)<-[r:knows]-(known) return known") @fetch private iterable<graphuser> knowsme; but when tried find nodes not knows current node, found solution , like; @query(value = "start user=node({self}), doesnotknowme=node(*) has(user.userid) , not((user)<-[:knows]-(doesnotknowme)) return doesnotknowme") @fetch private iterable<graphuser> doesnotknowme; when run neo4j online executor, works well.( http://www.neo4j.org/learn/cypher ) sample used on site like; start m=node:node_auto_index(id="603"), actor=node(*) has (actor.name) , not ((m)<-[:acts_in]-(actor)) return actor note: result, should put node not in relation movies. if exits, query result added record. when want run spring-data-neo4j, there problem. not relation([:knows]) not having alias [r:knows]. e

ruby on rails - How should I use the alias_method_chain for the build method? -

i using ruby on rails 3.2.13 , use alias_method_chain :build, :option_name statement since getting strange error. is, ... ... in controller file have: class articles::commentscontroller < applicationcontroller def create @articles_comment = @article.comments.build(params[:comment]) ... end end ... in model file have: class articles::comment < activerecord::base def self.build_with_option_name ... end alias_method_chain :build, :option_name end when run create controller action following error in log: actioncontroller::routingerror (undefined method `build' class `articles::comment'): app/models/articles/comment.rb:5:in `<class:comment>' how should use alias_method_chain build method? or, maybe better, should proceed in way reach make (for example, should overwrite build method in articles::comment model instead of using alias_method_chain )? note i : don't know if helps, build method refers association (

r - ggplot2 geom_line() to skip NA values -

Image
i have data set has multiple na values in it. when plotting data, ggplot's geom_line() option joins lines across na values. there way have ggplot skip joining lines across na values? edit: thousand apologies involved. made mistake in manipulation of data frame. figured out problem. x axis not continuous when created subset. missing data had not been replaced nas, data being linked because there no nas created in subset between rows. geom_line make breaks na s in y column, joins across na values in x column. # set data frame nas in 'x' column independant <- c(0, 1, na, 3, 4) dependant <- 0:4 d <- data.frame(independant=independant, dependant=dependant) # note unbroken line ggplot(d, aes(x=independant, y=dependant)) + geom_line() i assume na values in as.posixlt(date) . if so, 1 solution map columns na values y , , use coord_flip make y axis horizontal: ggplot(d, aes(x=dependant, y=independant)) + geom_line() + coord_flip()

performance - More on using i and j as variables in Matlab: speed -

the matlab documentation says that for speed , improved robustness, can replace complex , j 1i. example, instead of using a = i; use a = 1i; the robustness part clear, as there might variables called i or j . however, speed , have made simple test in matlab 2010b , obtain results seem contradict claim: >>clear >> a=0; tic, n=1:1e8, a=i; end, toc elapsed time 3.056741 seconds. >> a=0; tic, n=1:1e8, a=1i; end, toc elapsed time 3.205472 seconds. any ideas? version-related issue? after comments @tryhard , @horchler, have tried assigning other values variable a , these results: increasing order of elapsed time: "i" < "1i" < "1*i" (trend "a") "2i" < "2*1i" < "2*i" (trend "b") "1+1i" < "1+i" < "1+1*i" (trend "a") "2+2i" < "2+2*1i" < "2+2*i" (t

c++ - program that will send a magic packet to a certian ip -

i need code c, c++, .bat, or python program. should detect if there person trying connect ip address(192.168.1.149) through port(25570) outside router/ fire wall. program send magic packet ip address (192.168.1.149). magic packet wake computer. because computer in sleep mode code have on computer in network(i don't want this). maybe in router or dns. have windows 7 computer. computer supposed in sleep mode. need people answer question give me guide i not coder why asking question here router info: https://www.asus.com/networking/rtn65u/ sorry have old dns cant give specs. how this? thx. here's python code use on 1 of network machines wake another. not sure got originally, works great. can adapt purposes. #!/usr/bin/env python import socket s=socket.socket(socket.af_inet, socket.sock_dgram) s.setsockopt(socket.sol_socket, socket.so_broadcast, 1) s.sendto('\xff'*6+'\x00\x11\x22\x33\x44\x55'*16, ('192.168.0.255', 9)) print "attem

ruby on rails - Programmatically interact w/ a webpage? -

is there way through ruby or command line can choose value drop-down box on webpage , press submit button? i want download html of webpage, every version of it, changes based on values selected box. if helps, on source of page of values in box listed option tags inside select tag below. <select name="subj_code"> <option value="%">all subjects <option value="aaec" selected>aaec - agricultural , applied economics (aaec selected value drop-down, indicated selected option inside tag) any way select different value, tell site, , reload page via code? thanks take @ mechanise . it's gem interact web pages should on issue.

java - Eclipse RCP Internationalization separate plugin -

no tutorial presents concrete example of how internationalization plug-in fragment created used. need translations plugin.xml 's , source code files. trying wrap head around translations go, , i18n facade goes. 1. how fragment apply multi-plugin enterprise application, , more importantly, how plugins externalize strings inside appropriate folders in fragment? 2. what external jars? how mechanism provide translation support external resources? 3. risk of being long-shot, possible provide independent translation of view or perspective ? not @ runtime, because know bundles can't dynamically switched. there available, this article lists process. it's based on eclipse 2.0 (!) basic ideas still correct. better article this tutorial vogella for each plugin need translate, create 1 plugin fragment. fragment associated 1 host plugin, need several fragments. each fragment can contain several languages though. languages separated folder structure described

webfonts - @font-face with data URIs and Font Squirrel’s @font-face generator -

i developing javascript application modern browsers , don't need support older ones. want embed fonts in css file instead of loading them. for browsers want support, need woff , ttf fonts. now when use font squirrel’s @font-face generator, "base64 encode" -- gives me data uri woff type , not ttf type. why it? i believe reason minimize overall file size / load time. some devices have 25kb limit in order maintain files "cached". when ttf , woof base64'd css file can exceed limits , cause reload each visit. browsers use first font "it can" (or "cascade" if will). see formats listed in following order specific reasons: 1. eot - used catch older ie (<9). ie choke multiple "src". you'll see ?#iefix involved in eot reference, or additional selector eot file in there followed similar selector witht woff , ttf. plus, since old ie doesn't datauri, have leave external file. 2. woff - modern browsers.