Posts

Showing posts from 2014

php - SOAP and NTLM Authentication between Debian an IIS Server -

i have problem soap authentication in php. have check everywhere answer without success. i hope 'll able me here ! so, here deal. my php application server debian 6 apache2 , web service based on iis server. both servers inside our company network. for connection , authentication use class find on web : http://tcsoftware.net/blog/2011/08/php-soapclient-authentication/ here code using class : <?php define('curlopt_certinfo',1); ini_set("max_execution_time",120); ini_set('default_socket_timeout', 120); ini_set("soap.wsdl_cache_enabled", "0"); ini_set('soap.wsdl_cache_ttl',0); include('./soapclientauth.php'); //wsdl $soapurl = "http://myapplicationadress/ws/web100t/patient_identite_chargerparid.wsdl"; $soapparameters = array( 'login' => 'anadlogin', 'password' => 'theadpassword',

ios - How to use autolayout to prevent overlapping of arbitrary number of dynamically created UIViews -

this question exact duplicate of: uiview contraints such no 2 subviews can touch how can prevent multiple uiviews overlapping when number of uiviews isn't defined before hand? don't care placed on screen long padding definition met. using autolayout seems way can't right. i need have loop uiview *prevview = nil; (uiview *aview in [self subviews]) { // need check foreach subview if view isn't overlapping // lets assume 2 views simplicity if (cgrectintersectsrect(aview.frame,prevview.frame)) { // update view frame // or update autolayout constraints } } // might need call function recursively if first pass wasn't successful depending on specific wants , needs could: position new subview correctly when creating it. if subviews don't move write logic make correct layout of subviews. loop through subviews suggests , relocate each overlapping subview until it's no

android - How to sync AlarmManager with system time? -

i have question, i'm using alarmanager update widget every minute (it's clock) display current time, however, alarmmanager never synced system clock in device, use this: alarmmanager.setrepeating(alarmmanager.rtc, system.getcurrenttimeinmillis(), 60000, pendingintent); it works every minute, however, problem that, if put widget in screen @ 2:15:30 pm example, 1 minute after time alarmmanager going call broadcast again, next update @ 2:16:30 pm, , won't synced system time because when system time displays 2:16:00pm widget still show 2:15:00pm. i hope clear enough, appreciate help, thank you. the second argument setrepeating time want alarm fire first time. need arithmetic align next minute boundary. example like: = system.getcurrenttimeinmillis(); oneminutefromnow = + oneminute; nextminuterollover = oneminutefromnow - (oneminutefromnow % oneminute); then use nextminuterollover second argument setrepeating. (this simplified -- made verbose see c

laravel - L4 and Wordpress - How to install L4 on subdomain shared with Wordpress -

here structure aiming for: project1.site.com -> laravel projects project2.site.com -> laravel projects project3.site.com -> laravel projects www.site.com -> wordpress install how can accomplish this? tried following web host structure /home/user/www/wp -> wordpress install /home/user/l4/project1 -> laravel app folders /home/user/www/project1 -> laravel public folder however l4 not loading - cannot access app folder ("no such file or directory" when trying access l4 bootstrap folder located outside webroot). checked folder permissions , looks fine, guess wordpress not playing laravel. anyone know how fix this? or provide setup allow wordpress site separate subdomains each laravel project? try structure this: /home/user/www/wp -> wordpress install /home/user/www -> laravel install make sure home page goes /home/user/www/public . also, readability, recommen

JavaFX ReadOnlyListProperty not read only? -

this code throws unsupportedoperationexception, expect since it's read only. listproperty<string> lp = new simplelistproperty<string>(); readonlylistwrapper<string> rolw = new readonlylistwrapper<string>(lp); readonlylistproperty<string> rolp = rolw.getreadonlyproperty(); rolp.add("element"); however, code not. observablelist<string> ol = fxcollections.observablearraylist(); readonlylistwrapper<string> rolw = new readonlylistwrapper<string>(ol); readonlylistproperty<string> rolp = rolw.getreadonlyproperty(); rolp.add("element"); is bug, or not understanding something? the original expectation wrong - examples provided. unsupportedoperationexception occurs different reason , not because "read-only" list being "written" to. still possible have "read-only" lists. hope answer below helps clarify. the answer needs considered in 2 parts. one: listproperty exc

erlang - Ejabberd Voip with mod_jinglenodes -

