Posts

Showing posts from September, 2015

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

audio - An desktop or web app to watch user's desktop and listen -

one of clients in need of software (desktop app or web app) can view user's desktop , hear happening in microphone. has ever heard of such software exists? sound important can't view of user's desktop. thanks, you can use teamviewer this. it's remote assistances application voip. http://www.teamviewer.com also, free non-commercial use.

opencv - Realtime Face-tracking on Iphone -

does know which,currently,is best library realizing real time face-tracking solution iphone? i've done research i've found quite old articles opencv portings. know if there specific,reliable,fast (and possibly free) ar solution overlay in real time image face in iphone camera video stream (not static image) any (link,tutorial) great. thanks everybody!! elos ios 5 brings facial recognition native feature. basically have configure object act video output stream’s delegate (could controller, example) , use cidetector object process stream (which class available in ios 5 ). this cidetector object faces in each of video's frame , return cifacefeature object several information faces found, such eyes , mounth position , bounds (the rectangle face found inside). you can check this blog more implementation details: https://web.archive.org/web/20130908115815/http://i.ndigo.com.br/2012/01/ios-facial-recognition/

c++ - Newbie question f2c compilation problem: cc1plus error: /include: not a directory What does this mean? -

i having problems compiling code on mac (os x, 10.6.5). the code uses f2c. i don't understand error, , appreciate help. wondered if might problem compiler, , in case reinstalled xcode, installs new g++ compiler. still same error. here's error: cc1plus: error: /include: not directory cc1plus: error: /lib: not directory make: *** [task1.o] error 1 thanks! this may error in installation of gcc compiler. seems may looking includes in /usr/include , missing first part of directory. try executing: $ gcc -v to see directories gcc you're using has default. in case, see --prefix=/usr as 1 of options.

javascript - jQuery live and sortable -

i have following static html: <ul id="mylist"> <li id="li_10"><a href="10">item 10</a></li> <li id="li_20"><a href="20">item 20</a></li> <li id="li_30"><a href="30">item 30</a></li> <li id="li_40"><a href="40">item 40</a></li> <li id="li_50"><a href="50">item 50</a></li> </ul> i have following jquery: <script> $( document ).ready( function() { $("#mylist").sortable( {axis:"y"} ); }); </script> this works perfectly, stops working use jquery/ajax generate above html. assuming need use "live" function in jquery sortable section. can me implement this? .live() event based, can't use plugins this. can call code when ajax call f

java - how to save & retrieve data in the same activity with SharedPreferences in Android -

i new android platform. please resolve query "how save & retrieve data in same activity sharedpreferences in android" many applications may provide way capture user preferences on settings of specific application or activity. supporting this, android provides simple set of apis. preferences typically name value pairs. can stored “shared preferences” across various activities in application (note cannot shared across processes). or can needs stored specific activity. shared preferences: shared preferences can used components (activities, services etc) off applications. activity handled preferences: these preferences can used in activity , can not used other components of application. shared preferences: the shared preferences managed of getsharedpreferences method of context class. preferences stored in default file(1) or can specify file name(2) used refer preferences. (1) here how instance when specify file name public static final string pr

network programming - Can I create a listening TCP socket using raw sockets in Linux? -

i create listening tcp socket control when responds client first syn+ack after receives initial syn packet client. i want introduce delays or ignore initial syn packets. can using iptables @ moment, i'm wondering if done using os socket interface. note if use normal tcp socket, once server calls listen() on socket descriptor, os establish connection when client connects it. i wondering if use raw sockets implement behavior. examples have seen far raw sockets active sockets (client server) , not passive sockets (listening sockets). you theoretically write own tcp implementation on raw sockets. kernel still respond incoming tcp packets before raw socket gets copy. you'd have work around using iptables or block kernel seeing packets you're interested in. i think easier in kernel module via netfilter interface (which may you're doing). check out libnetfilter_queue might work if want in userspace.

java - How do I replace the a portion of the string with special characters -

