Posts

Showing posts from March, 2012

What happens to a running rake task if I change its source? -

if running rake foo:bar , if edit bar method before task completes, change task midway through? if change code of rake task no, if change on depends will. changing database schema on task dependent change mid way

Connection limit for SQLDB with small_plan (Bluemix) -

what concurrent connection limit sqldb small plan? have liberty application bounded sqldb service small plan , got following error. db2 sql error: sqlcode=-4712 the free beta plan features 100mb per instance , 10 concurrent connections. the small plan features 10gb max per instance , 20 concurrent connections. the premium plan features 500gb max storage per instance , 100 concurrent connections. see link below more information: https://console.ng.bluemix.net/?ace_base=true/#/store/cloudoepaneid=store&serviceofferingguid=0d5a104d-d700-4315-9b7c-8f84a9c85ae3&fromcatalog=true if think you're close exhausting connections, should use monitoring , analytics service monitor connection pools: https://www.ng.bluemix.net/docs/#services/monana/index.html#gettingstartedtemplate

sas dis - kickout process to publish tables in SAS DIS -

i have job matching may produce duplicates. when happens, want job create table containing these duplicates , send email data. putting aside conditionality moment (on whether duplicates produced), can't seem email send. i have tried selecting publish email transformation , follow this link best could, errors error: email host ****** not found error: unable publish package email address ****** error: email transport engine encountered errors while publishing package. error: email host ****** not found. package end successful where ****** strings obscuring. 1 issue mentioned link asks me show output tab, checking indicated box has no effect , output tab still cannot seen. not know if causing error. much gratitude this. update: i can output tab display. toggling option takes effect after closing , reopening job. other (main) issue remains. please reach out sas administrator this. either email options have not been setup correctly in sas or maybe

sorting - bug in bash sort with different columns? -

i working file contains 3 values, id (they happen protein ids in case curious), value, , value. tab delimited, looks this: a2m 0.979569315988908 1 aacs 0.925340159491081 1 aagab 0.982296215686199 1 aak1 0.736903840140103 1 aamp 0.00589711816127862 0.138868449447202 aars2 1 1 aars 3.13300124295614e-05 0.00212792325492566 aarsd1 0.527417792161261 1 aasdh 0.869909252023668 1 aasdhppt 0.763918221284724 1 aatf 0.691907759125663 1 abat 0.989693691462661 1 abca1 0.601194017450064 1 abca5 1 1 abca6 1 1 i interested in sorting these ids in alphabetical order , extracting various values. however, noticed sort sorts ids differently, depending on extracting. when execute: cut --fields\=1,2 input.txt|sort --key=1 the resulting file is: a2m 0.979569315988908 aacs 0.925340159491081 aagab 0.982296215686199 aak1 0.736903840140103 aamp 0.00589711

python - How to set axes limits in each subplot -

i created subplot figure code: f, axs =plt.subplots(2,3) now on loop make plot on each subplot doing: for in range(5): plt.gcf().get_axes()[i].plot(x,u) is there similar code set axis limits of subplot i'm accessing ? yes can use .set_xlim , .set_ylim on axessubplot object get_axes()[i]. example code in style gave: import numpy np matplotlib import pyplot plt f, axs =plt.subplots(2,3) x = np.linspace(0,10) u = np.sin(x) in range(6): plt.gcf().get_axes()[i].plot(x,u) plt.gcf().get_axes()[i].set_xlim(0,5) plt.gcf().get_axes()[i].set_ylim(-2,1) or more pythonically: import numpy np matplotlib import pyplot plt f, axs =plt.subplots(2,3) x = np.linspace(0,10) u = np.sin(x) sub_plot_axis in plt.gcf().get_axes(): sub_plot_axis.plot(x,u) sub_plot_axis.set_xlim(0,5) sub_plot_axis.set_ylim(-2,1)

objective c - How to set default text at UITextField in iOS -

