Posts

Showing posts from July, 2015

c++ - I need some clarification regarding this example on Stroustrup's new book about ADL -

i reproduce below argument-dependent lookup (adl) example given in pages 396 , 397 of stroustrup book (4th edition): namespace n { struct s { int i; }; void f(s); void g(s); void h(int); }; struct base { void f(n::s); }; struct d : base { void mf(n::s); void g(n::s x) { f(x); // call base::f() mf(x); // call d::mf() h(1); // error: no h(int) available } }; what comments above correct (i've tested it), doesn't seem agree author says in next paragraph: in standard, rules argument-dependent lookup phrased in terms of associated namespaces (iso §3.4.2). basically: if argument class member , associated namespaces class (including base classes) , class's enclosing namespaces. if argument member of namespace, associated namespaces enclosing namespaces. if argument built-in type, there no associated namespaces. in example, x , has type n::s not member of class d , nor of base

Selecting html elements with jquery based on div and some other attribute -

this question has answer here: selecting element data attribute 10 answers i have html code: <p class="test" data-id=1>some value</p> <p class="test" data-id=2>some value</p> <p class="test" data-id=3>some value</p> <p class="test" data-id=4>some value</p> how can select <p> element based on data-id ? with jquery: alert($("p[data-id='1']").html()); demo jquery - attribute selector

c# - Cannot insert Phone Number into Database (MS Access File) -

i'm creating database app; ms access database file. happens inserted correctly, not phone numbers. when entering phone number application working throws me exception. i've double checked coding , database , can't figure out why issue caused. here's part of code. private void btn_save_click(object sender, eventargs e) { { try { oledbcommand dbcmd = new oledbcommand(); dbcmd.commandtype = commandtype.text; dbcmd.commandtext = "insert tbl_clientinfo (firstname, lastname, address, zipcode, city, state, country, language, phonenr, mobilenr)" + "values (@firstname, @lastname, @address, @zipcode, @city, @state, @country, @language, @phonenr, @mobilenr)"; dbcmd.parameters.addwithvalue("@firstname", txt_firstname.text); dbcmd.parameters.addwithvalue("@lastname", txt_lastname.text); dbcmd.parameter

java - Same resource in two different servlets -

is possible have same resource in 2 different classes in 2 different servlets? i want this: public class one{ @resource(name="subscriptionservice") private subscriptionservice subscriptionservice; } public class two{ @resource(name="subscriptionservice") private subscriptionservice subscriptionservice; } @service("subscriptionservice") @transactional public class subscriptionservice { } there 2 different servlet class 1 , class 2 there 2 different instances of subscriptionservice. there way this? edit: web.xml <?xml version="1.0" encoding="utf-8"?> <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"> <!-- definition of root spring container shared servlets , f

javascript - Cannot get proper expression -

how can write following javascript coffeescript foo.bar(function() { dosomething(); })(x, y); for instance, following doesn't work: foo.bar -> dosomething() (x, y) something this: f -> ... (x, y) is little ambiguous in coffeescript since (x, y) valid expression on own. since things of form f(g(x)) , f(g) more common f(g)(x) , ambiguity resolved 2 statements: f -> ... and (x, y) when parser resolves ambiguity in way don't want, solution resolve ambiguity forcing desired interpretation parentheses: foo.bar(-> dosomething() )(x, y) that becomes this javascript : foo.bar(function() { return dosomething(); })(x, y); that may or may not have same effect javascript you're trying achieve. if foo.bar cares return value of argument then return dosomething(); and just dosomething(); can quite different; implicit "return last expression's value" in coffeescript can trip up. 1 example jquery

constraints - How to pin buttons to the bottom iOS7 Autolayout -

Image
i having hardest time positioning items on scroll view. in 3.5" work fine, in 4" higher want them be. want buttons tied bottom of screen in both cases. should possible pinning , constraints, believe. no matter works in 1 not in other , wise versa. if let auto layout add own constraints worse if define manually. had same problem 3 buttons @ top somehow managed though place them under should top bar. lost ...

Is Boolean a Built-in Enum in C? -

i wondering if boolean built-in enumeration. according wikipedia ~ "some enumerator types may built language. boolean type, example pre-defined enumeration of values false , true." http://en.wikipedia.org/wiki/enumerated_type in c , other languages, boolean enum? , if not - can explain why? the question more of abstract, philosophical question "what type" c. in c, (more or less) integer @ heart, misses point. when "integer" referring arithmetic type, i.e. 1 arithmetic operations addition , multiplication make sense. by contrast, enumerative type type holds collection of discrete values have no further structure among them. property enumerative value has itself; there no operations on other checking equality. forgetfully, integers enumerative type (they enumerate number of shoes can have on shoe rack, sizes of herds of sheep), there's more them - have internal structure given arithmetic operations admit. a boolean val

printing - add a print button inside a joomla article -

i have module load position in joomla page. unfortunately couldn't find way print page , module. i've inserted link following parameter didn't work either: index.php/our-cars/loan-calculator?tmpl=component&format=pdf is there solution this? try this, joomla default print , email button available on article pages. if disable buttons enable it. content menu -> article - > options on tootlbar first tab article have option show print icon enable it. this option enable print button articles, in joomla 1.7 not work . if using joomla 1.7 or not need print icon articles follow steps. go menu manager , article needs print icon go menu , choose article options right side can find same options here too. hope helps..

Why does the C preprocessor interpret the word "linux" as the constant "1"? -

why c preprocessor in gcc interpret word linux (small letters) constant 1 ? test.c: #include <stdio.h> int main(void) { int linux = 5; return 0; } result of $ gcc -e test.c (stop after preprocessing stage): .... int main(void) { int 1 = 5; return 0; } which -of course- yields error. (btw: there no #define linux in stdio.h file.) in old days (pre-ansi), predefining symbols such unix , vax way allow code detect @ compile time system being compiled for. there no official language standard (beyond reference material @ of first edition of k&r), , c code of complexity typically complex maze of #ifdef s allow differences between systems. these macro definitions set compiler itself, not defined in library header file. since there no real rules identifiers used implementation , reserved programmers, compiler writers felt free use simple names unix , assumed programmers avoid using names own purposes. the 1989 ansi c standard intr

linux - setting Cronjobs in exact time -

i want set cronjob in directadmin control panel , have question. if set job in format: 05 21 * * * /home/backup.sh my script run 1 time in day @ 21:05 or every 5 miutes(12 times in hour) , every day @ 21:00 ?? want cronjobs run's 1 time in day @ 21:05! please me your script run @ 21:50 every day. see file formats manpage crontab: $ man 5 crontab the line parts before command crontab are: ( below manpage. ) the time , date fields are: field allowed values ----- -------------- minute 0-59 hour 0-23 day of month 1-31 month 1-12 (or names, see below) day of week 0-7 (0 or 7 sun, or use names) field may asterisk (*), stands "first-last". and see example further below: ( below manpage. ) # run 5 minutes after midnight, every day 5 0 * * * $home/bin/daily.job >> $home/tmp/out 2>&1 man friend.

show button instead of menu bar when browser resize in css/html -

i have navigation menu in web page, , want show button instead of these menu-bar when browser size below level (below size) , vice verse . need code. how works ? pure css or need apply java script/ code here example web page sample site above sample page . if u change size of browser (about half ) u see menu button on top-right corner. , if u maximize disappears , shows menu-bar instead of that(menu button) here solution problem. demo : courtesy osvaldas dot info

unable to set focus on textboxes using javascript -

i trying set focus on textboxes 1 1 on tab press not working me. here code have tried: function showstep2() { document.getelementbyid('step2').style.visibility = 'visible' document.getelementbyid('prevordquan').focus(); } function showstep3() { document.getelementbyid('step3').style.visibility = 'visible'; document.getelementbyid('takeoutamt').focus(); } function showstep4() { document.getelementbyid('step4').style.visibility = 'visible'; document.getelementbyid('compsperweek').focus(); } html: <table style="width: 100%;" align="left"> <tbody> <tr> <td>how many takeout orders do each week?</td> <td><input tabindex="1" type="text" name="prevordquan" id="prevordquan" size="6" value="7" onblur=" docalc1(); showstep2();&

video - How can I read the info of a media file using visual c++? -

is there way read info (fps, bitrate, duration, codecs required, etc.) of media file (avi, mp4, mkv, etc.) on windows using visual studio c++? i managed play various files (which don't want) using directshow ( http://msdn.microsoft.com/en-us/library/windows/desktop/dd389098%28v=vs.85%29.aspx ) don't know how information file. edit: got working this... int height, width, framerate, bitrate; large_integer duration; // initialize com library coinitialize(null); // ipropertystore* store = null; shgetpropertystorefromparsingname(l"e:\\test.avi", null, gps_default, __uuidof(ipropertystore), (void**)&store); propvariant variant; store->getvalue(pkey_media_duration, &variant); duration = variant.hval; store->getvalue(pkey_video_frameheight, &variant); height = variant.lval; store->getvalue(pkey_video_framewidth, &variant); width = variant.lval; store->getvalue(pkey_video_framerate, &variant); framerate = variant.lva

(PHP) Categorize into an html opgroup based on mysql value -

basically have database 66 bible books; old testament new. bname value name of book, while bsect has value of o or n(new or old), how can make dropdown box dynamically display book old or new optgroup based on whether its' bsect o or n? teacher said have make array, have no idea how it. thoughts? my database sample: +-----------+-------+ | bname | bsect | +-----------+-------+ | genesis | o | | exodus | o | | leviticus | o | +-----------+-------+ i don't want have rely on manually setting opgroups based on number of entry, want dynamic based on value of bsect. right have following query select dropdown puts book old or new based on record number, break if more books added $query = $mysqli->query("select distinct bname name kjv"); ?> <select name="book"> <?php $i=1; while($option = $query->fetch_object()){ if($i==1) echo "<optgroup label='old testament'>"

Php : create a class with eval -

i watching code of prestashop, , see following : eval(($class_infos->isabstract() ? 'abstract ' : '').'class '.$classname.' extends '.$classname.'core {}'); they use in order override core class, in autoload method (complete file prestashop / classes / autoload.php ) wondering if thing create dynamic class this: will class cached apc or op code optimizer? what performance? i wondering if thing create dynamic class this: no. will class cached apc or op code optimizer? no. what performance? no! (cw-ified. feel free flesh out answer.)

django class-based views key word -

i've been following manual generic views django 1.4, can 'list books publisher' example work. site different in i'm trying list bookings of property name (or id) of person books property. people book more once, want able see bookings were. my views.url is: class guestbookinglistview(detailview): context_object_name = 'guest_booking' template_name = 'guest_booking.html' def get_queryset(self): self.guest = get_object_or_404(guest) return booking.objects.filter(guest = self.guest) def get_context_data(self, **kwargs): context = super(guestbookinglistview, self).get_context_data(**kwargs) context['guest'] = self.guest return context my model is: class guest(models.model): first_name = models.charfield(max_length=30) last_name = models.charfield(max_length=50) spouse_first = models.charfield(max_length=30, blank=true) spouse_last = models.charfield(max_length=50, blank=true) num_child = models.integerfield(verbose

java - 1772 of Caribbean online judge giving a time limit exceeded error. please help me find why is my algorithm taking so long -

so trying solve problem 1772 of caribbean online judge web page http://coj.uci.cu/24h/problem.xhtml?abb=1772 , problem asks find if substring of bigger string contains @ least 1 palindrome inside it: e.g. analyzing sub-strings taken following string: "baraabarbabartaarabcde" "bara" contains palindrome "ara" "abar" contains palindrome "aba" "babar" contains palindrome "babar" "taar" contains palindrome "aa" "abcde" not contains palindrome. etc etc etc... i believe approach fast because iterating strings starting @ first char , @ last char @ same time, advancing towards center of string looking following patterns: "aa" "aba" whenever find pattern can substring given contains palindrome inside it. problem algorithm taking long time can't spot problem on it. please me find lost on one. here algorithm public static boolean haspalindromeinside(stri

jquery - When to use html.beginform vs ajax.beginform -

it's amazing after posts i've checked there still no definitive explanation (in mind) in situation should subject data used... i know html.beginform, perform postback, post data controller method, , either redirect method or return same view user. i know ajax.beginform, you must (correct me if i'm wrong) specify updatetargetid resulting posted data controller method go partial view within div tag on same page form. know cannot redirect action method after form submitted. under both these conditions, can still have user input round of data submit , process via controller. so, unless need redirect action method, why wouldn't use ajax.beginform of time? the thing can imagine, html.beginform method best suited data entry input on , on again whereas ajax.beginform method used display result user depending on information input form (almost one-time) deal. btw, know i've contradicted myself use of saying use ajax.beginform of time. can please give me relat

increment a number in java until it gets to 100 than decrement down to 0 continously -

i'm making game there goalie. want him move , forth forever. have int called goalieposx (goalie position on x axis) , want go 1 until hits 200, go down 1 till 0 , repeat. i've tried folllowing //this bit isnt in method, outside global varibale boolean forward=true //this bit in method continiouly called nonstop if (goalieposx<200){ forward=true; } else if (goalieposx>200){ forward=false; } system.out.println(forward); if(forward=true){ goalieposx++; system.out.println("forward"); } else if (forward=false){ goalieposx--; system.out.println("backwards"); } } this method called continously. prints true until gets 200, prints false. however, prints forward, never backward. conclusion is: boolean changes expected first if called, seems ignore condition ive tried this if(forward = true){ if(goalieposx==200){ forward=false; }

loops - (FIXED) My java game runs in slow motion on different computers -

i developing game, , wanted test on different computer check if resolutions ok , stuff noticed 1 big problem, game runs in slow motion reason... not laggy, slow motion.. game loop temporary: while(gameisrunnin){ dostuff(); thread.sleep(1000/60); but after test, i've tried check how time take dostuff(); code , tested this: while(gameisrunnin){ long startt = system.currenttimemillis(); dostuff(); long stopt = system.currenttimemillis(); system.out.println(stopt-startt); thread.sleep(1000/60); the result gives me 0, on both computers, (on 1 developing game runs in perfect speed, , on pc runs in slow motion.. tested nano time, gives me 50000-80000 on both computes (pretty same result. what's up? superman save me? update: ok when run game on other computer not on full screen, it's runs fine, when on full screen, it's slowmotion update: looks superhero here, i've set displaymode refresh rate unknown, guess whole problem...

Simple rails filters -

i have simplest rails app, scaffold tent here controller#index def index @tents = tent @tents = @tents.where(:brand => params[:brand]) if params[:brand] @tents = @tents.where(:season => params[:season]) if params[:season] end view standart, generated scaffold and here search witch should filter data = form_tag tents_path, method: :get = label_tag "manufacturer" = select_tag :brand, options_for_select(...), include_blank: true = label_tag "seasons" - tent.pluck(:season).each |season| =check_box_tag 'season', season =h season = submit_tag 'submit' problem 1: when submit from, , params unselected(select or checl_boxes) don't want send params sent empty get /tents?utf8=...&brand=&season=&commit=submit problem 2: when check multiple checkboxes request somthing like get /tents?utf8=...&brand=brand &season=4&season=3& commit=submit after

mysql - Always return 1 even when there is no table related object -

i query database table joined related table example: want show styles , join mixes style show 0 mixes if thst style don't have mixes related. here 2 tables: first mixes table create table `mixes` ( `mixes_id` int(11) not null auto_increment, `datepublic` date default null , `timelenght` time default null , `title` varchar(255) default 'no-title-yet' , `dwnlsize` varchar(45) default '? megabytes', `quality` char(10) default '? kbits/s', `style_id` int(3) unsigned zerofill default null, `collection_id` int(3) unsigned zerofill default '001', `liendwnld` varchar(255) default null, `vidlink` varchar(255) default null, `artistefeat` varchar(255) default null, `slugmixtitle` varchar(100) default null, `cache` enum('0','1') default null, primary key (`mixes_id`), unique key `title_unique` (`title`), unique key `liendwnld_unique` (`liendwnld`), unique key `slugmixtitle` (`slugmixtitle`), key `styl

excel - Storing user inputs for retrieving later -

Image
i have spreadsheet user inputs various details on inputs page , presses calculate button want. inputs strings, numbers , dates. i want save inputs each calculation user @ later date enter calc id , not have renter inputs. one simple way thought of doing copy inputs when calculation run sheet inputs in column calc id. save future inputs in separate column , lookup correct column retrieve inputs @ later date. i read question - what benefits of using classes in vba? , thought make class called calculationinputs had details stored in 1 object. may overkill need wanted ask how other people solve simple task. you can use names define variables within scope of workbook or worksheet. typically these used define ranges, , more dynamic ranges, can used store static/constant values. to create name manually, formula ribbon, names manager: click on "new" button, , give meaningful name: make sure put ="" in "refers to" field, if leave

php - Cookies and variables -

i've created login class web app , work, i've created infamous "keep me logged in" - checkbox , don't work. here's class login: <?php error_reporting(e_all ^ e_notice); class login { private $error; private $connect; private $email; private $password; public $row; public function __construct(pdo $connect) { $this->connect = $connect; $this->error = array(); $this->row = $row; } public function dologin() { $this->email = htmlspecialchars($_post['email']); $this->password = htmlspecialchars($_post['password']); $this->rememberme = $_post['rememberme']; if($this->validatedata()) { $this->fetchinfo(); } return count($this->error) ? 0 : 1; } public function validatedata() { if(empty($this->email) || empty($this->password)) { $this->error[] = "täyttämättömiä kenttiä"; } else {

ruby - Liquid template falls when filtering a collection with 'map' -

after updating jekyll 1.2.1 error when running blog: generating... liquid exception: can't convert string integer in _posts/ru/issues/2009-06-21-xpath-prime-numbers.md the trace reffers place in liquid says nothing me: /library/ruby/gems/1.8/gems/liquid-2.5.2/lib/liquid/standardfilters.rb:108:in `[]': can't convert string integer (typeerror) /library/ruby/gems/1.8/gems/liquid-2.5.2/lib/liquid/standardfilters.rb:108:in `map' /library/ruby/gems/1.8/gems/liquid-2.5.2/lib/liquid/standardfilters.rb:102:in `map' /library/ruby/gems/1.8/gems/liquid-2.5.2/lib/liquid/strainer.rb:43:in `send' /library/ruby/gems/1.8/gems/liquid-2.5.2/lib/liquid/strainer.rb:43:in `invoke' /library/ruby/gems/1.8/gems/liquid-2.5.2/lib/liquid/context.rb:82:in `invoke' /library/ruby/gems/1.8/gems/liquid-2.5.2/lib/liquid/variable.rb:102:in `render' /library/ruby/site/1.8/rubygems/core_ext/kernel_require.rb:53:in `inject' /library/ruby/

sql - Create a ROLLING sum over a period of time in mysql -

i have table columns date , time_spent . want find each date d sum of values of 'time_spent' period of time : (d-7 - d), ie. past week + current day. i can't figure out way this, can find examples total sum , not sum on variable period of time. here dataset example : create table rolling_total ( date date, time_spent int ); insert rolling_total values ('2013-09-01','2'), ('2013-09-02','1'), ('2013-09-03','3'), ('2013-09-04','4'), ('2013-09-05','2'), ('2013-09-06','5'), ('2013-09-07','3'), ('2013-09-08','2'), ('2013-09-09','1'), ('2013-09-10','1'), ('2013-09-11','1'), ('2013-09-12','3'), ('2013-09-13','2'), ('2013-09-14','4'), ('2013-09-15','6'), ('2013-09-16','1'), ('2013-09-17','2'), ('

android - Gradle skipping task X as it has no source files -

i have created gradle.build compiles android project. producing correct apks , post build step want copy them folder more meaningful name. i have wrote task achieve this: task copybundle(type: copy) { def versioncode = android.defaultconfig.versioncode def builddate = new date().format("yyyy-mm-dd't'hh-mm") def outputfile = 'hexpath-android-release-' + builddate + '-' + versioncode + '.apk' println "copying file " + outputfile from('hexpath-android/build/apk/') into('output/android/') include('hexpath-android-release.apk') rename ('hexpath-android-release.apk', outputfile) } the problem having skips task saying "skipping task ':hexpath-android:copybundle' has no source files. any ideas on doing wrong? the folder correct , has several .apks. include filename correct. output folder not exist when script ran. rename valid filename. you

http status code 401 - Msdeploy 401 while trying to sync directories -

i've been following tutorial using msdeploy deploy windows service. i have command running locally against iis server , against remote server , same error both. -verb:sync -presync:runcommand='c:/deploy/presync.cmd',waitinterval=30000 -source:dirpath='c:/deploy/service' -dest: dirpath='c:/websites/service', computername=localhost, username='username',password='password', authtype='basic' -allowuntrusted -postsync:runcommand='c:/deploy/postsync.cmd',waitinterval=30000" this error get error code: error_user_not_admin more information: connected 'localhost' using web deployment agent service, not authorize. make sure administrator on 'localhost'. learn more at: http://go.microsoft.com/f wlink/?linkid=221672#error_user_not_admin. error: remote server returned error: (401) unauthorized. error count: 1. however can command work ok without errors run bunch of commands through manifest , cr

c# - Accept integer numbers as input, one at a time, in a single field -

quick note - new c# apologize if stupid simple. i having hard time trying complete simple c# task in book. my task - create windows application accepting integer numbers input, 1 @ time, in single field. button should cause displaying number right below input field, if larger displayed number (or it’s first number processed). 0 (0) has been processed, stop accepting more input , display (above input field) sum of entered numbers. here's have far - using system; using system.collections.generic; using system.componentmodel; using system.data; using system.drawing; using system.text; using system.threading.tasks; using system.windows.forms; using system.linq; namespace windowsformsapplication2 { public partial class form1 : form { public form1() { initializecomponent(); button1.click += new system.eventhandler(button1_click); listofnumbers = new list<int>(); } list<int> listofnu

javascript - How to combine JQuery and RequireJS in an object-oriented, well-structured manner? -

i'm developing visual html editing tool. i'm writing frontend on top of yeoman webapp template, , using jquery dom manipulation , requirejs structure code. example code (contents of /app/scripts/views/drawing/draw-element.js can feeling directory structure): define(['jquery', 'jquery-ui', 'domready'], function ($, $ui) { 'use strict'; function drawelement (elementid) { this.jqelement = $("#" + elementid); console.log('drawelement: ', this, this.jqelement); // printed when instance created , looks fine this.jqelement.addclass("draw_element"); // has no effect. why not working? this.jqelement.click(function (eventobject) { this.jqelement.addclass("selected"); }) return this; } return drawelement; }); i later use drawelement this: var drawelement = new drawelement("box1"); question: recommended way of u

javascript - Angularjs $http POST request empty array -

the following $http request executes successfully, yet php script on other end receives empty $_post array when should receive 'test' , 'testval.' ideas? $http({ url: 'backend.php', method: "post", data: {'test': 'testval'}, headers: {'content-type': 'application/x-www-form-urlencoded'} }).success(function (data, status, headers, config) { console.log(data); }).error(function (data, status, headers, config) {}); if wan send simple data, try this: $http({ url: 'backend.php', method: "post", data: 'test=' + testval, headers: {'content-type': 'application/x-www-form-urlencoded'} }).success(function (data, status, headers, config) { console.log(data); }).error(function (data, status, headers, config) {}); and php part shoul this: <?php $data = $_post['test']; $echo $data; ?> i

backbone.js - Backbone Model change data in one instance affects another -

i had weird bug when using backbone.model so have model declaration like: var mymode = backbone.model.extend({ defaults:{ 'somelist': [] }, initialize: function(){ _.bindall(this, 'tostring', 'castfromstring'); }, tostring: function(){ return this.get('hierarchynamelist').join('+'); }, castfromstring: function(str){ var strarray = [], index = 0; if (str) { strarray = str.split('+'); } (index = 0; index < strarray.length; index++){ this.get('hierarchynamelist').push(strarray[index]); } } }); then tried test it (function () { 'use strict'; var assert = function(condition, message) { if (condition !== true) { throw message || "assertion failed"; } }; var ma = new mymodel({'somelist': ['a','b','c']}); var mb = new mymodel(); mb.castfromstring('a+b+c');

javascript - jQuery next().val() undefined -

i try next input value after <td> field. tried $(this).parent("tr").next("input") didn't work out. here jsfiddle . as can see need select option parse input ... want delimiter input value of same row .. try el.parent("td").next().find("input[name=delimiter]").val() : $("#go").click(function () { $('.csv_field').each(function (index, element) { el = $(this); if (el.val() != "'-- none --'") { console.log(el.parent("td").next().find("input[name=delimiter]").val()); } }); }) jsfiddle example you're iterating on .csv_field select fields. parent td want parent() or parent("td") parent("tr") won't work because parent() goes 1 level dom. want go next cell via next() , child via find("input[name=delimiter]") . note el.val() != "'-- none --'" should el.val()

objective c - Keep UIButton highlighted after touch & iOS 7 -

i need keep uibutton highlighted after touch event. in ios versions < 7 used following action touch inside event: - (ibaction)clickme:(id)sender { uibutton *button = sender; [nsoperationqueue.mainqueue addoperationwithblock:^{ button.highlighted = yes; }]; } unfortunately has changed in ios 7 , code doesn't work anymore: if tap button, button reverts normal state; interestingly, if keep button pressed little longer, button remains highlighted. please note app developed ios 6 runs in ios 7 in compatibility mode. i'm trying figure out way make app work on both ios 6 & 7 far haven't found nice solution (one workaround queue event highlights button after short delay produces annoying flickering of button). advice? as " .highlighted " property you're using, apple documentation states : "uicontrol automatically sets , clears state automatically when touch enters , exits during tracking , when there touch up." why not chan

rhel6 - MariaDB fails to start on RHEL 6 -

installing mariadb in rhel6 , starting server service start mysql gives error 131007 02:56:13 mysqld_safe starting mysqld daemon databases /var/lib/mysql 131007 02:56:13 mysqld_safe wsrep: running position recovery --log_error= --pid-file=/var/lib/mysql/hostname.pid 131007 02:56:15 mysqld_safe wsrep: failed recover position: how can fix this. this selinux error. instructions supplied on mariadb website, supported configuration disable selinux.

objective c - creating convex SKPhisycsBodies -

i,m trying rectangle hole in new framework provided apple, problem default method bodywithpolygonfrompath not accept concave polygons, tried approach problem follows: cgpathmovetopoint (path, null, self.size.width/4.0, self.size.height/4.0); cgpathaddlinetopoint(path, null, self.size.width/2.0, -self.size.height/4.0); cgpathaddlinetopoint(path, null, -self.size.width/2.0, -self.size.height/4.0); cgpathaddlinetopoint(path, null, -self.size.width/2.0, self.size.height/4.0); cgpathclosesubpath (path); self.physicsbody = [skphysicsbody bodywithpolygonfrompath:path]; self.physicsbody.affectedbygravity = yes; self.physicsbody.categorybitmask = solidcategory; self.physicsbody.dynamic = yes; [self addchild:shape1]; self.auxiliaryshapenode = [[skspritenode alloc] init]; cgpathmovetopoint (path_aux, null, 3*self.size.width/8.0, 0); cgpathaddlinetopoint(path_aux, null, self.siz

Java String Bubble Sorting -

i need sorting array in alphabetical order using bubble sort algorithm. my code is: public class strings { public static void main(string[] args) { scanner reader = new scanner(system.in); string tempstr; system.out.print("enter strings > "); string s1 = new string(reader.nextline()); string[] t1 = s1.split(", "); (int t=0; t<t1.length-1; t++) { (int = 0; i<t1.length -1; i++) { if(t1[i+1].compareto(t1[1+1])>0) { tempstr = t1[i]; t1[i] = t1[i+1]; t1[i+1] = tempstr; } } } for(int i=0;i<t1.length;i++) { system.out.println(t1[i]); } } } the code compiles, not sort alphabetical. please me. you have 3 errors in code. the first error in inner loop, in place check statement, should i <

Losing precision converting from int to double in java -

i tried test following code, , gave me 434 on n, result did not anticipate, what's reason loss of precision? double f = 4.35; int n = (int) (100 * f); // n 434 - why? n = (int) math.round(100*f); // n 435 floating point isn't perfect. uses approximated values. in particular, double s can not represent numbers. 1/3 can't precisely represented in decimal using finite number of digits, can't 4.35 represented in binary finite number of bits. so rounded results. values close 4.35 , not quite equal. in case, it's bit smaller, when multiply 100, don't 435 , almost 435 , not quite same. when cast int , truncate result, 434,999... becomes 434 . in contrast, when use math.round , convert 434,999... 435 (which can represented precisely). if precisely representing 4.35 necessary, take @ java bigdecimal type.

c# - Populating multiple comboboxes in a single event -

i'm trying populate number of combo boxes in formload method, 1st 1 populates. in same method same stored procedures called data grids , work fine. please see attached code: private void frmmain_load(object sender, eventargs e) { dataaccesslayer dal = new dataaccesslayer(); pnleditcall.visible = false; pnleditinspection.visible = false; pnleditequipment.visible = false; #region populate datagrids dgvinspections.datasource = dal.getallinspections(); dgvcalls.datasource = dal.getallcalls(); dgvstaff.datasource = dal.getallstaff(); dgvlabs.datasource = dal.getalllabs(); dgvequipment.datasource = dal.getallequipment(); #endregion #region populate comboboxes cmbinspectionstaff.datasource = dal.getallstaff(); cmbinspectionstaff.displaymember = "name"; cmbinspectionstaff.valuemember = "[staffid]"; cmbcallstaff.datasource = dal.g

Getting Java Println Outputs in PHP -

i'm trying output java application use below code output values system.out.println(object.getnumber(3)); system.out.println(object.getnumber(4)); i'm using exec("somejavapath javaname", $output) , print_r($output) output array print. know values wanted format instead of array ( [0] => 34 ) i want this array ( [0] => 3 [1] => 4 ) does know format? thanks if not expecting comas in output java application , include coma between 2 values : system.out.println(object.getnumber(3)); system.out.println(","); // print coma in between system.out.println(object.getnumber(4)); then $values_array = explode( ',', $output );

Error while using PHP to run R scripts using a sequence or vector as parameter -

i working on small project uses graphs generated r scripts, values php script. have problems using vectors parameters. from php use simply echo shell_exec("plot.roc.curves.r ".$d." ".$sigma." \"".$distribution."\" \"".$f."\" \"".$x."\" \"".$y."\" ".$size); this r script args <- commandargs(true) # allow command line arguments d <- as.integer(args[1]) sigma <- as.integer(args[2]) # sigma distribution <- args[3] # distribution (cauchy, norm, exp, binom, ... ) f <- args[4] # filename of output file xaxis <- args[5] # text x axis yaxis <- args[6] # text y axis size <- as.integer(args[7]) # size of generated png file (x , y) plot.roc.curves <- function(d_f,sigma_f,distribution_f,xaxis_f,yaxis_f) { cdf <- get(paste("p&

performance - C++ Business rule expression parser/evaluation -

i'm looking suggestions of portable lightweight libraries written in c++ , support mathematical , business rule expression , evaluation. understand c++ doesn't provide such functionality in stl . the basic requirement follows: the expressions evaluated comprised of numbers , strings , variables either representing numbers or strings. some of expressions expected evaluated many times per second (1000-2000 times), hence there requirement high performance evaluations of expressions. originally project @ company, encode business rules classes derived base expression class. problem approach not scale number of expressions increases. i've googled around, "libraries" find pretty simple examples of shunting yard algorithm, of expression parsers, perform parsing , evaluation in same step making them unsuitable continuous reevaluations, , support numbers. what i'm looking for: library written in c++ (c++03 or c++11) stable/production worthy

Is there a way to add a new line to display in the title attribute of an Anchor tag in HTML? -

i using code store html code in variable called $conversions $conversions = "gbp " . number_format($file*0.84) . "chf " . number_format($file*1.23) however can't seem figure out how add <br> before word "chf ". any ideas? the whole code follows: <?php $file = get_field('fl_price'); if(trim($file) == ""){echo 'price on application' ;}else{$conversions = "gbp " . number_format($file*0.84) . "<br />chf " . number_format($file*1.23) ;echo 'eur ' . number_format($file) . "</br><a class=\"wp-tooltip\" title=\" $conversions \">other currencies</a>" ;} ?> $conversions = "gbp " . number_format($file*0.84) . "&#xa;chf " . number_format($file*1.23); echoing $conversions have html-linebreak before chf.

delphi - ProgresBar - display message after the bar reaches 100% -

i playing around progress bars ... trying display message when progress bar reaches end of line (100%) ( used raize status bar , tms advprogressbar) raize, code sample seem work : procedure tform1.timer1timer(sender: tobject); begin rzprogressstatus1.percent := rzprogressstatus1.percent +1; if rzprogressstatus1.percent = 100 begin showmessage('yo'); application.terminate; end; end; however,for advprogressbar not because keeps firing messages when position reaches 100.that makes me worry if raize maybe in trouble. procedure tform1.timer1timer(sender: tobject); begin advprogressbar1.position := advprogressbar1.position +1; if advprogressbar1.position = 100 begin showmessage('yo'); application.terminate; end; end; edit : debugger shows : first chance exception @ $00649d6c. exception class $c0000005 message 'access violation @ 0x00649d6c: read of address 0x00000048'. process project1.exe (2928) , stops on following cod