i replace portion of string "\\_\\_\\_\\_\\_" (e.g. string str = "hello world") if str.replaceall("world", "\\_\\_\\_\\_\\_"); i don't see "\" character in replaced string, expect show me "hello \_\_\_\_\_" you need: str = str.replaceall("world", "\\\\_\\\\_\\\\_\\\\_\\\\_"); see it. \ escape character in java strings. mean literal \ need escape \ \\ . \ escape char regex engine as-well. \\ in java string sent regex engine \ not treated literally instead used escape following character. to pass \\ regex engine need have \\\\ in java string. since replacing string (not pattern) string, there no need regex , can use replace method of string class as: input = input.replace("world", "\\_\\_\\_\\_\\_"); see it.

.net - UIElement.IsMouseOver returns false -

uielement.ismouseover return false if other element on (zorder >) uielemnt. is there property ismouseover = true case? if want determine mouse on states layered elements can manual hit testing. see can make wpf set ismouseover both covering , covered element?

model view controller - Need some tips regarding the Cocoa MVC/KVO patterns -

this wide-ranging/vague question, here goes. apologies in advance. the app (desktop app) i'm building takes different kinds of input generate qr code (i'm building learn obj-c/cocoa). user can switch between different views allow input of plain text (single text field), vcard/mecard data (multiple text fields), , other stuff. no matter input, result qr code. to keep things contained, i'd use views view-controllers, handle they're own inputs, , can "send" generic "data encode" object containing data central encoder. i.e. plain text view make data object textfield's text, while vcard/mecard view use of fields make structured vcard/mecard data. i can bind of stuff manually in code, i'd learn how bindings/kvo me out. alas, after reading apple's developer docs, , simpler tutorials/examples find, i'm still not sure how apply app. for instance: user edits textfields in vcard-view. vcard view-controller notified of each update , &

html table, variable width columns plus a floating width column -

i have table 4 columns. first 3 columns should take space need display data / ui control placed in them, whereas fourth column should take remaining space. don't know while creating table widths first 3 columns should be, can't put "width" value in there. if set fourth column 100% width, squishes first 3 columns much; if there drop down list ("select" in html terms) in 1 of columns, last column force become somewhere around 20 pixels wide, whereas should wide option element has longest text in menu. other rows in table cells span multiple columns, think i'm stuck using table element (as opposed divs etc) any ideas? ie6 not supported site whatever works in firefox / chrome should good. try putting width:1%; white-space:nowrap; in first 3 columns , leave fourth without width

objective c - How to send message using XMPP Framework -

i creating chat application using xmpp framework in iphone. received messages not able send message. can 1 give me solution this?? - (void)sendmessage:(nsstring *)msgcontent { nsstring *messagestr = textfield.text; if([messagestr length] > 0) { nsxmlelement *body = [nsxmlelement elementwithname:@"body"]; [body setstringvalue:messagestr]; nsxmlelement *message = [nsxmlelement elementwithname:@"message"]; [message addattributewithname:@"type" stringvalue:@"chat"]; [message addattributewithname:@"to" stringvalue:[jid full]]; [message addchild:body]; [xmppstream sendelement:message]; } } use above code in chatviewcontroller ..it working fine me.

xml - Multiline comment with QXmlStreamWriter -

i trying comment multiline section of xml output file using qxmlstreamwriter. in loop, iterating through nested structures, , if structure noted "iscommented" need insert "< ! - -" (without spaces) continue writing xml form of output. when end of structure need insert end comment: "-->". qxmlstreamwriter::writecharacters(qstring) method won't suffice since picks out special characters such "<" , re-interprets them. have handled eradicating cases nested comments... isn't issue (the inner , outer loop guaranteed not both commented) ideas alternate solution? below example of code: ... qxmlstreamwriter writer(&myfile) (int = 0; < bigstruct.size(); i++){ if (bigstruct.at(i)->iscommented){ //start comment sequence //insert "<!--" } writer.writestartelement("bigstruct"); (int j = 0; j < smallerstruct; j++){ if (smallerstruct.at(i)->iscommented){ //start comme

flex4 - Flex: Set caret cursor position in RichEditableText control -

is there method set caret position within richeditabletext control? the control's contents can contain errors user must fix navigated though via next/previous buttons, , during navigation set caret cursor end of each error within text. first need change focus: textfield. setfocus() then set positoin: textfield. selectrange()

iphone - Breaking String -

i have break string in 2 parts: 2º felipe massa (bra) 1)2 2)felipe massa (bra) i using method myarray = [mystring componentsseparatedbystring:@"º"]; but not breaking it, , returning me this: 1\u00ba felipe massa (bra) i know unicode character, how can break it? in advance. try this nsstring* blah = @"2º felipe massa (bra)"; nslog(@"%@", [blah componentsseparatedbystring:@"\u00ba"]); you have use unicode escape sequence make work.

