Posts

Showing posts from January, 2011

How to create an object and use it into other methods of a class in C# -

i'm trying write class needs use object in other method of class, consider pseudo code : class socket { private (something used other methods) interface_like_method { //initializing socket class //to used other methods } public filetrasfer (ref socket client) { // here, can use initialized obj of interface_like_method // client.sendfile("a path") ; } } how such functionality implemented? declare variable 'instance variable' (also known 'member variable'). means variable can used anywhere in class. if variable declared inside method, method has access it. class 1 { //code } class 2 { 1 one; //instance variable accessible in entire class, not initialized 1 oneinitialized = new one(); //this 1 initialized two() { //this constructor 1 = new one(); //initializes object 'one' declared above } somemethod() { 1 secondone = new one(); //can used inside method } //use object 'one' anywhere; }

android - java.lang.IllegalArgumentException: Service Intent must be explicit: Intent -

i trying connect android app ms band , getting following error: java.lang.illegalargumentexception: service intent must explicit: intent { act=com.microsoft.band.service.action.bind_band_service } the code snippet using follows: private view.onclicklistener mbuttonconnectclicklistener = new view.onclicklistener() { @override public void onclick(view button) { pairedbands = bandclientmanager.getinstance().getpairedbands(); bandclient = bandclientmanager.getinstance().create(getapplicationcontext(), pairedbands[0]); // connect must called on background thread. new connecttask().execute(); } }; private class connecttask extends asynctask<bandclient, void, void> { @override protected void doinbackground(bandclient... clientparams) { bandpendingresult<connectionresult> pendingresult = null; try { pendingresult = bandclient.connect(); } catch (bandioexception e) {

java - Hibernate @JoinColumnOrFormula error -

i trying map entity through jointable, didn't work trying use @joincolumnorformula annotation, keep getting error. models user , house , userhousemap . want use user.name (non-primary key & non-unique) retrieve record user_house_map using user_house_map.user_name (primary key) & retrieve associated house using other key house_name , should reference house.house_name (primary key) the db structure weird, necessary & cannot changed @ point. here have tried. may incorrect since theres no proper documentation on how use joincolumnorformula @id @generatedvalue @expose public long id; @expose @required @manytoone @joincolumnsorformulas({ @joincolumnorformula(formula=@joinformula(value="(select user_name name user_housing_map user_name = name)", referencedcolumnname="house_name")), @joincolumnorformula(column = @joincolumn(name="house_name", referencedcolumnname="house_name")) }) public house house; not

html - div moving and resizing -

my website address is here 2 black divs on page shrink width , 1 moves , down when page resized. @ moment have created website how on 1920 x 1080 resolution. my code: <!doctype html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>js computing services - home </title> <!--[if ie]> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script> <script src="http://css3-mediaqueries-js.googlecode.com/svn/trunk/css3-mediaqueries.js"></script> <link href="iestylesheet.css" rel="stylesheet" /> <![endif]--> <meta name=”description” content=”js computing services offers reliable, affordable , professional computer repair, laptop repair, bespoke web design, web hosting , custom hosted email packages in sheringham

Php/Mysql: Database class and dependency injection -

i'm trying adopt dependency injection pattern mid-scale project have been working on. of classes interact database on level , instead of instantiating pdo object inside each class, instantiate single pdo object on controller level , inject object classes require database connection. way, classes using same connection , whole process making unit testing pretty easy. however, things little bit complex when try use transaction these classes. our database heavily de-normalized , each action requires multiple inserts/updates different classes. give basic example, let's have classes below: class student{ public function addcourse($pdo,$course){ //$pdo->execute(); } } class course{ public function incrementstudentcount($pdo){ //$pdo->execute(); } } as see, both addcourse , incrementstudentcount methods must work in single transaction mode.however,student , course classes not aware of whether trans

elasticsearch - automatically update index haystack directly with the database without using django models -

hello forgive ignorance, because have little time scheduling , bad english . question how make haystack update index making changes database outside of models, mean , imagine delete registry hand database, or using third-party programs add , delete records in database . how can make these records automatically update haystack , possible ? ( , not have use --remove command update_index because database large) well, think realtimeprocessor using django models. thank in advance great community. if change db without notification django, has no way react. may try write trigger log activities, of changing data, table. write crontab task update indicies related particular data.

asp.net - OData DataServiceQuery deserialize only first element of collection -

Image
on asp.net mvc5 application, have service reference odata api. i'm making call api, expanding child propertie, follows: dataservicequery<cenariodeinvestimentocenario> querycenario; querycenario = context.cenariodeinvestimentocenario .expand("cenariodeinvestimentocenarioitem") .where(a => a.idaerodromo.equals(55)) dataservicequery<cenariodeinvestimentocenario>; queryoperationresponse<cenariodeinvestimentocenario> response = querycenario .includetotalcount() .execute() queryoperationresponse<cenariodeinvestimentocenario>; this generates following query string: localhost/myapi/cenariodeinvestimentocenario()?$filter=idaerodromo eq 55&$expand=cenariodeinvestimentocenarioitem using query string browser, can correct result set of data follows on image bellow. notice cenariodeinvestimentocenarioitem collection: however, inside asp.net application, on queryoperationresponse response object, first cenariodeinvestimentoc

Wordpress template directory PHP code outside of echo -

i hope silly simple thing. i'm trying add quick conditional code, showing image instead of text choice. i'll post code. <?php if(get_field('our-rating') == "4 stars") { echo '<img src="' . bloginfo("template_directory") . '/images/4-stars.png">'; } ?> my problem code producing html output: www.site.com/wp-content/themes/dn4l<img src="/images/4-stars.png"> am doing wrong? have sworn i've done dozen times before. guys! bloginfo outputs, get_bloginfo returns. what's happening here template_directory being output while you're building string, before output string. use get_bloginfo instead: https://codex.wordpress.org/function_reference/get_bloginfo

objective c - update record against a specific user in user class Parse ios -

i have user class in parse , want update record against specific user in parse.i not know how update it. pfuser *user= [pfuser user]; [user wherekey:@"username" equalto:@"john"]; user[@"cellno"]=cell.text; [user saveinbackgroundwithblock:^(bool succeeded, nserror *error) { if(!error) { ............ } }]; but [user wherekey:@"username" equalto:@"john"]; can not work , error found how handle it. what have done created user instance. opposed querying user class. pfuser either pointing existing or creating 1 in circumstance. common error in community , should have popped on google had researched it. proper way query user class in parse : pfquery *query = [pfuser query]; then perform rest of method. fyi, common issue parse devs think can alter users info. can't security reasons, if trying update else's info in user class won't able unless sig

java - Getting Spring-XD and the hdfs sink to work for maprfs -

this question spring-xd release 1.0.1 working maprfs, officially not yet supported. still work. so did: 1) adjusted xd-shell , xd-worker , xd-singlenode shell scripts accept parameter --hadoopdistro mapr 2) added libraries new directory $xd_home/lib/mapr avro-1.7.4.jar jersey-core-1.9.jar hadoop-annotations-2.2.0.jar jersey-server-1.9.jar hadoop-core-1.0.3-mapr-3.0.2.jar jetty-util-6.1.26.jar hadoop-distcp-2.2.0.jar maprfs-1.0.3-mapr-3.0.2.jar hadoop-hdfs-2.2.0.jar protobuf-java-2.5.0.jar hadoop-mapreduce-client-core-2.2.0.jar spring-data-hadoop-2.0.2.release-hadoop24.jar hadoop-streaming-2.2.0.jar spring-data-hadoop-batch-2.0.2.release-hadoop24.jar hadoop-yarn-api-2.2.0.jar spring-data-hadoop-core-2.0.2.release-hadoop24.jar hadoop-yarn-common-2.2.0.jar spring-data-hadoop-store-2.0.2.release-hadoop24.jar 3) run bin/xd-sing

mysql - PHP SQLSTATE[HY000] [1045] Access denied for user Laravel -

i'm working on project (php laravel 4.2) using svn team, after checked out repository on disk (local), , tried open link localhost/mylaravel , got error pdoexception (1045) sqlstate[hy000] [1045] access denied user 'dbusername'@'xx.xxx.xx.xxx' (using password: yes) note: changed real username , host ip the database not locally, it's remotely hosted online. project on localhost. config/database.php 'connections' => array( 'sqlite' => array( 'driver' => 'sqlite', 'database' => __dir__.'/../database/production.sqlite', 'prefix' => '', ), /** * remote database connection */ 'mysql' => array( 'driver' => 'mysql', 'host' => 'hostip:port', 'database' => 'mydatabasename'

java - Android - Unable to instantiate receiver -

i have problem when using broadcast. error occurs when using broadcastreceiver . here code: <receiver android:name="com.org.ti.lucky.gcm.gcmbroadcastreceiver" android:permission="com.google.android.c2dm.permission.send" > <intent-filter> <!-- receives actual messages. --> <action android:name="com.google.android.c2dm.intent.receive" /> <category android:name="com.org.ti.lucky.gcm" /> </intent-filter> </receiver> <service android:name="com.org.ti.lucky.gcm.gcmintentservice" /> here class , error: package com.org.ti.lucky.gcm; import android.app.activity; import android.content.componentname; import android.content.context; import android.content.intent; import android.support.v4.content.wakefulbroadcastreceiver; public class gcmbroadcastreceiver extends wakefulbroadcastreceiver { @override

pyserial - Python not releasing serial port -

i open serial port, read parameters modem (omited here simplicity), close serial port , call sakis3g, script connect internet through serial or usb modem. i can connect calling sakis3g console. the code: # -*- coding: iso-8859-1 -*- import serial import time subprocess import call port = serial.serial("/dev/ttyama0", baudrate=9600, timeout=0) port.open() at_ok=false #wait until modem answers ok while at_ok==false: port.write(bytes("at\n", 'iso-8859-1')) time.sleep(.5) r=port.read(1000) if len(r)>0: if r.decode("iso-8859-1").find("ok")>0: print ("connected modem") at_ok=true port.close() time.sleep(1) #just in case call(["sakis3g","connect","--pppd"]) the output: root@raspberrypi:~# python3 /usr/test2.py connected modem port /dev/ttyama0 occupied 14057 python3. failed connect. (i'm using raspberry) edit: used port.isopen(

Sharing Files with other Chrome Extensions using ARC -

we have android application have developed , testing arc. part of functionality share word/pdf , other documents other applications on android device , have them pass content when done. however, since arc applications run in own sandbox instance of android there no other applications share using standard intents. know chrome extensions can message each other, there way access functionality android app running arc. ideally we'd share document have open in google drive, , able there using standard android intents. possible, or have @ other ways accomplish (i.e. sdks.) update: here code use launch external activities have them open files editing: uri uri = uri.fromfile(attachmentfile); intent intenturl = new intent(intent.action_view); intenturl.setdataandtype(uri, applicationtype); intenturl.setflags(intent.flag_activity_clear_top); getcontext().startactivity(externalactivityintent); you can file google drive or other file provider availab

python - How to delay blits being iterated from a list -

i'm trying create typewriter effect text being blitted. typewriter effect, mean im trying avoid entirety of text being blitted on screen @ once. instead, im trying have each letter appear individually, slight delay before next character in string appears. the catch im not using pygame's font.render. instead, i've made own custom fonts, each letter being saved separate image file. each alphanumeric character has it's own variable it's image attached , each appended list. e.g: letter_imgs = [] = "a" == pygame.image.load("img/letter_a.gif) letter_img.append(a) lower, have along these lines: letter_pos_x = 0 text = "hello" i, c in enumerate(text): screen.blit(letter_imgs[i], (letter_pos_x,0)) letter_pos_x += 20 scroll_wait #this clock.delay variable. it's value set outside loop. i'm calling here. now you'd guess, result code entire line of text app

How to connect to non-wsdl API via SoapClient in PHP? -

i trying connect php application connectwise api. never used soapclient lost after looking on soapclient manual here request should when sent connectwise post /v4_6_release/apis/2.0/serviceticketapi.asmx http/1.1 host: cw.connectwise.net content-type: text/xml; charset=utf-8 content-length: length soapaction: "http://connectwise.com/getserviceticket" <?xml version="1.0" encoding="utf-8"?> <soap:envelope xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:xsd="http://www.w3.org/2001/xmlschema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:body> <getserviceticket xmlns="http://connectwise.com"> <credentials> <companyid>string</companyid> <integratorloginid>string</integratorloginid> <integratorpassword>string</integratorpassword> </credentials> <ticketid>int<

Insert bootstrap module into PHP? -

i'm trying show bootstrap module dialog box confirm delete on database. so code have: <?php //sample pop if ($delete_category_id > 0) { <div class="source-code runnable"> bootstrapdialog.alert('i want banana!'); </div>; //$da->delete_category($delete_category_id); } ?> i've tried inserting echo's divs bootstrapdialog box doesn't work supposed (or @ actually). how can insert , have work inside php? there couple of solutions this, 1 be: <?php if ($delete_category_id > 0) { ?> <div class="source-code runnable"> bootstrapdialog.alert('i want banana!'); </div> <?php } ?> another 1 be: <?php if ($delete_category_id > 0) { echo <<<html <div class="source-code runnable"> bootstrapdialog.alert('i want banan

python - how can I get the token instead of string? -

i have following syntax: kv = word(alphanums + '_') | quotedstring('"', escquote="\\") | quotedstring("'", escquote="\\") kv = kv.setresultsname('literal', listallmatches=true) cskv = kv + optional(zeroormore(suppress(',') + kv)) # comma separated kv and example: >>> res=cskv.parsestring('a,b,c,d,e') >>> res (['a', 'b', 'c', 'd', 'e'], {'literal': [('a', 0), ('b', 1), ('c', 2), ('d', 3), ('e', 4)]}) >>> res[0] 'a' >>> type(res[0]) <type 'str'> notice: >>> type(res[0]) <type 'str'> i want parseresults , instead of string, such can res[0].getname() it, , should literal . the second question how can index of token? let's want know index of literal d , should return 3 . it's trivial in example since have 1 type of

javascript - Specific styling pattern for nested and non-nested links in parent -

i'm working on website, , want rather specific pattern styling of links, don't know how it. what want following result: a red link a green link a red link a green link … here's html <div id="arandomdivforthisquestion"> <a href="#">a red link</a> <p> <a href="#">a green link</a> <a href="#">a red link again</a> </p> <a href="#">yet again green link</a> </div><!-- /arandomdivforthisquestion --> … , css tried, knew not job done begin with #arandomdivforthisquestion a:nth-of-type(odd) { border-bottom: 1px solid red; color: red; } #arandomdivforthisquestion a:nth-of-type(even) { border-bottom: 1px solid #3dcd7c; color: #3dcd7c; } so, in nutshell : want every tag within tag id arandomdivforthisquestion follows pattern regardless of fact wether it's chi

php - Check if date string is current date -

i'm scraping lot dates check wether today. so like if ("apr 9, 2015 18:45" == date('y-m-d )) how can check if string date like apr 9, 2015 18:45 is today? list of dates i'm checking apr 9, 2015 23:40 apr 9, 2015 18:45 apr 9, 2015 14:18 apr 9, 2015 13:23 apr 9, 2015 12:24 apr 9, 2015 11:00 apr 8, 2015 21:15 apr 8, 2015 21:15 apr 8, 2015 19:35 apr 8, 2015 18:54 apr 8, 2015 17:09 apr 8, 2015 16:41 apr 8, 2015 16:30 apr 8, 2015 15:55 apr 8, 2015 14:15 apr 8, 2015 12:38 apr 8, 2015 12:12 apr 7, 2015 22:30 apr 7, 2015 22:15 apr 7, 2015 18:26 loop snippet foreach($gosu->find("//table[@class='simple gamelist medium']/tbody/tr") $gosu_element) { $gosu_date = mysql_real_escape_string($gosu_element->find("/td[@class='live-in']", 0)); if (date('y-m-d', strtotime($gosu_date)) == date('y-m-d')){ echo date('y-m-d', strtotime($gosu_date)) . "<b

json - How to get objectId from Parse.com rest api in javascript -

i working on project using parse.com rest api , ionic/angularjs. when issue post request, objectid response body. i can see objectid included in response in json format, can´t seem extract it. var signup = new signup(signupdata); var response = signup.$save(); // using angularjs $resource console.log(response); when log reponse in console: object { $$state: object } "dotting" $$state returns number. any appreciated. i never used parse.com if using $resource code below should works var signup = new signup(signupdata); signup.$save(function(response){ console.log(response); });

javascript - Resetting User Password When User Email is Not Stored in "User" Class -

background info: this question concerns parse javascript sdk by default, parse.com stores users' email addresses in pre-defined "user" class. although 1 can use clps and/or acls restrict access "user" class objects, seems impossible (even using parse.cloud.usemasterkey() in cloud code) create functional app fulfills needs without allowing public read access on "user" class. this means users' email addresses accessible rudimentary understanding of javascript (an obvious deal-breaker). avoid problem, decided create separate class holds users' email addresses, pointers respective "user" class objects. i'm able lock down these new "email" class objects while maintaining functionality app requires, using clps , acls. but causes new problem: parse's method allowing user request password-reset -- parse.user.requestpasswordreset() -- apparently requires email address set on "user" class. in trying

mod rewrite - apache How to use "Header set Set-Cookie expires=<date>" dynamically -

i using apache load balancer , reverse proxy. session stickiness creating cookie route of node. header set set-cookie "h=.%{balancer_worker_route}e; path=/; domain=.domain.com" env=balancer_route_changed how set expires value in cookie x minutes when request comes in? the documentation mod_headers doesn't cover set-cookie in detail there no info there on dynamic syntax use expires . i tried setting max-age unfortunatelly max-age doesn't work ie 11 , lots of our customers use it. the docs mod_rewrite cookie cover how set lifetime in cookie can work using ugly mod_rewrite hack had 1 rule per route since didn't work inside <proxy balancer://my_cluster> section: rewritecond %{http_cookie} h=.1 [nc] rewriterule . - [co=h:.1:.domain.com:30:/] rewritecond %{http_cookie} h=.2 [nc] rewriterule . - [co=h:.2:.domain.com:30:/] rewritecond %{http_cookie} h=.3 [nc] rewriterule . - [co=h:.3:.domain.com:30:/] rewritecond %{http_cookie} h=.4 [nc] re

php - Using $row result in a variable name -

contid db gives number, number want put on end of varible, tried gives blank page if take "" . $row['contid'] . "" out fine , page loads fine, know wrong way cant think of how other way, heres code... $object = new connecttodb(); $result = $object->getmarks($user,$ksget); foreach($result $row){ $marks"" . $row['contid'] . "" = "" . $row['mark'] . "/5"; } the result db give 7 rows contid number between 1 , 7 an array smarter idea variable variables $marks=array(); foreach($result $row){ $marks[{$row['contid']}] = $row['mark'] . "/5"; }

c# - Would a regex lookaround work to match one or two numbers? -

i taking in user input (string) , checking against 3 different reg ex patterns. reason doing asynchronous validation , validation function firing on every key up. user input string concatenations, longer each iteration. the regex should match 1 3 digit numbers, space, again 1 3 digit numbers. examples: correct: 1 12 12 26 123 12 incorrect letter or spec character space before number (space after first set of numbers ok). the following function works: static void main(string[] args) { string userinput = console.readline(); list<string> patternlist = new list<string>(); patternlist.add(@"^([0-9])$"); patternlist.add(@"^[0-9]{1,3} $"); patternlist.add(@"^[0-9]{1,3} [0-9]{1,3}$"); validateinput(userinput, patternlist); } private static void validateinput(string userinput, list<string> patternlist) { regex r = null; match m = null; b

c++ - How do I implement an overloaded copy assignment operator for a reference (proxy) class? -

as assignment have create template bit array class , part of overloading index operator. told use proxy class , given sample code go off of: class bits { ... class reference { bits& b; int pos; public: reference(bits& bs, int p) : b(bs) { pos = p; } reference& operator=(bool bit) { // set bit in position pos true or false, per bit if (bit) b.data |= (1u << pos); else b.data &= ~(1u << pos); return *this; } operator bool () const { // return true or false per bit in position pos return b.data & (1u << pos); } }; reference operator[](int pos) { return reference(*this, pos); } my code reads follows (altered fit bit array): template <class itype = size_t> class bitarray { ... class bitproxy { bitarray& b; si

c++ - Is this how I should be understanding what a multiway tree is? -

Image
i implement multi-way tree in c++, still not sure are. have read few documentations, still confused because of lack of pictures or visualization provided. lets want 3 way tree, according online web notes means each node can have @ 3-1 = 2 elements , each node can have @ 3 children. below have drawn trees not sure if 3-way trees, can please verify understanding correctly? thank you! also, if have 2 way tree, mean have binary tree well? o.o? my understanding of multi-way tree number of subtrees can traversed single node. +---+ | d | +---+ ^ | | +---+ +------+ +---+ | | <-- | root | --> | b | +---+ +------+ +---+ | | v +---+ | c | +---+ the diagram above shows multi-way tree because root has more 1 child. usually 2 children per node (except leaf nodes) indicates binary trees.

LinkedList code in python -

__author__ = 'jarvis' class node: def __init__(self, num): self.next = none self.data = num class llist: def __init__(self, h=none): self.head = none def insert_node(self, num): node = node(num) if self.head none: self.head = node else: node.next = self.head self.head = node def print_list(self): node = self.head while not (node none): print node.data node = node.next lis = llist() lis.insert_node(10) lis.insert_node(20) lis.insert_node(30) lis.print_list() i new python. trying create linkedlist. no error shown nothing getting displayed. when trying debug. program exiting without happening. not able understand problem is. you shouldn't setting node.next = self.head. should maintaining pointer both head , tail. i've modified code below. class node: def __init__(self, num): self.next = none sel

html - Centering <a> in <div> -

i trying <a> tags centered in div#teacherpageoptions . centered in microsoft expression web, not when view page in browser. doing wrong? #blackbar { background-color: chartreuse; padding: 10px; height: 57px; } html { height: 100%; } body, #teacherpage { min-height: 100%; background-color: #f4f4f4; } hr { visibility: hidden; } .center { padding-bottom: 50px; padding-top: 50px; } .button { display: block; width: 115px; height: 25px; background: chartreuse; padding: 10px; text-align: center; border-radius: 5px; color: white; font-weight: bold; } .button1 { display: block; width: 115px; height: 25px; background: #008dde; padding: 10px; border-radius: 5px; color: white; font-weight: bold; position: absolute; } p { color: white; font-weight: bold; line-height: 40px; } .auto-style1 { /* make username hang little left. */ margin-left: 53px; } #teacherpage { hei

vb.net - IOException issue with asynchronous PDF creation -

i have asynchronous method creates pdf file xml retrieved database. works great, ioexception because when try cleanup temporary .fo file after creating pdf, file still in use. public sub formatobjecttopdf(byval intrxno integer, byval strsourcefilename string) dim startinfo new processstartinfo dim strpdffile string = g_strrootpath & "paperwork\" & intrxno & "m.pdf" ' if pdf file exists, no need re-create if not file.exists(strpdffile) try startinfo.arguments = "-fo """ & strsourcefilename & """ -pdf """ & strpdffile & """" startinfo.filename = g_strapppath & "fo.net\fonet.exe" startinfo.useshellexecute = true startinfo.windowstyle = processwindowstyle.hidden using proc process = process.start(startinfo) proc.waitforexit() if p

javascript - Using value of an element vs innerHTML? -

i know innerhtml not safe , can slow, though part of html5. on other hand using dom can verbose. what using value of e.g. value of button? function changeit (valueff, idp){ var change_item = prompt("change item",valueff); if (change_item) { document.getelementbyid(idp).value = change_item; } ... it's restaurant menu made codeigniter. function receives value of button, , id , value changed according admin's input. makes ajax call database , changes relevant entry. im planning sanitize input of course. so above better using textarea , innerhtml?: document.getelementbyid(idp).innerhtml = change_item; the value changed line in menu e.g. espresso $2.50, doesnt matter if use button long admin can click on , change value in actual menu. <input id="list_5" type="button" value="espresso $2.50" onclick="changeit(this.value,this.id);"> edit: if google why innerhtml bad - lot of results, (example answe

MATLAB - Difficulty in getting desired output with Struct -

i have matlab code i've written i'm having problem doesn't give required answer.. when run track = readtrack('test1.gpx'); disp(track); i answer in form of 1x4 struct array containing fields: name points but ideally test should like scalar structure containing fields: name = test #1 points = 0.00000 0.00000 0.00000 0.00000 2.00000 2.10000 0.00000 7.00000 4.50000 0.00000 10.00000 10.00000 any suggestions how change code , how? thanks!! :) here code. function data = readtrack(filename) %creates struct fields 'name' , 'points' data extracted %from gpx file. uses supporting functions. fid=fopen(filename); if fid == -1 result = error (filename); else [data,name,point] = setup(fid); while length(point) > 9 [pointstruct, point] = findlatlongelev(point,fid,name); data = [data pointstruct]; end end end functi

javascript - How data is filling when user start typing in search field -

Image
i want make search box google web page: i came across question: google-like search box angularjs directive in accepted solution, i'm not able understand how (from where) data populating user start typing in search text box. on-change event handled textbox. can please me this? see this, idea not search result. it search on click of button per functionality provided in plunker, , searched json file

php - Unable to load dynamic library openssl.so -

i set php , apache on mac 10.8 localhost. far works fine. installing symfony2. when run composer install command, following error : $ curl -s http://getcomposer.org/installer | php #!/usr/bin/env php settings on machine make composer unable work properly. make sure fix issues listed below , run script again: openssl extension missing, means secure https transfers impossible. if possible should enable or recompile php --with-openssl i uncommented following line in php.ini : extension=php_openssl.dll but still same error, preceded message : php warning: php startup: unable load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20131226/php_openssl.dll' - dlopen(/usr/local/lib/php/extensions/no-debug-non-zts-20131226/php_openssl.dll, 9): image not found in unknown on line 0 warning: php startup: unable load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20131226/php_openssl.dll' - dlopen(/usr/local/lib/php/extensions/no-debug-n

Updating a field of an Access table with data from form -

i working on access 2007. have table fields in it. had created form table , 1 of fields of table concatenation of 2 fields same table. there 2 fields oppno , material in table. had created form these (and others in table) fields. there field oppmat blank in table. however, had got data oppmat field populated concatenation of oppno , material fields in form. looking @ having table updated data of oppmat form same corresponding field in table. kindly advise how achieve this. thanks , regards, this might possible if these cases met: the field oppmat has same structure , can assure does. users not able or unlikely deviate structure. notably should use left(), right(), mid() , on. whatever works best structure. can use string modifiers: https://msdn.microsoft.com/en-us/library/dd789093.aspx on other hand must admit sceptical if solutions best. here my reasons : users unpredictable , continously deviate intended way use application. using string functions ,

int - How to display a hex/byte value in Java -

int myint = 144; byte mybyte = /* byte conversion of myint */; output should mybyte : 90 (hex value of 144). so, did: byte mybyte = (byte)myint; i got output of mybyte : ffffff90 . :( how can rid of ffffff s? byte signed type. values in range -128 127; 144 not in range. there no unsigned byte type in java. if using java 8, way treat value in range 0 255 use byte.tounsignedint : string output = string.format("%x", byte.tounsignedint(mybyte)); (i don't know how formatted integer hex output. doesn't matter.) pre-java 8, easiest way is int bytevalue = (int)mybyte & 0xff; string output = string.format("%x", bytevalue); but before either of those, make sure want use byte . chances don't need to. , if want represent value 144, shouldn't use byte , if don't need to. use int .

android - Bizarre Invalidate behaviour -

i have custom viewgroup (custom2) inside custom viewgroup (custom1). custom1 has imageview displaying rectshape shapedrawable , 2 textviews. i set onclicklistener in custom2 removes imageview using this.removeviewat(0) , creates new textureview, calling this.addview (mtextureview, 0) , invalidate. textureview play video using mediaplayer. here code: public void settotextureview() { //textureview when not debugging textureview view; view = (textureview) new textureview(mcontext); view.setlayoutparams(new layoutparams(600, 500)); this.removeviewat(0); this.addview(view, 0); view.invalidate(); log.d("debug", "invalidate called"); view.setsurfacetexturelistener(new textureview.surfacetexturelistener() { @override public void onsurfacetextureavailable(surfacetexture surface, int width, int height) { surface msurface = new surface(surface);

Create User Using ASP.NET Membership -

when create user using membership in asp.net, after create user automatically login system. don't want login immediately. can me? set logincreateduser property false. example, protected void page_load(object sender, eventargs e) { // replace createuserwizard1 id of createuserwizard control. createuserwizard1.logincreateduser = false; }