Posts

Showing posts from January, 2013

swift - POST requests in Alamofire Parameter Encoding returning GET responses -

i'm trying make route builder in swift using alamofire (3.0) , have succeded requests, when try make post request, example, still same responses of method. my api routes are: /users //get -> return list of users /users //post -> create new user parameters sent when use postman works fine. here router code: import foundation import alamofire enum userrouter: urlrequestconvertible{ static let baseurl = nsurl(string: "http://192.168.0.106/users")! case users case createuser([string: anyobject]) case readuser(int) case updateuser(int, [string: anyobject]) case destroyuser(int) var url: nsurl { return userrouter.baseurl.urlbyappendingpathcomponent(route.path) } var route: (path: string, parameters: [string: anyobject]?) { switch self{ case .users: return ("/", nil) case .readuser(let userid): return ("/\(userid)", nil) case .createuser(let use...

asp.net - Iphone not receiving .ics calendar -

can tell why text not come attachement iphone works android , calendar event click on add calendar here looks on iphone when email begin:vcalendar prodid:-//mycompany calendar//ttw version:2.0 method:request begin:vevent dtstart:20120812t090000z dtend:20120813t160000z location;encoding=quoted-printable:location mine description;encoding=quoted-printable:my description summary;encoding=quoted-printable: uid;encoding=quoted-printable:580e0a63-2009-4373-8743-6afdce1f7012 trigger:-pt15m priority:3 organizer:donotreply@mycompany.com sequence:1 end:vevent end:vcalendar" it turned out there method used in write procedure used writeline instead of write because writeline added new line , iphone device did not know how handle it.

c# - Programmatically go back -

in application, user goes page page b. is there way programmatically simulate button press? have button on page b , when user clicks it, want go page a. don't want use navigationservice , navigate page a, want go page if user clicked on hardware button. there way that? although don't want use it, navigationservice.goback method way go: if (this.navigationservice.cangoback) { this.navigationservice.goback(); }

oracle sql code for diaplaying mirror image of a text/column from the databse -

this question has answer here: sql code create mirror image of string in oracle sql [closed] 1 answer i have referred previous question closed similar issue. answer provided not enough solve issue. please let me know if other possible solutions this. the previous answer provided says needs more insight. reason have asked new question exact requirement criteria. please note not duplicate of that. i have requirement need display text in reverse mirror image. clear, for example, if column in database reads " abcdefg", the query output should "bɟǝɐqɔp" i have tried multiple ways able reverse of text "gfedcba" not required output. please let me know possible solution kind of requirement. i recall (or pretty similar question) asked in october. see post, too: sql code create mirror image of string in oracle sql

elasticsearch - Persist Elastic Search Data in Docker Container -

