Posts

Showing posts from June, 2015

arrays - Java SQL looping though List of Strings[] -

so have list of strings being returned db query: list<string[]> = getsqlreults(); the way results being return in name value pair: e.g name value test 0 test2 2 and on. now need loop though list , if name = "test ", store value in variable. any great! you can try like list<string[]> data = getsqlreults(); string result = null; (string[] str : data) { if ("test".equals(str[0])) { result = str[1]; break; } }

c# - Entity Framework 6 mapping issues -

i've been using ef while, basic normalized tables, , little-to-no relationships between them. i'm looking branch out , running mapping issues, i'm sure solved simple onmodelcreating() changes, or additional model properties. i'm creating website manage events can occur @ various locations. each event entity. each event has basic primitive properties, has virtual icollection<timeslot> . public virtual icollection<timeslot> timeslots { { return mtimeslots ?? (mtimeslots = new collection<timeslot>()); } set { mtimeslots = value; } } timeslot pretty simple too, it's supposed represent container collection of activities occur @ particular time. public class timeslot { private icollection<timeslotitem> mitems; public virtual icollection<timeslotitem> items { { return mitems ?? (mitems = new collection<timeslotitem>()); } set { mitems = value; } } [key] p

caching - Is Translation Lookaside Buffer (TLB) the same level as L1 cache to CPU? So, Can I overlap virtual address translation with the L1 cache access? -

i trying understand whole structure , concepts caching. use tlb fast mapping virtual addresses physical addresses, in case if use virtually-indexed, physically-tagged l1 cache, can 1 overlap virtual address translation l1 cache access? yes, that's whole point of vipt cache. since virtual addresses , physical 1 match on lower bits (the page offset same), don't need translate them. vipt caches built around (note limits number of sets can use, can grow associativity instead), can use lower bits lookup in cache before found translation in tlb. this critical because tlb lookup takes time, , l1 caches designed provide bw , low latency possible avoid stalling much-faster execution. if miss tlb , suffer greater latency (either level2 tlb or, god forbid, page walk), it's less critical since can't cache lookup until compare tag, few cycles did save in tlb hit + cache hit case should common case on many applications, that's considered worthy optimize , align

Java: Multiplication table string needs to be modified to get spaces in between each character -

