Posts

Showing posts from March, 2013

html5 - CSS Transform does not increase parent div height -

i have added 2 divs 1 parent , other child. <div class="parent_div"> <div class="child_div_with_transform"> </div> </div> i have added webkit-transform child div. want set parent div height same it's child div after transform. want remove scrollbar. you can ref. following code. http://jsfiddle.net/sab2t/ i love try solution. try this add .parent { display:table; // add parent width:400px; // per requirement } .child { display:table-row; // add child } it solve problem. have jsfiddle

Split date into parts - PHP/Laravel/Carbon -

i'm starting integrate carbon website , can't seem able format wants. carbon::create($year, $month, $day, $hour, $minute, $second, $tz); // initial data $day = 'today'; $time = '1100'; // convert them $d = date('y-m-d',strtotime($day)); $t = date('h:i:s',strtotime($time)); // end date = "2016-01-05" time":"11:00:00" how can split them php me extract $year, $month, $day, $hour, $minute, $second so based on comments: function converttime($day, $time){ $d = date('y-m-d-h-i-s',strtotime($day." +".$time)); $expd = explode("-", $d); $year = $expd[0]; $month = $expd[1]; $day = $expd[2]; $hour = $expd[3]; $minute = $expd[4]; $second = $expd[5]; return array($year, $month, $day, $hour, $minute, $second); }

libgdx - texture packer doesn't create one huge image of images -

i'm following book libgdx , haven't comprehend texture atlases to. far understood, texture packer creates 1 huge image textures , atlas or pack file. when run it creates atlas/pack file , stores images 1 one. end same number of images stared with, therefore have done nothing. why happening? additional option needs checked, can create 1 huge file of images? used texture packer https://code.google.com/p/libgdx-texturepacker-gui/ i not use texture packer gui easier , faster pack textures source. if work eclipse, can following. make raw-assets folder inside android/assets folder , copy images there make pack folder inside android/assets folder create new class on desktop project , copy code public class texturesetup { static string input = "../android/assets/raw-assets"; static string output = "../android/assets/pack/"; static string atlas = "my-assets"; public static void main(string[] args){ texturepa...

memory management - How can 8086 processors access harddrives larger than 1 MB? -

how can 8086 processors (or real mode on later processors) access harddrives larger 1 mb, when can access 1 mb (without expanded memory) of ram? access not linear (by byte) sector. sector size may example 512 bytes. computer reads sectors memory needed.

php - using stdClass() to create soap request wsdl complex type -

after finding php soap not handle arrays complex type, i'm using stdclass() i've coded creates soap request in wrong sequence. want idtag , idtaginfo in pairs below. <soap:body> <ns:sendlocallistrequest> <ns:updatetype>full</ns:updatetype> <ns:listversion>1</ns:listversion> <ns:localauthorisationlist> <ns:idtag>1</ns:idtag> <ns:idtaginfo> <ns:status>good</ns:status> </ns:idtaginfo> <ns:idtag>2</ns:idtag> <ns:idtaginfo> <ns:status>bad</ns:status> </ns:idtaginfo> </ns:localauthorisationlist> </ns:sendlocallistrequest> </soap:body> my soap request wrong coming out below <env:body><ns1:sendlocallistrequest><ns1:updatetype>full</ns1:updatetype> ...

java - How to handle ConnectTimeoutException Android -

does know how handle connecttimeoutexception? i'm posting variables url using asynctask internet connection shocking i'm recieving null data because of connecttimeoutexception. best ways handle example if time out occurs try run again etc have not had problem before don't have clue how handle feel needs handling improve user experience. ideas? you use handler let activity know got connecttimeoutexception catch exception in asynctask , send message handler (then whatever want) just information, asynctask aren't designed long running operation, if should use thread

javascript - Changing server from client-side on Socket.io -