i have working es docker container running run so docker run -p 80:9200 -p 9300:9300 --name es-loaded-with-data --privileged=true --restart=always es-loaded-with-data i loaded es bunch of test data , wanted save in state followed docker commit containerid es-tester docker save es-tester > es-tester.tar then when load in data gone... gives? docker load < es-tester.tar if started official es image, using volume ( https://github.com/docker-library/elasticsearch/blob/7d08b8e82fb8ca19745dab75ee32ba5a746ac999/2.1/dockerfile#l41 ). because of this, data written volume not committed docker. in order backup data, need copy data out of container: docker cp <container name>:/usr/share/elasticsearch/data <dest>

Partial C++ template specialization in dependent project -

suppose have library , multiple projects dependent on library. library headers has partial class specializations. want allow each dependent project override own partial specializations. need achieve statically performance reasons. simplified code below. library code: template <class a, class b, class enable=void> struct widget; struct foo { }; template <class b> struct widget<foo, b> { }; user code: template <class b> struct dospecialize; template <class b> struct widget<foo, b, enable_if< dospecialize<b> >::type { }; the problem here end multiple definitions of same specialization. think need disable_if<> somewhere. how avoid this? i'd suggest solve separating layers. library has it's own specializations , user can overwrite them if needed. if acceptable, following library code: namespace impl { template <class a, class b, class enable=void> struct widget; } template <class a, cla...

Conditionals in Prolog -

i have predicates monthyear returns current month if month , year not supplied below. monthyear(m,y) :- get_time(stamp), stamp_date_time(stamp, datetime, local), date_time_value(month, datetime, m), date_time_value(year, datetime, y). if month , year supplied return supplied month , year. achieve have written following code below. cal(x,y,z1,z2):- z1 x, z2 y. cal(x,y,z1,z2):- x == null, y == null, monthyear(z1,z2). however sure code can improved , faced error error: is/2: arguments not sufficiently instantiated how can go making work?. x=1,y=2,cal(x,y,z1,z2). returns z1 = x z2 = y and cal(x,y,z1,z2). returns z1 = 1, z2 = 2016 you can use 2 versions of cal : cal(x,y,z1,z2):- z1 x, z2 y. cal(z1,z2):- monthyear(z1,z2). if call cal(2, 2015, z1, z2) z1 = 2, z2 = 2015. if call cal(z1, z2) (today) z1 = 1, z2 = 2016.

php - Advanced Timestamp Calculations (Even and Odd Rows Totalling) -

i creating personal time card system pet project , have down pat except totaling of times each day , week. let's have 4 punches day pulled database using while loop: [1] 2013-03-01 07:00:00 - in - (for day) [2] 2013-03-01 12:00:00 - out (to lunch) [3] 2013-03-01 12:30:00 - in (from lunch) [4] 2013-03-01 15:30:00 - out (for day) my question how go creating running total spit out total of 8 hours? have thought days no logical solution in mind. in advance! you should probably change structure of table. underlying idea notion of working period, requires start time , end time. current structure splits fact 2 rows. use 1 row instead. work_periods time_in time_out -- 2013-03-01 07:00:00 2013-03-01 12:00:00 2013-03-01 12:30:00 2013-03-01 15:30:00 if have table this, can difference in minutes timestampdiff(). select time_in, time_out, timestampdiff(minute, time_in, time_out) elapsed_time work_periods; you can return same data existing table. thi...

wordpress - slideToggle, fadeIn, fadeOut animation shifts up during animation -

i'm creating simple "read more/read less" button wordpress site when pressed reveals hidden content using slidetoggle . it's in form of wordpress plugin . buttons fadein , fadeout . , i'm using php/html display page. everything working great except 1 little hiccup. reason, when read more button clicked , animation starts, content div (or p tag - can't tell sure) starts few pixels down , shifts after finishes animation. , vice versa, when read less button clicked, animation same thing. i've looked through php , css , can't find anything. i've inspected elements , removed css way it's not helping. i've included code , short video show mean. here link video: https://youtu.be/3lnmapglypi javascript jquery('.wpsm-content').addclass('wpsm-content-hide'); jquery('.wpsm-show, .wpsm-hide').removeclass('wpsm-content-hide'); jquery('.wpsm-show').on('click', function (e) { "use ...

Minimal amount of points needed to get grade "x" (C++) (explained) -

i doing challenge in c++ online , stuck on part. basically, challenge following. "derp student of college. favorite lesson math. end of year coming , derp asks himself how many points needed on last exam grade "k". the teacher has given 5 tests year, maximum points can earned on test 100. if <=60 = grade : 1 if >=60 && <= 69 = grade : 2 if >=70 && <= 79 = grade : 3 if >=80 && <= 89 = grade : 4 if >=90 && <= 100 = grade: 5 in case 89.8 points, have grade 4, not grade 5. know results of first 4 tests - t1,t2,t3,t4. have find how many minimum points derp needs on last test wanted grade "k". input: in input, firstly, input wanted grade derp "k" (2<= k <= 5) in second line, input results of first 4 tests. (0 <= t1,t2,t3,t4 <=100) output: have output minimum amount of points derp needs on last test in order have wanted grade "k" in math. if derp has no chance ...

How to restrict area of drag&drop ImageView Android -

how limit area of moving imageview doesn't go out of relativelayout area. my code moving imageview is: public boolean ontouch(view v, motionevent me) { if (me.getaction() == motionevent.action_down) { oldxvalue = me.getx(); oldyvalue = me.gety(); } else if (me.getaction() == motionevent.action_move) { relativelayout.layoutparams params = new relativelayout.layoutparams(v.getwidth(), v.getheight()); params.leftmargin = (int) (me.getrawx() - (v.getwidth() / 2)); params.topmargin = (int) (me.getrawy() - (v.getheight())); v.setlayoutparams(params); } return true; } i looking answer on stackoverflow didn't find it. if(params.leftmargin<=0){ params.leftmargin=0; } if(params.topmargin<=0){ params.topmargin=0; } if(params.leftmargin>=width-(v.getwidth())){ params.leftmargin=(int)width-(v.getwidth()); } ...