i installed mod_jinglenodes.erl plugin method in ejabberd.it shown in psi+ service discovery option jinglenodes.192.168.1.35 ,but didnot correct response iq a) send iq: <iq type="get" to="kumar@192.168.1.35" id="ab71a"><servicesxmlns='http://jabber.org/protocol/jinglenodes'/></iq> receive it: <iq from="kumar@192.168.1.35" type="error" xml:lang="en" to="babu@192.168.1.35/psi+" id="ab71a"> <services xmlns="http://jabber.org/protocol/jinglenodes"/> <error type="cancel" code="503"> <service-unavailable xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/> </error> </iq> b) <channel xmlns='http://jabber.org/protocol/jinglenodes#channel' protocol='udp'/> didnot result. please me. , how send voip call iq example ? from protocol examples in xep-0278 , looks you're s

ruby - How to check if a value is included between two other values? -

i'm trying express condition this: if 33.75 < degree <= 56.25 # code end but ruby gives error: undefined method `<=' true:trueclass i'm guessing 1 way like: if 33.75 < degree , degree <= 56.25 # code end but there no another, easier way? ruby has between?: if value.between?(lower, higher)

What is the git command to list ignored files? -

this question has answer here: git command show specific files ignored .gitignore 8 answers my netbeans ide shows ignored files on different color. presume, ide knowing using git command. i wish know files on project folder , subfolders being ignored. what command should use? git status --ignored show untracked files. includes normal status output. there not appear status option show ignored files.

asp.net - Page_load event not firing but page_init is -

i have aspx page, work calling stored procedure. if leave page time , click asp.net button click event not fire. if attach process using debugger , put break points in button.click, page.load , page.init events breakpoint fires off page.init. in circumstances can happen? i using tcp socket. using ajax. can of these things cause happen? down timeout issues? thanks just close this. down session ending. sorry waste everyones time. on plus side have answered (and been accepted) first question :)

sql - HOWTO Make a Function With Loop/Repeat In MySQL? -

i'm trying rid of boring task of clicking on create button of gui creating new rows i've decided define function many times want to... here's code, returns error in navicat: create function addrow (number int) begin set @x = 0; repeat insert 'result' () values () set @x += 1; until x > @number end repeat; end call addrow (10) error: [sql]create function addrow (number int) begin set @x = 0; repeat insert 'result' () values () set @x += 1; until x > @number end repeat; end call addrow (10) [err] 1064 - have error in sql syntax; check manual corresponds mysql server version right syntax use near 'begin set @x = 0; repeat insert 'result' () values () set @x += ' @ line 2

android - Decrease the size of the radio button icon -

i progrmatically creating radio button, , works fine, radioimagebutton radioimagebutton = new radioimagebutton(this); radioimagebutton.setgravity(gravity.center); radioimagebutton.setid(buttonid); radioimagebutton.settextcolor(color.black); radioimagebutton.setcompounddrawableswithintrinsicbounds(icon, null,null, null)// use set icon radioimagebutton.setbackgrounddrawable(drawable); radiogroup.layoutparams radioimagebuttonparams = new radiogroup.layoutparams(linearlayout.layoutparams.match_parent, linearlayout.layoutparams.match_parent, 1f); radioimagebuttonparams.setmargins(0, 0, 1, 0); radiogroup.addview(radioimagebutton, radioimagebuttonparams); in radioimagebutton class drawable image; public radioimagebutton(context context) { super(context); setbuttondrawable(android.r.color.transparent); } @override protected void ondraw(canvas canvas) { super.ondraw(canvas); if (image != null) { image.s

linux - nc -u 192.168.1.255 9999 fails -

i trying broadcast 192.168.1.255 broadcast address. ifconfig says eth0 link encap:ethernet hwaddr 50:e5:49:51:0b:cb inet addr:192.168.1.2 bcast:192.168.1.255 mask:255.255.255.0 inet6 addr: fe80::52e5:49ff:fe51:bcb/64 scope:link but if nc -uv 192.168.1.255 9999 reports nc: connect 192.168.1.255 port 9999 (udp) failed: permission denied but nc -uv 192.168.0.255 9999 works fine try using socat instead since nc tools don't support udp broadcasting. echo "hello" | socat - udp4-datagram:192.168.1.255:9999,broadcast

c - Single variable polynomial addition -

