Posts

Showing posts from February, 2010

Is it possible to use BCP In with named pipe in SQL Server 2008 R2? -

i have input json file want load sql server table. following below steps: 1) convert json file flat structure using jq utility. ( http://stedolan.github.io/jq/ ) 2) store output of jq flat file 3) load flat file sql table using bcp bcp database.schema.table in "\\shareddirectory\inputfilename.txt" -t -s "server" -w -t ~ -r \n is possible skip step 2) , load output of jq directly sql server table using bcp? trying run below command: jqcommand | bcp database.schema.table in -t -s "server" -w -t ~ -r \n judging can see in msdn , seems bcp accepts files inputs. for windows, there special file called con used capture stdin (similar /dev/stdin ). try using that. jqcommand | bcp database.schema.table in con -t -s "server" -w -t ~ -r \n

Changing color JavaScript doesn't work -

my problem is: have 3 elements on list, , have keep changing text color when mouse hover. so building 3 different functions, because colors different. what did is: <script type="text/javascript"> var links = document.getelementsbyclassname("menuitems"); function firsthover() { links[0].style.color = "rgb(204, 0, 0)"; /*this avoiding setinterval delay*/ setinterval(function(){ if(links[0].style.color == "rgb(204, 0, 0)") { links[0].style.color = "rgb(235, 153, 153)"; } if(links[0].style.color == "rgb(235, 153, 153)") { links[0].style.color = "rgb(204, 0, 0)"; } },1150); } </script> the problem is: changes color once. i tried use hexadecimal color too, doesn't work. please patient, still novice. the problem small logical flaw. color change, changes right away. if first if statement evaluates true , color set rgb(235,...

ruby on rails - Call before_update if an attribute is filled -

what way call before_update trigger if particular attribute filled? here part of code: before_update { self.gravatar = gravatar.downcase } validates :gravatar, :on => :update, length: { maximum: 128 }, format: { with: valid_gravatar_regex }, allow_blank: true indeed want call downcase function on attribute if 1 filled in edit form. i have following error: undefined method `downcase' nil:nilclass which logical. like ? before_update { self.gravatar = gravatar.downcase if gravatar.present? }

transactions - How to integrate Square Payment in my website? -

i want integrate square api in website payments of products. please provide solution can integrate it. i beginner in square api , searched lot of things not found way integrate it. please give me answers if knows. try looking @ https://github.com/square/connect-api-examples examples on using square apis in few languages. hope helps!

highcharts - Show tooltip in column chart when hovering crosshair line -

using highstock ("stockchart"), tooltips each bar in column chart show if hovering "crosshair line" above actual bar. see example: $('#container').highcharts('stockchart', { chart: { alignticks: false }, rangeselector: { selected: 1 }, title: { text: 'aapl stock volume' }, series: [{ type: 'column', name: 'aapl stock volume', data: data, datagrouping: { units: [[ 'week', // unit name [1] // allowed multiples ], [ 'month', [1, 2, 3, 4, 6] ]] } }] }); stockchart jsfiddle example how achieve same result using highcharts column chart? example of similar highcharts example column chart can found here: $('#conta...

ruby - Customize Rails' Default Resourceful Route Path -

tl;dr i'd change default behaviour of rails resourceful routing, move create path resources it's post /resources/new rather /resources . the setup let's presume resourceful route specified so: # routes.rb resources :events the actual routes generated are: $ rake routes prefix verb uri pattern controller#action events /events(.:format) events#index post /events(.:format) events#create new_event /events/new(.:format) events#new edit_event /events/:id/edit(.:format) events#edit event /events/:id(.:format) events#show patch /events/:id(.:format) events#update put /events/:id(.:format) events#update delete /events/:id(.:format) events#destroy n.b. create action triggered post /events path. now, if want change path, can "manually", on per-resource basis: # routes.rb # i've placed routes in order,...

How to read a config file without keys in python -

so have created config file & need read data it. the config file looks like:- [sport] cricket soccer tennis where sport section name & rest keys. i able read file without values using allow_no_value=true option. my problem need print 1st record in sport section & store in variable. my code till now:- import configparser config = configparser.configparser(allow_no_value=true) config.read('sport.ini') val1 = config.get('sport') print val1 it shows me error as:- val1 = config.get('sport') typeerror: get() takes @ least 3 arguments (2 given) kindly let me know how 1st record config file & store in variable. you have pass key also >>>print(config.get('sport', 'cricket')) none or view key value pairs >>>config.items('s') [('cricket', none), ('soccer', none), ('tennis', none)]

parse.com - Swift - Override "refreshControl" property of ParseUI -

good day! want ask if how can add custom pull refresh swift project parse, have pfquerytableviewcontroller pulltorefreshenabled set true default spinning butthole animation. want add said custom pull refresh animation. tried doing tutorial, i'm getting error cannot override mutable property 'refreshcontrol' of type 'uirefreshcontrol?' covariant type 'uirefreshcontrol' should do? thanks!

php - Default Value in a select -

this php application using pdo database binding. i'm working on edit form , have far works except drop down menu. can't seem show current value of device i'm editing. shows blank line. advice appreciated. <select name='connectedterminal' id='connectedterminal'> <option value='0'>select terminal</option> <option value='$row[connectedterminal]' selected='selected' text='$row[connectedterminal]'></option> $options_terminal; </select> use if condition <select name='connectedterminal' id='connectedterminal'> <option value='0'>select terminal</option> <option <?php if($row[connectedterminal] == '1') echo "selected " ?> value='1'>$row[connectedterminal]</option> <option <?php if($row[connectedterminal] == '2') echo "selected " ?> value='2'>$row[connectedt...

How can I change the svn diff patch number of context lines? -

what i'm looking is: using svn diff , how print more lines above , below new code being added? by default print lines unchanged (both below/above new code changed). is there way it? if on linux, tell diff tool how many lines include result, example 10: svn diff --diff-cmd=diff -x -u10

c++ - Microsoft IDL, Change attributes on an interface -

some time ago prepared idl file define interface plugins of vb6 application. reviewing code found there interface looks this: [ odl, uuid(<some guid>), version(1.0), nonextensible, oleautomation ] interface iplugin : iunknown { hresult dosomething(); } this interface used in vb6 , c++ components (dlls) expose main plugin class, exe refers typelibrary keep reference of plugin classes. what remove odl , version , nonextensible because not required, , add object attribute correctly define com interface. now entire system in production, can change attributes on interface? can without compatibility issues? thank you

android - Image view in grid view is scrolled partially when we do scroll on grid view -

i have gridview 2 columns. users can scroll vertically see gridview items. the problem when user has finished scrolling, first row not visible. want set top of first visible row top of gridview first row visible. can me? can try this. tried listview in project mgridview.setonscrolllistener(new onscrolllistener() { private int currentfirstvisibleitem; private int currentvisibleitemcount; private int currentscrollstate; public void onscroll(abslistview view, int firstvisibleitem, int visibleitemcount, int totalitemcount) { this.currentfirstvisibleitem = firstvisibleitem; this.currentvisibleitemcount = visibleitemcount; } public void onscrollstatechanged(abslistview view, int scrollstate) { this.currentscrollstate = scrollstate; this.isscrollcompleted(); } private void isscrollcompleted() { ...

qt - How to change the caption of a button in a QDialogButtonBox? -

i have added qdialogbuttonbox button default cancel , ok buttons. is there way change caption of these buttons? example, ok should become run . you have slight coding in cpp file: ui->buttonbox->button(qdialogbuttonbox::ok)->settext("run"); ui->buttonbox->button(qdialogbuttonbox::cancel)->settext("exit"); note may need include qpushbutton header: #include <qpushbutton> update: did not notice pyqt tag. i'm not familiar python (and pyqt in particular), think should job: self.ui.buttonbox.button(qdialogbuttonbox.ok).settext("run") self.ui.buttonbox.button(qdialogbuttonbox.cancel).settext("cancel") also, pointed out kuba ober, changing text of standard buttons not best approach. correct way add custom buttons appropriate role. self.ui.buttonbox.addbutton("run", qdialogbuttonbox.actionrole)

elasticsearch - function score groovy script not returning any result -

my query { "query": { "function_score": { "functions": [{ "script_score": { "lang": "groovy", "script_file": "category-score", "params": { "my_modifier": "doc['category'].value" } } }, { "script_score": { "lang": "groovy", "script_file": "popularity-score", "params": { "my_modifier": "doc['popularity'].value" } } }, { "script_score": { "lang": "groovy", "script_file": "type-score", "params": { "my_modifier": "do...

ios - Two class access each other by importing their head file(via #import ) causes error -

two class access each other importing head file(via #import ) causes error? i have been suggested use @class classname in header file if needing access other classes . i've got principle of why should this. there small sample below, triggers errors like" unknown type name ‘xxxclass’”. mean “#import” doesn’t copy code here ? if not so, why unable detect ‘xxxclass’ i think not cycle retain problem, principle of error ? ============================ person =============================== person.h #import <foundation/foundation.h> #import "dog.h" //@class dog; @interface person : nsobject @property (nonatomic, strong) dog *dog; //error :unknown type name ‘dog' @end person.m #import "person.h" @implementation person - (void)dealloc{ nslog(@"person--dealloc");} @end ============================ dog =============================== dog.h #import <foundation/foundation.h> #import "person.h...

Use C# HttpWebRequest to send json data to web service -

i trying send http request of json data web service. directed web service data null... here web service: public bool checkuserexist ([frombody] string email) { list<user> all_users = repo.getusers(); var match = all_users.find(i => i.email == email); if (match == null) { return false; } else { return true; } } and here http request: var webaddr = "http://localhost:59305/api/user/checkuserexist"; var httpwebrequest = (httpwebrequest)webrequest.create(webaddr); httpwebrequest.contenttype = "application/json; charset=utf-8"; httpwebrequest.method = "post"; using (var streamwriter = new streamwriter(httpwebrequest.getrequeststream())) { string json = "{\"email\":\"email\"}"; streamwriter.write(json); streamwriter.flush(); } v...

google chrome - How to rename(branding) browser built on Android Chromium source code? -

i need build custom browser based on android chromium custom product name. found config files(src/chrome/app/theme/chromium/branding) , changed product_fullname. have built apk commands src$ gclient sync src$ ninja -c out/release chrome_public_apk in console. build completes without errors. after installation on target device, saw default product name. configurations in src/build/common.gypi: 'branding%' : 'chromium' 'buildtype%' : 'dev' 'component%' : 'static_library' chromium.gyp_env: { 'gyp_defines': 'os=android' } what wrong? how rebrand chromium?

deployment - javax.security.auth.login.LoginException: unable to find LoginModule class: org.jboss.security.ClientLoginModule -

its been more 3 days couldn't figure out wrong jenkins. i have jenkins job, pull source bitbucket , build , deploy in jboss 5.1 . but @ time of deployment getting bellow exception tried multiple solution getting same annoying error. stack-trace [info] build success [info] ------------------------------------------------------------------------ [info] total time: 2.534 s [info] finished at: 2015-07-08t03:19:04+05:30 [info] final memory: 13m/176m [info] ------------------------------------------------------------------------ [jenkins] archiving /var/lib/jenkins/jobs/springhelloworld/workspace/pom.xml com.programcreek/helloworld/0.0.1-snapshot/helloworld-0.0.1-snapshot.pom [jenkins] archiving /var/lib/jenkins/jobs/springhelloworld/workspace/target/helloworld.war com.programcreek/helloworld/0.0.1-snapshot/helloworld-0.0.1-snapshot.war channel stopped deploying /var/lib/jenkins/jobs/springhelloworld/workspace/target/helloworld.war container jboss 5.x remote ...

asp.net mvc - How to grouping for the following structure in MVC5? -

here table : **name childid parentid** root 1 0 child1 2 1 child2 3 1 child3 4 2 child4 5 1 child5 6 2 but want format : **name childid parentid** root 1 0 child1 2 1 child2 5 2 child5 6 2 child2 3 1 child4 4 1 simply asking how parent related child down?? give me mvc5 controller code that. use orderby , sorting not working ? give me structure using foreach.

How can I control the key with IzPack class? -

i'm trying control product key izpack. did regularexpressionclass but, should write own class control lots of key. use below, can not same thing class. <userinput> <panel id="keycontrol"> <field type="rule" align="left" variable="the.password"> <spec txt="the key:" layout=" o:6:6 "/> <validator class="com.j32bit.installer.validator.regularexpressionvalidator" txt="wrong key!!" id="lang pack key error text"> <param name="pattern" value="asd"/> </validator> </field> </panel> </userinput> i hope, explanation understandable. help. you can change message overriding geterrormessageid method validator class: @override public string geterrormessageid() { return "your.error.message"; } where your.error.messag...

WSO2 Identity server super tenant role -

i interested in using wso identity server platform module part of tenant based saas platform. looking @ docs wso identity server module seems have 2 logical tiers of users: 'super tenant' user tier sys admin stuff, , 'tenant' level users. for our platform design have concept of 'tenant groups'. 'tenant group' logical grouping of tenants. for, example 'tenant group' 'acme' logical grouping of tenants 'acme uk', 'acme usa', , 'acme japan'. for model want third 'tenant group' tier of users -a hybrid of 'super tenant' user 'tenant group' user have sys admin rights on tenants in group. is possible adapt wso functionality deliver this? if so, how? currently wso2 provides multi tenancy feature. super tenant has management permission of tenants. meantime can create roles depends on permission particular tenant. can have different roles cater requirement. please read this ...

java - Maven TestNG execution runs in ghost mode even after terminting the program -

i using maven + testng combination execute selenium tests. in case terminate mvn run in-between, still testng execution continues execution. noticed testng execution happening in new java process. once killed process task manager, ghost execution stops. please let me know, how kill testng process automatically in case termination of maven process eclipse. creates bigger problem on running suite jenkins , cancelling job in middle. got it... should use forkmode=never in pom.xml ( https://issues.apache.org/jira/browse/surefire-524 )

sql - Data is converting into some weird data in asp.net -

i uploading excel database creating type in database , inserting data table. for example: create type [dbo].[temp_tbl_vendor] table([vendorcode] [varchar](10) null, [billdt] [varchar](12) null ) create proc myproc_bulkinsert (@venid int, @temptable temp_tbl_vendor readonly) begin insert mynewtab select *from temp_tbl_vendor end everything working fine problem excel data 20150702 changing 2.01507e002 . there couple of issues in design. never store date string in database. date date , should stored in datetime field. change temp_tbl_vendor to: create type [dbo].[temp_tbl_vendor] table([vendorcode] [varchar](10) null, [billdt] datetime null ) change corresponding column in mynewtab datetime field you need convert spreadsheet column date type and/or more importantly read date field before inserting temp_tbl_vendor .

Google Compute Engine: Internal DNS server and issues with the resolving -

since google compute engine not provides internal dns created 2 centos bind machines resolving machines on gce , forward resolvings on vpn private cloud , vice versa. as google cloud docs suggests can have kind of scenario. , edit resolv.conf on each instance resolving. what did edit ifcg-eth0 disable peerdns , in /etc/resolv.conf added search domain , top 2 nameservrs instances. now after 1 instance gets rebooted..it wont start again because searching metadata.google.internal domain jul 8 10:17:14 instance-1 google: waiting metadata server, attempt 412 what best practice in kind of scenarios? ty also need internal dns poor's man round-robin failover, since gce not provides internal balancers. as mentioned @ https://cloud.google.com/compute/docs/networking : each instance's metadata server acts dns server. stores dns entries network ip addresses in local network , calls google's public dns server entries outside network. cannot configure dns...

java - What is the purpose of this thread -

what purpose of thisthread created after gui components initialised? first few lines typical boiler plate code when new gui started, i'm struggling understand why thread started. found in open source project, , i'm wondering why this. public static void main( string args[] ) { java.awt.eventqueue.invokelater( new runnable() { public void run(){ // initialises gui components new schemaregistrationvisualizer(); final thread thisthread = new thread( new runnable(){ public void run(){ long starttime = system.currenttimemillis(); while( system.currenttimemillis() - starttime < math.pow( 10, 5 ) ); system.exit( 0 ); } }); thisthread.setpriority( thread.max_priority ); thisthread.start(); } }); } well, creates busy loop makes 1 of cpu cores of machine go 100% 100 seconds, , exits jvm. ...

How to the replace node names with new name and keep the attributes using C# and Linq to XML? -

i need change <test language="english" id="0" /> to <exam language="english" id="0" /> how replace node names new name , keep attributes ? you can use name property var xdoc = xdocument.load("input.xml"); var nodes=xdoc.descendants("test").tolist();//get "test" node nodes.foreach(d => d.name = "exam "); // set name 'exam' xdoc.save("output.xml");

Choose my own points instead of corner points in implementing optical flow in opencv python -

the current algorithm uses goodfeaturestotrack select corner points want choose own points. secondly, want save data pixels has point moved to. how go solving these 2 problems? code using :- import numpy np import cv2 cap = cv2.videocapture('output.avi') # params shitomasi corner detection # throw every other corners below quality level. sort rest in descending order. pick greatest, throw rest in min , pick n greatest feature_params = dict( maxcorners = 1, # how many pts. locate qualitylevel = 0.3, # b/w 0 & 1, min. quality below rejected mindistance = 7, # min eucledian distance b/w corners detected blocksize = 7 ) # # parameters lucas kanade optical flow lk_params = dict( winsize = (15,15), # size of search window @ each pyramid level maxlevel = 2, # 0, pyramids not used (single level), if set 1, 2 levels used, , on criteria = (cv2.te...

android - Change NumberPicker TextSize -

how set text size of center selected value of number picker ? , when scrolled size of center number should greater others. i have tried using following code : public static boolean setnumberpickertextcolor(numberpicker numberpicker, int color) { final int count = numberpicker.getchildcount(); (int = 0; < count; i++) { view child = numberpicker.getchildat(i); if (child instanceof edittext) { try { field selectorwheelpaintfield = numberpicker.getclass() .getdeclaredfield("mselectorwheelpaint"); selectorwheelpaintfield.setaccessible(true); ((paint) selectorwheelpaintfield.get(numberpicker)).setcolor(color); ((edittext) child).settextcolor(color); ((edittext) child).settextsize(48); numberpicker.invalidate(); return true; } catch (no...

file - Proper way to declare and use structures in C project? -

i building project trying organize follows: main.c globals.h structures.h functionset1.c, functionset1.h functionset2.c, functionset2.h etc. i thought define structure type in structures.h: struct type_struct1 {int a,b;}; // define type 'struct type_struct1' then declare function1() returning structure of type type_struct1 in functionset1.h: #include "structures.h" struct type_struct1 function1(); // declare function1() returns type 'struct type_struct1' then write function1() in functionset1.c: #include "functionset1.h" struct type_struct1 function1() { struct type_struct1 struct1; // declare struct1 type 'struct type_struct1' struct1.a=1; struct1.b=2; return struct1; } edit: corrected code above, compiler returns 306 'struct' tag redefined 'type_struct1' structures.h is file set practice ? practice manage structures ? your general structure looks good. 1 thing need do, zenith ment...

ios - tesseract - Trained Data for Codes -

i implementing ios application uses tesseract. right now, searching trained data set recognizes codes following: vte-61243, 299246, 4906-292342, w832284 any suggestions trained data set purpose? best regards the font important results, need train yourself.and can use whitelist recognize a-z letters, "-" , "," symbols ,and numbers.

How to disable Heads Up notifications on Android Lollipop -

how disable new headsup notifications on android l. app works app blocker , must not allow access blacklisted apps. eg. if call app blocked user must not able access caller app. but, whenever incoming call received, shows heads notification on screen. whenever such app accessed clicking headsup notification app gets blocked in call case call can received/rejected. can block such notifications in android.

vowpalwabbit - Vowpal Wabbit Readable Model Doesnt Have weights -

i wanted lasso regression vowpal wabbit. so, used command line vw --save_resume --readable_model ob/e/nsefut/vw_testing/buymodel.vwm -d ob/e/nsefut/vw_testing/vwsell.vwf --quiet --predictions ob/e/nsefut/vw_testing/predict.vw --loss_function logistic --noconstant --l1 0.001 the readable file shows no weights of features used. when skip param --l1 shows weights properly.plus when dont give --l1 param, came weights this.. 1:-0.437898 994842.000000 1.000000 33340:-0.176359 201942.265625 1.006310 59044:-0.152967 201843.875000 1.002754 63438:-0.187405 202149.140625 1.015530 124204:-0.159398 201741.187500 1.002742 166130:-0.185312 201754.421875 1.013330 which suggest weights negative. features +ve valued. hence linear combination of features negative observation resulting prediction -ve observation. seeing both +ve , -ve predicted label. three questions whether command line correct lasso regression. what enable me see weights. what making me not understand negative ...

localhost - Connecting MS SQL server 2012 -

i'm using ms sql server 2012 on homeserver. can connect server using localhost not isp ip adress if i'm @ home. how can local connect sql using isp ip adres when i'm @ home. can please me? if you're trying connect via public address (the ip of isp), need ensure have inbound connection through router opened on port 1433 sql answering on. q: sure want expose sql directly public connection that? open hacking , exploits.

ruby on rails - How can i select value of static select_tag on my controller -

this _form.html.erb <%= simple_form_for @guest_server, :html => { :class => 'form-horizontal' } |f| %> <%= f.input :current_uid %> <%= label_tag 'sippeer type' %> <%= select_tag "sippeer_type", options_for_select([ "conference", "trunk" ]) %> <%= f.input :sippeer_template_id %> <div class="form-actions"> <%= f.button :submit, :class => 'btn-primary' %> <%= link_to t('.cancel', :default => t("helpers.links.cancel")), guest_servers_path, :class => 'btn' %> </div> <% end %> this controller want value of sippeer_type def create @guest_server = guestserver.new(guest_server_params) if guest_server_params[:sippeer_type] == 'conference' @guest_server.set_confbridge_sippeer else @guest_server.set_sippeer end end use params[:sippeer_type] value. it's ...

javascript - Unexpected Token Illegal (This isn't a inverted comma issue, its something else) -

i wrote syntax after defining variables , fine. while (v.hasnext()) { rs = v.next(); var c = db.ufcards_click_tracking.find({ "cardid": rs.cardid }).count(); }; but when added condition query, kept returning error. while (v.hasnext()) { rs = v.next(); var c = db.ufcards_click_tracking.find({ "cardid": rs.cardid, "cardclickedtime": { "$gte": new date(2015-06-25t00:00:00.000z) } }).count(); }; i'm going crazy! me. you need wrap parameter of date() in quotes: "$gte": new date("2015-06-25t00:00:00.000z") note following in documentation. datestring : string value representing date. string should in format recognized date.parse() method (ietf-compliant rfc 2822 timestamps , version of iso8601).

python - Fish shell script : getting a precise random number -

basically, want greeting message (fish_greeting.fish) display either 1 ascii art or other (a cat or squid). so, need pick random integer. random function in fish doesn't seem take parameters (i.e random(1,4)). made in python, don't know how call fish script. any idea? fish shell wonderful shell, sadly no documented compared bash (which don't like) , zsh (awesome, not fish) you can use math arithmetic. example: if [ (math (random)'%2') -eq 1 ] squid else cat end

amazon web services - How to install audiowaveform program on AWS Elastic Beanstalk -

just fyi ... context here aws elastic beanstalk . i'm trying install audiowaveform program on 64bit amazon linux 2015.03 v1.4.3 (the customer ami id ami-6b50291c ). running ... 👇 $ sudo yum install git cmake libmad-devel libsndfile-devel gd-devel boost-devel ... installs packages except libmad-devel , libsndfile-devel . below relevant output ... failed set locale, defaulting c loaded plugins: priorities, update-motd, upgrade-helper amzn-main/2015.03 | 2.1 kb 00:00 amzn-updates/2015.03 | 2.3 kb 00:00 package git-2.1.0-1.38.amzn1.x86_64 installed , latest version package cmake-2.8.12-2.20.amzn1.x86_64 installed , latest version no package libmad-devel available. no package libsndfile-devel available. package gd-devel-2.0.35-11.10.amzn1.x86_64 installed , latest version package boost-devel-1.53.0-14.21.amzn1.x86_64 installed , latest version nothing...

java - Why is it said interface support multiple inheritance when the interface is completely abstract? -

i mean not inheriting interface. in concrete class define methods suppose do. interfaces allow multiple "inheritance" of behavior . java not support multiple inheritance of state . interface not have state. you can implement 1 or more interfaces (implement multiple behaviors) extend 1 class, abstract or not (inherit state 1 other class). therefore java has "limited" support multiple inheritance, it's not multiple inheritance canonically defined.

html - Please explain the following behavior -

i have given position parent relative , child absolute, child element(icon) not fitted in given parent, going out of parent. can 1 please explain behavior? that icon should in right of text , top. if below breakpoint {@media (min-width:320px) , (max-width:640px)} text should in left , icon should next text. if text goes in 2 line icon should again in top right. please me. <div id="main"> <div class="left"> <div class="leftwrapper"> <span>*</span> <span>hello label may 2 line</span> <div class="lefticon"><img src="https://wiki.jenkins-ci.org/download/attachments/42469250/info.gif?version=1&modificationdate=1264477127000"/></div> </div> </div> <div class="right"> <input type="text" /> </div> </div> css * { box-s...

android - onCreateView() called from where and when and what is its parameters when called? -

lets assume have 2 activity 1: mainactivity (we call a ) 2: fragmetnactivity ( b ) a in layout had framelayout hold b based on this guid when a in oncreate() first 4 method of b called respectively, yes??? called one-by-one a or no a call first method , rest execute respectively??? and oncreateview() parameters, know had 3 parameters ( here ): public view oncreateview (layoutinflater inflater, viewgroup container, bundle savedinstancestate) i want second parameters (viewgroup container) when method called caller in example??? don't call manually. oncreateview part of fragment's lifecycle , calling , timing android. i want second parameters (viewgroup container) when method is container host fragment. provide through transaction in add / replace methods

ubuntu - Android 5.1 build/envsetup.sh? -

when code android5.1 company customization android code kiled , said:build/envsetup.sh: line 1469: 30649 killed , change code on other branch still killed, change jdk 1.7 , down gcc @ 4.4 still doesn't work, use ubuntu 12.04 , log message below, if can me, thank you! log target c++: v8_tools_gyp_v8_base_gyp <= external/chromium_org/v8/src/hydrogen-mark-deoptimize.cc preparing staticlib: libc_common [including out/target/product/elink8735_ftb_l/obj/static_libraries/libjemalloc_intermediates/libjemalloc.a] preparing staticlib: libc_common_32 [including out/target/product/elink8735_ftb_l/obj_arm/static_libraries/libc_tzcode_intermediates/libc_tzcode.a] build/envsetup.sh: line 1469: 30649 killed make -j24 #### make failed build targets (23:48 (mm:ss)) #### install include/asm (33 files) in file included /home/lwf/lo35/1work-cfzz1-w801/alps/external/stlport/stlport/stl/_algo.h:737:0, /home/lwf/lo35/1work-cfzz1-w801/alps/external/stlp...

python : How to return from function in sub if statment? -

i have following code: def func(self,e): if x>0: dlg = wx.messagedialog(parent, "are sure?", 'warning!', wx.ok | wx.cancel| wx.icon_warning) result=dlg.showmodal() dlg.destroy() if result== wx.cancel: return win = frmpop(parent,data) my question on: if result== wx.cancel: return this if statement sub statement of if x>0 intended return out of func1 instead doesn't , frmpop being called. looks return statement existing if x>0 . there way change if result== wx.cancel exit func ? know can flags. something like: flag=0 ... if result== wx.cancel: flag=1 if flag==0: win = frmpop(parent,data) but i'm wondering if there more pythonic / stylish way that. tried break , continue have no loop here wont accept them. wx.cancel not returned showmodal() : shows dialog, returning 1 of id_ok, id_cancel, id_yes, id_no or id_help. so, need result == wx...

java - Hibernate @ManyToOne violates foreign key constraint -

i have person class contains object title. public class person { public person(){ titleid=new title(); } @id @generatedvalue(strategy = generationtype.auto) private longid; @manytoone(cascade = {cascadetype.all}, fetch = fetchtype.eager,targetentity=title.class) @joincolumn(name = "titleid", referencedcolumnname = "titleid",columndefinition="int",nullable=false) private title title; ... ... } @entity public class title { @generated(generationtime.insert) @column(columndefinition = "serial") private int titleid; @id private string title; } when try insert person object below detail. person p=new person(); title t=new title(); t.settitle("mr."); p.setname("abc"); p.settitle(t); sessionfactory.getcurrentsession().saveorupdate(p); it's working fine , inserting title , person but when try insert person same title, fails person p=new person(); title t=new title(); t.settitle("mr.")...

android - AnimationDrawable: Right way to free memory -

what right way free memory when using animationdrawable ? right using: for (int framecounter = 0; framecounter < animation.getnumberofframes(); ++framecounter) { drawable frame = animation.getframe(framecounter); if (frame instanceof bitmapdrawable) { bitmapdrawable castedframe = (bitmapdrawable) frame; bitmap bitmap = castedframe.getbitmap(); if (bitmap != null && !bitmap.isrecycled()) bitmap.recycle(); } frame.setcallback(null); } animation.setcallback(null); where animation animationdrawable. problem is, when go same activity (and animation displayed again), exception thrown: java.lang.runtimeexception: canvas: trying use recycled bitmap android.graphics.bitmap@2ee1a817 @ android.graphics.canvas.throwifcannotdraw(canvas.java:1225) @ android.view.gles20canvas.drawbitmap(gles20canvas.java:600) @ android.graphics.drawable.bitmapdrawable.draw(bitmapdrawable.java:544) @ android.graphics.drawable.draw...

sails.js - including toMany list of IDS in REST response from sailsjs -

i have sails model ("folders"): module.exports = attributes: { name: type: 'string' parent: model: 'folder' folders: collection: 'folder' via: 'parent' when retrieve via rest api, want response looks like: [ { name: 'foo', parent: 34, folders: [292, 358] } ] however, sails leaves out "folders" attribute. what simplest way tomany included (this 1 example -- there more tomany's, otoh don't want them included -- should configurable per-relation)? it seems "tomany" associations suppressed default "tojson" method sails provides. to override, in object definition, inside of objects, override tojson: _ = require 'lodash' attributes: { ... tojson: ()-> return _.extend {}, this use defaults provided "json.stringify", , "tomany" relationships sent lists of ids (if adapter has returned model).

ios - Populating UICollectionView in reverse order -

i populate uicollectionview in reverse order last item of uicollectionview fills first , second last , on. i'm applying animation , items showing 1 one. therefore, want last item show first. i'm assuming using uicollectionviewflawlayout, , doesn't have logic that, works in top-left bottom-right order. have build own layout, can creating new object inherits uicollectionviewlayout. it seems lot of work not much, have implement 4 methods, , since layout bottom-up should easy know frames of each cell. check apple tutorial here: https://developer.apple.com/library/prerelease/ios/documentation/windowsviews/conceptual/collectionviewpgforios/creatingcustomlayouts/creatingcustomlayouts.html

r - set dimnames of an xts object with the names of certain elements in a list through loop -

my question part of function coding. i've got list of data.frames (each own numeric , date columns) have either weekly data or monthly data. i've defined 2 empty objects "weekly" , "monthly" loop have written goes through , finds out element weekly or monthly. then, loop categorises each element weekly/monthly , converts them xts object. library(xts) weekly = null monthly = null (i in 1:length(terms.list)) { diff.days <- difftime(as.date(terms.list[[i]][2,1]), as.date(terms.list[[i]][1,1])) if (diff.days < 10) { freq <- 52 weekly = cbind(weekly, xts(terms.list[[i]][,2], order.by=terms.list[[i]][[1]], frequency=freq)) } else { freq <- 12 monthly = cbind(monthly, xts(terms.list[[i]][,2], order.by=terms.list[[i]][[1]], frequency=freq)) }} so end 2 xts objects i.e. weekly , monthly. want include in loop line of code picks out colnames of weekly defined terms (and monthly defined terms) , set dimnames of each type of xts object ...

excel - Rename multiple computers -

using netdom command i've changed host name on systems. netdom renamecomputer oldname /newname:newname /userd:domain\domainid /passwordd:* /force as need change name of hundred of systems. i've added excel/csv file have 2 columns 'oldname' , 'newname' respectively. i have tried create function calls above mentioned command line arguments(from each row in excel/csv file). powershell code function renameandreboot([string]$computer, [string]$newname) { $comp = gwmi win32_computersystem -computer $computer $os = gwmi win32_operatingsystem -computer $computer $comp.rename($newname) $os.reboot() } import-csv mylist.csv foreach ($entry in $list) { renameandreboot($entry.oldname,$entry.newname) } i need have same functionality in batch script. basically want know how import excel in batch file , execute each row. can me out in this. you can use for loop on lines of csv file , parse them deli...

crash - How to intentionally cause a fatal error in PHP script? -

i want script stop being executed @ point of crash, while not exhaust memory or otherwise crash server. any idea how that? i believe you're looking for: trigger_error("oops!", e_user_error); docs: http://php.net/manual/en/function.trigger-error.php e_user_error pretty equal e_error, fatal runtime error .

Keyboard type only English (instead Hebrew) -

i have issue keyboard: press alt+shift, again , again; left-side of keyboard (below 'caps-lock') , th right-side of keyboard (below backspace , enter buttons); nothing helps!!! typing english, instead hebrew... do have solution problem? if use windows, go control panel-region , language/language in windows 8.1 setting , add language. hope helps you.

vba - Excel Macro sending through Thunderbird -

i wondering if knew how build macro in excel send spreadsheet through thunderbird. example option explicit sub thunderbird() dim scmd string '// prepare thunderbird dim sto string '// recipient dim ssubject string '// subject dim sbody string '// email body sto = "test@email.com" ssubject = "subject" sbody = "body text" scmd = "c:\program files\mozilla thunderbird\thunderbird" '// or 'scmd = "c:\program files (x86)\mozilla thunderbird\thunderbird" '// path scmd = scmd & " -compose " & chr$(34) & "mailto:" & sto & "?" '// chr$(34)=double quote scmd = scmd & "subject=" & chr$(34) & ssubject & chr$(34) scmd = scmd & sbody call shell(scmd, vbnormalfocus) end sub

windows - how to install bower globally? -

tried install bower in directory wont let me. followed guideline: bower command not found windows . so in command line did: npm config prefix then did in directory: npm install bower. any ideas how bower working globally? to install bower globally run: npm install bower -g . might need run in administrator mode install globally

php - get table information using feching table in mysql stored procedure -

help.... i have 2 tables, customers id | registration_code | full_name 1 | a01 | abc 2 | b01 | bcd 3 | c01 | cde 4 | d01 | def history_transaction id | customer_id | transaction_date 1 | 1 | 2015-01-01 2 | 2 | 2015-01-01 3 | 3 | 2015-01-01 4 | 1 | 2015-01-02 5 | 3 | 2015-01-02 6 | 1 | 2015-01-03 i use php, , want customer list , transaction times between 2015-01-01 till 2015-01-03 the result should id | registration_code | full_name | n_trans 1 | a01 | abc | 3 2 | b01 | bcd | 1 3 | c01 | cde | 2 please help. want use store procedure on mysql, , dont want loop in php. to info use group statement: select a.id,a.registration_code,a.full_name, count(*) n_trans customers inner join history_transaction b on a.id=b.customer_id b.transaction_date between "{start_date}...

How to "append" a value with jQuery instead of replace it completely? -

the way understand val works when $(".foo").val("x") you literally replace value input. in jquery 2.x support "append" function instead? found unit/integration scenario let me reproduce real ... except val replaces input's value instead of "just adding single char" end user would. access callback function of .val( cb ) , return current value concatenated string of choice: $(".foo").val(function(i, currval) { return currval + "whatever"; }); <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <input class="foo" tyle="text" value="a-"> <!-- a-whatever --> <input class="foo" tyle="text" value="b-"> <!-- b-whatever --> if want jquery method .valappend() can create one: $.fn.valappend = function( str ) { return this.val( this[0...

More concise way of checking if a character is equal to a set of given characters in Python? -

is there cleaner way can write function? kind of thing in python function in standard library, or fancy syntactical feature? def is_separator(char): x = ['(', '\'', ')', '{', '}', '[', ']'] c in x: if char == c: return true return false i considered using dictionary, imagine theres better way? tried doing char in "(\){}[]" returns false. far above best attempt. you can rid of for loop , do: return char in x

Can't access control in footer of ASP.Net Gridview -

by company mandate. have gridview footertemplate, , in template have textbox. when go access in code behind, it's coming not found. kind of scope issue? shouldn't code behind have access fields in gridview? <footertemplate> <asp:textbox name="txtid" controlid="cntid" width="20" runat="server"></asp:textbox> </footertemplate> . insert.parameters.addwithvalue("@id", txtid not found ..... when nest 1 control inside another, it's best use parent control's findcontrol() method. also, need give control id attribute, not name. <footertemplate> <asp:textbox id="txtid" controlid="cntid" width="20" runat="server"></asp:textbox> </footertemplate> . insert.parameters.add("@id", sqldbtype.nvarchar, 50).value = gridview1.footerrow.findcontrol("txtid").text and if you're curious, here...

javascript - How to make phantomjs remember a login session? -

i using phantomjs test website. however, when login website, have enter captcha string. try render page, enter captcha console , pass captcha field, page reloads again , string not match captcha anymore. guess it's session problem. so want know if there way can login page on browser (firefox or chrome...) , when phantomjs program opens page, lead main page, not login page. or there better solution?

big o - What is the time complexity of mmap in Linux? -

in big o notation guess , respect size of memory requested. also, can assume memory not committed lazily because makes things complicated. to precise call mmap(0, n, prot_read | prot_write, map_private | map_anonymous, -1, 0) n variable. in reference state that, map_anonymous initialize region zeros. i believe process o(n) complexity, possibly more efficient : on systems using private anonymous mmaps more efficient using malloc large blocks. not issue gnu c library, included malloc automatically uses mmap appropriate.

c# - Run TestFixtures in Order with NUnit -

i need have ordered test fixtures in nunit c# application. have example on how run ordered test methods this page , , i've tried implement same logic test fixtures same methods provided in example application. in our application test fixture separated each class , each test fixture has 1 test method. our latest attempt use parent test fixture inherits class called: orderedtestfixture (the same in example), has following method: public ienumerable<nunit.framework.testcasedata> testsource { { var assembly = assembly.getexecutingassembly(); foreach (var order in methods.keys.orderby(x => x)) { foreach (var methodinfo in methods[order]) { methodinfo info = methodinfo; yield return new nunit.framework.testcasedata( new teststructure { test = () => { object classinstan...

How do I replicate items from a list in Clojure? -

i've tried many nights i've given on myself. seems extremely simple problem, guess i'm not understanding clojure should (i partially attribute sole experience imperative languages). problem hackerrank.com here problem: problem statement given list repeat each element of list n times. input , output portions handled automatically grader. input format first line has integer s s number of times need repeat elements. after there x lines, each containing integer. these x elements of array. output format repeat each element of original list s times. have return list/vector/array of s*x integers. relative positions of values should same original list provided input. constraints 0<=x<=10 1<=s<=100 so, given: 2 1 2 3 output: 1 1 2 2 3 3 i've tried: (fn list-replicate [num list] (println (reduce (fn [element seq] (dotimes [n num] (conj seq element))) [] list)) ) but gives me exception. i've ...