iOS 8 WKWebView: display local plain text like iOS 9? -

i'm attempting view local log file using wkwebview , due it's higher performance , asynchronous loading vs. uitextview . on ios 9, loadfileurl(_:allowingreadaccesstourl:) works load plain text file , display it. renders monospaced font (i wish set menlo though). however, on ios 8, local file urls can't loaded can load text file string , use loadhtmlstring(_:baseurl:) load view. works, text rendered, expected, if html. means there no line breaks or appropriate wrapping long lines. renders default font, not monospaced. i'm guessing attempt load javascript loads styling, have no experience , i'm hesitant put effort what's debug log viewer. so question is, how can render plain text plain text, local file, using wkwebview on ios 8?

API to search a product catalog -

i'm looking sort of api (or similar) can query consumer product manufacturer , list of products in catalog. e.g. amazon or ebay. my end goal search 'sony' , list of sony products , details in catalog (the better catalog, better). any idea how so? ebay provides api can searched keywords. free 5000 api requests day. here example of request based on keywords: http://developer.ebay.com/devzone/finding/concepts/makingacall.html

escaping - Laravel - htmlentities -

i making ajax requests laravel - reason custom function not escaping special characters. can't figure out why. have used exact same function in codeigniter , escapes output fine. of data getting returned fine js file - it's not escaping anything. here code: public function store( request $request, $project_id ) { //current logged in user. $user_id = auth()->user()->id; //get post inputs $inputs = $request->all(); //make sure project id belongs current user. stop adding task project isn't you. $projectbelongstouser = project::find(1)->where('user_id', $user_id)->where('id', $project_id)->get(); //if project id , inputs provided - log them database, if not redirect home $errors. if( $project_id && $inputs['description'] && $projectbelongstouser ) { $task = new task; $task->description = $inputs['description']; $task->due_date ...

php - Disable woocomerce api authentication? -

the woocomerce api takes oauth1.0 http requests , basic http authentication https requests. query simple. how remove authentication? did digging , found there class in woocommerce plugin constructor public function __construct() { // disable authentication, hook filter @ later priority , return valid wp_user add_filter( 'woocommerce_api_check_authentication', array( $this, 'authenticate' ), 0 ); } my job remove authentication part. here saying hook filter @ later priority. how , how return valid wp_user? create own plugin , place following code: function wc_authenticate_alter(){ //return wp_get_current_user(); if( 'get' == wc()->api->server->method ){ return new wp_user( 1 ); } else { throw new exception( __( 'you dont have permission', 'woocommerce' ), 401 ); } } add_filter( 'woocommerce_api_check_authentication', 'wc_authenticate_alter', 1 ); ...

how to convert php variable string to int -

how convert string variable integer 2, 990.00 i want output this 2990.00 if add 2 numbers $num1 = '2, 990.00'; <br> $num2 = '7, 990.00'; <br> <br><br> $ans = $num1 + $num2;<br> echo $ans; answers 9 you can use preg_replace("/[^0-9.]/", "", $subject) eliminate non-numeric characters.

Tcl/Tk: How to create a progress bar with a status text inside? -

Image
i want create progress bar using tcl/tk >= 8.5 not show progress in graphical way percentage of progress number (centered) within progress bar (e. g. "12 %"). i thinking overlaying progress bar , label transparently or 1 making parent of other widget not figure out solution. any ideas? here simple program frame: proc counter {} { {set 0} {$i < 100} {incr i} { puts "$i" after 25 .pb configure -value $i update idletask } } ttk::progressbar .pb -orient horizontal -maximum 100 -length 400 -value 0 button .bt -text "start counter" -command counter pack .pb pack .bt usually, don't. standard platform rendering of progress bars doesn't support such label. however, can hack frame s , label s (and clever use of place ). wrote this page long ago has links code that. should still work, might not how want: standard these things should has changed lot on years. i hate self-promotion, don't know of oth...

python - Is it possible to preserve YAML block structure when dumping a parsed document? -

we use pyyaml prep config files different environments. our yaml blocks lose integrity. give input.yml ... pubkey: | -----begin public key----- migfma0gcsq7opxrrqebaquaa4gnadcbiqkbgqcvrvukp6pr4qbene9lviuyfinq qtg/ocybdxl4bh3fmuzfni+z4bh3fmux+z2n0fcv/4bpghtdl8d95npopwvo1rh2 ufhymd6dq/x9t5m+y38jmzmsvak+fqu8ya18+yqvoeyeix3gxpsgegow33gcxfjk esugjhxcpw7opxrrcqidaqab -----end public key----- ... executing program using python3 ... import yaml open('input.yml', mode='r') f: parsed = yaml.safe_load(f) open('output.yml', mode='w') f: yaml.dump(parsed, f) ... produces output.yml ... pubkey: '-----begin public key----- migfma0gcsq7opxrrqebaquaa4gnadcbiqkbgqcvrvukp6pr4qbene9lviuyfinq qtg/ocybdxl4bh3fmuzfni+z4bh3fmux+z2n0fcv/4bpghtdl8d95npopwvo1rh2 ufhymd6dq/x9t5m+y38jmzmsvak+fqu8ya18+yqvoeyeix3gxpsgegow33gcxfjk esugjhxcpw7opxrrcqidaqab -----end public key----- ' is possible p...

count group by conflict oracle sql -

for following query, got result below select date, count(sales) table date between to_date('2015-09-01','yyyy-mm-dd') , to_date('2015-12-31','yyyy-mm-dd') group date date count(sales) 01-sep-15 480 01-sep-15 2 01-sep-15 3 01-sep-15 2 16-sep-15 12 16-sep-15 7 it should give me 2 rows-> 01-sep-15 , count(sales) 487. , 16-sep-15 , count(sales) 19 how that? in oracle date contains time part. sql client hides not including in output. need trunc() date column set time part 00:00:00 select trunc(date), count(sales) table date between to_date('2015-09-01','yyyy-mm-dd') , to_date('2015-12-31','yyyy-mm-dd') group trunc(date)

Python math division operation returns 0 -

print "------------ epidemiology --------------\n" def divide(a,b): return a/b print " [population] point prevalence rate: " = input("enter value people disease: " ) b = input("enter value total population: " ) prevalence = divide(a,b) print " population prevalence rate is: ",prevalence a , b user input , not know if integers or floats. answer 0 when run program. (i'm new in python). how fix or change in function avoid problem? the input part of code works, math not. you answer 0 because using python2 , performing integer division. fact population disease cannot higher total population reason 0 every reasonable input (except when both values same). two fixes: def divide(a,b): if b == 0: # decide should happen here else: return float(a)/b this make sure function performs floating point division, not matter numbers pass it. second fix should use raw_input in python2 , cast inp...

ios - Does anyone have a working review link for iOS9? -

hi noticed link use in app takes user apps review page (which i've been using since ios7) no longer works: itms-apps://itunes.apple.com/webobjects/mzstore.woa/wa/viewcontentsuserreviews?id=<appid> does have fix this? (note: know can use itms-apps://itunes.apple.com/app/id<appid> doesn't take review tab, apps page). in doing experimenting, figured out apple reverted how before ios7. have do: itms-apps://itunes.apple.com/webobjects/mzstore.woa/wa/viewcontentsuserreviews?id=247423477&onlylatestversion=true&pagenumber=0&sortordering=1&type=purple+software where 247423477 9 digit app id (the main difference have append &onlylatestversion=true&pagenumber=0&sortordering=1&type=purple+software after app id). note: works on ios9.0.2 i'm going assume works of ios9. can check , see if works on ios8 , ios7?

angularjs - Ionic App is not connecting to Node API using the Android Emulator or Phone -

i creating ionic app using mean stack. using mongolabs database, , node server @ localhost:8080 . endpoints (my login functionality) working fine in browser when use "ionic serve" or "ionic serve --lab" . port ionic default set on 8100, using. when run ionic emulate android use emulator or ionic run android see app on phone, app shows fine (the login pages), none of functionality works (which endpoints node api). do need set node port else? caused node being on localhost, , if so, change too? thanks! it sure because of localhost, cannot access localhost emulator. ip address of machine , use it. e.g. 192.168.1.102 or 10.0.x.x check ip ipconfig/ifconfig based on windows/unix respectively.

node.js - Why does text render slower than images with server-side rendering? -

i have many examples text renders slower image feels instant. doing via reactjs , server-side rendering nodejs. example gif: http://recordit.co/wama5ocwdd shows header image loads instantly, css loaded colors there , present. but, reason, text takes half second appear. how can fix or optimize this? the site in gif quran.com if want experiment it. thanks! ok, debugging kind of stuff it's useful hit yslow latest tips, etc. in general, though, it's remember browsers make separate requests each item in page (i.e. url; images, css, etc) , of them have kind of cap on concurrent downloads (4 seems common, varies , changes lot). while 12 requests isn't lot, it's still time. time parse , load js, etc. , parsing , loading js more time happen (and typically, in browsers, pause further downloads until it's done) without spending ton of time, i'm guessing html loads, calls in header image, , browser starts hitting js , react framework code , takes ...

html - Change css background for my code -

Image
i'm not in css, please try me i have css code #mo-stats-w1 { background: url("http://i48.tinypic.com/108dbix.png") 0px 0px repeat-x; /*height: 143px;*/ border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; margin: 10px 0px 0px 0px; padding-bottom: 10px; background-color: #3ec4cd; } #mo-stats-w2 { padding: 12px 0px 0px 15px; } #mo-stats-w1 ul { padding: 0px 0px 0px 0px; margin: 0px 0px 1px 0px; height: 59px; } #mo-stats-w1 ul li { display: block; list-style: none; padding: 1px;/*0px 0px 0px 0px;*/ margin: 0px 1px 0px 0px; width: 174px; height: 59px; float: left; } ul#mo-stats-r1 li { background: url("http://i50.tinypic.com/23j0bcg.png") 0px 0px no-repeat; } ul#mo-stats-r2 li { background: url("http://i50.tinypic.com/23j0bcg.png") 0px -59px no-repeat; } #mo-stats-w1 ul li strong { font-size: 24px; height: 22px; font-family: arial, "ni...

java - I need of assistance with array assigning user inputs to an array, and do-while loop repeat -

i'm having few problems code, on goal of program. one of professors hears of emerging programming expertise , asks write single program can used them grading. professor gives 3 50-point exams , single 100-point final exam. program prompt user student’s name, entered firstname lastname (i.e. bob smith), student’s 3-exam scores , 1-final exam score (all whole numbers). class size varies semester semester, 100 limit (declare constant). read in information students before doing calculations or displaying output. verify 3 exam scores between 0-50 points , final between 0-100 entered. declared minimums , maximums constant can updated, needed. if invalid, display error message , allow user re-enter invalid score. once student info read in, display each student’s name in format lastname, firstname (all uppercase), student’s exam percentage (total of exams plus final / total possible) 1 decimal , student’s final grade. this have: import java.util.*; import java.text.*; ...

javascript - Is there a way to method chain .push and .shift array methods? -

here's code: var myarr = [1,2,3,4,5]; function queue(arr, item) { return arr.push(item).shift(); } i'm attempting create function queue takes "array" , "item" arguments. need to add item onto end of array remove first element of array return element removed. my code not working. can me figure out? because arr.push returns length of array, can't chain shift that simply this function queue(arr, item) { arr.push(item); return arr.shift(); }

memory - SP605 Spartan 6 DDR3 addressing -

the following post quite long, since have had trouble making sp605 board interact ddr3 on month now, useful others in same situation find myself in. pretty it's simple configuration or conceptual error, more happy have resolved soon. === scenario === i have created usb-uart interface communicate fpga , control ddr3. using ip generator in ise, generated mig wrapper , designed memory interface controller. however, have referenced manuals ug388 , ug416, have not been able have ddr3 behave expected. === problem statement === playing around burst lengths write , read commands, able data ddr3, yet addressing scheme not seem correct data duplicated in addresses 0 , 1, 2 , 3, 4 , 5, , forth. also, whenever write address 0, example, nothing changes. then, when write address 1, both addresses 0 , 1 updated data value sent. seems "losing" half of memory space due coupled effect. === ddr3 ip configuration === the setup ddr3 using ip generator – considering sp605 board...

please help editing arrays in java -

i'm having hard time creating address book of mine, , im new @ this. thing want know if possible edit or modify values inside array, string lname[] = new string[size]; string fname[] = new string[size]; string address[] = new string[size]; string contact[] = new string[size]; if example assigned john dor in fname array how edit value without going through whole process again since want replace r e john doe. given address there , addresses contain large strings... well, relatively easy, normal string arrays can point using index such follows, plus assigning new string or using method such replace ... check out: string fname[] = new string[1]; fname[0] = "john dor"; system.out.println("fname #1: " + fname[0]); // prints john dor // using replace change letter fname[0] = fname[0].replace('r', 'e'); system.out.println("fname #2: " + fname[0]); // prints john doe // replacing new string fname[0] = "john dor...

php - Hyperlink inside of my Google map InfoWindow is not showing properly -

the link functional doesn't show unless highlight can see text. these multiple markers. var markers = [ ['joe brown park, new orleans', 29.993345,-90.098104], ['city park, new orleans', 30.030401,-89.966602], ['palace of westminster, london', 30.020819,-90.040573] ]; this info window content. 3 of links invisible unless highlight them. var infowindowcontent = [ [ '<h3>"named after 1 of states largest independent oil producers, park offers year-round events."</h3>' + '<h3></h3>' + '<h3><a href="http://nordc.org/parks/joe-w-brown-park/">joe brown park</a></h3>' + '</div>'], [ '<h3>"city park, 1,300 acre public park in new orleans, louisiana, 87th largest , 7th-most-visited urban public park in united states."</h3>' + ...

using php to build map grid string -

i'm using pp3diso build game map. library uses string determine image use in each grid cell this: 01,01,01,01,01,01,01:02,01,01,01,01,01,01:01,01,01,01,01,01,01:01,01,01,01,01,01,01:01,01,01,01,01,01,01:01,01,01,01,01,01,01 . i'm trying piece type of string in php while loops, code seems stop after first iteration ( 01,01,01,01,01,01,01,01: ). how can code below create full string? $mapstr = ''; $x = 1; $y = 1; while($x <= 500){ while($y <= 500){ $sql = 'select * '.cities.' city_x = '.$x.' , city_y = '.$y; $result = $db->sql_query($sql); $city = $db->sql_fetchrow($result); if($city){ $mapstr .= '02'.(($x < 500) ? ',' : ''); }else{ $mapstr .= '01'.(($x < 500) ? ',' : ''); } $y++; } if($x == 500){ $mapstr .= ':'; }else if($x == 500 && $y == 500){ ...

javascript - Angular Dropdown list with two different data -

my apologies, newbie using angular, question following. have dropdownlist , display 2 different sets data on dropdown. first make call way api single value, going default 1 on selected, second 1 make call option dropdown. display single data default , rest options update. can please help. this controller: function(){ vm.editmodeserve = response.data; var config = $http.get('http:single + id'), allconfig = $http.get('http:mutiple calls option all'); $q.all([config, allconfig]).then(function (data) { vm.config = data[0].data; vm.allconfig = data[1].data; } this dropdown: <label style="color:rgba(0,0,0,0.54);">configuration</label> <md-input-container class="md-block"> <select ng-model="vm.editmodeserve.mainconfig" ng-options="config.configname config in vm.allconfig"> <option value="">...

python - PyQt: hover and click events for graphicscene ellipse -

Image
i'd find out if user hovers on or clicks graphicsscene shape object (for example, ellipse object commented below). i'm new pyqt , documentation better c++ python, i'm having bit of trouble figuring 1 out. from pyqt4 import qtgui, qtcore class myframe(qtgui.qgraphicsview): def __init__( self, parent = none ): super(myframe, self).__init__(parent) self.setscene(qtgui.qgraphicsscene()) # add items x = 0 y = 0 w = 45 h = 45 pen = qtgui.qpen(qtgui.qcolor(qtcore.qt.green)) brush = qtgui.qbrush(pen.color().darker(150)) # want mouse on , mouse click event ellipse item = self.scene().addellipse(x, y, w, h, pen, brush) item.setflag(qtgui.qgraphicsitem.itemismovable) if ( __name__ == '__main__' ): app = qtgui.qapplication([]) f = myframe() f.show() app.exec_() update!!! now can event take place based on mouse click release. unfortunately, last it...

android - How to avoid duplicate values from the contacts database while usingContactsContract.CommonDataKinds.Phone.CONTENT_URI? -

i using following query fetch list of contacts. @override public loader<cursor> oncreateloader(int id, bundle args) { string selection = string.format("%s =\'1\' , length(\"%s, \") > 0", contactscontract.contacts.has_phone_number, contactscontract.contacts.display_name_primary); return new cursorloader(context, contactscontract.commondatakinds.phone.content_uri, // uri contactprofile.contact_projection, // projection fields selection, // selection criteria null, // selection args contactscontract.commondatakinds.phone.display_name_primary + " collate nocase asc" // case insensitive sort order ); } but getting duplicate values on phone multiple accounts. how avoid duplicate values you cannot use "distinct" when query using cursorloader. pass account param query selection, or remove duplicates when u...

c++ - How can I read memory from a specific address that's allocated to a different process in OSX? -

let's there's value of interest, , located @ address . however, memory owned process a.dylib . won't able access memory through ./code int x = *(int*)address because ./code not own memory holds address . how can access address ./code in osx, preferably without root? required go through vm_read() ?

Update values in Table A based on sorting results from Table B (MySQL) -

first - in advance looking , possibly helping, appreciated! basically need sort table a, column descript, a~z , then... based on sort, update table b, column printorder lowest sort value have printorder = 1 , highest sort value have printorder = 20,000 in subset of data lowest 18681 & highest 18695. (actual table range 1 20,000) the data should modified printorder in table b. here subset of data table a: inum descript 23151 crayon apron 23152 acrylic bunny acry153 23153 acrylic easter egg acry154 23154 acrylic posypot tulip acrye01a 23155 acrylic orn chick acrye02 23156 hat baby chick bge10151 23157 sipper baby chick bge10158 23158 grow chick ea10991 23159 nail crystals easter ea11052 23160 mug jelly bean em11681 23161 plush tumbleweed chick he10148 here subset of data table b: id inum printorder 142161 23151 18681 144054 23161 18683 145092 23159 18687 ...

Android OCR: Unsatisfied Link Error -

Image
i student working on ocr function school project. able implement functions , run application until now. i have application on android studio 1.5.1 , able run on old device, samsung galaxy note 3 api 21 . recently, changed device samsung galaxy note 5 api 22 , application crashes whenever try run ocr function. below logcat: fatal exception: java.lang.illegalstateexception: not execute method of activity @ android.view.view$1.onclick(view.java:4298) @ android.view.view.performclick(view.java:5254) @ android.widget.textview.performclick(textview.java:10557) @ android.view.view$performclick.run(view.java:21203) @ android.os.handler.handlecallback(handler.java:739) @ android.os.handler.dispatchmessage(handler.java:95) @ android.os.looper.loop(looper.java:145) @ android.app.activitythread.main(activitythread.java:6897) @ java.lang.reflect.method.invoke(method.java) @ java.lang.reflect.m...

ORACLE SQL ORDER BY -

how go ordering last 3 letters of name? for example: ashley julia belvet ley > lia > vet also, how go doing secondary sort id if last 3 letters same (bobby, robby...)? for first question: order substr(name, -3) for second question: order substr(name, -3), id

php - Ajax call twice cause duplicate message -

i trying figure out problem ajax called twice duplicated message. click sendplr button first time, message won't appear. shows message twice when clicking button again. check network tab on chrome, not show first ajax call. show duplicate call when hitting button again. html code. first time deal big form this. please help!!!! use wordpress <form id="frmbegin" method="post"> <div id="plr_radioselection"> <div id="plr_radioform">business unit: <input type="radio" name="plr_location" value="company">company (corp) | <input type="radio" name="plr_location" value="bu">other corp</div> <div id="plr_radiocat">reporting category: <input type="radio" name="plr_category" value="director">director | <input type="radio" name="plr_category" value="seniorteam">senior t...