i have write program in c whereby have add two, single-variable polynomials. can partly , end wrong answer. consider 2 polynomials: 5x^2 + 6x^3 + 9 6x^3 + 5x^2 + 3x + 2 i know answer going be, manually. here logic: if(term1->exp == term2->exp){ // same power of x // add them, store them in final answer linked list // increment pointers of both term1 , term2 linkedlist } if(term1->exp > term2->exp){ // term1 has higher power of x term2 // increment term1 linked list in search of lower power of x // ** term1 pending ** } if(term1->exp < term2->exp){ // term1 has lesser power of x term2 // increment term2 linked list in search of lower power of x // ** term2 pending ** } the problem face pending terms. how take care of pending terms ? how add them ? code here: http://pastebin.com/70ujdniq i have read code. you have memory issues inside function addpolyomials. problem caused bad wrong logic: leeor has

Invalid Xpath 2 error for 'Click' selenium function -

i have ran test using selenium ide 2.3.0 , copied junit4/remote control script eclispe classic 4.2.2 , started running code 'junit4'. i see following error: invalid xpath 2 the selenium command in eclipse xpath is: selenium.click("//input[@value='search equipment']"); i tried copying xpath using firebug was: /html/body/section[2]/section/div/div/div/form/div[2]/div[2]/div/span/input but same error. start selenium record , enter thing ur textbox or if button click button click stop.you can correct xpath going target in relevant step in selenium ide.use last xpath.

c# - NetSuite Transaction Search Returned Without Any Line Items for Invoice -

i attempting import invoice netsuite program. in program, need information invoice possible returned. not appear of line item information being returned. here piece of code completing search. suggestions? trying complete few calls out netsuite possible in order keep performance high. searchresult searchresults = new searchresult(); transactionsearch ts = new transactionsearch(); transactionsearchbasic tsb = new transactionsearchbasic(); // search invoices if (_invoicetxnids.count > 0) { tsb.internalid = new searchmultiselectfield(); tsb.internalid.@operator = searchmultiselectfieldoperator.anyof; tsb.internalid.operatorspecified = true; list<recordref> rrlist = new list<recordref>(); foreach (string stxnid in _invoicetxnids) { recordref rr = new recordref(); rr.internalid = stxnid; rrlist.add(rr); } tsb.internalid.searchvalue = rrlist.toarray(); ts.basic = tsb; searchresults = _service.search

c# - Windows Store Application Metronome Stop Button Not Working -

hello there developing windows store app. first of all, here code: public class tickargs : eventargs { public datetime time { get; set; } } public class metronome { private dispatchertimer _timer; public event tickhandler tick; public delegate void tickhandler(metronome m, tickargs e); public metronome() { _timer = new dispatchertimer(); _timer.tick += timer_tick; } private void timer_tick(object sender, object e) { if (tick != null) { tick(this, new tickargs { time = datetime.now }); } } public void start(int bbm) { _timer.stop(); _timer.interval = timespan.fromseconds(60 / bbm); _timer.start(); } public void stop() { _timer.stop(); _timer.start(); } } public class listener { public void subscribe(metronome m, mediaelement mmx) { m.tick += (mm, e) => mmx.play(); } public void unsubscribe(metr

java - ssl jdbc connection keystore not found -

i wish use jdbc connect remote mysql database has been secured via ssl. found simple example java program test connection. connection fails , complains keystore file can not found. verify keystore indeed in code. @ least think do. test application looks this: import java.io.file; import java.sql.*; public class testmysqlssl { public static void main (string[] args) { connection con = null; system.getproperties().setproperty("javax.net.debug","all"); system.getproperties().setproperty("javax.net.ssl.keystore","c:\\liferaystuff\\bundles\\liferay-portal-6.0.6\\tomcat-6.0.29\\jrel.6.0_20\\keystore"); system.getproperties().setproperty("javax.net.ssl.keystorepassword","####"); system.getproperties().setproperty("javax.net.ssl.truststore","c:\\liferaystuff\\bundles\\liferay-portal-6.0.6\\tomcat-6.0.29\\jrel.6.0_20\\truststore"); system.getproperties().

Umbraco xmltree update dll -

i had change xmltree.cs file , need move dll of compiled code project update project. there ton of dlls in presentation bin. wanted know if know specific ones need moved. thanks, corey assuming have created project umbraco source, need clean set of source (same version) , compile without change. make change , recompile. affected dlls have changed modified dates, , these ones dependent on code change. you should never base project directly on source, if don't know you're doing. if need modify source, keep separate (and under source control) , build project on compiled version.

java - is it correct to get html from servlet into ajax? -

i'm building web application has number of pages. index.html main page. has few <a> tabs each 1 links different servlet . now, have general css design web app. i want each web page received servlet have design. the first idea had add css code top , bottom of servlet's response think code replication. next idea had receive servlet's response ajax, single div holds new page's content. thank you the reason jsps exist don't things this. returning html in java string cumbersome , error prone. with jsp, can include different parts of other jsps. example, have jsp includes css links. can have jsps link it. here's info related that. if want go further, use web framework. example, stripes framework easy use , has concept of "layouts". can use concept avoid dry violations more. allow avoid saying, "include header file" in every jsp can create. and, there frameworks don't use jsps. example, wicket . t

java - Is there efficient way to convert org.json.JSONObject to POJO model using GSON? -

is there efficient way convert org.json.jsonobject pojo model using gson ? (at moment u thought gson g=new gson(); g.fromjson(json.tostring(), personmodel.class); json jsonobject ). using volley , in response instance of jsonobject , can parse on http://www.kpbird.com/2013/05/volley-easy-fast-networking-for-android.html have complex structure in models nested lists , avoid manual extracting of data json. first, sorry bumping old question. i asking myself same question , found example in android volley section called implementing custom requests in android developer site. @override protected response<t> parsenetworkresponse( networkresponse response) { try { string json = new string(response.data, httpheaderparser.parsecharset(response.headers)); return response.success(gson.fromjson(json, clazz), httpheaderparser.parsecacheheaders(response)); } // handle errors ... } i use stringrequest , use gson on response c

comments - Overriding SilverStripe 3 CommentsInterface.ss -

i've installed comments module ss 3.0 blog , it's working. but want override commentsinterface.ss template , can't figure out put overriding file. i've tried in themes/mytheme/template , themes/mytheme/templates/includes , neither seem work. this should not hard, must missing easy. clues? bob place commentsinterface.ss in /themes/mytheme/templates/ . run ?flush=all flush template cache silverstripe starts using new template.

android - Error with layout on new application project -

i create new application project on eclipse, gives immediatly errors on code of mainactivity.class. error on r. of setcontentview @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); } @override public boolean oncreateoptionsmenu(menu menu) { // inflate menu; adds items action bar if present. getmenuinflater().inflate(r.menu.main, menu); return true; } but if import android.r, gives error on words activity_main (it doesn't recognize layout), , on word main. can do? it's strange error on applications created. make sure have layout activity_main.xml within res/layout directory , menu main.xml within res/menu directory. you shouldn't import android.r

ruby on rails - How do I use the Impressionist gem? -

i'm using impressionist gem. i want display hit counter of 1 particular page, in same view. this did: install gem. run generator. add column counter_cache migration. run rake db:migrate . add impressionist :actions=>[:show ] controller want track impressions from. add is_impressionable :counter_cache => true model pertaining controller above. restart server. i have 2 questions: why doesn't counter_cache number increased each impression (and each respective record)? is there method can use in view display hit count, or should craft own query? there method show how hits: <%= @model_instance.impressionist_count %> views put in view.

javascript - Hide form and Div class from drop down box -

i have drop down box once selected displays specific form elements, works perfect add div class elements (drop down boxes) css class still shows if specific element isn't selected. is possible hide css class along form element, below code. javascript function check() { var dropdown = document.getelementbyid("filtercriteria"); var current_value = dropdown.options[dropdown.selectedindex].value; if (current_value == "page_name") { document.getelementbyid("contains").style.display = "block"; document.getelementbyid("term").style.display = "block"; document.getelementbyid("countries").style.display = "none"; document.getelementbyid("postcodes").style.display = "none"; document.getelementbyid("repeater").style.display = "none"; document.getelementbyid("visitor_type").style.display = "none"; document.getelemen

php - Jquery submit doesn't submit form -

my form submits fine using plain old javascript when try use jquery doesn't the form... <form class="control_select" name="audit_delete_form" id="audit_delete_form" method="post" action="<?php echo $_server['php_self']; ?>"> <select id="audit_id_select" name="audit_id_select"> <option value="">please select</option> <? while($row = mysqli_fetch_assoc($result)){ echo '<option value="'.$row['auditid'].'">'.$row['auditname'].'</option>';}?> </select> <input type="submit" name="audit_delete_submit" id="audit_delete_submit" value="" /> </form> the php.. if(isset($_post['audit_delete_submit'])){ $audit_id = $_post['aud

logging - Info about parameters and rendered partials missing from Rails development log file -

this how normal rails 3.2 log file entry looks like: started "/admin" 127.0.0.1 @ 2013-08-05 14:36:43 +0200 processing admin::pagescontroller#show html parameters: {"id"=>"admin/dashboard"} post load (1.5ms) select 'posts'.* 'posts' 'posts'.'riddle' = 1 , 'posts'.'solved_at' <= '2013-08-05 12:36:43' order comments_count desc limit 1 [...] cache (0.0ms) select 'comments'.* 'comments' 'comments'.'post_id' = 74 order 'comments'.'id' desc limit 1 (0.3ms) select count(*) 'posts' 'posts'.'riddle' = 1 rendered admin/dashboard.html.haml within layouts/admin (109.1ms) rendered shared/admin/_header.html.haml (3.8ms) the problem: in 1 of apps, leading processing ... , parameters: ... , trailing rendered ... lines missing , can't life of me figure out why! started "/admin" 1

ios - Can't make NSArray deep copy -

a user on app can select filters narrow down items. once filters selected, nsnotification sent passes array of selected filters ( nsstring s) view controller. when receive notification, can extract array [notification userinfo] . now, want compare new filters saved user, make call server if different. here's method: - (void)applyfilters:(nsnotification *)notification { nsarray *filters = [[notification userinfo] objectforkey:@"filters"]; if (showmyitems) { if (![[nsset setwitharray:filters] isequaltoset:[nsset setwitharray:[[pfuser currentuser] objectforkey:@"filtersmy"]]]) { [[pfuser currentuser] setobject:[nsarray arraywitharray:filters] forkey:@"filtersmy"]; [[pfuser currentuser] saveinbackground]; } } else { if (![[nsset setwitharray:filters] isequaltoset:[nsset setwitharray:[[pfuser currentuser] objectforkey:@"filters"]]]) { [[pfuser currentuser] seto

tsql - SQL Server: split long text into multiple lines with max # of characters per line -

is there function in sql server splits long text multiple lines? say have 1,000 characters , need split text multiple lines max of 80 characters per line, can split @ spaces not in middle of word? thanks. there's not built in split function, can use multiple substrings/charindex, like: declare @fieldname varchar(max) = 'lorem ipsum dummy text of printing , typesetting industry. lorem ipsum has been industrys standard dummy text ever since 1500s, when unknown printer took galley of type , scrambled make type specimen book. has survived not 5 centuries, leap electronic typesetting, remaining unchanged. popularised in 1960s release of letraset sheets containing lorem ipsum passages, , more desktop publishing software aldus pagemaker including versions of lorem ipsum.' select substring(@fieldname,1,charindex(' ',@fieldname,70)-1) ,substring(@fieldname,charindex(' ',@fieldname,70)+1,charindex(' ',@fieldname,140)-charindex('

Trying to deploy an Entity Framework MVC3 application to specialist ASP.NET shared host, getting strange error? -

i have 2 project mvc3 .net 4, ef5 web application have tried "one-click" publish discountasp account has ms sql server 2008 instance installed. the error getting : schema specified not valid. errors: ordersdb.csdl(2,9) : warning 0005: not find schema information attribute 'namespace'. ordersdb.csdl(2,38) : warning 0005: not find schema information attribute 'alias'. ordersdb.csdl(2,288) : error 0005: 'http://schemas.microsoft.com/ado/2009/02/edm /annotation:usestrongspatialtypes' attribute not declared. ordersdb.csdl(2,2) : error 0010: element schema in namespace http://schemas.microsoft.com /ado/2009/11/edm unexpected root element. expected schema in 1 of following namespaces: http://schemas.microsoft.com/ado/2006/04/edm, http://schemas.microsoft.com/ado/2007/05/edm, http://schemas.microsoft.com/ado/2008/09/edm. any ideas please? i publish web project, not db project contains pocos. not believe need dll pulled web project

java - HBase mapreduce: write into HBase in Reducer -

i learning hbase. know how write java program using hadoop mapreduce , write output hdfs; want write same output hbase, instead of hdfs. should have similar code did before in hdfs thing: context.write(key,value); could show me example achieve this? here's 1 way this: public static class mymapper extends tablemapper<immutablebyteswritable, put> { public void map(immutablebyteswritable row, result value, context context) throws ioexception, interruptedexception { // example copying data source table... context.write(row, resulttoput(row,value)); } private static put resulttoput(immutablebyteswritable key, result result) throws ioexception { put put = new put(key.get()); (keyvalue kv : result.raw()) { put.add(kv); } return put; } } you can read here table mapper

css - Can't select checkboxes in Modal dialog -

trying select of checkboxes in modal dialog here: http://ezami.com/ - 1 pops after clicking top right ribbon. none of them seem work. did little research , testing using z-index nothing seem work far, z-index being set modal value , seems working fine. i have sample ready logic want implement. image/colour can anything. demo link <html> <head> <title>checkbox</title> <style> input[type=checkbox] { display:none; } input[type=checkbox] + label { background: #999; height: 16px; width: 16px; display:inline-block; padding: 0 0 0 0px; } input[type=checkbox]:checked + label { background: #0080ff; height: 16px; width: 16px; display:inline-block; padding: 0 0 0 0px; } </style> </head> <body> <p> <input type='checkbox' name='thing' value='valuable' id="thing"/><labe

java - onSessionStateChange does whatever it wants -

i know title may odd, since i've changed app's lifecycle moving login cycle mainactivity loginactivity , facebook's onsessionstatechange absolutely nothing of ask him. the login's lifecycle, using facebook, logs user facebook, gets uid fb, , retrieve infos our app's server using uid, , starts next activity. i've changed app's lifecycle, starts next activity without getting uid. so here code onsessionstatechange in loginactivity : private void onsessionstatechange(session session, sessionstate sessionstate, exception exception){ //make change if activity visible if(isresumed){ log.i("facebook", "fb state changed"); fragmentmanager fragmentmanager = getsupportfragmentmanager(); //clear stack for(int = 0; < fragmentmanager.getbackstackentrycount(); i++){ fragmentmanager.popbackstack(); } if(sessionstate.isopened()){ log.i("facebook",

Python 2.7 - Split comma separated text file into smaller text files -

i (unsuccessfully) trying figure out how create list of compound letters using loops. beginner programmer, have been learning python few months. fortunately, later found solution problem - genearte list of strings compound of letters other list in python - see first answer. so took code , added little needs. randomized list, turned list comma separated file. code: from string import ascii_lowercase al itertools import product import random list = ["".join(p) in xrange(1,6) p in product(al, repeat = i)] random.shuffle(list) joined = ",".join(list) f = open("double_letter_generator_output.txt", 'w') print >> f, joined f.close() what need split massive file "double_letter_generator_output.txt" smaller files. each file needs consist of 200 'words'. need split many files. files of course not exist yet , need created program also. how can that? here's how it, i'm not sure why you're splitting

javascript - Recursively add identical element to each object in array -

i have object contain array of object ('pages') var obj = { "pages" : [ { "title": "title one", "sub" : [ { "title" : "title 1 one"}, { "title" : "title 1 two"} ] }, { "title" : "title two" }, { "title" : "title three", "sub" : [ { "title" : "title 3 one"}, { "title" : "title 3 two"}, { "title" : "title 3 three"} ] } ] } and expected result (add 'slug' element each object in 'pages') { "pages" : [ { "title" : "title one", "slug" : "title-one", "sub" : [

iphone - Auto Layout with navigation bar and view controller (iOS 7) -

i'm transiting application ios 7 (i want remain ios 6 compatible). question not covered apple nda, question auto layout (it seems ios 7 forces auto layout (edit : wrong, not forced)). i have navigation controller root view controller (obvious). ios 6, not using auto layout, root view controllers below navigation bar. ios 7, frame origin not include navigation bar, top part of content hidden... have idea how make entire view above navigation bar auto layout ? thanks ! on ios 7 have toplayoutguide specify navigation bar. can specify want constraint of tableview on toplayoutguide , not superview. this know if it's ios7 or not: if ([self respondstoselector:@selector(toplayoutguide)]) so can that nsstring *verticalconstraint = @"v:|[v]|"; nsmutabledictionary *views = [nsmutabledictionary new]; views[@"v"] = self.tableview; if ([self respondstoselector:@selector(toplayoutguide)]) { views[@"toplayoutguide"] = self.toplayout

c++ - Reference object array outside of function it is declared in -

int main() { tile map[50][50]; ///// generate map \\\\\ buildroom(10, 10, 10, 10, 1); return 0; } void buildroom(int startx, int starty, int sizex, int sizey, int direction) { if (direction == 1) { (int x; x++; x > sizex) map[startx + x][starty].type = 1; } } currently map variable doesn't exist in context of buildroom() function. how able access map variable outside of main() function? pass parameter. (arrays, unlike other parameters, not copied when passed value. modifying parameter alter external array). int main() { tile map[50][50]; ///// generate map \\\\\ buildroom(map, 10, 10, 10, 10, 1); } void buildroom(tile map[50][50], int startx, int starty, int sizex, int sizey, int direction) { if (direction == 1) { (int x; x++; x > sizex) map[startx + x][starty].type = 1; } } or put in class. #include <cassert> class map { public: static const int

Create folder with mkdir with loop in Bash -

i want create folders in bash taking months reference in loop, month in curse , future months, have code generate first folder. echo "probando desde vim" echo "vim" if [ -d "$home/desktop/$(date +%b)" ] echo "si existe" else mkdir $home/desktop/$(date +%b) echo "la carpeta fue creada" fi !/bin/bash home_dirs="$home/desktop/" date_dir=$(date +%b) folder in $home/desktop/; mkdir -p "${folder}/${date_dir}" done

javascript - Can JS be used to display a new dropdown already filled by php mysql? -

i know php server-side , js client side, i've done research haven't found looking for. so i'd know if possible use javascript display php code? scenario: i have drop down list on page being updated database (quick example) php while($row...) { <option><?php echo $row["number"]; ?></option> } and using javacript display new drop down list when button clicked <script language="javascript"> var = 1; function changeit() { my_div.innerhtml = my_div.innerhtml +"<br><select><option name='mytext'+ i></option></select>" i++; } </script> this works i'd able have new drop down list appear pre filled. is possible have these 2 items work together?? if how? or require page reload each time since php loads before reaches user (and how again..)? any or guidance appreciated. this example uses jquery make ajax call your-script.php , in turn returns html

css - How can I new newline in title attribute in HTML -

this question has answer here: how can use carriage return in html tooltip? 21 answers i using this <a href="#" title="select 1: 2: that" > click here </a> when hover on see text in 1 line. is there way show on new line? try code works <a href="#" title="select 1: &#013; 2: that" > click here </a>

android - Cannot run ndk-build on Terminal -

i new using ndk platform , following error on running ndk-build in terminal: aditya@aditya-vostro1510:~/workspace/fibonacci$ ~/android-ndk-r9/ndk-build android ndk: warning: app_platform android-18 larger android:minsdkversion8 in ./androidmanifest.xml android ndk: app_build_script points unknown file: ./jni/android.mk /home/aditya/android-ndk-r9/build/core/add-application.mk:176: *** android ndk: aborting... . stop. i didnt make application.mk file read optional , video tutorial refered did not include too. android.mk contains foll code: local_path := $(call my-dir) include $(clear_vars) local_src_files := com_native_fibonacci_fiblib.c local_module := com_native_fibonacci_fiblib include $(build_shared_library) i tried searching on forums failed.please give me detailed solution this.

google maps - Getting the nearest street/road coordinates in android -

in javascript, using google maps api s specify options such google.maps.travelmode.driving . have equivalent travelmode in android? couldn't see in android.location.locationmanager or android.location.criteria i've thought of following options: using travelmode alternative, coordinates approximated nearest street/road. alternatively, ( not preferred slow ) coordinates , send google api(this pretty slow there many points) , coordinates corrected nearest street coordinates. or in case if there exists (google-maps) javascript framework, may used corresponding street coordinates. edit1: i've looked this . , hence android.location.geocoder . getfromlocation in class seems of work. however, i'm afraid, of additional delay while acquiring nearest address. if referring directions service , uses google directions api internally stated in overview: this object communicates google maps api directions service receives direction requests , returns c

How to formate the xml in java dom parser? -

this question has answer here: how pretty print xml java? 29 answers <?xml version="1.0" encoding="utf-8"?><request> <id> here first tag written file followed xml version, need need write in next line. below <?xml version="1.0" encoding="utf-8"?> <request> <id> i have use below code write xml file,please help transformerfactory transformerfactory = transformerfactory .newinstance(); transformer transformer = transformerfactory.newtransformer(); domsource source = new domsource(document); streamresult result = new streamresult(new file( constants.xmllocation + constants.metadataxmlfilename + format.format(calendar.gettime()) + ".xml")); transformer.setoutputpr

angularjs - Should I care about W3C validation? -

i'm learning angularjs , found simple code one: <!doctype html> <html> <head> <meta charset='utf-8'> <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.js"></script> </head> <body ng-app ng-init="name = 'world'"> <h1>hello, {{name}}!</h1> </body> </html> does not pass w3c validation test, because there non standard attributes ( ng-app , ng-init ). the question is: should care w3c validation of application? should abandon angularjs? you use data- html5 attribute standard , far know works same angular. like: data-ng-app="" data-ng-init="xxx" will work same in angular , validated w3c. look @ this: ng-app vs. data-ng-app, difference? aside that, experience working standards better when product delivered possible large crowd (so you'r building website or public webapp , on) different clients, ver

android - Convenient way to test custom DB from Assets using ProviderTestCase2 -

i testing contentprovider using providertestcase2. to this, created assets folder , storing prepared db there. on start trying upload db make test on it, cannot assets folder assetsmanager since getassets using getcontext pointing tested contentprovider class, while getassets using getmockcontext throws throws unsupportedoperationexception. what proposed solution test custom db altogether custom contentprovider junit tests on android? providertestcase2 disappointingly doesn't expected do?

performance - Get time (& network speed) to download a file in AsyncTask - Android -

i'm newbie in android. can say, how display in android ui, during download progressing state, speed @ file (say xyz.mp4 ) downloading , remaining time complete download xyz.mp4 file. i using asynctask download task, , want display speed , time along "progress percentage". i'm using progressdialog in dialogfragment . solution class downloadvideofromurl extends asynctask<string, string, string> { @override protected void onpreexecute() { super.onpreexecute(); // pre executing codes (ui part)... // progressdialog initializations... } @override protected string doinbackground(string... params) { if(params.length < 2) return ""; string videourlstr = params[0]; string filename = params[1]; try { url url = new url(videourlstr); urlconnection conection = url.openconnection(); conection.connect(); // useful can sho

ListView without scroll on Android -

i want set listview show items without scroll. below layout: <linearlayout android:id="@+id/layout" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" > <textview android:id="@+id/tv1" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="large text" android:textcolor="@android:color/black" android:textappearance="?android:attr/textappearancelarge" /> <listview android:id="@+id/list" android:layout_width="match_parent" android:layout_height="wrap_content" > </listview> <textview android:id="@+id/tv2" android:layout_width="match_parent" android:layout_height="wrap_content"

coding style - Python Tkinter Custom Window -

i have simple tkinter custom window . beginner , learnt tkinter few months ago. have no experience in real software development. so, know if way coded acceptable? know when acceptable , mean lot of things. want know things should improve in coding style & way think? import tkinter tk ''' creating tkinter tk instance ''' class application(tk.tk): def __init__(self,*args,**kwargs): tk.tk.__init__(self,*args,**kwargs) self.bind("<buttonpress-1>", self.startmove) self.bind("<buttonrelease-1>", self.stopmove) self.bind("<b1-motion>", self.onmotion) self.init() self.layout() self.addbuttons() ''' setting main tk window size & styles ''' def init(self): self.geometry("1280x700+0+0") self.overrideredirect(true) self['background'] = '#201f29' self['highlig

How to fetch phone contact to create group in windows phone8 app -

i developing windows phone 8 application. have create group of contacts using phone contacts , make available access throughout application. research chooseers , launchers of windows phone: how use save contact task windows phone and have also how use email compose task windows phone how use save phone number task windows phone how use phone number chooser task windows phone to create group think can serialize , deserialize objects disk (xaml / c #) hope it's help

Highchart xaxis data decrease when shift -

i creating chart , populating random data every 5 minute. set xaxis data range 5 hour , when start initial data, it's width full in chart when continuously add point, data width decreasing. how do make not decrease series width? i have following code: $(function () { var current_time = (new date()).gettime()+300000; var now_time = (new date()).gettime(); var zone_name = ['a','b','c']; $(document).ready(function() { highcharts.setoptions({ global: { useutc: false } }); $('#container').highcharts({ chart: { type: 'spline', animation: highcharts.svg, marginright: 10, events: { load: function() { var chartsss = $('#container').highcharts(); setinterval(function() { for(var i=0;i<

maven - how to configure/use CheckStyle in Hudson/Jenkins -

please give solution eagerly waiting :) need - how use checkstyle. i doing static code analysis in hudson, first part, installed static analyser , checkstyle plugins in hudson. not able find out how use in official hudson checkstyple page also. official page : http://wiki.hudson-ci.org/display/hudson/checkstyle+plugin i saw documents in maven checkstyle plugin have mension configuration in pom file , run targets. then, got doubt, if doing maven, why need checkstyle plugin install in hudson? is possible configure checkstyle in hudson job java project instead of changing in pom or not? it here both ways, 1 better? do steps configure checkstyle plugin in hudson? if you've installed plugin in jenkins/hudson, should able add checkstyle goal project/job. in goals section of jenkins maven job, add "checkstyle:checkstyle" enable checkstyle plugin analyse project.

nonlinear regression in R with multiple data sets -

i learning r , using non linear regression (which learning). have 2 sets of data (duration of operation on different machines) , able find non linear regression each of these sets. now, find best regression minimise sum of both residual sum-of-squares. here have : a <- c(1:5) b <- c(100, 51, 32, 24, 19) c <- c(150, 80, 58, 39, 29) df <- data.frame (a,b,c) f <- b ~ k1/a + k2 g <- c ~ k1/a + k2 n <- nls(f, data = df, start = list(k1=10, k2=10)) p <- nls(g, data = df, start = list(k1=10, k2=10)) n #nonlinear regression model # model: b ~ k1/a + k2 # data: df # k1 k2 #101.595 -1.195 # residual sum-of-squares: 2.619 #number of iterations convergence: 1 #achieved convergence tolerance: 2.568e-07 p #nonlinear regression model # model: c ~ k1/a + k2 # data: df # k1 k2 #148.044 3.593 # residual sum-of-squares: 54.19 #number of iterations convergence: 1 #achieved convergence tolerance: 1.803e-07 k1 , k2 constant (of course)