linux - valgrind : Opening several suppression files at once -

i have script executes unit tests using valgrind. script became big, because have maybe 10 suppression files (one per library), , possible have add more suppressions files. now instead of having line : memcheck_options="--tool=memcheck -q -v --num-callers=24 --leak-check=full --show-below-main=no --undef-value-errors=yes --leak-resolution=high --show-reachable=yes --error-limit=no --xml=yes --suppressions=$suppression_files_dir/suppression_stdlib.supp --suppressions=$suppression_files_dir/suppression_cg.supp --suppressions=$suppression_files_dir/suppression_glut.supp --suppressions=$suppression_files_dir/suppression_xlib.supp --suppressions=$suppression_files_dir/suppression_glibc.supp --suppressions=$suppression_files_dir/suppression_glib.supp --suppressions=$suppression_files_dir/suppression_qt.supp --suppressions=$suppression_files_dir/suppression_sdl.supp --suppressions=$suppression_files_dir/suppression_magick.supp --suppressions=$suppression_files_dir/suppression_sql

ruby - What's a good way to test 'link_to' and other view helpers from the rails console? -

i use rails console lot , wondering best way test view helpers such 'link_to' or 'url_for' using it. what's best way this? just include urlwriter module in console: include actioncontroller::urlwriter

c - Compiling 64 bit DLL for JNI -

i want include c library in java project via jni. wrote necessary jni wrapper code , have compiled , tested in linux environment using gcc , make. need compile make 64 bit windows dll, , cannot compile. i downloaded visual c++ express 2010 , have been using cl.exe on command line. in absence of knowing better way it, have called cl.exe of files want compile arguments. variety of errors: command line warning d9024: unrecognized source file type 'svm_jni.h'... and svm_jni.c(63) : error c2275: 'jobject' : illegal use of type expression... the first problem have discovered fact cl.exe not accept .h files (i guess meant c++ instead of c?). there workaround this? change of .h files .c files , change include statements, prefer not this. i have tried compiling using make , gcc on mingw, says cannot compile 64 bit target. i have tried doing things through vc++ using makefile project type, not figure out how works. any suggestions? edit: removed .h files com

Sharepoint: list does not exist. Which list? -

when try access cache settings site @ url http://my.site.com/site/_layouts/areacachesettings.aspx error below. there nothing more in url , have no idea list being mentioned here. 1 can think of cache profiles , 1 there when check sharepoint manager... any ideas? - list not exist the page selected contains list not exist. may have been deleted user. @ microsoft.sharepoint.library.sprequestinternalclass.getlistswithcallback(string bstrurl, guid foreignwebid, string bstrlistinternalname, int32 dwbasetype, int32 dwbasetypealt, int32 dwservertemplate, uint32 dwgetlistflags, uint32 dwlistfilterflags, boolean bprefetchmetadata, boolean bsecuritytrimmed, boolean bgetsecuritydata, isp2dsafearraywriter p2dwriter, int32& plrecyclebincount) @ microsoft.sharepoint.library.sprequest.getlistswithcallback(string bstrurl, guid foreignwebid, string bstrlistinternalname, int32 dwbasetype, int32 dwbasetypealt, int32 dwservertemplate, uint32

visual studio 2010 - Stored procedure not appearing in client side [WCF Dataservice and EF4.0] -

we using visual studio 2010, , .net framework 4.0. project settings "target framework" ".net framework 4.0". added "stored procedure" server side suggested link . in client side, stored procedure method not appearing. this method generated in datamodel.designer.cs file. /// <summary> /// no metadata documentation available. /// </summary> public objectresult<global::system.string> display() { return base.executefunction<global::system.string>("display"); } i updated client side, still method not appearing. tried entity datatype also. if interpret server / client side correctly, sounds permissions issue. sql access run @ server.

Python Login Script -

