Posts

Integrate a "Search Maps" function in an Android app -

the google maps application features search box (with autosuggestion) allows search address, resulting in marker being placed on map of google maps application. is possible re-use functionality in custom android app, text box presented, resulting in geopoint being delivered custom app, app can place marker somewhere ? in other words, google maps application expose service or intent can used custom application ? if so, how can integration done ? if not, can provide pointer on how custom implementation can realized ? to acquire location named address, need use statement geocoder.getlocationfromname("london",5). return set of matches (5 in example), can either use first one, or show set user select right one. http://developer.android.com/reference/android/location/geocoder.html once have location (latitude , longitude) can plot location on map using mapoverlay, , show marker using that. http://developer.android.com/resources/tutorials/views/hello-mapview...

Handling an oAuth flow from local HTML files? -

i've got local html + javascript file consumes json api. i'd authenticate users via facebook, i'm not sure if that's possible -- have experience this? i'm unsure of how redirect (back facebook) managed when we're serving file:// context. just it! :) and you'll see. ps maybe should encode characters ":", "/" etc

messagebox - Silverlight: Message box prompting user to enter some text? -

i'm using silverlight 4. i'd message box prompts user enter text. possible? far, looks option ask user click button. you have create new child window in visual studio , build input form in child window.

What's the difference between UPnP AV and DLNA? -

am right in thinking if i'm dlna 1.5 compliant, i've implemented upnp av? dlna me besides specifying minimum format requirements? isn't dlna built on top of upnp? know sure dlna device discovery based on ssdp (upnp's device discovery protocol). dlna add in content discovery or content delivery specification? for example, boxee , xbmc both support upnp - don't work dlna devices? looking @ dlna , upnp whitepapers, upnp , dlna different although solve similar problems dlna adopts specific things upnp ( see dlna whitepaper page 5 ). it's incorrect dlna subset of upnp. a dlna device able discover upnp server might not able more if both sides don't agree av format. haven't verified this. it's more of understand after reading papers. looking @ this , seems xbmc server not support dlna. explain above situation.

How can I change what python interprets as a integer? -

how can change python interprets integer? example: 94*n valid integer. anything possible when smell old spice , use python's language services generate ast.

Getting number of hits without pagination in sunspot 1.2 on ruby on rails 3 -

i've installed sunspot ruby on rails 3 project, can't seem find way total hits search query. this search request @search = sunspot.search(job) fulltext params[:job] paginate(:page => params[:offset], :per_page => 25) end it works except need total number of real hits, not total results returned (in case 25 because of :per_page => 25) in other words, want able display: showing 1 25 out of 883 jobs found any appreciated! thanks the method total works here. query_results = sunspot.search(recipe) keywords(params[:qs]) paginate(:page=>params[:page], :per_page=>30) end @search_results = query_result.results @search_total = @search_results.total or, in view, total_entries works on results object. %div search = params[:qs] returned = pluralize(@search_results.total_entries, 'result')

java - Repast restart issue -

