Posts

Showing posts from March, 2010

java - Percentage app for teachers not working in Android Studio -

i trying make application teacher (my mom) calculate grade letter , percent amount wrong of number possible. application crashes after press button on first screen. wondering if me. import android.content.context; import android.media.mediaplayer; import android.support.v7.app.appcompatactivity; import android.os.bundle; import android.view.view; import android.widget.button; import android.widget.edittext; import android.widget.textview; public class mainactivity extends appcompatactivity{ int maxint; private button button; private edittext etmax; private textview tv1; private textview tv2; private textview tv3; private textview tv4; private textview tv5; private textview tv6; private textview tv7; private textview tv8; private textview tv9; private textview tv10; private textview tv11; private textview tv12; private textview tv13; private textview tv14; private textview tv15; private textview tv16; private textview tv17; private textview tv18; private textview tv19; pri...

python - Sorting through list and storing distinct values -

so i'm using pandas read data looks this: 0 overcast 1 overcast 2 overcast 3 overcast 4 rainy 5 rainy 6 rainy 7 rainy 8 rainy 9 sunny 10 sunny 11 sunny 12 sunny 13 sunny and wish store overcast (first entry) variable, , iterate through list until there contrasting variable, , store 1 also. should assign other contrasting variables along way until until end of list. i'm having hard time figuring out best way or maybe there in pandas me i'm missing? edit: want start @ position [0,0] 'overcast' , make variable a , run down list until hits 'rainy' point stores in b , 'sunny' c , etc. want understand how make robust no matter amount of labels, it'll store it. not hilbert's hotel big couple hundred. pandas offers unique() method identify distinct values of column. can transpose row. >>> df2 = pd.dataframe(df.unique()).t # t = transpose() ...

Integrate e-commerce side of drupal? With live chat? How? -

i'm design software , all, client insisted use drupal website.. they want e-commerce , live chat option...completely lost? do, , how do it. thanks! currently used e-commerce solution drupal "drupal commerce" may start here: https://www.drupal.org/project/commerce but if new in drupal world...hmm...it' won't easy. luck!

javascript - Removing html tags and content where tag content matches an array of values using Xml.parse() -

i've extracted html gmailapp using .getbody() , return html filters specific tag , contents contents matches value in array (specifically links text). looking @ this solution figure easiest way use xml.parse() , filter object can't beyond creating xmldocument. for example, if: var html = '<div>some text <div><a href="http://example1.com">foo</a></div> , <span>some <a href="http://example2.com">baa</a>,and <a href="http://example3.com">close</a></span></div>'; and var linkstoremove = ['baa','foo']; how return var newhtml = '<div>some text <div></div> , <span>some ,and <a href="http://example3.com">close</a></span></div>'; using var obj = xml.parse(html, true); i can object process falls apart there (i did consider using .replace() given issues matching regex though...

swift - Accessing primitive types in RealmSwift -

i using objectmapper along realmswift , class looks like: class location: object, mappable { var lat : float = 0 var lng : float = 0 required convenience init?(_ map: map) { self.init() } func mapping(map: map) { lat <- map["lat"]; lng <- map["lng"]; } } this location class referenced in class vehicle.swift subclass of realm object i able access location of vehicle using line: let location : location = vehicle.vehiclelocation! printing value of location gives me output: location location { lat = 49.24122; lng = -123.1153; } i opened realm database using realm browser , values correspond in database. however when try to access lat , lng values, getting 0.0 . trying access these using : let lat : float = vehicle.vehiclelocation!.lat let lng : float = vehicle.vehiclelocation!.lng any idea might happening ? all stored realm properties must defined dynamic . change: v...

asp.net web api - Error on data posting in xamarin.forms -

getting error while posting data sql using .net web api in xamarin.forms statuscode: 204, reasonphrase: 'no content', version: 1.1, content: system.net.http.streamcontent, headers:{cache-control: no-cache pragma: no-cache server: microsoft-iis/8.5 x-aspnet-version: 4.0.30319 x-powered-by: asp.net access-control-allow-headers: content-type access-control-allow-methods: get, post, put, delete, options date: thu, 17 mar 2016 08:32:28 gmt expires: -1 }} this code post data t returnresult = default(t); httpclient client = null; try { client = new httpclient(); client.baseaddress = new uri(hostname); client.defaultrequestheaders.add("accept", "application/json"); client.timeout = new timespan(0, 0, 15); httpresponsemessage result = null; stringcontent data = null; if (content != null) // data = new stringcontent(jsonconvert.se...

excel - Change size of HorizontalScrollBar with VBA -

i create excel file vba access. creates lot of new sheets , shows every sheet. i want looks that: correct version at moment looks that: wrong version i tried with: with activewindow .displayhorizontalscrollbar = false end but removes sidebar , user can't use anymore. ideas? try this: sub tabratio() activewindow.tabratio = 0.174 'adjust ratio according need. end sub

android - how to show only timestamp, rssi and mac-address of beacon -

private final threadlocal<scancallback> mscancallback = new threadlocal<scancallback>() { @override protected scancallback initialvalue() { return new scancallback() { @override public void onscanresult(int callbacktype, scanresult result) { scanrecord btscanrecord = result.getscanrecord(); //log.i(tag,"new johoksdfjkhdfsj");//not called if (btscanrecord != null) { } connect(); //log.i(tag,"new johoksdfjkhdfsj");//not called } @override public void onbatchscanresults(list<scanresult> results) { (scanresult sr : results) { log.i("scanresult-results", sr.tostring()); //log.i(tag, sr.tostring());//not called } } @override public void onscanfailed(int errorcode...

regex - How to extract all ifconfig data in awk except loopback -

i writing script includes function list interfaces except loopback ifconfig. logic i'm using loopback block regular expression , negating it. command use ifconfig|awk '!/lo:/,/\n\n+/' still returning interfaces. when remove ! , loopback address returned. why earlier command returning instead of except loopback? you can use awk : ifconfig | awk 'begin{ors=rs="\n\n"} !/^lo/{print}'

symfony - List entities belonging to an association in Doctrine -

let's have "person" entity. person can belong "group". associated through manytomany, join table strategy. the general code looks this: /** * vendor\acmebundle\entity\person * * @orm\entity(repositoryclass="vendor\acmebundle\entity\personrepository") */ class person extends baseuser { /** * @orm\column(type="integer") * @orm\id * @orm\generatedvalue(strategy="auto") */ protected $id; /** * @orm\manytomany(targetentity="vendor\acmebundle\entity\group") */ protected $groups; } and group entity /** * @orm\entity */ class group extends basegroup { /** * @orm\id * @orm\column(type="integer") * @orm\generatedvalue(strategy="auto") */ protected $id; /** * @orm\column(type="string", nullable=true) */ protected $publicname; } what want achieve? given group, list users belonging group in consistent way, including pagination...

Updating default arguments in Python across calls -

this question has answer here: “least astonishment” , mutable default argument 30 answers in following function l stores values during every call. for example, if call f(1) , l [1] . when call again previous l appended new value. l [1,1] . def f(a, l=[]): l.append(a) return l but in function: i = 5 def f(arg=i): print arg = 6 no matter how many times call function, argument still 5 - not remain updated between calls. what reason why not updated list does? this question. reason why happens because default arguments functions stored single objects in memory, not recreated every time call function. so when have list [] default argument, there 1 list forever duration of program. when add list adding 1 copy of list. still true numbers 5 . however, numbers immutable in python, , when alter default argument starts @ number,...

Add ListBox values toTextBox on Button click in ASP.Net did not work correctly -

i have 1 list box , 1 text box, want add list box value text box on button click , not working correctly, can please me ,i can add item text box cant add more item text box (multiselect)thanks in advance textbox <div class="col-sm-3"> <asp:textbox id="txtdesignname" runat="server" cssclass="form-control" width="250px" ></asp:textbox> </div> listbox <div class="col-sm-3"> <asp:listbox id="lstvalue" runat="server" cssclass="content" rows="5" validationgroup="save" width="250" onselectedindexchanged="lstvalues_selectedindexchanged"></asp:listbox> </div> add button <asp:button id="btnadd" runat="server" cssclass="button" text="add" validationgroup="add" width="70" onclick="btnadd_click" /...

javascript - Cross browser support for get and set properties -

my goal implement , set properties on javascript objects. object.defineproperty seems supported in ie9+ on non dom object . want work down ie7. __definegetter__ deprecated there seems workarounds aka "hacks": // super amazing, cross browser property function, based on http://thewikies.com/ function addproperty(obj, name, onget, onset) { // wrapper functions var oldvalue = obj[name], getfn = function () { return onget.apply(obj, [oldvalue]); }, setfn = function (newvalue) { return oldvalue = onset.apply(obj, [newvalue]); }; // modern browsers, ie9+, , ie8 (must dom object), if (object.defineproperty) { object.defineproperty(obj, name, { get: getfn, set: setfn }); // older mozilla } else if (obj.__definegetter__) { obj.__definegetter__(name, getfn); obj.__definesetter__(name, setfn); // ie6-7 // must real do...

if statement - Delayed evaluation in Scheme -

given following code: (define (my-if condition iftrue iffalse) (cond (condition iftrue) (else iffalse))) '-----example1 (my-if #t (display "my if true!") (display "my if false!")) (newline) '-----example2 (my-if #t (display "my if true!") (+ 2 3)) why example 1 evaluate both parameters right away giving output of my if true!my if false! yet in example 2 only my if true! is output? is because display never delayed arithmetic operators are, or else? in both cases both arguments evaluated - that's how procedures work, arguments function call evaluated before function body executed, never delayed! (unless explicitly done so). and that's why can't implement my-if procedure, has to special form, if , cond , evaluate part corresponding true condition, or else part if none true. also, bear in mind display prints argument on console, doesn't return val...

indexing - Tinkerpop API does not use mixed elasticsearch index while retrieving data from titan -

tinkerpop api not use mixed elasticsearch index while retrieving data titan. though if directly use titan api use mixed elasticsearch index. e.g. have created mixed index on name. when use tinkerpop api : graph.iterator().v().has("name", "apple") , not use mixed index on "name" , gives warning log 'query requires iterating on vertices'. with titan api works fine , uses mixed index on "name" given below titangraph.query().has("name", "apple").vertices() what can reason of this? this cross-posted on tinkerpop mailing list first off, if you're doing exact string matches, seems composite index fine. you should review titan docs in chapter 20. index parameters , full-text search. when addkey(name) without mapping parameter, mixed index string key default full-text search -- addkey(name, mapping.text.asparameter()) . there lot of gotchas listed in documentation consider full-text search: ...

angularjs - Angular application with different Application paths? -

i have 2 applications deployed on same server.both angular based applications. one url : http://localhost:8080/something/debug.html the other : http://localhost:8080/somethingelse/debug.html i want combine these applications can have same header can router individual contents within container. best way of achieving in angular js? if want keep them deployed in different urls, believe there's no "angular way" of doing , you'd have use iframe . keep in mind application inside iframe have no communication elements outside of it. if want merge both apps single one, keep in mind angularjs allows use of 1 ng-app directive per application, , if you, have small refactoring: create new angularjs module has other 2 existing ones dependencies. create index.html global layout , use ng-app directive reference newly created module. use tool such ui-router or ngroute set routes existing applications,making sure states/urls don't collide. if...

javascript - Evaluate check box from a scanned image in node.js -

i want evaluate checkbox checked or not scanned image. found node module node-dv , node-fv this. when install got following error on mac. ../deps/opencv/modules/core/src/arithm1.cpp:444:51: error: constant expression evaluates 4294967295 cannot narrowed type 'int' [-wc++11-narrowing] static int cv_decl_aligned(16) v64f_absmask[] = { 0xffffffff, 0x7fffffff, 0xffffffff, 0x7fffffff }; ^~~~~~~~~~ ../deps/opencv/modules/core/src/arithm1.cpp:444:51: note: insert explicit cast silence issue static int cv_decl_aligned(16) v64f_absmask[] = { 0xffffffff, 0x7fffffff, 0xffffffff, 0x7fffffff }; ^~~~~~~~~~ static_cast<int>( ) ../deps/opencv/modules/core/src/arithm1.cpp:444:75: error: constant expression evaluates 4294967295 cannot narrowed type 'int' [-wc++11-narrowing] static int cv_decl_aligned(16) v64f_absmask[] = { 0xf...

xml - Update the element name based on xpath from external file -

please suggest how update elements' name based on external file based on xpath given in it. i have tried, few variables store xpath external file, template matched element's xpath, unable required info. please suggest. external file (findreplaceelements.ini): <root> <tofind>aside/p</tofind> <toreplace><p class="aside_para"></p></toreplace> <tofind>aside[@class="sidenote1"]/p</tofind> <toreplace><p class="aside_para1"></p></toreplace> <tofind>body/p</tofind> <toreplace><p class="body_para"></p></toreplace> <tofind>body/div/div/h1</tofind> <toreplace><p class="body_h_2"></p></toreplace> <tofind>body/div/div/div/h1</tofind> <toreplace><p class="body_h_3"></p></toreplace> </root> input xml: <article>...

python - Tastypie annotation error "empty attribute..." -

i'm using tastypie create api , i'm stuck trying annotate sum total of decimals on type. each transaction has associated bucket type , i'd group bucket type, , sum transactions. api resource class transactiontotalresource(modelresource): class meta: queryset = ttransaction.objects.values('bucket').annotate(bucket_total=sum('amount')) resource_name = 'transaction_total' include_resource_uri = false allowed_methods = ['get'] authorization= authorization() model class ttransaction(models.model): bucket = models.foreignkey(tbucket) date = models.datefield() transaction_type_id = models.integerfield() amount = models.decimalfield(null=true, max_digits=18, decimal_places=2, blank=true) account_id = models.integerfield() recurrence_flag = models.smallintegerfield(null=true) notes = models.charfield(null=true,max_length=100) paid = models.smallintegerfield(nul...

linux - How do I open a specific port on RHEL 6.4? -

i'm setting remote connection oracle database , requires connection should established through port 1521 default. however, i'm getting error repeatly: [oracle jdbc driver]error establishing socket host , port: :1521. reason: connection refused checking deeper, realize port 1521 cannot connected on local machine: telnet localhost 1521 trying ::1... telnet: connect address ::1: connection refused trying 127.0.0.1... telnet: connect address 127.0.0.1: connection refused the connection through port not established anyway. moreover, iptables disable on local , remote machines well. ping localhost working fine. i notice port 1521 refusing connection. when tried telnet port 80, working fine. do need have port 1521 on netstat output establish connection through it? if yes how can do. thank in advances. regards, anh i hope trying connect remote oracle database server local machine. if yes have use following command telnet 1521 are sure using port othe...

iOS Provisioning Profile Status keeps changing to invalid -

has run issue ios provisioning profiles status change after short amount of time or after uploading app? on past few days have noticed status app working on invalid when go upload new test version. go developer.apple.com. re-generate same profile. status changes active. can upload app no problem. time ready upload test being set to invalid. within 24 hours. i have not changed settings on app, devices on devise list, or cert(s) / profiles associated app. seems happen if not upload new version. yesterday provision profile status invalid. logged in, re-generated, , status again active. did nothing else rest of day. today logged in check , again set invalid.

java - how to change the color of text partially in android -

i have sentence contains message posted server wow! superb pic #superb #pic #111 #222 enjoyed pic i want extract hastags , make them colored , leaving rest of text intact. i tried following code not working. private void spannableoperationonhastag() { mpostmessage = edpostmessage.gettext().tostring().trim(); string strprehash = null; string strhashtext = ""; if (mpostmessage.contains("#")) { try { int index = mpostmessage.indexof("#"); strprehash = mpostmessage.substring(0, index); spannablestring spannablestring = new spannablestring(strprehash); string strhashdummy=mpostmessage.substring(index, mpostmessage.length()); int hashcount= stringutils.countmatches(strhashdummy, "#"); // check number of "#" occurrence , run forloop getting number of hastags in string int hasindex=0; ...

angularjs - Add access token to every request header in Angular js -

this question has answer here: angular js - set token on header default 2 answers i working node js rest api. in authentication process api returns access token. need add access token every request common place. you can use http interceptor code looks follow $httpprovider.interceptors.push(function($q, $cookies) { return { 'request': function(config) { config.headers['token'] = $cookies.logintokencookie; return config; } }; }); from post

Characters get corrupt if spark.executor.memory is not set properly when importing CSV to DataFrame -

update: please hold on question. found might problem of spark 1.5 itself, not using official version of spark. i'll keep updating question. thank you! i noticed strange bug when using spark-csv import csv dataframe in spark. here sample code: object sparktry { def main(args: array[string]) { autologger.setlevel("info") val sc = singletonsparkcontext.getinstance() val sql_context = singletonsqlcontext.getinstance(sc) val options = new collection.mutable.hashmap[string, string]() options += "header" -> "true" options += "charset" -> "utf-8" val customschema = structtype(array( structfield("year", stringtype), structfield("brand", stringtype), structfield("category", stringtype), structfield("model", stringtype), structfield("sales", doubletype))) val dataframe = sql_c...

how to use toupper in C#? -

i ask how use .toupper() function in c#. our professor told use .toupper() . ex. when enter name , first letter of each input must capital letter. ian bartolome entera (original input) ian bartolome entera (output needed) you can use textinfo.totitlecase method (even though professor said use .toupper() quite easy!!!); with specific culture; string text = "ian bartolome entera"; textinfo textinfo = new cultureinfo("en-us", false).textinfo;//specify culture here string titlecase = textinfo.totitlecase(text); //ian bartolome entera or current culture; string text = "ian bartolome entera"; string titlecase = cultureinfo.currentculture.textinfo.totitlecase(text);

c# - Navigate to next page in xamarin forms on tap gesture -

i have click event label go next page in xamarin forms not able proper statement move on next page main page. have used following code. var forgetpassword_tap = new tapgesturerecognizer(); forgetpassword_tap.tapped += (s, e) => { // app.current.mainpage = mycontentpage; app.current.mainpage = new navigationpage(); app.current.mainpage.navigation.pushasync(page:mycontentpage()); }; forgetpasswordlabel.gesturerecognizers.add(forgetpassword_tap); in above statement got error "mycontentpage" not valid argument. if instance of page mycontentpage has been created, ought it: app.current.mainpage = new navigationpage(mycontentpage); if not, , mycontentpage type, not instance: app.current.mainpage = new navigationpage(new mycontentpage());

javascript - Unable to bind data to scope object after service call using $RESOURCE in typescript AngularJS -

i pulling data api , trying bind variable , have debugged code getting data api not getting binded scope object here code service: module application.common { angular.module("common.service", ["ngresource"]) export class dataaccessservice { static $inject = ["$resource"]; /// avoid minificaton errors i.e prameters thgar use defines , should in order. constructor(private $resource: ng.resource.iresourceservice,private $http:ng.ihttpservice) { } getproductresource() { return this.$resource("http://localhost:50000/api/values/getproducts", { 'query': { method: 'get', isarray: false } }).get().$promise.then(function (response) { var obj = new product(); //debugger; obj.title = response.title; obj.showimage = response.showimage; obj.products = response.objdetails; ...

python - Relationship of two time series using Scikit or Pandas -

say have 2 hypothetical time series data 1 rainfall , other ocean surface temperature. rainfall time series: 2001-12-31 25 mm 2002-12-31 50 mm 2003-12-31 75 mm 2004-12-31 50 mm 2005-12-31 25 mm 2006-12-31 10 mm 2007-12-31 6 mm 2008-12-31 8 mm 2009-12-31 10 mm 2010-12-31 12 mm 2011-12-31 20 mm 2012-12-31 75 mm rainfall time series: 2001-12-31 36 (degrees celsius) 2002-12-31 37 (degrees celsius) 2003-12-31 38 (degrees celsius) 2004-12-31 37 (degrees celsius) 2005-12-31 36 (degrees celsius) 2006-12-31 34 (degrees celsius) 2007-12-31 32 (degrees celsius) 2008-12-31 33 (degrees celsius) 2009-12-31 34 (degrees celsius) 2010-12-31 35 (degrees celsius) 2011-12-31 35.9 (degrees celsius) 2012-12-31 38 (degrees celsius) i wanted answer these questions: 1.) how 2 time series related? 2.) there way find out if either 1 of time series changes other 1 change? , if how much? we know rainfall , ocean surface temperature related , ...

javascript - how to stop loading animation once the screen is loaded -

@import url(http://fonts.googleapis.com/css?family=play:400,700); * { box-sizing: border-box; } body { background-color: #222; font-family: "play"; } h1 { font-size: 2rem; color: #fff; text-align: center; text-transform: uppercase; } .smart-glass { position: absolute; margin: auto; left: 0; top: 0; right: 0; bottom: 0; width: 288px; height: 388px; } .logo { width: 288px; height: 288px; position: relative; } .circle { padding: 20px; border: 6px solid transparent; border-top-color: #40a800; border-radius: 50%; width: 100%; height: 100%; animation: connect 2.5s linear infinite; } .xbox { background: #fff; width: 80px; height: 80px; border-radius: 100%; overflow: hidden; position: absolute; top: 0; right: 0; left: 0; bottom: 0; margin: auto; } .xbox:after, .xbox:before { content: ""; display: block; border-top: 10px soli...

Convert PDF to PNG without output file extension using ImageMagick -

it simple convert pdf file png: convert input.pdf -colorspace rgb -resize 800 output.png however have skip extension in file name, have tried with: convert input.pdf -colorspace rgb -resize 800 output but generates me pdf file. how can specify pdf type convert argument ? -type png does not work. solution: convert input.pdf -colorspace rgb -resize 800 png:output this creates png file named output .

jboss - Can we setup JMS communication without username and password? -

i working in jboss environment , implemented jms enabling asynchronous communication between 2 modules. need add user "add-user.sh" script. user information gets saved in application-users.properties , application-roles.properties. need hardcode username , password in messagepublisher class authenticate user following block of code - final static string initial_context_factory = "org.jboss.naming.remote.client.initialcontextfactory"; context context=null; final properties env = new properties(); env.put(context.initial_context_factory, initial_context_factory); env.put(context.provider_url, system.getproperty(context.provider_url, provider_url)); env.put(context.security_principal, system.getproperty("username", "abcd")); env.put(context.security_credentials, system.getproperty("password", "xyz")); context = new initialcontext(env); but want bypass step of username , password. know in activemq possible setting <sim...

azure data lake - Usql - Job failed due to internal system error - NM_CANNOT_LAUNCH_JM -

i following system error, error in activity: [{"errorid":"e_system_nm_nmcannotlaunchjm" ,"name":"nm_cannot_launch_jm" ,"severity":"error" ,"source":"system" ,"component":"nm" ,"message":"job failed due internal system error." ,"details":"" ,"description":"","resolution":"","helplink":"","innererror":null}]. the error not intermittent. copy file 1 location another. says internal system error - ideas? following usql script, declare @in string = "20160229"; declare @year string = "2016"; declare @month string = "02"; declare @day string = "29"; declare @filesource string = "/outputs/folder1/" + @year + @"/" + @month + @"/" + @day + @"/file." + @in; @rs0 = extract col1 string, ...

java - How to INSERT rows using UCanAccess? -

i using windows 8 64 bit , netbeans 8.1, java 8 i know in java 8 jdbc-odbc bridge removed. using ucanaccess have 1 problem i trying read data ms access using code (1) package javaapplication1; /** * * @author jay */ import java.sql.*; public class javaapplication1 { public static void main(string[] args) { connection cn; statement st; resultset re; try{ class.forname("net.ucanaccess.jdbc.ucanaccessdriver"); cn=drivermanager.getconnection("jdbc:ucanaccess://d://j//db//database.accdb"); st = cn.createstatement(); re=st.executequery("select * db1"); while(re.next()) { system.out.println(re.getstring(1)); } catch(classnotfoundexception | sqlexception e) { system.out.println(e); } } } i have inserted data manually in msaccess got out run: a b build successful (total time: 1 second) but when try insert data using following java code (2) package javaapplication1; /**...

sql - MYSQL | select inverse value between 2 tables -

i select records table have different values one. table 1. +--------+-------+ | userid | tagid | +--------+-------+ | 1 | 2 | | 1 | 3 | | 1 | 4 | +--------+-------+ table 2. +---------+-------+ | chaname | tagid | +---------+-------+ | hello | 1 | | how | 2 | | | 3 | | | 4 | | today | 5 | | guys | 6 | | ? | 7 | +---------+-------+ and suppose be +--------+-------+---------+ | userid | tagid | chaname | +--------+-------+---------+ | 1 | 1 | hello | | 1 | 5 | today | | 1 | 6 | guys | | 1 | 7 | ? | +--------+-------+---------+ it looks simple can't find way solve it. thank of answers <3 ps. btw i've tried use ' not in ' got error unrecognized keyword. (near "not in" @ position 92) to output, need use outer join . left join give records left table table2 , matching records right table table1 . means ...

ios - how to add same text field to the same view controller when i click on button each time in objective c x-code6 -

i have code uitextfield *textfield = [[uitextfield alloc] initwithframe:cgrectmake(18, 350, 309, 35)]; textfield.borderstyle = uitextborderstyleroundedrect; textfield.font = [uifont systemfontofsize:15]; textfield.keyboardtype = uikeyboardtypedefault; textfield.returnkeytype = uireturnkeydone; textfield.contentverticalalignment = uicontrolcontentverticalalignmentcenter; textfield.delegate = self; [self.view addsubview:textfield];..i tried this.. but want when click add button ,each time 1 text field added view controller different positions... thanks in advance..... try this if(![self.view viewwithtag:44]){ uitextfield *textfield = [[uitextfield alloc] initwithframe:cgrectmake(18, 350, 309, 35)]; textfield.borderstyle = uitextborderstyleroundedrect; textfield.font = [uifont systemfontofsize:15]; textfield.keyboardtype = uikeyboardtypedefault; textfield.returnkeytype = uireturnkeydone; textfield.contentverticalalignment = uicontrolcontentverticalalignmentcenter; ...

node.js - Calling SOAP API through proxy with node-soap client -

i using node-soap module , it's working fine, except when working behind proxy. can't manage find way set proxy can request api. soap.createclient(url, function(err, client) { client.myfunction(args, function(err, result) { console.log(result); }); }); it's written in docs : the options argument allows customize client following properties: request: override request module. httpclient: provide own http client implements request(rurl, data, callback, exheaders, exoptions). is way go? in soap.createclient() options set 'request' request object has 'proxy' set using request.defaults() . let request = require('request'); let request_with_defaults = request.defaults({'proxy': proxy_url, 'timeout': 5000, 'connection': 'keep-alive'}); let soap_client_options = {'request': request_with_defaults}; soap.createclient(wsdl_url, soap_client_options, function(err, client) { ...

sql server - Merge Rows of table -

Image
want merge rows 2 id need merge columns docstatus , release date skipping empty values. basically can use group aggregate function. below select id, somecol, max(another_column), min(yet_another_column) yourtable group id, somecol

python 2.7 - How to autofill an field value for other model in Odoo? -

this re-work on mro module available link - https://www.odoo.com/apps/modules/8.0/mro/ following sequence of workflow 1) maintenance request created , and after confirming proceeded maintenance order 2) when maintenance order processed , reaches state 'done', maintenance request document origin of order reach state 'done'. there 2 classes mro.request class mro_request(osv.osv): """ maintenance requests """ _name = 'mro.request' _description = 'maintenance request' _inherit = ['mail.thread', 'ir.needaction_mixin'] state_selection = [ ('draft', 'draft'), ('claim', 'claim'), ('run', 'execution'), ('done', 'done'), ('reject', 'rejected'), ('cancel', 'canceled') ] _track = { 'state': { 'm...

java - How to generate multiple circle shapes and animate those shapes going down the frame -

Image
i having trouble generating multiple oval shapes when clicking panel of frame. want generate many oval shapes , shapes move downward. 1 of requirement use 2 multi threading. in case, program created that, generate 1 oval shape , position randomly changing. can please me 1 this. package ovalrandomcolors; import java.awt.color; import java.awt.component; import java.awt.graphics; import java.awt.graphics2d; import java.util.list; import java.awt.shape; import java.awt.event.mouseadapter; import java.awt.event.mouseevent; import java.awt.geom.ellipse2d; import java.util.arraylist; import java.util.collections; import java.util.logging.level; import java.util.logging.logger; import javax.swing.jframe; import javax.swing.jpanel; import javax.swing.swingutilities; public class ovalrandomcolors extends jpanel{ private int ovalx = 50; private int ovaly =50; private int ovalpositionx = 250; private int ovalpositiony = 250; private color color = color.yellow; pu...