i know similar questions have been asked, have read them. have read other related articles find. have tried httplib2, header modifications, , else find or think of, cannot login script work. import cookielib import urllib import urllib2 cj = cookielib.cookiejar() opener = urllib2.build_opener(urllib2.httpcookieprocessor(cj)) resp = opener.open('http://www.biocidecity.com') theurl = 'http://www.biocidecity.com/index.php' body={'username':'someusername','password':'somepassword', 'login' : '1'} txdata = urllib.urlencode(body) txheaders = {'user-agent' : 'mozilla/4.0 (compatible; msie 5.5; windows nt)'} try: req = urllib2.request(theurl, txdata, txheaders) handle = opener.open(req) htmlsource = handle.read() f = file('test.html', 'w') f.write(htmlsource) f.close() except ioerror, e: print 'we failed open "%s".' % theurl if hasattr(e

php - Access a variable using a counter as part of the variable name -

i tried somthing that: $cat1 = array('hello', 'everyone'); $cat = array('bye', 'everyone'); for($index = 0; $index < 2; $index++) { echo $cat$index[1]; } it doesn't work of course. need change here? you should use nested arrays, can done. $cat1 = array('hello', 'everyone'); $cat2 = array('bye', 'everyone'); for($i = 1; $i <= 2; $i++) { echo ${'cat' . $i}[1]; } reference: http://php.net/language.variables.variable this better though: $cats = array( array('hello', 'everyone'), array('bye', 'everyone') ); foreach ($cats $cat) { echo $cat[1]; }

silverlight - How can I create a button in F# that contains both an image and text? -

i have both button, , image follows: let btnfoo = new button() let imgbar = new bitmapimage(new system.uri("images/whatever.png", system.urikind.relativeorabsolute)) i'd button content contain text, , image. i can either of these 2 things fine, don't me both text , image on button @ same time: btnfoo.content <- "text" btnfoo.content <- imgbar neither of these things work: btnfoo.content <- "text " + imgbar // compiler hates btnfoo.content <- "text ", imgbar // compiler ok, result ugly since image rendered class text i can't set background of button image: btnfoo.background <- imgbar // compiler doesn't because background expects media.brush any thoughts/ideas? thanks! you can create stackpanel , add image along textblock it's children. set stack panel buttons content. may choose other panel well.

bios - Where's the catalog of objects in the ACPI namespace? -

i'm trying read , maybe write acpi source language. i see in code i'm looking at, statements store values particular... ah, registers guess, in acpi object namespace. looks this: store(arg0, \_sb_.pci0.lpc0.bcmd) what i'd catalog of naming scopes , objects in sb namespace, , meanings. just mean when store value _sb_.pci0.lpc0.bcmd ? there other examples , too: store(0x80, \_sb_.pci0.lpc0.smic) so, don't want answer bcmd, want reference describes available objects, names, , behaviors or meanings. i suppose catalog specific each particular type of hardware. computer variable-speed fan expose basic control , management of it, guess, via acpi objects; biometric fingerprint reader , 1394 port. each set of hardware features particular make+model of computer have own unique name tree, guess. thanks pointers. the best place specific variables acpi specification ( www.acpi.info/spec.htm ). reserved names start underscore '_', ,

jQuery .get not working on new server -

im using jquery .get pull in , parse xml file. working fine on test environment, when moved production server not working. there wrong code cause this? $(document).ready(function() { $.ajax({ type: "get", url: "rss/ninjatraderrss.xml", datatype: "xml", success: parsexml }); function parsexml(xml) { $(xml).find('item').each(function() { var title = $(this).find('title').text(); var page = $(this).find('link').text(); var desc = $(this).find('description').text(); $('#ticker').append($('<li>', '<a href={text: page}>', {text: title}, {text: desc})); //$('#ticker').append($('<li><a href="' + page + '">' + title + '</a>&#

c# - Compiler Requiring Return Value - Not Noticing Unconditional Exception in Called Method -

why c# compiler not smart enough in following scenario? void throwex() { throw new exception(); } int test() { throwex(); } ...test()': not code paths return value edit: in practice, want extract exception throwing logic separate method because i'm tired typing stuff throw new faultexception<mycustomfault>(new mycustomfault(), "cannot validate input"); it doesn't between methods; not least, method in different assembly , change without rebuilds, or virtual, extern, abstract or partial - confusing spot small number of cases. you have throwex return "int", , then: return throwex(); which make compiler happy. or use generics: static t throwex<t>() {...} ... return throwex<int>();

sql - Deleting a table in PostgreSQL without deleting an associated sequence -

i have table, foo . purposes of quick upgrade/deploy of site, made new table, tmp_foo , contain new data, doing: create table tmp_foo (like foo including constraints including defaults including indexes); now each table has pk id column looks like: column | type | modifiers -------------+-----------------------+-------------------------------------------------------------------------- id | integer | not null default nextval('foo_id_seq'::regclass) the important point both tables rely on exact same sequence, foo_id_seq . there no tmp_foo_id_seq . seems ok purposes. after this, loaded tmp_foo new data , renamed tables tmp_foo took on real foo , , original foo became foo_old . try drop foo_old : db=> drop table foo_old ; error: cannot drop table foo_old because other objects depend on detail: default table foo_old column id depends on sequence foo

iis 7.5 - 401 - Unauthorized IIS 7.5 on UNC application website -

i'm running win server 2008 r2 iis 7.5 i have application under website has anonymous authentication enabled. the application points shared unc drive. i've created iusrdomain domain account , both servers on same domain. the application pool identity using iusrdomain account. the unc share , file permission both give full control iusrdomain account. however when try make changes iis application settings, error message says: there error while performing operation. filename: \?\unc\\share\webapp\web.config error: cannot write configuration file due insufficient permissions and when try browse html test page get: 401 - unauthorized: access denied due invalid credentials. not have permission view directory or page using credentials supplied. iis log file says: /webapp/test.html - 80 - xxx.xxx.xxx.xxx mozilla/5.0+(windows;+u;+windows+nt+6.1;+en-us)+applewebkit/534.7+(khtml,+like+gecko)+chrome/7.0.517.44+safari/534.7 401 3

c++ - Suppress output from base class constructor -

i have series of classes tells debug stream ( std::cout in case) has been created, allowing me follow program execution nicely. have several classes subclasses of base classes not abstract, results in double message when subclass instance created. suppress output in base class constructor when called subclass. know isn't possible without fancy trick, if possible @ all. i did think of using backspace escape sequence \b , , doing enough of delete previous message not efficient, it's debug info, performance isn't critical then...). i'm not sure of portability or effectiveness of approach. any ideas welcome, effort! there's no way suppress code in base constructor, unless code in base constructor checks condition itself. may achieve e.g. passing special flag base constructor (having default value not prohibiting debug output). class base { public: base(bool suppressdebuginfo = false) { if (!suppressdebuginfo) cout <&l

php - How to include helpers in smarty? -

id use static functions helpers in smarty template. im using ko3 , kohana-module-smarty - https://github.com/mranchovy/kohana-module-smarty/ question how autoload helper , use in template, ie: app/class/url.php class url { function test () { return 'test'; } } views/index.tpl {$url.test} you should able pass url variable, $url , , access within view {$url->test()} . i'm not sure if able access static functions url::test() though. if you're using helper in same views, can create new controller binds variable in view: <?php // application/classes/controller/site.php class controller_site extends controller_template { public $template = 'smarty:my_template'; public function before() { $this->template->set_global('url_helper', new url); } } ?> then extend in other controllers: <?php // application/classes/controller/welcome.php class controller_welcome extends

unicode - Mercurial commit messages and log, what encoding is supported, does Hg care at all? -

i tried doing simple commit through wrapper library mercurial, using simple text of unicode:æøåÆØÅ commit message. written text file , given mercurial appropriate parameter: hg commit --logfile file if subsequently @ repository tortoisehg, characters reproduced correctly. on console, mangled: [c:\temp] :hg log changeset: 0:6a0911410128 tag: tip user: lasse v. karlsen date: wed dec 01 21:48:54 2010 +0100 summary: unicode:├ª├╕├Ñ├å├ÿ├à if redirect output of hg log file, , open up, æøåÆØÅ reproduced correctly. so, question this: can ask hg write log file directly, or have redirect standard output? will cause problems python encoding console, ie. characters make hg crash instead of mangling output? is there known supported encoding commit messages should adhere to? or simple: mercurial doesn't care, takes contents of file give it, whatever content, , stores commit message. when producing log, dump console falling prey whatever