this first question on website. lot of questions on google have been answered site, can't find answer question, or can't think of right way post question. i have 3 socket.io servers should change clicking different buttons. thought this: var pot_bot = io('12.12.12.12:3222'); pot_bot.on('action', function(data) { console.log('unique data '+data.hi);}); if(button1.clicked) pot_bot = io('12.12.12.12:3223'); everything correct, problem when override variable pot_bot .on('action') called when new server emits it. isn't case code example above. does have solution this? i suggest removing event listener old manager before overwriting pot_bot , binding new listener new one. (io caches managers if every switch old manager back, , if keep adding listener, without ever removing them, duplicate listeners on same manager). can put in function don't have repeat code: function switch_to_server( new_uri ) { pot_bot &...

Install certificate on Centos 7 for docker registry access -

we have docker registry setup, has security. normally, in order access it, developer's perspective, have long docker login --username=someuser --password=somepassword --email user@domain.com https://docker-registry.domain.com . however, since trying automatized deployment of docker container in cloud, 1 of operations, docker pull command, fails because login not performed (it works if add login in template, that's bad). i suggested use certificate allow pull being done (.crt file). tried installing certificate using steps explained here: https://www.linode.com/docs/security/ssl/ssl-apache2-centos but not seem work, still have manual login in order able perform docker pull registry. is there way can replace login command use of certificate? as see, it's wrong url ssl authentication between docker server , private registry server. you can follow this: running domain registry while running on localhost has uses, people want registry more available....

python - Logging in custom time format -

the logging module offers automatic display off information next logging message: logging.basicconfig(format='%(levelname)s {%(filename)s:%(lineno)s} in %(funcname)s: %(message)s', level=logging.debug) i want include seconds start of runtime of script. logging module offers msecs how can include seconds since start inside format string? in documented logrecord attributes : relativecreated %(relativecreated)d time in milliseconds when logrecord created, relative time logging module loaded.

javascript - Warn on non-ASCII Characters in Django Form -

i'm trying add client-side ajax validation of django form. want warn users, typing in field, if of characters inputted not ascii. i put basic python check ascii characters in form's clean method. don't want that, though, don't want produce error rather give warning message , let user continue rest of form. try: field_value.decode('ascii') except unicodeencodeerror: #raise forms.validationerror("non-ascii characters may cause issues in registering data. consider removing these characters. may still submit @ own risk.") # want show warning user can still submit form if wish i want show small warning under field user typing. i've tried using django-dajax, not sure. how can this? edit: clarify, want show warning before user submits form. so, filling out form... use javascript validate form field. example (using jquery): <form> <input name="whatever" id="fieldid"> ... </fo...

How to find directories without dot in bash? -

i try find folders without dot symbol. search in users directory via script: !#/bin/bash users=$(ls /home) user in $users; find /home/$user/web/ -maxdepth 1 -type d -iname '*' ! -iname "*.*" done but see in result users folders dot, example - test.uk or test.cf what wrong? thanks in advance! you can use find -regex option that: find /home/$user/web/ -maxdepth 1 -type d -regex '\./[^.]*$' '\./[^.]*$' match names without dot.

html - How to make transparent text? -

Image
this question has answer here: how change text transparency in html/css? 7 answers i'm making portfolio , i'd know how set div property makes div's text transparent , background , such opaque. use rgba , set opacity 0 (the last value). color:rgba(0, 0, 0, 0); see here update now have clarified question... svg best bet. see fill-opacity

virtual machine - NumPad keys dont work -

i had problem on virtual box virtual machine running ubuntu, times, numpad keys worked , times didn't. thought bug, or issue guest additions, or related starting virtual machine while numpad led activated. nothing that. though share solution. the solution quite simple: system -> preferences -> keyboard -> tab "mouse key" -> deactivate "pointer can controlled using keypad". and numpad keys work fine. source: https://forums.virtualbox.org/viewtopic.php?f=1&t=18023#p77983

for loop - PHP Foreach: 2 columns, 1 row, repeatedly -