following code: - (void)getage:(nsstring *)age getgender:(nsstring *)gender getlocation:(nsstring *)location getprefage1:(nsstring *)age1 getprefage2:(nsstring *)age2 getprefgender:(nsstring *)prefgender getpreflocation:(nsstring *)preflocation getimage:(uiimage *)image { self.textfieldage.text=age; self.textfieldgender.text=gender; self.textfieldlocation.text=location; self.textfieldprefgender.text=prefgender; self.textfieldprefage1.text=age1; self.textfieldprefage2.text=age2; self.textfieldpreflocation.text=preflocation; self.imageprofilepic.image=image; } i these value viewcontroller want set these textfields above values. can help? new ios. this method calling above method : -(ibaction)editpro:(id)sender { profileeditviewcontroller *profileedit= [[profileeditviewcontroller alloc] initwithnibname:@"profileeditviewcontroller" bundle:nil]; [profileedit getage:_labelage.text getgender:_labelgender.text getlocation:_label

sql - MySQL select rows with timestamp closest to but not exceeding the given timestamp -

i have table looks below state_history +---------------------+-----------+----------------+ + | state_added_time | entity_id | state_id | .... | +---------------------+-----------+----------------+ | | 2015-05-15 13:24:22 | 1 | 1 | | | 2015-05-15 13:29:44 | 3 | 2 | | | 2015-05-15 13:34:26 | 2 | 2 | | | 2015-05-15 14:24:28 | 1 | 3 | | | 2015-05-15 14:24:30 | 2 | 3 | | | 2015-05-15 14:26:32 | 3 | 5 | | | 2015-05-15 14:26:34 | 3 | 3 | | ....... my intention know states of entities @ given time. example, if timestamp received application 2015-05-15 14:25:00 expected output should be: state_history +---------------------+-----------+----------------+ + | state_added_time | entity_id | state_id | .... | +---------------------+-----------+----------------+ | | 2015-

c# - How to program with an age (or any other) range -

i trying create maintenance page admin create/amend/delete age ranges show on page customer select age range. age range 1-20, 21-40, 41-60, 61-80, 81-100 allow values amended , deleted range cannot overlap or exist in first place so based on above below entries cannot exist 2-30 - falls within range or 22- 30 - falls within range etc etc so far have code check if range exists ienumerable<agerange> ar = in mydatacontext.ageranges.where(aa => aa.minage <= newage.minage && aa.maxage >= newage.minage) select a; not tested far seems trick. added in delete function. if delete range 41-60 have new set of issues. if add new entry 42 - 59 customer cannot select range if age 41 or 60 above code not find above range allow save. amended range in example be 1-20 21-40 - customer 41 cant select option 42-59 - customer 41 cant select option either. if customer 60 cant select option 61-80 - if customer 60 cant select option either. 81-100 i think have s

php - Find string inside single and double quotation marks using regex -

how find string between "" , '' using regex. want create function using php preg_match_all() function match static strings in file, creating string using "" , '' need find such strings file. you should aware inside quoted "entities" may find escaped quotes. best way match strings using regex this: (?s)'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*" see demo sample code: $re = "/(?s)'(?:[^'\\\\]|\\\\.)*'|\"(?:[^\"\\\\]|\\\\.)*\"/"; $str = "\"string 'c' \" string \" \" , ' string \"ste\" \' '"; preg_match_all($re, $str, $matches); ideone demo

php - Send mailer Symfony2 -

i use symfony2. action send message , redirect page. like this public function myaction() { ... code ... sendmessagewithswiftmailer() .... return $this->redirect(url); } this code work. url takes time opened. how can first open url page , send message? can give me idea? you can use: swiftmailer: spool: { type: file } in config_prod.yml and: swiftmailer: spool: { type: memory } in config.yml . then, in production environment, can create crontab job executes symfony2 command: app/console swiftmailer:spool:send this command send spooled messages. more info @ symfony.com/doc/current/cookbook/email/spool.html

gwt - how to use eventBus.removeHandler in mvp4g? -

i wanted delete/clear instances of presenter before firing event. documentation says use eventbus.removehandler(handler), not figure out how handler object presenter class presenter has multiple=true attribute set. if have declared presenter "multiple="true" @presenter(view=oneview.class, multiple=true) public class onepresenter extends basepresenter<ioneview, oneeventbus>{...} you add presenter eventbus calling: onepresenter presenter = eventbus.addhandler(onepresenter.class); and remove presenter calling: eventbus.removehandler(presenter); here find documentation: https://github.com/frankhossfeld/mvp4g/wiki/04.-defining-presenters,-views-&-services#multiple-presenter in mvp4g can activate , deactive presenters activate/deactivate attribute of @event annotation. ( https://github.com/frankhossfeld/mvp4g/wiki/03.-defining-eventbus#activatingdeactivating-presenters ) if need control before presenter handles event, can override on

Invalid boolean value using python requests -

i using python requests posting data in dpd api. if post data: { "job_id": null, "collectionondelivery": false, "invoice": null, "collectiondate": "2012-05-01t09:00:00", "consolidate": null, "consignment": [] } using requests, getting response 200, error {"errorcode":"1008","errortype":"validation","errormessage":"invalid boolean value","obj":"collectionondelivery"} i modified value of collectionondelivery 0 , tried, got same error message. can in this? i guess "null" , "false" aren't variable or type created. in python "none" instead of "null", need capitalize first letter of "false" try this: { "job_id": none, "collectionondelivery": false, "invoice": none, "collectiondate": "2012-05-01t09:00:00", "consoli

ios - Will app lose the NSUserDefault data on over the air installation? -

this question has answer here: do nsuserdefaults persist through update app in appstore? 5 answers will app lose nsuserdefaults values when on air installation? no app installed in device install app version 1.0 on air , saving values in nsuserdefaults install app version 1.0 on air again out deleting app. will lose nsuserdefaults values because of installing same version? whatever have in nsuserdefaults remains in device/system. never gets deleted when upgrade app on uninstalling or manually deletion removed.

sed - Regex to replace a character if is unique -

i need please script regex fix big text file under linux (with sed example). records looks like: 1373350|doe, john|john|doe|||b|acme corp|... 1323350|simpson, homer|homer|simpson|||3|moe corp|... i need validate if 7th column has unique character (maybe letter or number) , if true, add second column without comma, mean: 1373350|doe, john|john|doe|||b doe john|acme corp|... 1323350|simpson, homer|homer|simpson|||3 simpson homer|moe corp|... any help? thanks! awk better suited job: awk -f '|' 'begin { ofs = fs } length($7) == 1 { x = $2; sub(/,/, "", x); $7 = $7 " " x } 1' filename that is: begin { ofs = fs } # output separated same way input length($7) == 1 { # if 7th field 1 character long x = $2 # make copy of second field sub(/,/, "", x) # remove comma $7 = $7 " " x # append seventh field } 1 # print line

Handling of Chracter in Java -

this question has answer here: in java, result of addition of 2 chars int or char? 8 answers i came across case in java prints character ascii. if try print 2 character prints sum of there ascii value. system.out.println('c'); =>> c system.out.println('a'+'b'); =>> 195 (97+98) just want know why in second case prints sum of there ascii value behind scenes, compiler acting smart , replacing char + char int constant value . in first case println(char) called , in second case println(int) called sample code : public static void main(string[] args) { system.out.println('a'); system.out.println('a' + 'b'); // compiler first "resolves" expression 'a'+'b' (since char cannot added added ints) , tries call correct `println(int)` method. } byte code: public

utf 8 - How do I show utf8 characters in pig shell aka grunt? -

i've file has utf-8 characters 현 . i'm taking file input in pig script, processing , returning processed string udf. when use dump see output, see ??? processed in grunt shell. expected output 현 processed . how show utf-8 characters on pig grunt shell?

c# - Deserializing inherited classes -

i want send parameter-settings backendapplication frontend. need able have different type of parameters (portnumbers, folders, static strings , such). so i've designed baseclass, parameter such: public abstract class parameter { public abstract bool isvalid(); } let's have 2 types of folder parameters: public abstract class folder : parameter { public string foldername { get; set; } protected folder(string foldername) { this.foldername = foldername; } } public class readwritefolder : folder { public readwritefolder(string foldername) : base(foldername) { } public override bool isvalid() { return isreadable() && iswritable(); } } public class readfolder : folder { public readfolder(string foldername) : base(foldername) { } public override bool isvalid() { return isreadable(); } } this used webapi, controller: public dictionary<string, parameter> get() {

php - Why my $_POST is empty? -

this question has answer here: what difference between post , get? [duplicate] 8 answers i have no time , tired struggle this, decided ask here: i've created file my.php contains only: <?php var_dump( $_post ); ?> and open file using browser this: www.domain.com/my.php?post1=hey&post2=ho&post3=letsgo and in browser have array(0) { } response. question: possibly done wrong?? thanks! in url get parameters, not post . echo $_get['post1']; // hey echo $_get['post2']; // ho echo $_get['post3']; // letsgo

cordova - Smart Watch (Android & Apple) integration in Ionic Framework -

i working on ionic framework couple of months, checked out new ionic version out 1.0.1. post question regarding creating smart watch application in ionic framework. until google , found cordova plugin interact apple watch https://github.com/20steps/cordova-plugin-watch . support ios. there several cordova plugin available did't find relevant answer or tutorial or blog using can learn smart watch integration. in native task easy using same plugin , target both apple , android smart watch more important , cost less development. any topic helpful. ! have tried https://github.com/tgardner/cordova-androidwear in meantime? there example on https://github.com/tgardner/cordova-androidwear-example too.

dynamic - Dynamically create compiled binary with go -

first sorry perhaps bad title - imagine lot of difficulty i'm experiencing relates not knowing correct terminology i'm trying achieve. in go, wish have program when run can dynamically create secondary binary. illustrate basic hello world example - in pseudo code since don't know how achieve it. generator.go -> read in statement statement.txt (i.e. "hello world") -> insert statement following program... package main import ( "fmt" ) func main(){ fmt.println([dynamic statement inserted here]) } -> compile code subprogram whenever go run generator.go executed subprogram binary created. running output hello world . changing statement.txt else , executing go run generator.go again once more create subprogram when run execute new statement. in summary with go, how can create program can dynamically create compiled child program output. thanks. so have 2 sub-tasks want: perform text substitution acquire fina

ios - EKEventEditViewController freezes app and loads after long time -

i have following code in swift: var eventcontroller = ekeventeditviewcontroller() eventcontroller.editviewdelegate = self var store = ekeventstore() eventcontroller.eventstore = store var event = ekevent(eventstore: store) event.title = viewmodel.rolename event.location = viewmodel.location event.startdate = viewmodel.startdate event.enddate = viewmodel.enddate eventcontroller.event = event var status = ekeventstore.authorizationstatusforentitytype(ekentitytypeevent) switch status { case .authorized: self.setnavbarappearancestandard() dispatch_async(dispatch_get_main_queue(), { () -> void in self.presentviewcontroller(eventcontroller, animated: true, completion: nil) }) case .notdetermined: store.requestaccesstoentitytype(ekentitytypeevent, completion: { (granted, error) -> void in if granted == true { self.setnavbarappearancestandard

c++ - Why it doesn't swap two integers in an array? -

#include <iostream> using namespace std; int main() { int a[6]={3,7,9,4,6,1}; int max; max = a[0]; for(int i=0; i< 6; i++) { if(a[i] > max) { max = a[i]; } } //cout << max <<"\n"; int temp; temp=a[0]; a[0]=max; max = temp; for(int i=0;i<6;i++) { cout << a[i] << endl; } return 0; } i want swap maximum value first 1 in decared array replaces 1st value maximum while maximum value retained @ position. the logic wrong. swapping values of variable max instead of element max value. if want swap element max value, keep track of position, this: if(a[i] > max) { max = a[i]; pos = i; } and while swapping, use follows: int temp; temp=a[0]; a[0]=a[pos]; a[pos] = temp; note: alternative way use pointers, simple non-pointer method.

javascript - Expand/collapse not working using java script in html -

this link http://jsfiddle.net/susxk/124/ when clicking customer services not happening can 1 me issue. expected output: clicking customer services want show full table.in same way collapse. this show , hide table $(document).ready(function() { $(".form-matrix-table").hide(); $(".form-label,form-label-top").click(function() { $(".form-matrix-table").toggle(); }); });

tortoisesvn - SVN - adding files that should be ignored -

i've copied new files subfolder in repo. when click add in tortoise svn, can see files shouldn't added, need ignore them. can see ignoring lots of other files correctly. so alter top-level svn:global-ignores adding testresults ignore folder. cannot commit property change, since tortoisesvn sees nothing commit, assume property changes happen directly, don't need committing. going add files, see them still listed. why of ignore patterns working , new pattern not? you can active global ignores following command: svn pg svn:global-ignores /path/ -v --show-inherited-props

javascript - JQuery and Serverside requiredfield validations can check both on click event -

can check both server side , custom jquery validations on click event ?? i have function in js returns true or false after validation .. call on onclientclick event when returns true postback skipping require field validators validations ... how handle other lot of code in js validations move in js , remove serverside tags ? thats code $(".number-allowed").focusout(function () { var sum = 0; var stockvalue = $('#tblquantity tr:eq(' + ($(".number-allowed").index(this) + 1) + ') td:eq(' + 1 + ')').text(); var lblstatus = $('#tblquantity tr:eq(' + ($(".number-allowed").index(this) + 1) + ') td:eq(' + 3 + ')'); var inputvalue = $(this).val(); var totalquantity = $('#txtquantity').val(); $('.number-allowed').

php - File does not exist though the path seems right -

i can't figure out why file_exists() don't find file though path seem right. here script : if($_post['delete-avatar'] == 'on') { $q = execute_query("select avatar gj_customers id_customer = '$_get[id]'"); $customer = $q->fetch_assoc(); $img_path = $_server['document_root'] . website_root . $customer['avatar']; var_dump($img_path); if(!empty($customer['avatar']) && file_exists($img_path)){ unlink($img_path); } } i'm on mamp, website in htdocs/gamejutsu/www/ , website_root contains '/gamejutsu/www/' , avatars in img/avatars/ . var_dump on $img_path returns me : /applications/mamp/htdocs/gamejutsu/www/img/avatars/sonik_avatar.jpg. if go on localhost:8888/gamejutsu/www/img/avatars/sonik_avatar.jpg image displayed. i never enter in if bloc. if remove file_exists test have warning : unlink(/applications/mamp/htdocs/gamejutsu/www/img/avatars/sonik_avatar.jpg): no such fil

sql - Access: Syntax error in JOIN operation -

i'm trying finish query below keep getting error message "syntax error in join operation". select myexternaltable1.incident_id incident_nr, first(myexternaltable1.parentitem) [company], first(myexternaltable1.loggeddate) [logged_date], first(myexternaltable1.status) [status], first(myexternaltable1.priority) [priority], first(myexternaltable1.category) [complexity], first(myexternaltable1.usergroup) [group], first(myexternaltable1.specialistid) [specialist], first(myexternaltable1.module) [category], last(myexternaltable1.actiondate) [actiondate], first(myexternaltable1.description) [description], iif([status]=""closed"" or [status]=""cancelled"" or [status]=""resolved"", datediff(""d"",logged_date,actiondate), datediff(""d"",logged_date,date())) [days_open], myexternaltable2.responseachieved [sla_status] ((myexternaltable1 in 'k:\some_folder\some_fold

javascript - Parsing though JSON-data and getting one Object -

Image
i getting simple json data structure phone numbers, fax numbers , mobile numbers in sapui5 application: { "teles": [ {"tele": "05312024040", "default": true}, {"tele": "017666254336", "default": false}, {"tele": "017666224336", "default": false} ], "faxs": [ {"fax":"053155599755", "default": true}, {"fax":"01548568745", "default": false} ], "mobils": [ {"mobil":"017655994816", "default": true}, {"mobil":"01548568745", "default": false} ] } my goal loop/parse through data structure , number default, , put model name "tele-standard", "fax-standard" or "mobil-standard". should happ

php - Fetching value into form from MySql database -

i'm trying fetch value mysql database. have form want fetch emailid mysql db. please <tr><td><b>email :</td><td><input type="text" name="txtemail" readonly value="<?php $name=$_session['usr_name']; $host="localhost"; // host name $username="root"; // mysql username $password=""; // mysql password $db_name="test"; // database name $conn=mysqli_connect($host,$username,$password) or die("cannot connect"); mysqli_select_db($conn,$db_name); $result = mysqli_query($conn,"select emailid tabledetails username='$name'"); echo $result; mysqli_close($conn); ?>"> </td> </tr> this working in local system: try code per requirement: <?php $name=$_session['usr_name'] $servername="localhost"; // host name $username="root"; // mysql username $password=""; // mysql pass

mysql - How can I check for date range exists -

Image
as may have noticed title, question quite difficult express, there problem: i have mysql table data: in registration form have specify reservation start , end times. how can check, whether there registered reservation specified time or not. example should not able put new reservation starts @ 13:20 , ends @ 15:00 etc. if either start or end of new reservation want create inside current range, reservation should blocked. using :reservationstart , :reservationend these dates, query: select * reservations :reservationstart between reservation_from , reservation_to or :reservationend between reservation_from , reservation_to or

how can i get user information using facebook sdk 4.1 in ios? -

i'm using pre-built login uibutton of version 2.3 of facebook integration. problem: getting null result, when fetching user details. -(void) loginbutton:(fbsdkloginbutton *)loginbutton didcompletewithresult:(fbsdkloginmanagerloginresult *)result error:(nserror *)error { if ([fbsdkaccesstoken currentaccesstoken]) { fbsdkgraphrequest *request =[[fbsdkgraphrequest alloc]initwithgraphpath:@"me" parameters:nil]; [request startwithcompletionhandler:^(fbsdkgraphrequestconnection *connection, id result, nserror *error) { // handle result nslog(@"%@",result); }]; fbsdkprofile *profile = [[fbsdkprofile alloc]init]; } } try code: appdelegate.m - (void)applicationdidbecomeactive:(uiapplication *)application { [fbsdkappevents activateapp]; //default fb button [[nsnotificationcenter defaultcente

Android copy database to mnt/shared -

how can copy database /data/data/my.package.name/databases/ /mnt/shared folder using java? i tried using fileoutputstream open failed: eacces (permission denied) use this: public void writetosdcard() throws ioexception { system.out.println("write sd"); file f=new file("/data/data/com.yourpackage/databases/dbname"); fileinputstream fis=null; fileoutputstream fos=null; try{ fis=new fileinputstream(f); fos=new fileoutputstream("/mnt/sdcard/dumped.db"); while(true){ int i=fis.read(); if(i!=-1){ fos.write(i); } else{ break; } } fos.flush(); } catch(exception e){ e.printstacktrace(); } finally{ try{ fos.close(); fis.close();

java - eclipse acting weird when creating methods -

Image
i don't see wrong here, working on different method had problems tried simplify check mistake ended going simple method , still have same error. when put mouse on redx @ line 6 message saying: multiple markers @ line -syntax error on token "(",;expected -syntax error on token ")",;expected` mouse @ line 7 says: void method cannot return value 2 quick fixes available change method return type 'int' change 'return;' i changed public static void public static int , changed method's modifier error @ line 6 appears everytime. don't see wrong here think i'm making mistake needs simple fix, going crazy? never had particular problem before the problem declaring method called y within main method. in java, cannot nest method declerations. you have move outside main method scope or else, declare private inner class hold y method. in short: public class gat { public static void main(string args[]) {

extjs - Set ViewModel data value from inside timeout doesn't update the View -

i need update viewmodel data inside settimeout callback function, doesn't work. looks i'm running problem similar happens when need update data value in angular outside angular , need call $scope.apply() , in extjs' way. here's code: ext.define('web.view.taskbar.clock.clockcontroller', { extend: 'ext.app.viewcontroller', alias: 'controller.taskbar-clock', init: function() { var me = this; // works var time = new date(); me.getviewmodel().data.time = time.gethours() + ':' + time.getminutes() + ':' + time.getseconds(); // doesn't work var timer = function() { settimeout(function() { var time = new date(); me.getviewmodel().data.time = time.gethours() + ':' + time.getminutes() + ':' + time.getseconds(); timer(); }, 1000); }; timer(); } }); edit:

javascript - MeteorJS: Input value in a table is displayed twice -

i have issue meteorjs regards inserting value editable table. whenever insert value , blur event handler called (doing update operation db), value in table cell displayed twice. i have code available at: https://github.com/jeffrey-effendy/sudolver thanks help! i have experienced similar contenteditable fields. think caused because value stays in cell {{value}} adds value, displaying twice. you can fix clearing cell first: template.createcell.events({ "blur .cell": function(e) { var val = $(e.currenttarget).text(); $(e.currenttarget).text(''); meteor.call("update", this._id, val); } });

css - C# Email - New lines not rendering with white-space: pre-wrap -

i have email table , 1 value contains string multiple lines. (enter-key) when viewed in outlook or view source in ie, white-space not working. any idea or solution? thanks. new lines within html not rendered such. need add <br> tags @ end of each line make sure email rendered correctly new lines. you can within c# code replacing every new line character in problematic value <br> .

html - force images in same div to overlap -

<div style='width:10px'> <a style="z-index : 1;cursor: pointer; text-decoration: underline; padding: 0px 3px 0px 0px; float: left;"> <img src='myimage.png' /> </a> <a style="z-index : 1;margin-left: 4px; padding: 0px 3px 0px 0px; float: left;" > <img src='myimage2.png' /> </a> </div> http://jsfiddle.net/n5q06r59/ with code, 2 images displayed below each other. if increase width of main div, images correctly displayed beside each other. how force elements displayed beside each other, getting rather overlapped drawn below in case of limited space? you can use display table/table-cell display beside. like: div{ display:table; } a{ display:table-cell; } and remove float:left anchor tag. check fiddle here.

java - How to take object from BlockingQueue? -

i have class x , class machine , class z , of them threads. when machine threads initialized, put on blockingqueue firstqueue . inside machines' run method there while loop checks if boolean variable should true or false. when true, machine should put on blockingqueue secondqueue secondqueue.put(this); and z class can take there. if machine thread returns false, class x can take machine firstqueue , work on it. now, question is: when boolean true, possible make machine take firstqueue ? ps.i know question might unclearly asked, don't know how form properly. if knows make better, please correct it. edit. code samples. here part class starts threads, queues initialized of course. public class machine implements runnable{ private final blockingqueue firstqueue; private final blockingqueue secondqueue; boolean broken; public machine(...){...} public void run() { while(true){ //use rand (min=0, max=1) , define if(random==1)broken=true else brok

ios - ITMS-90047 Disallowed paths ("iTunesMetadata.plist") -

Image
i getting error when trying submit xamarin application review appstore. can explain why happening , how can resolve issue? try - unzip ipa go destination folder , compress "payload" folder rename some_name.ipa upload ipa remove itunesartwork , itunesartwork@2x project (if any)

php - INSERT if not exists, else return id -

there limitations: cannot modify database columns not unique needs return last insert id ( returning id ) if exists, return existing id it called through our custom db library (the values in select parameters php (?, ?, ?, !)) insert tags (name, color, groupid) select 'test', '000000', 56 not exists ( select text tags name = 'test' , groupid = 56 ) returning id this works - until point need existing id aswell. inserted id. possible return value of select statement if doesn't insert? update: do $$ begin if not exists ( select text tags name = 'test' , groupid = 56 ) insert tags (name, color, groupid) values ('test', '000000', 56) returning id; else return select text tags name = 'test' , groupid = 56; end if; end $$ was testing kind of format - ends few errors: return cannot have parameter in function returning void you can using cte. the

php - Override a Wordpress parent theme function -

i creating child theme of flowmaster theme.i have problem override parent function. function exists in parent's theme: add_filter('loop_shop_columns', 'pt_loop_shop_columns'); function pt_loop_shop_columns(){ if ( 'layout-one-col' == pt_show_layout() ) return 4; else return 3; } i add function in child theme if ( ! function_exists( 'pt_loop_shop_columns' ) ) : function pt_loop_shop_columns(){ global $wp_query; if ( 'layout-one-col' == pt_show_layout() ) return 4; else return 4; } endif; add_filter('loop_shop_columns', 'pt_loop_shop_columns'); got error: fatal error: cannot redeclare pt_loop_shop_columns() (previously declared in c:\xampp\htdocs\futuratab\wp-content\themes\flowmaster-child\functions.php:44) in c:\xampp\htdocs\futuratab\wp-content\themes\flowmaster\woofunctions.php on line 9 please help.thanks function of child theme executed first , parent theme's.

html - Slider Transform button into arrow -

could transform button of slider 2 arrows "next - previous" ?! in case have button each slide, had use 2 button, how can transform input in next , previous?! simple js or fix problem css?! <div id="slider-wrapper"> <input type="radio" id="button-1" name="buttons" checked="checked"/> <label for="button-1"></label> <input type="radio" id="button-2" name="buttons"/> <label for="button-2"></label> <input type="radio" id="button-3" name="buttons"/> <label for="button-3"></label> <input type="radio" id="button-4" name="buttons"/> <label for="button-4"></label> <input type="radio" id="button-5" name="buttons"/> <label for="button-5"></label> &l

git rewrite history - Git Repository Only Gets Bigger After Using BFG -

we in process of migrating our svn repo git (hosted @ bitbucket). used subgit import our branches/history bare repo have locally on (windows) pc. the repo quite big (7.42 gb after import) because contains information svn revision numbers provide way have 2 way sync between git , svn (i'm interested in 1 way svn git). i create local clone of imported bare repo , push branches bitbucket. after couple of hours (!) repo uploaded. bitbucket gave me warnings repo size. checked size , 1.1gb. thats not big imported bare still big have fast repository. after playing around bfg managed remove soms large dll/sql export files using these commands on bare repo (i use clone pushing without svn-related refs): java -jar bfg.jar --delete-files '{''specialized 2015''','''specialized,''insert-pcreeks''}.sql' --no-blob-protection java -jar bfg.jar --delete-files 'incara.*.dll' --no-blob-protection incara.git git reflog expir

sql - Condition for current time greater than or equal to from time and current time less than or equal to time in ORACLE -

condition not working because using to_char(),but how extract time? following query: select * supply_timing to_char (sysdate, 'hh:mi') >= to_char (from_time, 'hh:mi') , to_char (sysdate, 'hh:mi') <= to_char (to_time, 'hh:mi') it looks interested in time not in date part. assuming data type of from_time , to_time date or timestamp can this: select * supply_timing extract(hour sysdate) + extract(minute sysdate)/60 between extract(hour from_time) + extract(minute from_time)/60 , extract(hour to_time) + extract(minute to_time)/60

c++ - How can I find out if a map contains a given value? -

i'd find out whether given value present in map. getting corresponding key(s) nice not required. bool map::contains(string value); is there simple way other iterate on whole map , comparing each value given value? why there no corresponding method in stl? std::map indexes elements key; not index them value. therefore, there no way element value without iterating on map. take @ boost.bimap : boost.bimap bidirectional maps library c++. boost.bimap can create associative containers in both types can used key. bimap<x,y> can thought of combination of std::map<x,y> , std::map<y,x> . using pretty straightforward, although of course need consider question of whether duplicate values allowed. also, see is there boost.bimap alternative in c++11?

ios - Running project doesnot show the menu after files copied to another project while using SWRevealViewController -

this second question on same topic. swipeout menu not working while using swreveal library i didn't figure out error knew when copy running project files(class files,storyboard) , paste new project.the running code doesnot run on new project while using swrevealviewcontroller library. ther need add.... p.s. bridging header created after dragged both .h , .m files of swrevealviewcontroller library the problem on new project is..no error bar button not showing menu updated: action method show menu.. if want project go above link @iboutlet weak var menubutton:uibarbuttonitem! override func viewdidload() { super.viewdidload() if self.revealviewcontroller() != nil { menubutton.target = self.revealviewcontroller() menubutton.action = "revealtoggle:" self.view.addgesturerecognizer(self.revealviewcontroller().pangesturerecognizer()) // uncomment change width of menu //self.revealvie

angularjs - how to bind click event in angular js? -

i trying make custom directive in angularjs .i able make custom directive of menu option menu option https://jqueryui.com/menu/ .but need menu option display when user click or mouseover event on button. http://codepen.io/anon/pen/ovnqmg var app = angular.module("ionicapp", ['ionic']); app.directive('custommenu', function() { return { restrict: 'a', scope: {}, link: function(scope, element, attr) { $(element).menu(); } } }); app.controller('cnt', function($scope) { $scope.showmenu = function() { // code here } }); how bind click or mouse on event custom directive ? use ngclick , ngmouseover directives respectively ngmouseover ngclick e.g. <div ng-controller="cnt"> <button ng-click="showmenu()">click menu</button> <button ng-mouseover="showmenu()">hover menu</button> </div>

openerp - Extend year range in odoo -

by default, odoo (openerp 8.0) fields.date combobox show year selection in range of +/-10 years current year. how extend it? just follow way try end from openerp.osv import fields, osv openerp import tools dateutil.relativedelta import relativedelta import datetime class myclass_nextyear(osv.model): _name='myclass.nextyear' def str_to_datetime(strdate): return datetime.datetime.strptime(strdate, tools.default_server_date_format) def compute_next_year_date(self, strdate): oneyear = datetime.timedelta(days=365) curdate = str_to_datetime(strdate) return datetime.datetime.strftime(curdate + oneyear, tools.default_server_date_format) _columns = { 'start_date': fields.date('contract start date', help='date when coverage of contract begins'), 'expiration_date': fields.date('contract expiration date', help='date when coverage of contract expirates (by defaul

linux - In C programming language, how can variable store two values? -

this question has answer here: how possible fork() return 2 values? 5 answers i've decided learn c, , here snippet 1 of books use: #include <sys/types.h> #include <unistd.h> #include <stdio.h> int main() { pid_t result = fork(); if (result == -1){ fprintf(stderr, "error\n"); return 1; } if (result == 0) printf("i'm child pid = %d\n", getpid()); else printf("i'm parent pid = %d\n", getpid()); return 0; } its output is: i'm parent pid = 5228 i'm child pid = 5229 everything's clear, how result == 0 , result != 0 @ same time? looks variable stores 2 values, because printf instruction executed twice. know, fork() returns 0 , parent's pid, how result check if returns true different conditions? because it's not s

regex - How to avoid Blank space insertion at the beginning of the String in Java while using Split() function -

here code snippet. public static void main(string...strings){ string s="google"; string[] s1=s.split(""); system.out.println(s1[0]); system.out.println(s1.length); } i'm trying split string s around each character. problem while splitting blank space getting introduced @ begining of splitted array. giving me output length 7 instead of 6. , since can't have trailing spaces split here getting passed split("", 0) , has @ beginning test printed s1[0] , giving blank space indeed. my question how avoid such problem. need use split. what happening here.? ideone link the method string.split() behaves differently in java 7 (used ideone) , java 8 (probably used of commenters , answerers). in java 8 javadoc documentation string.split() , following written: when there positive-width match @ beginning of string empty leading substring included @ beginning of resulting array. zero-width match @ be

angularjs - Can't log in/out or register, and my submitPost function stopped working -

grunt gives me no errors and under debugger "error: [$injector:unpr] unknown provider: authprovider <- auth <- user <- navctrl and "error: [$injector:unpr] unknown provider: authprovider <- auth <- user this auth service https://github.com/eibonic/angularjs-reddit/blob/master/app/scripts/services/auth.js and nav controller 'use strict'; app.controller('navctrl', function ($scope, $location, post, auth){ $scope.post = {url: 'http://', title: ''}; $scope.signedin = auth.signedin; $scope.submitpost = function () { post.create($scope.post).then(function (ref){ $scope.post = {url: 'http://', title: ''}; $location.path('/posts/' + ref.name()); }); }; $scope.logout = function () { auth.logout(); }; }); and auth controller. 'use strict'; app.controller('authctrl',

android - Why my main background wrap content instead of match parent? -

Image
i have been doing nested recyclerview lately, , post managed solve problem. why main background wrap content custom layout instead of match parent? <framelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:card_view="http://schemas.android.com/apk/res-auto" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#ffc18d" android:id="@+id/flayout"> <android.support.v7.widget.cardview android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" android:layout_marginleft="5dp" android:layout_marginright="5dp" card_view:cardelevation="2dp" card_view:cardusecompatpadding="true" card_view:cardcornerradius="3dp"> <linearlayout android:layou

angularjs - Angular-Summernote on-image-upload editor Object Undefined -

i'm struggling on figuring out how use angular-summernote callback on-image-upload. the code in view: <summernote data-editable="editable" data-on-image-upload="imageupload(files, editor)"></summernote> and imageuplaod function: $scope.imageupload = function(files, editor) { console.log(files); // filelist console.log(editor); // undefined console.log($scope.editable); // undefined }; and image not inserted editor. have tried googling implementation example on imageupload, find null. can show me how it? i struggled too. current documentation basic feature poor. anyway, how it: $scope.imageupload = function(files) { uploadeditorimage(files); }; function uploadeditorimage(files) { if (files != null) { // begin uploading image. // here i'm using ngfileupload module (named 'upload') upload files, can use $.ajax if want // remember include dependency in controller!

python - How to treat stdin like a text file -

i have program reads parses text file , analysis on it. want modify can take parameters via command line. reading file when designated stdin. the parser looks this: class fastareader : ''' class provide reading of file containing 1 or more fasta formatted sequences: object instantiation: fastareader(<file name>): object attributes: fname: initial file name methods: readfasta() : returns header , sequence strings. author: david bernick date: april 19, 2013 ''' def __init__ (self, fname): '''contructor: saves attribute fname ''' self.fname = fname def readfasta (self): ''' using filename given in init, returns each included fasta record 2 strings - header , sequence. whitespace removed, no adjustment made sequence contents. initial '>' removed header. ''' header =