so im trying make string in java displays multiplication table tab in between each number in java. im looking modifier adds more spaces between each character. heres code have done , need modify table of strings have spaces in between each number "1 2 3 4" instead of "1 2 3 4". import java.util.*; public class multtable { public static void main(string[] args) { string y = ("1 23 " + "12345"); system.out.println("1 2 3 4 5 6 7 8 9 10"); system.out.println("2 4 5 8 10 12 14 16 18 20"); system.out.println("3 6 9 12 15 18 21 24 27 30"); system.out.println("4 8 12 16 20 24 28 32 36 40"); system.out.println("5 10 15 20 25 30 35 40 45 50"); system.out.println("6 12 18 24 30 36 42 48 54 60"); system.out.println("7 14 21 28 35 42 49 56 63 70"); system.out.println("8 16 24 32 40 48 56 64 72 80"); system.out.println("9 18 27 36 45 54 63

How do I show tips that don't have a head in `git log --all`? -

the jargon understand it: tip , commit has no children (only parents unless orphaned) head , named reference, eg master , or "tree-ish" http://git-scm.com/book names it. under normal circumstances use more graphical permutation of git log all: git log --all --color --oneline --graph --decorate to create tip no head did: git checkout head^ echo "" >> index.html git commit -am "tip test" at point git log --all show tip, because has head, head . git checkout master and tip we've created no longer reported git log. i understand behavior by-design, , git reflog can point out recent "commit-ish" references. i'd way see tips in git log (as chronology important feature purposes). i don't know way this, short of creating temporary references deferenced head@{n} entries before requesting log (though answer uses such still acceptable presuming cleaned after itself) git doesn't know (or care)

java - Syntax Error - Navigating Pages -

i appear getting syntax error when try build application. trying navigate 1 page appear getting 6 syntax errors. please have assistance going wrong! package com.techblogon.loginexample; import android.app.activity; import android.content.intent; import android.os.bundle; import android.view.view; import android.widget.button; public class mainmenu extends activity { protected void oncreate(bundle setinstancestate) { super.oncreate(setinstancestate); setcontentview(r.layout.activity_main_menu); final button button = (button) findviewbyid(r.id.btnhealth); button.setonclicklistener(new view.onclicklistener() { public void onclick(view v) { intent activitychangeintent = new intent(mainmenu.this, tips.class); mainmenu.this.startactivity(activitychangeintent); } }); } }

javascript - Making asynchronous requests within a Node.js server error:"TypeError: Object #<Object> has no method '_implicitHeader'" -

so trying make server receive request, make new request, receive new response, , relay original source. here code: var http = require('http'); var request = require('request'); var server = http.createserver(function(request, response){ response.writehead(200, {"content-type": "text/plain"}); response.write('on'); getsummonerid(response); }); server.listen(9000); console.log("server running!"); function getsummonerid(cb){ request('https://na.api.pvp.net/api/lol/na/v1.4/summoner/by-name/' + 'someones-name' + '?api_key=mykeygoeshere', function(request, response, body){ cb(json.parse(body)); }); } when did that, got typeerror: object #<object> has no method '_implicitheader' . upon further searching through tome of googel, found these: https://github.com/joyent/node/issues/5597 how can implement nodejs stream api? i think might problem i'm having, i'm h

html - background-size cover in a table -

trying use background size cover in table , not getting results after. see: http://jsfiddle.net/pp9st63l/1/ .image th { background-size: cover !important; height: 300px; width: auto; } the data columns (not including left column) should equal width, number of columns variable. 3 , other times 4 (including left headline column). the width of these data columns should equal , sufficient background image can cover. if there long data in other. width of columns purely related data in columns. override behavior css , set max widths columns , make them equal width. background-size cover work. any thoughts on how work? thanks. just delete display:block , max-width , use width table cell . background-size:cover works me. 'beautiful' may use background-position:50% 50% or background-position:50% 0px images . table-cells same width properties ( 30% 30% 30% or 30px 30px 30px 30px ) point set width same. p.s. sorry bad english. upd al

java - Jackson deserializing GMaps JSON -

i trying deserialize following json: http://maps.googleapis.com/maps/api/geocode/json?address=04545-006 my doubt is, how deserialize in way results.geometry.location.lat , results.geometry.location.lng ? since using spring, tried using resttemplate , annotate helper class follow, without success: public class gmapsdto { t@jsonproperty("results/geometry/location/lat") private string lat; @jsonproperty("results.geometry.location.lng") private string lng; public string getlat() { return lat; } public void setlat(string lat) { this.lat = lat; } public string getlng() { return lng; } public void setlng(string lng) { this.lng = lng; } } is there way navigate through object tree , info need? thanks. you want able use simple navigation via annotations, there has been jira issue reported @jsonwrapped annotation, opposite @jsonunwrapped, you're saying http://jira.codehaus.org/browse/jackson-781 . in humble opinion simplest way

How can I explain Hadoop not to split my file in some special MapReduce task? -

given have file process hadoop , know size of file smaller block size of hdfs. guarantees file not splitted , dont need write inputsplit because default 1 not split it? given file saved sequencefileoutputformat (or other output format) bigger block size, consists of 1 key-value pair. implies file block's stored on same node (except replicated copies) , mapreduce task not waste time fetch them? means dont need write own inputsplit because key not splitted (key size smaller block size , there 1 key)?

python - SimPy Bank Tutorial with users lining up for a specific counter, and being able to leave the line early -

i'm looking @ simpy tutorial https://pythonhosted.org/simpy/tutorials/thebank.html#several-service-counters , i wondering how changed have customers use same line use specific counter? and further modification, if did not have wait @ front of line specific counter? background: i'm trying simulate line of people lining go theatre set seats. has line theatre itself, not has wait guy in row 5 seated if in 6 or greater. , has set seat (much "counter" in example). enjoy local theatre hoping able simulate easier way people line , find seats. you looking @ old documentation simpy 2. no longer supported. please refer docuemntation of current version 3 of simpy: http://simpy.readthedocs.org/en/latest/

folder - Iterate Directories with Batch -

the objective display directory name in myfolder. my.exe exists in folder, curiously, without wildcard in ...\desktemp*, "@echo showing subfolders" never displayed, "@echo g working" is. my.exe never found when moved 1 of subfolders. otoh current code never finds my.exe , never displays "@echo g working" lists each subfolder: "@echo showing subfolders". the other problem pauses @ end of block never reached. substituting inner with cd \users\%username%\desktop /d /r %%g in ("desktemp*") ( gets same result. my.exe isn't found if moved 1 of subfolders of desktemp. setlocal enabledelayedexpansion set currdrive=c set myfolder= :searchdrives rem block %%b in (c) ( if exist %%b: ( pushd %%b:\ if not defined myfolder ( echo "%cd%" rem displays path batch run from. rem above pushd doesn't change c:\ /f "tokens=*" %%g in ('dir /b /s /a:d "%%b:\users\%username%\desktop\desktemp*" ^| f

python - numpy vectorize a parallel update -

i want implement one-dimensional cellular automaton following simple rules: if cell 1 , neighbor cell 0 , move (to right) if cell 1 , neighbor cell 1 , don't move all cells update @ same time according state. we have closed boundary conditions . means neighbor of last cell first cell. for example: 0 1 1 0 1 after update: 1 1 0 1 0 my solution is def update(cells): neighbors = np.roll(cells,-1) dim = len(cells) tmp_cells = np.zeros(dim) i,j in enumerate(cells): if j , not neighbors[i]: tmp_cells[i], tmp_cells[(i+1)%dim] = 0, 1 elif j: tmp_cells[i] = 1 return tmp_cells that works fine, solution not exploit possibilities of np.arrays , reduces simple list -algorithm. i thought find neat logic between cells , neighbors , apparently have go sleep now. some ideas? to value cell without looping, need know neighbors on both sides. need left because if you're 0 new value depends o

string - Reading from file in C++, dealing with blanks -

i tying read text file in c++98. has pattern, field empty: id name grade level 1 80 2 b b 3 c 90 how can read file such can ignore blanks? ( wish use regex: \d*) is there simple way of doing that? you need use knowledge have input make assumptions missing. can use std::stringstream parse individual terms text line. in other words std::stringstream deals blanks ignoring spaces , getting complete term only, example std::stringstream("aaa bbb") >> >> b load strings a "aaa" , b "bbb" . here example program parses input, making robust parser scratch can difficult, if input strict , know expect can away simple code: #include <iostream> #include <fstream> #include <string> #include <sstream> //----------------------------------------------------------------------------- // holds data entry struct entry { int id; std::string name; int grade; std::string level; entry(

url - Android Linkify not detecting some new top-level domains -

i using linkify detect urls in text view linkify.addlinks(messagetext, linkify.web_urls); it works great , detect "most" urls, however, seems class regex pre set detect domains only. came across url http://kodi.wiki/ , linkify failed detect url. doesn't detect others like http://test.menu http://test.link http://test.foo so safe/wise use url regex detect urls (doamin names , ips)? or shall live , wait google fix linkify? (note: don't regex since experience cannot predict weird glitches might encounter them) update there bug report created android here state problem got fixed in android 5, there no fix android versions prior that. , based on comments seems google using regex match urls without validating gtlds, think way on devices cannot updated easily.

java - Using a timer for my visually updating bar graph -

i have been having trouble getting timer show bar graph updating on time instead, have graph being sorted automatically though set timer update every couple of seconds. here paint , updatetextfieldthread method. private class display extends jpanel { private color color = color.red; public void paintcomponent(graphics g) { super.paintcomponent(g); g.setcolor(color.red); dimension d = getpreferredsize(); int clientwidth = d.width; int clientheight = d.height; int barwidth = clientwidth / array.length; int x=0, y=0; int base=410; for(int i=0;i<array.length;i++){ x+=30; y+=30; int linethickness=20; int linelength=50; g.setcolor(color.red); g.fillrect(x, base-linelength*array[i], linethickness , linelength*array[i]); g.setcolor(color.black); g.drawrect(x, base-linelength*array[i], li

php - Symfon2 Spit out 3 text fields with a widget -

can set widget such can spit out 1-3 text fields depending on desired format? have coordainate entity long , lat field. of ours users prefer degrees minutes seconds, degrees minutes, decimal. have customizations handle on our current system (symfony 1.4) , use these same customization files. i'm sure that's passed in through options? here's form class: <?php namespace ***\adminbundle\form; use symfony\component\form\abstracttype; use symfony\component\form\formbuilderinterface; use symfony\component\optionsresolver\optionsresolverinterface; class coordinatetype extends abstracttype { /** * @param formbuilderinterface $builder * @param array $options */ public function buildform(formbuilderinterface $builder, array $options) { $builder ->add('gps84lat') ->add('gps84long') ->getform() ; } /** * @param optionsresolver

python - What is the way to select a hard-coded value in a query? -

i have sql query uses hard-coded value: select col1, col2, 'some hard coded value' col2 table_a union select col1, col2, col3 table_b i tried following in sqlalchemy: result = session.query(table_a.col1, table_a.col2, 'hardcoded value'.label('col3') but got attributeerror , makes sense. thought adding value in python doing union. how can add hard coded value sqlalchemy query? use literal construct. from sqlalchemy import literal result = session.query( table_a.c.col1, table_a.c.col2, literal('hardcoded value').label('col3') )

How to get around memory error with karma & phantomjs -

we're running tests using karma , phantomjs last week, our tests mysteriously started crashing phantomjs error of -1073741819. based on thread chutzpah appears code indicates native memory failure phantomjs. upon further investigation, consistently seeing phantom crash around 750mb of memory. is there way configure karma not run against limit? or way tell flush phantom? we have around 1200 tests far. we're 1/4 of way through our project, 5000 ui tests doesn't seem out of question. thanks stackoverflow phenomenon of posting question , discovering answer, solved adding gulp tasks. before running karma start @ command line. spun single instance of phantomjs crashed when 750mb reached. now have gulp command each 1 of our sections of tests, e.g. gulp common-tests , gulp admin-tests , gulp customer-tests then single gulp karma runs each of groupings. allows each gulp command have own instance of phantom, , therefore stay underneath threshold.

c# - Export global variable in .NET executable -

this question force system nvidia optimus use real gpu application? explains how indicate nvidia drivers use nvidia gpu instead of igp in application. the trouble is, application .net app , don't know if there's way of exporting global variable .net executable. how achieve same effect question above in .net? e.g. there workaround modify exe post build add global variable export?

ruby - Rails 3 ActiveAdmin - different queries used for the filter tab vs the index data -

Image
i'm new ruby, rails, activeadmin. i have custom filters return correct data , can see correct number of records appearing in filter tab. i notice different query used render data in index view , don't know why. with further investigation, think issue related paging in activeadmin. have specific request have own limit of displayable adverts set three, limit being overridden paging operation within activeadmin. i tried setting paginate false, has not had effect. # query should # [ query here, see image below ]) order random() limit 3 # effect paginate = true query is: # [ query here, see image below ]) order random() limit 30 offset 0 config.paginate = true # effect paginate = false query is: # [ query here, see image below ]) order random() limit 10000 offset 0 config.paginate = false # expected sql - gets used on tabs @ top of screen select "advertisements".* "advertisements" "advertisements"."site_section" = 'signed

osx - python SimpleHTTPServer suspended, how to stop? -

i accidentally hit ctrl z instead of ctrl c stop python simplehttpserver , came saying [1] + 35296 suspended python -m simplehttpserver now cannot restart on same port port 8000 in use traceback (most recent call last): file "/system/library/frameworks/python.framework/versions/2.7/lib/python2.7/runpy.py", line 162, in _run_module_as_main "__main__", fname, loader, pkg_name) file "/system/library/frameworks/python.framework/versions/2.7/lib/python2.7/runpy.py", line 72, in _run_code exec code in run_globals file "/system/library/frameworks/python.framework/versions/2.7/lib/python2.7/simplehttpserver.py", line 220, in <module> test() file "/system/library/frameworks/python.framework/versions/2.7/lib/python2.7/simplehttpserver.py", line 216, in test basehttpserver.test(handlerclass, serverclass) file "/system/library/frameworks/python.framework/versions/2.7/lib/python2.7/basehttpserver.py", line 595, in te

jQuery - getting checked items in name array -

http://jsfiddle.net/3kwchkf6/1/ $('[name^="item"]').each(function(){ if ($(this).prop('checked')) { itemcheckedlist.push($(this).attr('name')); } }); console.log(itemcheckedlist); hi returns ["item[2001]", "item[2090]"] i want return [2001, 2090] i thinking maybe solution include regex somehow or serialize somehow? thanks. you can use .substring() fiddle $('[name^="item"]').each(function(){ if ($(this).prop('checked')) { var start = $(this).attr('name').indexof('[')+1; var end = $(this).attr('name').indexof(']'); itemcheckedlist.push($(this).attr('name').substring(start, end)); } });

floating point - float error occured in CPU calculation -

i found strange results in float assignment in cpu my code is float w[0]=0.1; printf("%.10f",w[0]); the result 0.1000000015 can give me help? thank you. 0.1 decimal repeating ' bicimal ': 0.0 0011 0011 0011 0011 0011 0011 0011 ... (the 0011 repeats, i've shown spaces). rounded 24 significant bits -- fit float -- 0.000110011001100110011001101. 0.100000001490116119384765625 in decimal . rounded 10 places, decimal number 0.1000000015 .

javascript - program a task with node.js... cron or setInterval? -

maybe seems odd question... don´t know how program task... o rather, don´t know wich 1 best solution. finish web app , needs everyweeks, every monday, execute "special" piece of code, can´t invoked anywhere else. the cron solution looks better, piece of code isolated, if code , rest of application 2 diferents programs. , worst handicap of cron solution (even tough suposse can solved), when call javascript file cli node cron.js makes job, never ends... normal?? or depends code?? becouse don´t want execute 1 instance, , next week, first instance still running, run second, , everyweeks same problem. the "setinteval" solution setting time day, , testing if monday (on monday makes action)... or maybe setting time week (604800000 miliseconds)... solution hasn´t these problems, last, consumes lot of resources (i think...no?). what best solution?? different?? , if cron best... how stop task? (uuuuuhhhh maybe other programed task cron -a shell- 1 minute after kill

jasper reports - JFreeChart: overlapping bars in XY chart that have the same value -

Image
i have problem 2 bars different series overlap each other when have same value. , 1 of both on top of other. unfortunately, want 1 in back, front : i tried changing order of category expression, no avail. can tell me how can orange bar on top of blue 1 please ? you may try datasetrenderingorder : xyplot plot = jfreechart.getxyplot(); plot.setdatasetrenderingorder(datasetrenderingorder.forward); // or reverse or plot.setseriesrenderingorder(datasetrenderingorder.forward); if neither works, isn't bad idea use stacked bar .

inheritance - Casting a class type as its known super class in Objective-C -

i have parent class in use class variable known super class. there way tell compiler super class of type? my use case more complex using external library (which why have such strange thing. here simplified: @interface +(void)magicmethod; @end #import "a.h" @interface b: @end #import "a.h" @interface c { class class_to_call } @implementation c -(void) fun_method { [class_to_call magicmethod]; // need context here base class a!!!! } @end #import "c.h" @interface d: c @end @implementation d -(id)init { self = [super init]; class_to_call = [b class]; } as can see above, there no way give context class i'm using call. there syntax "class" variable holds class base type a?

How Can I combine a list from XML in PHP -

i have parts list coming xml file, goes below. want able generate using php combined list. example "part 1" recorded twice. want qty show 13 under part 1 when generated either in json output or xml output. best way of doing that? looked @ php function array_combine wasn't able figure out if values combined mathematically instead of showing 1 of results. loading xml url in simplexml_load_file() function. thank help my xml url: <db> <record> <part>part 1</part> <qty>4</qty </record> <record> <part>part 2</part> <qty>5</qty </record> <record> <part>part 1</part> <qty>9</qty </record> </db> want display: <db> <record> <part>part 1</part> <qty>13</qty> </record> <record> <par

d3.js brush with multiline chart -

i'm making multi-line chart , using brush select time periods. it's broadly based on mike bostock's example @ http://bl.ocks.org/mbostock/1667367 my chart @ http://lowercasen.com/dev/d3/general/piezobrush.html my problem in selecting multiple lines in 'focus' area apply brush to. i've nested data based on key, data within function. because function calls brush outside function, can't access data , i'm getting typeerror: undefined not object (evaluating 'data.length') here's code nests data: datanest.foreach(function(d, i) { focus.append("path") .attr("class", "line") .attr("id", d.key.replace(/\s+/g, '')) //the replace stuff getting rid of spaces .attr("d", levelfocus(d.values)); context.append("path") .attr("class", "line") .attr("id", d.

oracle - Want two excel sheets as an attachment in mail through PL/SQL -

my requirement send data coming oracle tables excel sheet attachment through mail customers. able 1 excel sheet 1 table attachment need 2 excel sheets 2 tables. declare p_email varchar2(255) ; p_subject varchar2(255) := 'weekly report'; p_message clob; l_mailhost varchar2(255) := 'mail.abc.com'; l_mail_conn utl_smtp.connection; v_clob clob := empty_clob(); v_len integer; v_index integer; s_clob clob := empty_clob(); s_len integer; s_index integer; headerlines_v clob := empty_clob(); headerlines_s clob := empty_clob(); length_v integer; length_s integer; crlf varchar2(2) := chr(13)||chr(10); v_date varchar2(15) := to_char(trunc(sysdate),'dd_mm_yyyy'); cursor cur_a select a, b, c table1 cursor cur_b select x, y, z table2 begin /*table header in attachment*/ dbms_lob.create

javascript - How can I get the html of a page as a string in a Firefox extension? -

i need html of current page loaded string, may manipulate , use information later on. needing use in firefox extension, , having lot of trouble getting work. i tried storing value using .outerhtml, had seen , got work in other places. here example of how worked: var pagehtml = document.documentelement.outerhtml; i tried searching piece needed @ time, so: document.getelementbyid("header") however, neither of these seem access html. assume because code operating in browser, not in document itself. how can go accessing html 'document' of page loaded in tab firefox extension. the firefox addon sdk includes module called page-mod intended purpose. content scripts run under page-mod run in context of web page, rather typical sandboxed context. from page's documentation: you can modify document in script: var pagemod = require("sdk/page-mod"); pagemod.pagemod({ include: "*.mozilla.org", contentscri

ruby on rails - RuntimeError: Circular dependency detected while autoloading constant - ActiveAdmin.register Role -

i using activeadmin , have file doing this: activeadmin.register role something--- end however, server gives me error: runtimeerror: circular dependency detected while autoloading constant role /library/ruby/gems/2.0.0/gems/activesupport-4.0.10/lib/active_support/dependencies.rb:461:in `load_missing_constant' /library/ruby/gems/2.0.0/gems/activesupport-4.0.10/lib/active_support/dependencies.rb:184:in `const_missing' ~/desktop/boxfox/app/admin/role.rb:1:in `<top (required)>' /library/ruby/gems/2.0.0/gems/activesupport-4.0.10/lib/active_support/dependencies.rb:424:in `load' /library/ruby/gems/2.0.0/gems/activesupport-4.0.10/lib/active_support/dependencies.rb:424:in `block in load_file' /library/ruby/gems/2.0.0/gems/activesupport-4.0.10/lib/active_support/dependencies.rb:616:in `new_constants_in' /library/ruby/gems/2.0.0/gems/activesupport-4.0.10/lib/active_support/dependencies.rb:423:in `load_file' /library/ruby/gems/2.0.0/gems/activesuppor

asp.net - Client Time performance tuning using Glimpse -

i using glimpse 1.8.6 in asp.net web forms application in vs2013 deployed azure website (standard tier). have user control embedded in aspx page, question specific timings in requests section. i typically seeing 3000-4000ms request times, 5-25ms wire, 500-1000ms server , 2000+ client. additionally load 500-700ms , render sub 100ms. the "client" portion question, used calculate client , more importantly should looking in code decrease number? great question... client time difference between loadeventend , responseend (you can see relevant code here ). in english terms happens time browser receives last byte server (for main document) when load event current document run (this typically occurs after external resources have loaded). most of time, improve number, involves caching aggressively, bundling documents together, etc. there great talk nik molnar did on has large section on optimizing these types of - http://vimeo.com/97415381 .

java - How to check value of two fields in URL? -

hello guys have 1 url connected through id, here using user_login_id , response this.. {"interestreceived":[{"received_detail_id":2783,"interest_id":1288,"name":"monali patel","profile_id":"gm453843", "image":"","cast":"not willing specify","age":"24","location":"","user_status":"accept"}]} here have received_detail_id in above json,, now in next json response here using both ids,and in code using put , pass values string matchid=this.getintent().getstringextra("received_detail_id"); string id=this.getintent().getstringextra("user_login_id"); user url: user_url="http://mywebsitename.com/webservice/interestreceiveddetail?version=apps&received_detail_id="+matchid+"&user_login_id="+id; is right way do?because not getting output check

javascript - Create a Airport Database with API Access -

i'm looking create database can access without api keys using link. essentially, i"m looking copy exact system: http://gd.geobytes.com/autocompletecity?callback=?&q=new except i'd replace results airport codes , names have. have idea how can this? maybe if clarify further. using typeahead , in custom.js file have following need update use own dataset i"m clueless on how this. $('.typeahead').typeahead({ hint: true, highlight: true, minlength: 3, limit: 8 }, { source: function(q, cb) { return $.ajax({ datatype: 'json', type: 'get', url: 'http://gd.geobytes.com/autocompletecity?callback=?&q=' + q, chache: false, success: function(data) { var result = []; $.each(data, function(index, val) { result.push({ value: val }); }); cb(result); } }); } }); after commen

JSON array to C# List -

how can deserialize simple json string list in c# ? ["on4thnu7","n71yzyvkd","cvfspm2w","10kqotv"] such that, list<string> mystrings = [the content of json above] i using datacontractjsonserializer found in system.runtime.serialization.json, , don't need external library. edit: javascriptserializer found in system.web.script.serialization acceptable. just this, string json = "[\"on4thnu7\",\"n71yzyvkd\",\"cvfspm2w\",\"10kqotv\"]"; var result = new javascriptserializer().deserialize<list<string>>(json);

python - django i18n : gettext didn't translate one line -

update: i solve use &#37; replace % <h3>{% trans "is 100&#37; free?" %}</h3> do have better solution ?? original question: i use gettext translate chinese,but line didn't not translate . still output is 100% free? please guide me thank you. template : <h3>{% trans "is 100% free?" %}</h3> django.po #: templates/help.html:5 #, python-format msgid "is 100%% free?" msgstr "完全免費嗎?" i think still open issue, can solve like {% blocktrans percent_sign = u'%' %} 100{{percent_sign}} free? {% endblocktrans %} or try way ( bug seems fixed) msgstr "完全免%% 費嗎?" you place %% belongs, dont know chinese. one of them (or both of them) should work

android - R cannot be resolved to a variable, when clean build is done -

i have searched many questions cant seem solution problem. issue came after updated using download manager while eclipse running. the problem: whenever clean build , " r cannot resolved variable" issue comes. r not present in gen folder. if comment places r used, r.java gets generated, uncomment code containing r.id.. , things run , come again if clean build triggered. if build normally, changes not getting reflected. how issue came: download manager - > update. intall 16 packages button - didnt much, because peer connection refused issue came. delete 1 package option. used option twice , deleted 2 folders whise names dont remember. after projects had thousands of compilation errors. tools folder not present. added unzipping it. now whenever clean build , " r cannot resolved variable ". r not present in gen folder. if comment places r used, issue gone, uncomment code , things run , come again if clean build triggered. solutions tried:

Fitting three buttons and a background image in android -

Image
i trying develop android app should ios have done last month. there view background image , 3 buttons. background image has header part , footer part, , need 3 buttons stay between these 2 parts. screenshot ios version , desired output android activity: and have layout file activity: <?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" android:background="@drawable/fondo_pantalla"> > <button android:id="@+id/button2" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_alignparentleft="true" android:layout_below="@+id/button1" android:drawableleft="@drawable/actividades_izq&q