i trying produce this php foreach loop: <form> <div class="form-group"> <div class="row"> <div class="col-md-6"> data </div> <div class="col-md-6"> data </div> </div> </div> </form> current php code: $form = ''; $form .= '<form>'; $count = 0; foreach ($fields $f) { // open .form-group , .row every 2 loops? if($count % 2) $form .='<div class="form-group"><div class="row">'; $form .= '<div class="col-sm-6">'; // open column $form .= 'whatever data'; $form .= '</div>'; // close column // close .form-group , .row every 2 loops? if($count % 2) $form .= '</div></div>'; $count++; } $form .= '</form>'; i tried many possible ways, examp...

javascript - Counting the occurence of a string after a for loop -

i working on personal project, javascript. @ intermediary level. have created loop gives me list of random numbers. each "i", there 1 pair of integers. integers positive, different , within range (ex. between 1 , 10). let's after run loop, this: 1 vs 3 4 vs 7 5 vs 8 2 vs 3 7 vs 5 3 vs 4 1 vs 2 3 vs 5 3 vs 1 5 vs 7 ... , on... now, how count occurence of each pair of occurence. example, able have: 3 vs 1: occurred 2 times 7 vs 5: occurred 2 times 3 vs 5: occurred 1 time , on... the order not matter, consider 3 vs 1 , 1 vs 3 same thing. realize may complicate things. // generate pairs var randompairs = [] (var = 0; < 10; ++i) { var randompair = [math.floor(math.random() * 4) + 1, math.floor(math.random() * 4) + 1] randompairs.push(randompair) } // count pairs var randompairscounted = [] (var = 0; < randompairs.length; ++i) { var = randompairs[i][0] var b = randompairs[i][1] if (a > b) { var t = = b b...

python - Numba returns NotImplemented Error - cell vars are not supported -

somehow numba not want compile function. have suspicion might connected lambda functions internet revealed nothing. error code is: numba returns notimplemented error - cell vars not supported my file: from __future__ import division scipy import special math import exp,sqrt import numba nb import numpy np @nb.jit def build_cov_matrix(n,t,h,rho): # initialisation of variables sigma = np.zeros((2*n,2*n)) # initialise covariance matrix sigma t_grid = np.linspace(t/n,t,n) # time grid gamma = 0.5-h # simplifying parameter in calculations d_h = sqrt(2*h)/(h+0.5) # factor used in computation # definition of auxiliary functions itt = lambda x: t_grid[x%n] # translate index time g = lambda x: 2*h*(1/(1-gamma)*x**(-gamma)+gamma/(1-gamma)*x**(-1-gamma)* special.hyp2f1(1,1+gamma,3-gamma,1/x)/(2-gamma)) # covariance matrix building without z_0 , ...

php - Codeigniter no data sent posted on form -

my login system stopped working, can't fix it, i've been looking , seems data doesn't posted can't find problem. this view: <?php if(! is_null($err)) echo "<div class=\"alert alert-danger\">".$err."</div>";?> <form class="form-signin" action="<?php echo site_url("user/validate"); ?>" method="post"> <h2 class="form-signin-heading">please sign in</h2> <label for="email" class="sr-only">email address</label> <input type="email" name="email" class="form-control" placeholder="email address" required autofocus> <br/> <label for="password" class="sr-only">password</label> <input type="password" name="password" class="form-control" placeholder="password" r...

git - How to Exclude NuGet Content from Source Control -

i know nuget packages (at least nowadays) should not included in version control. how should exclude files package adds project? for example: have .net mvc project uses bootstrap nuget package. adds css, js, , font files content, scripts, , fonts, respectively. should these files included in source control? if not, best way ignore them? (i'm using git on particular project.) generally speaking, generated files should not tracked source control tool. here question addresses pros/cons of doing so. you can ignore files , directories creating .gitignore file @ root of repo. following example package above, ignore content adding .gitignore file: content scripts fonts here more documentation on ignoring files git .gitignore . you can populate .gitignore based on visualstudio project uses .

multiple log_opts for docker logging -

my docker-compose file looks this. works great. logs show on syslog server. problem cannot view them locally in /var/log/messages . way can both? mydocker: image: mydocker log_driver: syslog log_opt: syslog-address: "<url-goes-here>" currently answer no . mentioned in link syslog/journald host , further process logs there. creating own little log container shouldn't hard either.

ios - Update UI on main thread from AFHTTPRequestOperation -

i've built rails backend ios app lets users access restful api after having authorized device. authorization managed retrieving token. when user submits username , password, webservice gets called afhttprequestoperation (see code below). display user hud ( mbprogresshud ) track progress of request. i've set callbacks success , failure , want update hud , let stick onscreen updated message couple of seconds before dismissing it. //set hud mbprogresshud *hud = [mbprogresshud showhudaddedto:self.view animated:yes]; hud.mode = mbprogresshudmodeindeterminate; hud.labeltext = @"authenticating"; //set http client , request nsurl *url = [nsurl urlwithstring:@"http://localhost:3000"]; afhttpclient *httpclient = [[afhttpclient alloc] initwithbaseurl:url]; [httpclient setparameterencoding:afformurlparameterencoding]; //setting x-www-form-urlencoded nsmutableurlrequest *request = [httpclient requestwithmethod:@"post" path:@"/api/v1/tokens.json...

visual studio 2015 - Allow Git in File Explorer After Installation -

i have installed git using visual studio 2015 installer. unfortunately, looks installing way did not add "git bash here" feature file explorer, feature used heavily when installed git manually. is there way add feature without reinstalling manually? the "git bash here" should provided setup (not portable version) of git windows . its releases include: v2.7.0.windows.1/git-2.7.0-64-bit.exe or, 18 months later: v2.14.1.windows.1/git-2.14.1-64-bit.exe .

visual studio 2015 - Entity Framework 7 code first error CREATE DATABASE permission denied in database 'master' -

i'm using vs2015 vnext/asp.net5 wint ef7. config.json file has following value "testcontextconnection": "server=.\\sqlexpress;database=testdb;trusted_connection=true;multipleactiveresultsets=true" whenever run project following error create database permission denied in database 'master'. can please explain, don't know user i'm referring here active directory user or other dbuser? rights i've assign user in order code work successfully? if have create new user scratch required permissions this? thanks in advance. do need use testdb database on sqlexpress server, or trying , running? if trying , running, try using following connection string: server=(localdb)\\mssqllocaldb;database=<database_name>;trusted_connection=true;multipleactiveresultsets=true

android - interstitial ad show black (->) AFMA_ReceiveMessage is not defined (:1) -

i followed official guide of android add interstitial ads . if use test mode: adrequest adrequest = new adrequest.builder() .addtestdevice("my code here") .build(); minterstitialad.loadad(adrequest); works ok , can see demo interstitial add. if use release mode: adrequest adrequest = new adrequest.builder().build(); minterstitialad.loadad(adrequest); i see black interstitial add , in log in red: js: uncaught referenceerror: afma_receivemessage not defined (:1) + info: i use last updated google play services lib. i try 2 devices , 2 wifi networks. in same device can see other apps interstitial ads the ad created in admob in last 24 hours. i try load add fron thread app crash my admob account ok, have other ads working. manifest: <uses-permission android:name="android.permission.internet" /> <uses-permission android:name="android.permission.access_network_state" /> (......

Java - ArrayList default initial values -

when create arraylist of type integer in java default values? need check if arraylist full , going size of array value @ last index , check if default value. is there better way? default value? hope makes sense. cheers int size = a.size(); int last = a.get(size); if( last == null ) { return true; }else{ return false; } edit; is possible create arraylist max size can not go on stop dynamically expanding? when create arraylist , use size() return actual size or amount of elements in arraylist? when doing create max size default values null? public boolean isfull() { int size = a.size(); int last = 0; try{ last = a.get(size-1); }catch (exception e){ } if( last == null ) { return true; }else{ return false; } } i have this, how look? make sense now? when declare arraylist empty. dynamic container meaning grow ask if "full" more of constraint you'd need add code. so, if want achieve...

win universal app - Separator in a SplitView Pane -

Image
i have created splitview, have problem in defining separator menu option in splitview pane in groove musique application: i tried use line shape, think not solution. how can define kind of separator in splitview pane? using windows 10 splitview – build first hamburger menu guide, have adapted shown below using border , rectangle achieve separator. <splitview x:name="mysplitview" displaymode="compactoverlay" ispaneopen="false" compactpanelength="50" openpanelength="150"> <splitview.pane> <stackpanel background="gray"> <button x:name="hamburgerbutton" fontfamily="segoe mdl2 assets" content="&#xe700;" width="50" height="50" background="transparent" click="hamburgerbutton_click"/> <stackpanel orientation="horizontal"> <...

android - How to tell when user selects "Open in Chrome" from menu -

i'm trying determine when user opens chrome custom tab in chrome (the "open in chrome" option menu). my navigation callback returns event code of 6, same code returned when user closes custom tab. there way differentiate between whether user has closed custom tab or opened in chrome? navigation code 6 means customtabs activity not visible more either user has navigated activity started customtabs intent or activity, in case chrome has been started, has taken place. when user navigates customtabs activity chrome navigation code 6, when button hit, event sent code 5 (tab visible again). in case customactivity still visible, previous activity finished, activity started intent still paused. starting customtabs activity might solve case when have navigation code 6 , onactivityresult() method called on activity started session. public void openurlforresult(string url, int requestcode){ customtabsintent customtabsintent = buildcustomtabintent(mcustomtab...

c# - StringSplitOptions.RemoveEmptyEntries equivalent for TextFieldParser -

i learn textfieldparser parse words use string.split so. , have question regarding newly learned class . if parse message using string.split stringsplitoptions.removeemptyentries string message = "create myclass \"56, 'for better or worse'\""; //have multiple spaces string[] words = message.split(new char[] { ' ' }, 3, stringsplitoptions.removeemptyentries); then words contain 3 elements this: [0] create [1] myclass [2] "56, 'for better or worse'" but if textfieldparser string str = "create myclass \"56, 'for better or worse'\""; var parser = new microsoft.visualbasic.fileio.textfieldparser(new stringreader(str)); //treat string i/o parser.delimiters = new string[] { " " }; parser.hasfieldsenclosedinquotes = true; string[] words2 = parser.readfields(); then return consists of words without text [0] create [1] [2] [3] [4] myclass [5] [6] [7] "56, 'fo...

python - Accuracy lost when using scipy.signal.lsim2 -

i'm trying implement rk4 routine. in process, i'm struggling match accuracy order , found out scipy.signal.lsim2() suffers same problem, if using lsoda odepack (which should better rk4). import numpy np import scipy sp scipy import signal sympy import meijerg, exp, lambdify, vectorize sympy.abc import t # time , input t0 = np.linspace(0, 0.5, 200+1) # time vector u0 = np.ones_like(t0) # input vector (step) # transfer function sys = signal.transferfunction([147.4, 2948.], [1., 162.14, 2948.]) # exact solution expr_t = 147.4*meijerg(((-140.272532338765, -20.0, -19.8674676612354, 1), ()), ((), (-141.272532338765, -20.8674676612354, -19.0, 0)), exp(t)) expr_ft = lambdify(t, expr_t) expr_vft = vectorize(0)(lambda t: float(expr_ft(t))) y_exact = np.array(expr_vft(t0)) h = t0[1] - t0[0] print "time step: h =", h print "h^4 =", h**4 print "h^5 =", h**5 tout, y1, x1 = signal.lsim(sys, u0, t0) print ...

javascript - Confimration not appearing when it should do -

a confirmation not bing displaye after validation has passed, instead showing validation message stating no students have been selected add though have done this. how can confirmation displayed? here application can use see , use yourself: application select course drop down menu in avialable students enrol box see list of students. select student , click on add button underneath , see student added box underneath. click on submit students button @ bottom , displays validation message saying have no selected student add course, have done confirmation should appear. problem the jsfiddle showing whole code here: http://jsfiddle.net/phwbm/3/ you checking children of element id courseadd while id should looking @ studentadd . try changing either id of select or selector.

dependency injection - angular2 inject a service to other - error when using @Inject -

this question has answer here: angular2 beta dependency injection 3 answers i using angular2 beta. , getting error when using @inject annotation di 1 service another, not able figure out wrong. seem per angular2 documentation . i using cloud based data-services - clouddb - application's data needs. clouddb gives me javascript based client library can include in js app , use crud operations in clouddb database or call other custom api have stored in clouddb account, userauth api (api authenticate user's credentials). before using clouddb js client lib api , need supply clouddb account's url , authkey calling clouddb js object's getclient method. in angualar2 app, created injectable service class - clouddbprovider - store clouddb account url , authkey , call clouddb.getclient set provider's js client object clouddb account. import {injec...

python - How to implementing a graph for REST API -

i'm trying create effective course planner engineering school @ college , need implement graph of of courses offered , different ways navigate through them graduation. i've implemented tsp type problem in c, wondering technologies best used implement in production web app. specifically, i'm wondering best setup on end, includes: rest api interface front end workers of computationally intensive operations on graph the graph imagine best implemented type of db web crawler retrieves up-to-date list of courses , attributes , inserts entries graph my proposed config consist of django api, python scripts workers, adjacency list in postgres db graph, , daemonized python script web crawler using scrapy library (mostly keep in few different technologies possible). are there obvious flaws in design? example, better write worker (#2) in c speed things or not worth time? more importantly, there other commonly used methods implementing graphs service this?

jquery - How to move all list items on click of a button from one list to another connected list in kendo sortable list? -

i working on kendo sortable list. working fine drag , drop option. want move list items on click of button 1 list connected list in kendo sortable list. i have written following code, on click of button want move item2, item3 sortable-listselectedcolumns list @ same time want remove items sortable-listallcolumns list. <div class="form-group"> <div class="col-md-6"> <div class="box select-box item-list"> <ul id="sortable-listallcolumns" style="min-height: 100px;"> <li>item 2</li> <li>item 3</li> </ul> </div> </div> <div class="col-md-6"> <div class="box select-box seleted-item"> <ul id="sortable-listselectedcolumns" style="min-height: 100px...

hadoop - Is there a way to set a TTL for certain directories in HDFS? -

i have following requirements. adding date-wise data specific directory in hdfs, , need keep backup of last 3 sets, , remove rest. there way set ttl directory data perishes automatically after number of days? if not, there way achieve similar results? this feature not yet available on hdfs. there jira ticket created support feature: https://issues.apache.org/jira/browse/hdfs-6382 but, fix not yet available. you need handle using cron job. can create job (this simple shell, perl or python script), periodically deletes data older pre-configured period. this job could: run periodically (for e.g. once hour or once day) take list of folders or files need checked, along ttl input delete file or folder, older specified ttl. this can achieved easily, using scripting.

GitLab CI builds remains pending -

Image
we started use gitlab-ci on gitlab.com free service. @ first went fine, now, seems can't build our project anymore. builds shown pending , doesn't anything. here's have in our builds list: and if check details of build: as might notice, in list, each build assigned runner id, in details page, runner section blank. at first, thought latency caused gitlab.com ingrastructure, it's stuck there... edit it's more 1 year ago keep having notifications question. if recall properly, problem due gitlab itself. follow gitlab docs , make sure setup valid, , hope best ! gitlab maxed out shared runners have finished adding more of them. gitlab has 12 shared runners. take @ issue: https://gitlab.com/gitlab-org/gitlab-ce/issues/5543#note_3130561 update gitlab has moved auto scaling runners. if you're still hitting issues might due different cause.

php - How to run the websocket without shell command -

i'm building real time message system , used http://www.sanwebe.com/2013/05/chat-using-websocket-php-socket/comment-page-1 tutorial example. in local pc worked find. have shared server , hosting provider doesn't allow me access shell command on server. can me on this. there way can execute shell command in php file? you can start web-socket php like: exec("php -q ".your_path_of_directory."/server.php >/dev/null 2>&1 &");

Is it possible to access azure storage using wasb URI scheme in C#? -

can access azure blob , azure data lake store using wasb uri scheme in code behind file of u-sql activity in c#. have not observed example/sample demonstrating this, , not specified weather possible or not. if possible, please share sample/example use this. code-behind easy way create , use assembly. code in code-behind has same restrictions around accessing external resources assembly code has. so means cannot access blob or data lake file way. instead, should write own custom extractor processes content of file passed in using extract statement. samples provided on github site @ https://github.com/microsoftbigdata/usql/tree/master/examples (see dataformat example extractors now, more examples extractors coming).

c++ - Reverse stack in increasing order alternately -

what elegant way (less code?) of reversing stack in increasing order in alternating manner? (non recursively) ex. 1 2 3 4 5 6 7 8 9 10 1 [3 2] 4 5 6 [10 9 8 7] i use std::reverse . work you? http://www.cplusplus.com/reference/algorithm/reverse/

java - Android fragment view with vertical scrollbar and left and right swipe gesture detection -

i implementing simple jokes app functionality of swipe left , right see next or previous joke. joke long , need scrollbar on textview. however, looks ontouch listener , scrollbar messing each other , after scrolling swipe not work. idea? <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#fff" tools:context="com.bontututu.bontu.jokefragment"> <scrollview android:id="@+id/textareascroller" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_x="0px" android:layout_y="25px" android:scrollbars="vertical"> <textview ...

maps - Windows Phone - continuously tracking and ReverseGeocodeQuery -

i'm using new windows phone 8 maps , maps toolkit. on each positionchanged event, set userlocationmarker new position. if user taps on userlocationmarker , show map location via reversegeocodequery , set user location pushpin visible. fast, execute reversegeocodequery in positionchanged event. my question is, if users location changed quickly, execute many reversegeocodequery s. performance issue? private void initializegeolocator() { geolocator = new geolocator(); geolocator.desiredaccuracy = positionaccuracy.high; geolocator.movementthreshold = 5; geolocator.statuschanged += geolocator_statuschanged; geolocator.positionchanged += geolocator_positionchanged; } private void geolocator_positionchanged(geolocator sender, positionchangedeventargs args) { dispatcher.begininvoke(() => { geoposition geoposition = args.position; this.userlocationmarker.geocoordinate = geoposition.coordinate.togeocoordinate(); this.userl...

Android Display Text File that shares Same Name as Image File -

right have simple app take picture, answer question. have file name picture bundled on question class, , question saved text file using same file name (these saved on sd card). trying display text file (it'll displayed in textview) when picture selected. question there way display text file shares same name selected image file in textview ? haven't been able find else out there this, though seems wouldn't uncommon task. my code below: creating image file name: imagebutton button; static int data = 0; button.setonclicklistener(new view.onclicklistener() { public void onclick(view v) { = new intent(android.provider.mediastore.action_image_capture); string root = environment.getexternalstoragedirectory().tostring(); file mydir = new file(root + "/mydirectory/"); mydir.mkdirs(); if (mydir.exists()) { } random generator = new random(); int n = 10000; n = generator.n...

cakephp loses sessions when using safari and internet explorer -

i'm using ajax , sessions cakephp project looks session gets lost when use either safari or ie. i've followed solutions in sessions in ie , cakephp 1.3 not working when saving via ajax i've set core.php files settings below. configure::write('session.checkagent', false); configure::write('security.level', 'low'); i've upgraded cake version 2.3.0 , i'm still having same issues. please help? thank you. here pastebins jscript http://pastebin.com/wdcatkeh php - http://pastebin.com/yl7qklf0 there seems wrong cake somewhere ... adding session_start(); first line on webroot/index.php solved issue me.

jquery - How to make Inputs in Boxes in HTML form as shown in image? -

Image
how make inputs in boxes, in html form shown in bellow image. also, how should collect input. i'd collect values of inputs , append them single variable. don't know how make this.

ng-show not working based on the AngularJs version -

here created custom directive show , hide particular field json data , here problem angular version, in low version working ( https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js ), high version not supporting ( https://code.angularjs.org/1.3.15/angular.js ) please check below link http://plnkr.co/edit/h3mrwqjopbqzya0y5pot?p=preview var app = angular.module('testapp', []); app.directive('telbasictext1', ['$http', 'telngshowservice', function($http, telngshowservice) { return { restrict: 'aec', require: 'ngmodel', scope: { ngmodel: '=', placehold: '@', checkid: '@', classname: '@', ngmaxlength: '@', ngminlength: '@', lblvalue: '@', textboxsize: '@', lblsize: '@', validate: '@', ngshow: '@', textboxtype: '@', getstring: ...

typescript - Visual studio Code : Connot compile module unless the --module flag is provided -

Image
i getting error typescript code file , seems common error unable fix that. new visual studio code. cannot compile modules unless '--module' flag provided so, understood problem - common exception , solve should analyse compiler options so, if compile code on tasks.json can define several addition arguments compiler { "version": "0.1.0", // command tsc. assumes tsc has been installed using npm install -g typescript "command": "tsc", // command shell script "isshellcommand": true, // show output window if unrecognized errors occur. "showoutput": "silent", // args helloworld program compile. "args": ["-m", "commonjs", "helloworld.ts"], // use standard tsc problem matcher find compile problems // in output. "problemmatcher": "$tsc" } so -m means --module compiler command. ...

html - Fatal Error in PHP OOP Login Registration System -

i trying make user login registration system.all things going when trying insert fatal error , says fatal error: call member function prepare() on non-object in c:\xampp\htdocs\loginregister\loginregistration\functions.php on line 11 i have searched , find topic said database variable should global .but not work me.can tell me problem? thanks in advanced. here config.php file. <?php class databaseconnection{ public function __construct(){ try{ $db = new pdo('mysql:host=localhost;dbname=phplogin', 'root', ''); } catch (pdoexception $e){ die("error database connection:".$e->getmessage()); } } } ?> and here functions.php file. <?php require "config.php"; class loginregistration{ function __construct(){ $database = new databaseconnection(); } public function resigteruser($username, $password, $name, $email, $website){ global $db; $query = $db-...

regex - Array manipulation in Perl -

the scenario follows: i have dynamically changing text file i'm passing variable capture pattern occurs throughout file. looks this: my @array1; $file = `cat <file_name>.txt`; if (@array1 = ( $file =~ m/<pattern_match>/g) ) { print "@array1\n"; } the array looks this: 10:38:49 788 56 51 56 61 56 59 56 51 56 80 56 83 56 50 45 42 45 50 45 50 45 43 45 54 10:38:51 788 56 51 56 61 56 59 56 51 56 80 56 83 56 50 45 42 45 50 45 50 45 43 45 54 from above array1 output, pattern of array this: t1 p1 t1(1) t1(2)...t1(25) t2 p2 t2(1) t2(2)...t2(25) on , forth currently, /g in regex returns set of values occur twice (only because txt file contains pattern number of times). particular pattern occurrence change depending on file name plan pass dynamically. what intend acheive: the final result should csv file contains these values in following format: t1,p1,t1(1),t1(2),...,t1(25) t2,p2,t2(1),t2(2),...,t2(25) on , forth for instance: fina...

c# - Multiline Textbox allow to split wording after cursor highlight in specific word -

let say, i have multiline textbox the textbox content below: abc def ghi aa jkl mno pqr the cursor located @ second line after sentences 'aa' how use string split out when there cursor in-between 'aa'

php - codeigniter add language flag in the end of url -

i`m using codeigniter 3.0.3 need add language flag in end of url and on loading page need check this // removing slash $url = rtrim($url, '/'); // checking if url $url = filter_var($url, filter_sanitize_url); // splitting $url on slashes $this->_url = explode('/', $url); // checking if exists language if(lang::check(end($this->_url))) unset($this->_url[count($this->_url) - 1]); and after need send $this->_url bootstrap , route this also need create how lang class implementing database check if flag in database... so how can this??? this url type client http://www.example.com/controller/function/value1/value2/value3/en and en flag of english converted url must be http://www.example.com/controller/function/value1/value2/value3 and en must add in session after check key lang_key function($value1,$value2,$value3,$lang=null){ if($lang){ $newdata = array( 'username' => 'johndoe', ...

xmpp - WebRTC p2p connection without ICE servers -

i trying out strophejingle example @ jingle-interop ( https://github.com/legastero/jingle-interop-demos/tree/gh-pages/strophejingle ) uses httpbind , google open source ice server "stun:stun.l.google.com:19302" establish peer-to-peer connection. thinking, whether possible establish connection without using ice servers, if planning use example in lan? appreciated. thanks. maybe can try passing empty ice servers config rtcpeerconnection() api, no stun or turn server. in strophejingle there ice_config options contains config.

c# - Designing a RDLC report using Visual Studio and in-memory data source -

Image
i have following code in client application. public class invoice { int invoiceid {get;set}// key string description {get;set} datetime invoicedate {get;set} } public class invoicelines { int invoiceid {get;set} //parent key int invoiceline{get;set}//key string item{get;set} string description{get;set} int quantity{get;set} decimal price{get;set} } public class invoiceutil { list<invoice> customerinvoices = getallinvoices(); invoice invoice = getinvoice(1005); public list<invoice> getallinvoices() { //logic } public invoice getinvoice(int invoiceid) { //logic } } i create invoice report this. i need create rdlc report. datasource report should invoiceutil object. invoiceid should passed report report parameter. i have gone through tutorials, couldn't find one. can please provide me step step instruction develop report in visual studio report designer? ...

android - No default RealmConfiguration was found. Call setDefaultConfiguration() first -

i'm using realm database android application. not sure why happens everytime uninstall app, first run crashes in activity on: realm = realm.getdefaultinstance(); crash message: caused by: java.lang.nullpointerexception: no default realmconfiguration found. call setdefaultconfiguration() first in application class have this: @override public void oncreate() { super.oncreate(); realmconfiguration config = new realmconfiguration.builder(this) .name("mydb.realm") .deleterealmifmigrationneeded() .schemaversion(1) .migration(new migration()) .build(); realm.setdefaultconfiguration(config); //...crashlytics , other things... } all future runs after crash ok. ideas? i found problem. realm had nothing it. custom application's oncreate never called on first app run because of allowbackup attribute in manifest. setting false fixed...

mysql - Propel 1.6 How to autogenerate Base/Peer/Query model classes in symfony2 -

i newbie propel1.6 user , know way generate base/peer/query classes in model using commandline. how do that? or can point me in right direction. alot ive done running app/console propel:build to generate sql file, then app/console propel:model:build to build model classes (base,peer,query) and app/console propel:sql:insert --force to generate mysql tables

objective c - finding duplicated on outletCollection -

i'm beginner in objective-c, coming c#, when creating outletcollection of uibutton, noticed following behavior if connect same button outletcollection again , again there no error or warning letting me know object associated outlet. opened storyboard file in editor , found there connections different id's, pointing same destination (representing object id), place saw duplication , button happened on @ connection inspector my questions: a) reason , logic behind behavior (letting me set same connection multiply times)? b) there way change object id or associate name (like in c#)? c) there way or place find kind of mistakes cause in case there many buttons(or other objects) take long time go 1 one finding duplicate one. thanks

php - Multiple custom post type use the same template -

i have 3 custom post type use same template: // custom posttype photos $labels = array( 'name' => _x('photos', 'post type general name'), 'singular_name' => _x('photos', 'post type singular name'), 'menu_name' => __('photos'), 'parent_item_colon' => __('photos:'), 'all_items' => __('all items'), 'view_item' => __('view item'), 'add_new_item' => __('add new event'), 'add_new' => __('add new'), 'edit_item' => __('edit item'), 'update_item' => __('update item'), 'search_items' => __('search item'), 'not_found' => __('not found'), 'not_found_in_trash' => __('not found in trash'), ); $args = array( 'labels' => $labels, 'supports' => array('ti...