i'm developing artificial intelligent program explore given space resources. i'd run multiple scenarios in order collect data , output file. i used "multiple runs" option in gui , stop() when 1 module run finished (all resources have been explored). problem when runs model second turn, doesn't work properly. what mean after running once need kill application exiting because restart option doesn't work properly. is there "restart" forgets do? because if exit application , run again works perfectly edited it's more clear: i use repast platform in order simulate exploration mars. have 3 kinds of agents, scouting, digging , transporting. communicate among them schedule tasks , other things. the first time run simulation runs smoothly. , when mineral resources of planet have been explored restart model , try again can collect data. the problem is, when use "restart" option simulation doesn't run well. if exit (not r...

javascript - JQuery Slideshow and MooTools Conflict -

i having problem motools library conflicting jquery library: here's code: <script language="javascript" type="text/javascript" src="revamp/js/jquery-1.4.2.js"></script> <script language="javascript" type="text/javascript" src="revamp/js/jquery.blinds-0.9.js"></script> <script type="text/javascript" src="js/mootools-1.2-core.js"></script> <script type="text/javascript" src="js/_class.viewer.js"></script> <script type="text/javascript">//<![cdata[ window.addevent('domready',function(){ var v5 = new viewer($('boxcont').getchildren(),{ mode: 'alpha', fxoptions: {duration:500}, interval: 6000 }); v5.play(true); }); </script> <script type="text/javascript"> $(window).load(fu...

java - can beanutil get the property of one field with its native type -

hi: using beanutil properties of bean,then put them map. found getproperty() can return string value,i wonder if can return native(original) type? for example: bean: public class entity { private string name; private int age; private list<date> childs = new arraylist<date>(); public entity(string name, int age, list<date> childs) { this.name = name; this.age = age; this.childs = childs; } public static entity newinstance() { list<date> list = new arraylist<date>(); list.add(new date()); list.add(new date()); return new entity("beanutil", 23, list); } //the getter , setter fields } then want field property of it,and not know fields requried,so use way: public class beanutilmain { public static void main(string[] args){ string[] requestpro={"name","childs"}; //this field specified clien map<string, object> map=new hashmap<string, object>(); entity en=entity.newinstanc...

c++ - Best form for constructors? Pass by value or reference? -

i'm wondering best form constructors. here sample code: class y { ... } class x { public: x(const y& y) : m_y(y) {} // (a) x(y y) : m_y(y) {} // (b) x(y&& y) : m_y(std::forward<y>(y)) {} // (c) y m_y; } y f() { return ... } int main() { y y = f(); x x1(y); // (1) x x2(f()); // (2) } from understand, best compiler can in each situation. (1a) y copied x1.m_y (1 copy) (1b) y copied argument of constructor of x, , copied x1.m_y (2 copies) (1c) y moved x1.m_y (1 move) (2a) result of f() copied x2.m_y (1 copy) (2b) f() constructed argument of constructor, , copied x2.m_y (1 copy) (2c) f() created on stack, , moved x2.m_y (1 move) now few questions: on both counts, pass const reference no worse, , better pass value. seems go against discussion on "want speed? pass value." . c++ (not c++0x), should stick pass const reference these constructors, or should go pass value? , c++0x, should pass rvalue reference on pass value...

c# - Treecontrol: SelectionChanged Event called thrice -

i have tree control used in form , have around 10 items in tree. each parent having 1 sub child/node. i handling selectionchanged event of tree. whenever treeitem selected event fired , function called. function called @ least thrice!! is there have done wrong everytime select tree item called thrice !! r u doing in handler causes tree selection event fire ? can please post of code? edit try putting e.handeled = true in handler

Can PHP files with an extension of .php.xx be executed as PHP? -

say have file myfile.php executes php code. file somehow (any possible way) executed if named myfile.php.xx , xx characters? myfile.phpxx ? other types of executable files in same situation (.pl, .exe, .dll, etc)? i'm working on firewall, using regexes check file names these types of files. enough check end of file .php, .exe, etc., or should check comes after it, too? it's completely web server decide how wants handle given url. if wants treat url 20-digit number accessed @ 2:35 in afternoon on third thursday in month php script prerogative. attempting guess web server strictly url requested not possible.

java - How to call a servlet from JSP page? -

possible duplicate: calling servlet jsp file i have used following code call conn.java (servlet) index.jsp . works. <%@page import= "java.util.arraylist"%> <%@page contenttype="text/html" pageencoding="utf-8"%> <!doctype html public "-//w3c//dtd html 4.01 transitional//en" "http://www.w3.org/tr/html4/loose.dtd"> <%@ page import= "aa.conn" %> <jsp:usebean id= "conne" class= "conn" scope= "session"/> <jsp:setproperty name= "conne" property= "*"/> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <title>jsp</title> </head> <body> <link rel="stylesheet" href="rowcolor.css" type="text/css"> <% conne.con(request, response); arraylist newlist=...

google app engine - When to use entity groups in GAE's Datastore -

following on my earlier question regarding gae datastore entity hierarchies , i'm still confused when use entity groups . take simple example: every company has 1 or more employee entities an employee cannot moved company , , users deal 1 company can never see employee s of company this looks case make employee child entity of company , practical consequences? improve scalability, hurt scalability, or have no impact? other advantages/disadvantages of using or not using entity hierarchy? ( entity groups enable transactions, assume example not need transactions). nick stated should not make groups larger necessary, best practices writing scalable applications has discussion 1 why. use entity groups when need transactions. in example gave, referenceproperty on employee achieve similar result. aside transactions, entity groups can helpful because key-fetches , queries can keyed off of parent entity. however, might want consider multitenancy thes...

c++ - undefined reference to `DhcpEnumSubnets' -

i'm trying information dhcp server using windows api, keep getting undefined references. according msdn dhcpenumsubnets in dhcpsapi.lib , have verified prototype is in dhcpsapi.h file , (by simple text search) is in .lib as can see below linking against lib, still linker errors. have ideas me ? here compile log: i'm using dev-c++ 4.9.9.2 on windows xp sp2, latest windows platform sdk "microsoft® windows® software development kit (sdk) windows server 2008 , .net framework 3.5" "this release of windows sdk supports x86, x64, , ia64 platforms building , running applications on windows xp sp2, windows server 2003 r2, windows vista, , windows server 2008." compiler: default compiler building makefile: "c:\projects\dhcptest\makefile.win" executing make clean rm -f main.o dhcptest.exe g++.exe -c main.cpp -o main.o -i"c:/dev-cpp/lib/gcc/mingw32/3.4.2/include" -i"c:/dev-cpp/include/c++/3.4.2/backward" -i...

php - How to make three column template in codeigniter? -

newbie ci.and want implement ci in 3 column template manner.but not sure how can implement it.the right column static 1 once user logged site.it contains profile pic,accountinfo , other stuffs. in middle , left columns going change depend upon user operation link on right side. -------------------------------------------- header left | middle | right pic | | account| | footer ---------------------------------------------- for example if user clicks left side link account need display account information in middle panel.so middle panel changes in content?how can achieve this? just display views depending on method requested.. <?php class profile extends controller { function __construct() { parent::__construct(); } function index() { $this->load->view('profile/home'); } function messages...

sml - warning in the ML -

can please explain, warning mean? stdin:18.35 warning: calling polyequal and why have "a , not 'a in following statement: val alreadyvisited = fn : ''a * ''a list -> bool this function: fun alreadyvisited(v, []) = false | alreadyvisited(v, x::xs) = if(x=v) true else alreadyvisited(v, xs); thanks in advance 'a means "any type", while ''a means "any type can compared equality". since alreadyvisited function compared x , v using = , x , v need have type supports comparing them equality, type ''a . the warning means you're comparing 2 values polymorphic type equality. why produce warning? because it's less efficient comparing 2 values of known types equality. how rid of warning? changing function work specific type instead of type. should care warning? not. in cases argue having function can work type more important having efficient code possible, i'd ignore w...

c++ - Is it possible to detect GDI leaks from the Visual Studio debugger? -

leaking gdi objects can seen task manager or process explorer . (well don't see leaks, can see if object uasage count continually goes up.) there tools allow view gdi objects type, such gdiview [a], deleaker , dpus or gdidebug (sourecode) . [a] note consider gdiview great tool job done of identifying , confirming existance gdi leaks, doesn't find leaking code in large applications. (i note here tool works nicely , seems behaved, although homepage littlebit weird (-: ) there windbg plugin called leaktrap uses mss detours library . i know (and have used) aqtime 's resource profiler allows detect gdi (and other) resource leaks in application including stack traces leaking calls. now, actual question is: is possible detect leaking gdi objects within vc++ debugger? 1 doesn't need separate tool , gdi leaks can caught during normal debugging , not have checked separately. gdi objects not have checked individually (notreally), can in charge deleaker -...

Hibernate Tools : how to generate base classes? -

i installed eclipse helios , hibernate tools 3.4.0.beta1. i've been trying generate "base class" mapping files can't find out how do. let have mapping file called individual.hbm.xml. want hibernate tools generate 2 pojos : - baseindividual.java contain constructors , getters/setters - individual.java add "custom" code not removed whenever re-generate pojos i spent lot of time seeking information never found practical answer. if can help... in advance i have come across question while trying same thing myself (i think). what have done set following in hbm.xml config file: <class name="user" table="users"> <meta attribute="generated-class">ocs.authentication.userbase</meta> <id name="user_id" column="user_id" type="integer"> <generator class="increment"/> </id> <property ...

load xml file in a rich text box from a remote server to vb.net form -

i have windows app in vb.net , trying read xml file server(http://dev2010.abc.com/abc.xml).i able read abc.xml . now have requirement show abc.xml in rich text box in vb.net , have show node , value in combobox . able directory(suppose file in c:/abc.xml) please suggest me way way load xml file server in rich tex box , there show nodes , corresponding value in combobox , display output in textbox.. code in vb .net imports system.xml imports system.io public class form1 inherits system.windows.forms.form region " windows form designer generated code " public sub new() mybase.new() initializecomponent() end sub protected overloads overrides sub dispose(byval disposing boolean) if disposing if not (components nothing) components.dispose() end if end if mybase.dispose(disposing) end sub friend withevents txtfile system.windows.forms.textbox friend withevents txtresults system.windows.forms.textbox friend witheve...