Posts

Showing posts from February, 2014

Android Studio Log Cat not showing Application Package -

Image
i updated android studio 1.2.1.1, using eclipse earlier, , log cat worked perfect on it. since have moved android studio, not able filter log cat application (package), eclipse used show package name(s), in android studio getting none. attaching screen shot of log cat. restarted android studio, , ran project several times, remains same.

php - Cookie Law EU - Create a popup for blocking interaction -

hi there's big mess around new cookie law. most websites nowdays made in wordpress , there's bunch of plugins inside. majority of cookie plugins show banner, or asks developer mark shortcode each cookie code in website, loading can prevented script. but average website, bunch of plugins inside, huge work! should read code of each plugin , mark cookie code. isn't crazy work do? wouldn't better add popup totally block interaction till user accept policy? ( website http://www.ilsole24ore.com/ ) is there plugin doing this? found nice script http://malsup.com/jquery/block/#dialog blocking ui... how can save user preference won't appear anymore after user click once? is solution comply cookie eu law?

c# - WPF Data Binding confusion -

i've started taking course wpf , i'm bit confuse areas related data-binding. have no syntax issue, committed newbie errors , have couple of questions. i've done simple screen 2 textboxes , when click button these 2 items added listbox. reference within window tag of xaml people class xmlns:classes="clr-namespace:wpf_course.classes" added window resource <window.resources> <classes:people x:key="people"/> </window.resources> here's how i've declared listbox <listbox datacontext="{binding source={staticresource people}}" itemssource="{binding persons}" x:name="personlistbox"> <listbox.itemtemplate> <datatemplate> <grid> <stackpanel> <textblock text="{binding fullname}"/> &

.net - Call Matlab Function from C# error : The type initializer for 'tes.tambah' threw an exception -

i getting "the type initializer 'tes.tambah' threw exception.." using system; using system.collections.generic; using system.componentmodel; using system.data; using system.drawing; using system.linq; using system.text; using system.threading.tasks; using system.windows.forms; using mathworks.matlab.net.arrays; using tes; namespace panggil_lib_matlab { public partial class form1 : form { public form1() { initializecomponent(); } private void button1_click(object sender, eventargs e) { tambah tbh = new tambah(); } } } and matlab code: function [ hasil ] = coba( a,b ) hasil = a+b; end i error on line: tambah tbh = new tambah(); , 'innerexception' message: system.typeinitializationexception: type initializer 'mathworks.matlab.net.utility.mwmcr' threw exception. ---> system.typeinitializationexception: type initializer 'mathw

android - Custom TabHost / TabSpec don't work -

i've little problem in initialisetabhost(). when give drawable in setindicator, it's don't work. tabactivity's deprecated, use fragmentactivity. tutorial don't how custom indicator. protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); // step 1: inflate layout setcontentview(r.layout.evenement); // step 2: setup tabhost initialisetabhost(savedinstancestate); if (savedinstancestate != null) { mtabhost.setcurrenttabbytag(savedinstancestate.getstring("tab")); //set tab per saved state } } protected void onsaveinstancestate(bundle outstate) { outstate.putstring("tab", mtabhost.getcurrenttabtag()); //save tab selected super.onsaveinstancestate(outstate); } private void initialisetabhost(bundle args) { mtabhost = (tabhost) findviewbyid(android.r.id.tabhost); mtabhost.setup(); tabinfo tabinfo = null; fragmentlistevents.addtab(this, this.mtabhost, th

c# - How to bind events and properties of controls in UniformGrid dynamically? -

i newbie in templating wpf controls. use vs2013, wpf 4.5 , caliburn micro 2.0.2 . in part of tasks have need populate grid toggle buttons contained different images , subtitle. have solved using uniformgrid. see code below. work still don't have event , property binding since don't know how can bind events , properties of toggle buttons view model, since generated automatically , dynamically , number of toggle buttons uncertain (depends on number of images in image folder). for example: manually bind click event, ischecked property , other properties of toggle button 1 following: <togglebutton x:name="togglevehicle01" ischecked={binding selectedvehicle01} background="{binding backcolorselectedvehicle01}" tooltip="{binding vehiclename01}"> but now can't anymore since toggle buttons generated automatically , number uncertain. please help. feel free change code below or give me examples code works. thank in advance. the view (

Parse.com not able to import csv -

i need import csv file parse unfortunately doesn't work due fact have commas in fields , stuff "€". how test file looks like: productname;productdescription;producturl;designer;category;price;pricecurrency;shipping;shippingcurrency materialmix-shirt;set2x36 2x38 2x40;http://some-url.com/artikel/materialmix-shirt-1.html;set;longsleeves;39;"&euro;";4.9;"&euro;" kniestrümpfe family;anziehen und wohlfühlen: mit den beliebten allround-kniestrümpfen family von dummy gönnen sie ihren füßen herrlichen tragekomfort. sie bestehen aus weicher, hautfreundlicher baumwolle mit elasthan-anteil und überzeugen mit einer perfekten passform.weicher griff verstärkte belastungszonen für optimale haltbarkeit;http://some-url.com/artikel/family-3.html;dummy;strümpfe & socken;13;"&euro;";3.95;"&euro;" any ideas? i've got solution: parse.com doesn't allow use semicolon separator. if replace semicolons regular comm

jquery - Modifying Bootstrap Navbar -

am trying modify bootstrap navbar display links(list item) on different media screen, example on navbar list have list including search , login/signup list items, on phone or tablet want display search , login/signup list items , navbar-brand, instead of showing navbar-brand , collapsing lists item, have tried different methods e.g excluding search , login/signup list items dropdown list etc. still not working. here html code css bootstrap css(bootstrap.css). , please me, if can without bootstrap well. view working code on jsbin . or <nav class = "navbar navbar-inverse"> <div class = "navbar-header"> <button type = "button" class = "navbar-toggle" data-toggle = "collapse" data-target = "#mynav"> <span class = "icon-bar"></span> <span class = "icon-bar"></span> <span class = "icon-bar"></spa

python - Pexpect ssh option StrictHostKeyChecking raising TypeError -

i have python script ssh device using pexpect module. runs following $ ssh hostname -l username by doing: >>> import pexpect.pxssh pxssh >>> conn = pxssh.pxssh() >>> conn.login(hostname, username, password, terminal_type='vt100') >>> ... now, trying implemement same script stricthostkeychecking=no option. in order this, follow documentation of pexpect , add options={} below. however, raises following typeerror . >>> import pexpect.pxssh pxssh >>> conn = pxssh.pxssh(options={'stricthostkeychecking':'no',}) exception attributeerror: "'pxssh' object has no attribute 'closed'" in <bound method pxssh.__del__ of <pexpect.pxssh.pxssh object @ 0x7f96294aded0>> ignored traceback (most recent call last): file "<stdin>", line 1, in <module> typeerror: __init__() got unexpected keyword argument 'options' i have had around , not fin

how to get the address of center point of GoogleMap v2 in android? -

i following this tutorial position of center point of v2 googlemap .now want address of point using reverse geocoding .... i using following code latlang of center point when button clicked : @override public void onclick(view view) { if(view.getid()==r.id.btn_set_location){ visibleregion visibleregion = map.getprojection() .getvisibleregion(); point x = map.getprojection().toscreenlocation( visibleregion.farright); point y = map.getprojection().toscreenlocation( visibleregion.nearleft); point centerpoint = new point(x.x / 2, y.y / 2); latlng centerfrompoint = map.getprojection().fromscreenlocation( centerpoint); } } i have seen others tutotials address using latitude , longitude seperately in case have got latlang ,how address using latlang..need here ....if there others ways center point of map , address of same point ...any kind of appreciated ...tha

c# - Access web service and integrate response in SQL View -

i using sql server 2012 , need prepare view "view1" in our database "db1". the view1 has data table1 , needs data webservice1. how data webservice1 , integrate view1? i reading sql clr not able find material directly relevant sql server 2012. i read web service tasks can configured , used. support web api calls without wsdl? what possibilities available here?

javascript - How to re-factor 2 functions which are the same? -

i'm working on accessible carousel weak javascript knowledge, , i'm facing syntax problem. here part gives me problem : events: function () { var self = this; this.target.on('click', '.nav-right, .right', function (e) { e.preventdefault(); self.movecarousel(self.target.find('.carousel-wrapper li'), 'left', 'right', function (cur, $el) { if (cur === $el.length - 1) { return '0'; } return cur + 1; }); }); this.target.on('focus', '.nav-right, .right', function (e) { e.preventdefault(); self.movecarousel(self.target.find('.carousel-wrapper li'), 'left', 'right', function (cur, $el) { if (cur === $el.length - 1) { return '0'; } return cur + 1; }); }); here full code if that's important (121 lines) : http://jsfiddle.net/12b63z7e/ now, purpose of function ? want slide event

gridview - IOS How to create tableview with two column first column have one row and second column have multiple row ? -

Image
hello here attach image have create tableview image . description: in tableview have 2 columns first time , second event show come web services. don't have idea how create type of view . if know example please share me . have find lots of grid view example problem in grid view both column equal have create first(time) columns height depend on second column(event) height equal please share valuable knowledge . thankyou as k6sandeep suggests, can put 2 table-view controllers next each other. assuming data available when loading table views, can count amount of events in time-slot , use value size rows in left column (in heightforrowatindexpath). populate events table usual. using uiscrollview delegate methods (scrollviewdidscroll) of tableviews can synchronise scrolling behaviour. an alternative have collectionview instead of tableviews.

r - automatically generate string from data frame row -

i trying create string data frame row. little example this: df <- data.frame(name=c('bla'), firstname=c('dada'), other=c('dum')) sprintf('name:%s firstname:%s other:%s', df[1,'name'], df[1,'firstname'], df[1,'other']) i trying create function can provide data frame argument , creates string like. i started try sprintf can't arguments right: sprintf(paste(sub('$',':%s',names(df)), collapse=' '), df[1,]) how can unlist or anyhow automatically use arguments? working solution be: sprintf(paste(sub('$',':%s',names(df)), collapse=' '), df[1,'name'], df[1,'firstname'], df[1,'other']) perhaps do.call help: df <- data.frame(name=c('bla'), firstname=c('dada'), other=c('dum')) fmt <- 'name:%s firstname:%s other:%s' do.call(sprintf, c(df, fmt = fmt))

sql order by - MySQL sorting string values with numbers? -

my data this: krypton-4xlv krypton-3xstg krypton-16xth krypton-8xth krypton-8xlv when call order by on column values sorted this: krypton-16xth krypton-3xstg krypton-4xlv krypton-8xlv krypton-8xth is there way sort like? krypton-4xlv krypton-8xlv krypton-3xstg krypton-8xth krypton-16xth here sql fiddle: http://sqlfiddle.com/#!9/6d061/2 try following: select code (select *, substring(code, locate('-', code) + 1, length(code)) o products )t order substring(o, locate('x', o), length(code)), cast(o unsigned)

How to get through the Google+ AP list of persons in my circles BUT of my bussiness page - not in my account -

i'm reading persons in circles in main, personal google account (via google-api-php-client ). have few business pages - part of personal google account. read list persons in circles of pages. when i'm trying below code with $userid 'me' works fine. when i'm trying code my bussiness page id $userid receive error: fatal error: uncaught exception 'google_service_exception' message 'error calling https://www.googleapis.com/plus/v1/people/101474958426407069227/people/visible : (400) allowed fetch authenticated user's visible circles.' code $client = new google_client(); $client->setclientid($client_id); $client->setclientsecret($client_secret); $client->setredirecturi($redirect_uri); ... $plus = new google_service_plus($client); $people= $plus->people->listpeople('me','visible'); <-- works $people= $plus->people->listpeople('101474958426407069227','visible'); <-- not work alt

fix - Quickfix client for Rapid Addition engine -

my fix server using rapid addition engine, can use use quickfix client code connect fix server on rapid addition? i think should able connect since client can on technology not sure whether correct. if confirm it. the fix protocol (or rather should be) entirely independent of the api used. using quickfix have connected rapid addition , many other proprietary fix engines , work expected. issue might have if fix engine has ssl embedded in stunnel can used allow communications.

Regex for accepting all type of phone numbers in javascript validation -

i'm using below regex accepting phone numbers, /^\+?(\d[.\- ]*){9,12}(e?xt?\d{1,5})?$/; but want accept following phone numbers also(specially indian mobile , landlines): +91 9970464878 +91-22-22221500 09970464878 9970464878 you can add 3 possiblities start of regex. this regex once used on similiar requirement : ^(?:(?:\+|0{0,2})91(\s*[\-]\s*)?|[0]?)?\d{10}$ note - have strip away hyphens, dont think required validations. sample test here regular expression analyzer explanation.

android - Listview displays only one row from the list -

i new android listviews , trying populate listview in android list of items coming webservice. know list contains more 1 record coming webservice custom listview displays first record list. checked size of list , there more 1 records listview showing 1 of them. custom adapter following: public class listadapter extends baseadapter { context ctx; layoutinflater linflater; arraylist<litem> lstitems; listadapter(context context, arraylist<litem> objects) { ctx = context; lstitems = objects; linflater = (layoutinflater) ctx .getsystemservice(context.layout_inflater_service); } @override public int getcount() { return lstitems.size(); } @override public object getitem(int position) { return lstitems.get(position); } @override public long getitemid(int position) { return position; } @override public view getview(int position, view convertview,

r - Turn parsed corpus into data frame using stringr and regex -

i'm trying transform parsed corpus data frame in r using stringr , regular expressions (i've since read maybe shouldn't using regular expressions kind of work, spent time on know whether there solution). corpus looks this: text <- paste("<w type=\"np0\" lemma=\"dorothy\">dorothy</w><c type=\"pun\">, </c><w type=\"prp\" lemma=\"in\">in </w><w type=\"dps\" lemma=\"she\">her </w><w type=\"nn1\" lemma=\"time\">time</w><c type=\"pun\">, </c><w type=\"vhd\" lemma=\"have\">had </w><w type=\"vbn\" lemma=\"be\">been </w><w type=\"at0\" lemma=\"an\">an </w><w type=\"aj0\" lemma=\"active\">active </w><w type=\"nn1\" lemma=\"member\">member </w>&

How can I add omitable dynamic values to an array in Javascript? -

i adding dynamical values array 2 tables (datatables.js) in here: var formarray = { "valuefroma0" : table1.row(0).data()[1], "valuefroma1" : table1.row(1).data()[1], "valuefromb0" : table2.row(0).data()[1], "valuefromb1" : table2.row(1).data()[1] }; these tables dynamically created. of values (or of them) can empty. want omit 'undefined'/empty values during creation array. example, valuefroma1, valuefromb0 , valuefromb1 undefined means there should 1 value in array this: "valuefroma0" : "5" try this: var formarray = { "valuefroma0" : "7", "valuefroma1" : undefined, "valuefromb0" : "5", "valuefromb1" : undefined }; function removeemptyentries(obj) { for(var prop in obj) { if(obj.hasownproperty(prop) && !obj[prop]) delete obj[prop]; } } removeemptyentries(formarray);

excel vba - How to disable the rowsin Sheet1 based on values on other sheet2 -

i trying disable rows in sheet1 ,the range based on values based on sheet2. sheet comprise of rows titles , sheet2 have title having value in either 0 or 1. depending upon whether title value in sheet2 0 or 1, disabled or enabled in sheet1. 0 value in sheet 2 - row should disabled in sheet1. 1 value in sheet2 - row should enabled in sheet1. hello please see below code, code in sheet2 range a1 a50 "0" , "1" lock same rows in sheet1 accordingly: sub lockingrows() dim wb workbook dim ws1 worksheet dim ws2 worksheet dim c range set wb = activeworkbook set ws1 = wb.sheets("sheet1") set ws2 = wb.sheets("sheet2") ws1.unprotect password:="pass" '<--- password ws1.cells.locked = false each c in ws2.range("a1:a50").cells '<--- range in sheet2 0 , 1 if c.value = 1 ws1.rows(c.row & ":" & c.row).locked = true elseif c.value = 0 ws1.rows(c.row & ":&qu

html - Embed website in an iframe and hide certain elements -

i have client wants able embed website distributors websites. basically inserting in iframe . want elements of website visible not appear on embedded version. is there way embed website in iframe , use css hide specific div id's achieve this? you can use following code in java script manage element of iframe frame.contentwindow.document.getelementbyid or frame.contentdocument.getelementbyid

recursion(python) help please -

i'm new programming world, , i'm struggling recursion. this code, i'm not sure why doesn't work :( enter_number = input("enter 'x' value: ") def g(x): if x == 0: return 1 elif x == 1: return 2 else: return g(x−1) + g(x−3) + g(x−4) print(g(enter_number)) thank you your g function doesn't handle inputs 2 , 3 .

amazon web services - Deploy python web server on AWS Elastic Beanstalk -

i'm deploying python web server on aws , have question it. i'm using websocket communicate between end , front end. do have use framework django or flask? if not, should put index.html file? in other word, after deploying, how aws know default page of application? thanks in advance. aws doesn't "know" content. webserver install configured point "root" directory in index.html (or equivalent) should be. since depends on webserver (django, flask, jinja etc) install - should lookup documentation!

python - AttributeError: 'NoneType' object has no attribute 'group' error -

try: res = self.browser.open('https://login.facebook.com/login.php?login_attempt=1',form_data) response = res.read() self.fbid = re.search('https://www.facebook.com/(.*)\?sk=info',response) self.fbid = re.search('https://www.facebook.com/(.*)',self.fbid.group(1)) self.fbid = re.search('https://www.facebook.com/(.*)',self.fbid.group(1)) except urllib2.httperror,e : print "****exception****inside login error code: %s" % (e.code) res.close() except urllib2.httperror,e : print "****exception****inside login error code: %s" % (e.code) #print " server response code: %s " % (res.code) i got this file "facebotv2.py", line 122, in login self.fbid = re.search('https://www.facebook.com/(.*)',self.fbid.group(1)) attributeerror: 'nonetype' object has no attribute 'group' self.f

php - Laravel Count with where inside blade -

i'm trying total comments user have.. controller: public function index() { $setting = setting::findorfail(1); $comments = comment::where('published', '=', '1')->get(); $users = user::all(); return view('page.index', compact('setting', 'comments', 'users')); } view: @foreach($comments $comment) {{ count($users->where('user_id', '=', $comment->user_id)) }} @endforeach the problem returns 0 , have 2 comments there.. using user id instead of "$comment->user_id" doesnt work. still display 0. $users collection, not query. treat such: @foreach ($comments $comment) {{ $users->where('user_id', $comment->user_id)->count() }} @endforeach the collection's where method not take operator . from wording in question seems want other way around: $comments = comment::wherepublished(1)->get()->groupby('user_id')

Is there a way in Perl to get the coordinates of a Path from a PDF in the same coordinate system as the PDF text? -

i have pdf page contains both paths , text. need find coordinates of both paths , text in same coordinate system. can use cam::pdf text coordinates per below: use cam::pdf; use pdf::totext; #open pdf file , @ pg1 $pdf = cam::pdf->new($pdffilename); $contenttree = $pdf->getpagecontenttree(1); $contenttree->render("pdf::totext"); i can't work out how coordinates of paths on same pdf page. can @ pdf page contents , see path coordinates think these need translated using current transformation matrix, know specific text characters sit on same location on page path (like x marks spot on treasure map...) there no overlap in coordinates can (text , path out ~500 units). there way path coordinates using cam::pdf (or other other perl module?) in same coordinate system (device space?) text? i'm author of cam::pdf. indeed, you're on right track. take @ implementation of cam::pdf::renderer::dump , simple. class demonstrates how capture coordinates of

regex - Find entries with zero distance variance and recorded watts -

i'm cyclist , programmer. during rides, i'm recording data xml files using phone based gps tracker , power meter. after ride, use power meter software merge data , upload web site. on website, resulting data showing highly inaccurate data wr watts (it weighted average, known normalized power, definition higher average power , lower maximum recorded watts. see http://ridewithgps.com/trips/4834566 (export tcx history file i'm referring to). /<watts>\d{4,} returns no results. calories: 1809 max watts: 676 avg. watts: 213 (170 0s) wr power 23487 work 1681 kj max speed: 26.2 mph avg. speed: 16.6 mph here 2 sample readings tcx history file. <trackpoint> <time>2015-05-30t11:35:50z</time> <position> <latitudedegrees>41.96306</latitudedegrees> <longitudedegrees>-87.645939</longitudedegrees> </position> <altitudemeters>177.7</altitudemet

in app purchase - Android in-app billing error: Authentication is required -

Image
i have app published on google play store in-app purchase upgrade full version. iab library updated v3 in latest app release. many users complain can't buy upgrade. error is: "authentication required. need sign google account." i noticed error in logs: basicnetwork.performrequest: unexpected response code 403 https://android.clients.google.com/fdfe/preparepurchase this managed product. i've checked sku, keys, everything, couldn't find cause of error. users complaining , i'm losing income... appreciated!

python - PyCharm automatically change script -

in pycharm, there way automatically change script in run/debug configurations file editing? currently, when create new file, manually edit script in configurations 1 want run. right click in context menu , click run 'your_script' or press ctrl+shift+f10 found here: https://www.jetbrains.com/pycharm/quickstart/

python - How to fix an "ImportError: No module named numpy" on AWS EC2 Server with AMI Linux but it installed? -

for 5 days or start script numpy without problems. installed here in forum proposed , worked. when try start python script numpy today, got following error: traceback (most recent call last): file "neuraltensornetworkacc.py", line 8, in <module> import numpy np importerror: no module named numpy but numpy seems installed: [ec2-user@ip-172-31-10-106 sk-learn]$ sudo yum install numpy loaded plugins: priorities, update-motd, upgrade-helper amzn-main/latest | 2.1 kb 00:00 amzn-updates/latest | 2.3 kb 00:00 package python26-numpy-1.7.2-8.16.amzn1.x86_64 installed , latest version nothing what wrong? how fix bug? thanks in advance! i need instruction every time again, start instance: installing numpy on amazon ec2

java - How to extend a built-in Hibernate Validator ConstraintValidator -

now working on spring+hibernate application. want overlay validator of @min annotation , wrote following code: @component public class customminvalidator extends minvalidatorfornumber { public void initialize() { min min = new min() { @override public string message() { return null; //to change body of implemented methods use file | settings | file templates. } @override public class<?>[] groups() { return new class<?>[0]; } @override public class<? extends payload>[] payload() { return null; } @override public long value() { return 150; } @override public class<? extends annotation> annotationtype() { return null; } }; super.initialize(min); } } but in debug

parse.com - API 100 objects limit -

i have production ios app , i'm little confused 100 object default query limit (which found out about). if have class has 150 objects, , query 125 of objects, return 100 objects? also, if have class has 200 objects , want query 1 object, , object number 150 out of 200, return nothing because queried first 100? in advance. parse queries have default limit of 100 set on them. can retrieve upto 1000 parseobjects in 1 query. need set limit attribute when execute query. if want retrieve more 1000 objects in 1 query, need split query can run multiple times , whole result set in app. also, if have class has 200 objects , want query 1 object, , object number 150 out of 200, return nothing because queried first 100? if query has 1 result, retrieved no matter data in table, meaning query runs on whole table. limit applies number of rows returned in single query. check ios parse docs understand working better. you can limit number of results setting limit. default, r

Amazon S3 redirect based on browser language -

i've multi language website. want redirect english users /en , spanish users /es. currently i'm doing via javascript, feel there better way. <html> <body> <script type="text/javascript"> var language = window.navigator.userlanguage || window.navigator.language; if (["es","en"].indexof(language) != -1){ window.location.replace(language); } else{ // other languages go en window.location.replace("/en"); } </script> </body> </html>

ios - UIAlertView save textfield.tex -

i want replay alertview textfield until canceled. text in textfield should save in nsmutablearray . tried something, doesn't work. mynsmutablearray = ... expected identifier. doing wrong? @synthesize mynsmutablearray; - (void)viewdidload { [super viewdidload]; [self alert]; } - (void)alertview:(uialertview *)alertview clickedbuttonatindex: (nsinteger)buttonindex { if (buttonindex == 0) { mynsmutablearray = [[nsmutablearray alloc] addobject:[[alertview textfieldatindex:0].text]]; [self alert]; } else{ nslog(@"done"); } } -(void)alert{ uialertview *alert = [[uialertview alloc] initwithtitle:@"titel" message:@"message" delegate:self cancelbuttontitle:@"next" otherbuttontitles:@"done", nil]; alert.alertviewstyle = uialertviewstyleplaintextinput; [[alert textfieldatindex:0] setplaceholder:@"first"]; [alert show]; } you have number of issu

pointers - Java JList - Argument must not be null -

i have problem compiling java program. have no idea why error when create new object in line 103... error is: exception in thread "main" java.lang.nullpointerexception: argument must not null @ javax.swing.spring.checkarg(spring.java:688) @ javax.swing.spring.width(spring.java:657) @ javax.swing.springlayout.applydefaults(springlayout.java:1093) @ javax.swing.springlayout.putconstraints(springlayout.java:1123) @ javax.swing.springlayout.getconstraints(springlayout.java:1158) @ javax.swing.springlayout.putconstraint(springlayout.java:1080) @ javax.swing.springlayout.putconstraint(springlayout.java:1075) @ javax.swing.springlayout.putconstraint(springlayout.java:1041) @ cwiczenie9.cwiczenie9.setspringlayoutconstraint(cwiczenie9.java:204) @ cwiczenie9.cwiczenie9.<init>(cwiczenie9.java:31) @ cwiczenie9.cwiczenie9.main(cwiczenie9.java:232) java result: 1 build successful (total time: 2 seconds) my application code here:

linux - How to print the IP and the Port separately with netstat? -

i want print ip , port separately using netstat command, i tried this: netstat -nat | awk '{print $4}' but gives me that: 192.168.1.213:40405 i want that: first ip: 192.168.1.213 and command port: 40405 if want them different commands, use sed like: netstat -nat | awk '{print $4}' | sed -e 's/:.*//' # gives ip netstat -nat | awk '{print $4}' | sed -e 's/.*://' # gives port depending on how you're using it, store in bash variable , accomplish same thing while access like both=$(netstat -nat | awk '{print $4}') ip=${both%%:*} port=${both##*:}

c++ - How does bind know when to cast to pointer? -

i found interesting thing in c++. using namespace std; struct person { string name; bool check() { return name == "carol"; } }; int main() { person p = { "mark" }; list<person> l; l.push_back(p); if (find_if(l.begin(), l.end(), bind(&person::check, std::placeholders::_1)) == l.end()) { cout << "not found"; } return 0; } the if statement above works should. while dereferencing iterator for_each gets , object , passes function. somehow bind knows (while biniding) first argument of pointer-to-member-function should pointer. in following example doesn't know , throws error due casting person person*. how bind work then? , how pass pointer in following example? find_if(l.begin(), l.end(), bind(mem_fun(&person::check), std::placeholders::_1)) == l.end() i have come i'm not sure if best way of doing it. find_if(l.begin(), l.end(), bind([](person& p) { return

javascript - Reverse scroll direction with AngularJS -

i'm building ionic / angular app , i'm in situation reverse scroll direction on scroll input. when scroll down example area scroll move down. i'm trying accomplish when scroll down content moves , when scroll content moves down. so possible reverse scroll direction? this code: <!-- home page --> <script type="text/ng-template" id=“home.html"> <ion-view ng-controller=“homecontroller" title=“home page"> <ion-content> <ion-list> <ion-item ng-repeat="message in messages track $index"> {{message}} </ion-item> <ion-list> </ion-content> </ion-view> </script> yes, possible. @ jsfiddle . html: <div ng-app="scrollapp"> <scrollbox> <!-- directive --> content scrolled </scrollbox> </div> javascript: var

c# - How to setup multiple async methods into a queue? -

i picked async/await, , wrote series of async methods each perform database sql task , tied each 1 different button. gui doesn't locked when click button, figure that's awesome. however, if click each 1 desired result second button wait first task finish, , on. however, async/await if click multiple buttons i'm not guaranteed finish first. can create unwanted race conditions cause sql queries fail. is there class/object/keyword or can use instead of having each async method handle individual sql command instead adds queue , somehow queue processed serially when has been added it? there many possible designs this. prefer tpl dataflow. you can use actionblock , post async delegates processed sequentially: actionblock<func<task>> _block = new actionblock<func<task>>(action => action()); block.post(async () => { await task.delay(1000); messagebox.show("bar"); }); another possible solution asynchronous

c++ - const constexpr char* vs. constexpr char* -

i know difference between const , constexpr. 1 compile time constant , other either compile time or runtime constant. however, array of chars/strings, i'm confused why compiler complains 1 being used on other. for example have: constexpr char* a[2] = {"....", "....."}; const constexpr char* b[2] = {"....", "....."}; with declaration "a" get: iso c++ forbids converting string constant 'char*' [-wwrite-strings] but declaration "b" no warnings. why const qualifier rid of warning? aren't both of them "const char*" anyway? ask because both declared constexpr should make const char* default? i'd expect fine :s const tells compiler chars pointing should not written to. constexpr tells compiler pointers storing in arrays can totally evaluated @ compile time. however, doesn't whether chars pointers pointing might change. by way, way write code be: const char * c

ruby - Date returns non-existing day -

i'd iterate on days in month, so: require 'time' time.now.month # => 5 time.now.day.next # => 32 what mean? 32nd of may? also, rota.rb:2:in `<main>': undefined method `days_in_month' time:class (nomethoderror) what's wrong? this should explain it: time.now.day.class => fixnum fixnum doesn't know dates, have method next . if want advance next day then: (time.now + (60 * 60 * 24)).day => 1 or if have rails installed can do: require 'active_support/time' (time.now + 1.day).day => 1

css - How to set @Html.Checkbox() is checked when clicking the text beside? -

i have line contains checkbox , text. this: @html.checkbox("cb1") @: checkbox , , requirement is: when hover "my checkbox" , checkbox cb1 hovered. when click "my checkbox" , cb1 clicked. i have tried this, doesn't work: <tr> <td>@html.checkbox("cb1")</td> <td><label id="text">my checkbox</label></td> </tr> with css: #text:hover #cb1:hover { /* mean: if #text hovered, #cb1 hovered too. doesn't work */ } can me? you don't need css. set for attribute in <label> id of control identifies.

php - Micro timestamp and/or random string to file name -

so part of upload file setting name of file struggling append time stamp onto file name or set random string or both? here setting file name , type: if ( move_uploaded_file($_files['upload']['tmp_name'], "../uploads/{$_files['upload']['name']}")){ print_r($_files); echo '<p><em>the file has been uploaded</em></p>'; } // end of move.... if. adding timestamp idea. do: $date = new datetime(); if (move_uploaded_file($_files['upload']['tmp_name'], "../uploads/" . $date->gettimestamp() . "_{$_files['upload']['name']}")){ print_r($_files); echo '<p><em>the file has been uploaded</em></p>'; } note have added underscore _ after timestamp becomes easier remove timestamp if need initial filename again: substr($filename, strpos($filename, '_&

image processing - SIFT: Do I need to compute the orientation in absense of rotations -

i trying understand sift , have question computation of orientation each keypoints. suppose using sift compute transformations between images know images translated respect each other. can away without computing orientation , compute descriptor angle of 0 degrees?