Posts

Showing posts from March, 2011

uitableview - IOS: use custom cell in some classes -

when crate custom cell create class uitableviewcell , add nib tablecell; it's clear. want understand how manage situation when should use custom cell in classes use tableview. for example have view controller called "firstviewcontroller" , inside view controller have tableview, import class of tableview cell , create iboutlet reference #import "mycell.h" iboutlet mycell *mycell; in file's owner of mycell class in identity inspector set class of firstviewcontroller, in way can link iboutlet of custom cell easily. in way can use mycell firstviewcontroller, there way share mycell other classes secondviewcontroller? thanks you can create subclass of uitableviewcell, customcell . create xib file,add uitableviewcell root of xib. change identity of uitableviewcell customcell . connect outlets elements of customcell. don't give ownership viewcontroller. instantiate following code in tableview:cellforrowatindexpath: in viewcontroller ...

delphi - Is it possible to 'clip' the lower part of TAreaSeries? -

Image
i hints on working teechart tareaseries, , on creating not overlapping series. when create 2 area series on same plot, related same bottomaxis , leftaxis this: https://skydrive.live.com/redir?resid=9966bbbe2447aa89!116&authkey=!akm6dmvrxlex5ps and if scroll plot vertically see these 2 series expanding downwards endlessly negative infinity (y coordinate). but wonder if possible 'cut' lower part of series @ y point? retrieve this: https://skydrive.live.com/redir?resid=9966bbbe2447aa89!115&authkey=!agaejdrepknpymy (excuse me links instead of images, don't have permission post them due reputation restrictions) yes, can in all features\welcome!\axes\opaque zones example @ new features demo, available @ teechart's program group, example: unit unit1; interface uses windows, messages, sysutils, variants, classes, graphics, controls, forms, dialogs, teegdiplus, teengine, series, extctrls, teeprocs, chart; type tform1 = class(tform) ...

c++ - Memberspaces may access private members of parent class -

i've been reading this article , , playing around memberspace idiom while when noticed surprised me within snippet (which compiles without problems: http://ideone.com/hriv5b ): class hugeclass { public: struct memberspace { int f() const { return parent.f; } private: friend hugeclass; explicit memberspace(hugeclass & parent) : parent(parent) {} hugeclass & parent; } memberspace; hugeclass() : memberspace(*this), f(42) {} private: int f; }; i have expected compiler error access of hugeclass::f not allowed because f private in context. hugeclass friend of memberspace , hugeclass may call private constructor of memberspace , why work other way around without explicitly declaring memberspace friend of hugeclass ? by language rules in c++11. nested class member , such has same access rights other member. example: ...

Reading multiple XML files from an input stream Java -

how read multiple xml files input stream in java , write them xml files? i have this: inputstream = new gzipinputstream(new fileinputstream(file)); edit: have tar.gz file say, xmls.tar.gz "file" contains multiple xml files. when convert string using: public static string convertstreamtostring(java.io.inputstream is) { java.util.scanner s = new java.util.scanner(is).usedelimiter("\\a"); return s.hasnext() ? s.next() : ""; } i of xml files chained together, file information well. on system.out.println get(this beginning of 1 file): blah.xml 60 0 0 2300 12077203627 10436 0ustar 0 0 <?xml version="1.0"... answer: this worked great me, following on keith's suggestion use apache compress , io: http://thinktibits.blogspot.com/2013/01/read-extract-tar-file-java-example.html import java.io.*; import org.apache.commons.compress.archivers.tar.tararchiveentry; import org.apache...

ServiceStack OrmLite for Oracle hangs during select -

i trying servicestack ormlite (with oracle database). hangs @ db.select .. not throwing exception either.. hangs there if there many data load. i have installed latest oracle instant client ver 12.1 in pc. this ormlite code: namespace consoleapplication1 { class program { static void main(string[] args) { string dbconnection = "server=(description=(address=(protocol=tcp)(host=xxx.xxx.xxx.xxx)(port=9530))(connect_data=(service_name=mysid)));uid=myusername;pwd=mypassword"; var dbfactory = new ormliteconnectionfactory( dbconnection, false, oracledialect.provider); using (var db = dbfactory.open()) { var res = db.select<einduk>().take(10); //<-- hangs here, no stacktrace whatsoever foreach (var einduk in res) { console.writeline(einduk.tostring()); } } console.readline(); ...

java - How to use DispatcherListener in Struts 2 -

there interface dispatcherlistener in struts2. docs says "a interface tag want execute code on init , destroy of dispatcher ." but how use interface. if create class implements interface, how should configure struts2? when dispatcher instantiated, send listener notification when it's initialized or destroyed. reference , code samples here . the simple usage instantiate bean container via bean tag , add in init method , remove when destroyed did classpathconfigurationprovider . the code raw show idea struts.xml : <bean type="com.opensymphony.xwork2.config.packageprovider" name="mybean" class="jspbean.struts.mybean" /> mybean.java : public class mybean implements configurationprovider, dispatcherlistener { public mybean() { system.out.println("!!! mybean !!!"); } @override public void dispatcherinitialized(dispatcher du) { system.out.println("!!! dispatcherinitialize...

java - Blurry Text after setting StyleConstants.setFirstLineIndent as negative in Swing -

im newbie swing applications. need add firstlineindent text , after setting value negative paragraph's first line seems little blurry. unable recognize behavior of styleconstants.setfirstlineindent(attr,-50) method. how rectify error. below link of code using reference: http://java-sl.com/tip_hanging_first_line.html thanks... not sure why example extends jeditorpane. editor pane html. prefer use jtextpane styled text. don't know why custom editor kit used. the following code works me: import javax.swing.*; import javax.swing.text.*; import java.awt.*; //public class hangingindent extends jeditorpane { public class hangingindent extends jtextpane { public static void main(string[] args) { jframe frame = new jframe("negative (hanging) first line indent"); frame.setdefaultcloseoperation(jframe.exit_on_close); final hangingindent app = new hangingindent(); // app.seteditorkit(new myeditorkit()); app.sett...

c - Writing in to dat file clearing old data -

i trying write student.dat file.my problem when writing second time first data clearing out.please me student st; file* fp = fopen("d:\\student.dat", "w"); //fseek(fp,0,seek_set); st.getdata(); fwrite((char *) &st,sizeof(student),1,fp); fclose(fp); printf("\n\nstudent record has been created "); fflush(stdin); getch(); try append mode: file* fp = fopen("d:\\student.dat", "a"); w mode overwrites file: "create empty file output operations. if file same name exists, contents discarded , file treated new empty file."

Access Violation error using IInterfaceList Delphi XE3 -

i have encountered access violation error [access violation @ address 5005f6e in module 'rtl170'. read of address 0000000a] using iinterfacelist. code looks this: if not assigned(foroutingcodes) exit; := 0 foroutingcodes.ncount - 1 begin ... end; the declaration of foroutingcodes is: foroutingcodes : iroutingcodelist; and definition of iroutingcodelist iroutingcodelist = interface function getcount: integer; ... property ncount: integer read getcount; end; the implementation of ncount property is: function troutingcodelist.getcount: integer; begin result := 0; if assigned(foitems) result := foitems.count; // here access violation error end; where troutingcodelist implementation of iroutingcodelist , foitems declared as: foitems: iinterfacelist; i have fixed using foitems: tlist<iroutingcode>; instead of foitems: iinterfacelist; i new delphi, can me understand wrong previous approach. don't know if relevant because the...

c# - DevExpress RepositoryItemCheckEdit does not change state when clicking on non-focused node -

i using repositoryitemcheckedit editor of 1 of columns in treelist . change its' state necessary cell containing checkbox focused. when click checkbox of non-focused cell, gets focused, checkbox state not change. need 2 clicks change state of checkbox of non-focused cell, not friendly , not see reason, why works this. is there way make work on first click(so not necessary have cell focused before change state of repositoryitemcheckedit )? have tried find event or property, nothing seems work ensure treelist.optionsbehavior.immediateeditor set true : this.treelist1.optionsbehavior.immediateeditor = true;

iphone - Can't add custom font iOS project -

Image
i'm trying add custom font called "matrixbook" iphone app getting no luck. have read several threads , tried several things app won't show font. below things i've tried, if knows problem or else can try, please me out before pulled out hair on head! p.s: i'm trying add 3 fonts , 1 working ("matrixboldsmallcaps"). sorry links, can't upload images , can have 2 links because don't have enough reputation. font included in plist file, font included in copy bundle resources. font name , file name matched: application see font:

c# - How to change the background image of a button when clicked in code? -

Image
there similar question mine here in stackoverflow explains how change in xaml. want know how can change in code. here image shows how in xaml using blend: link full size: https://snag.gy/4skk4.jpg basically want change background of button's pressed state in c# can't seem find examples on internet. must in code because image of button change therefore button's pressed image must change well. the following code change image of button , it's start. image.imagesource = new system.windows.media.imaging.bitmapimage(new uri(@"images/button-warning-icon.png", urikind.relative)); image.stretch = stretch.uniform; buttonwarnings.background = image; if understand correctly, trying change appearance of button control in "pressed" visual state. i'm not near dev computer try out, "unblock you" i'll give direction. first, noticed in blend screenshot, each visual state represented storyboard , defines how various proper...

How to use SQL Server Management studio - "Execute Stored Procedure" for User Defined Table Types? -

i trying right click stored procedure in sql server management studio 2012 , trying execute stored procedure accepts single parameter of type tbltype_xxx user defined table type . when try pass single value error msg 206, level 16, state 2, procedure uspgetxxxxxxxx, line 0 operand type clash: int incompatible tbltype_xxx how can specify parameter of type tbltype_xxx in sql server management studio -> execute stored procedure ui? tbltype_xxx contains 1 column of type int you need declare table variable, insert data if needed, call stored procedure not using @parameter = 1 format: declare @return_value int, @tblparameter tbltype_xxx insert @tblparameter values (1) exec @return_value = [dbo].[uspgetxxxxxxxx] @tblparameter

YouTube Player API Reference for iframe Embeds displays blank page in all the browsers -

i have been referring https://developers.google.com/youtube/iframe_api_reference , have created 1 test.html code under 'getting started" section. html page appears blank in browsers. please suggest how resolve issue? appreciate help.

How can I delete a file/folder from Dropbox using the java api? -

i'm working on project leverages backend dropbox api's. when started, there no java api, android api. used , had function delete , worked fine. came out more generic java version of sdk i'm switched on to, however, can't seem find in documentation how delete. i realize of sdk's sit on top of rest api, use sdk everything, rather use rest api. if can how delete java api, great. thanks! i downloaded dropbox java sdk 1.6 , found in changelog: 1.6 (2013-07-07) completely rewritten sdk, focused on java web apps. many api calls not yet implemented. not backwards compatible previous versions. also looking @ javadoc did not reveal remove/delete method ( dropbox java sdk javadoc ). guess not implemented yet. either rest or wait little longer :)

c# - How can I make implementation of an interface produce an auto property instead of NotImplementedException? -

consider have simple interface such icar when move mouse on icar expression , click on implement interface visual studio produce below implementation. is there way of providing auto property seen on interface. cause re-factoring issues , make me crazy each time! public interface icar { double power { get; set; } } public class car:icar { public double power { { throw new notimplementedexception(); } set { throw new notimplementedexception(); } } } you need change template used visual studio when click on implement interface . template stored in following location: c:\program files (x86)\microsoft visual studio 10.0\vc#\snippets\1033\refactoring the template need change called propertystub.snippet note: existing snippet file before making changes can revert if things not go well. the lines need update...

jquery - Avoid cookie editing -

i'm makin small adventure game , i'm using jquery cookie save variables (like amount of money player have) in cookies. know there tools cookie managment , editing. there way avoid editing? there way camouflage value/variable corresponding total amount of money player has? what have is: <style> gold = 150; mycookie = { totalgold: gold }; $.cookie(filename, $.param(mycookie), { expires: 9999 }); </style> thanks. the answer can't, cookies meant store references session on server, can store as want on client have aware apt edited, alternative store encrypted values , translate them algorithm, way if user modifies value, won't make sense value wrong. want build js model can sync server , add end logic validate, can check out backbone.js remember, cookies stored on users's computer hence can whatever want them

iphone - Custom method for UIPageviewController datasource -

i want implement 1 custom method uipageviewcontroller datasource turn page @ index something this - (void) pageviewcontroller:(pageviewcontroller *)pageviewcontroller willturntopageatindex:(nsuinteger)currentindex i don't know if correct way of implementing custom method uipageviewcontroller datasource. you can add whatever methods data source class. methods considered public should defined in header file. but that's not you're asking. you're asking: how can uipageviewcontroller call it? the short version is: can't. while method has nice, readable signature, compiler it's no different to: - (void) pageviewcontroller:(pageviewcontroller *)pageviewcontroller banana:(banana*)banana; there's no way controller expected know it. i'm afraid, in general, have use methods published. there some exceptions. example, there no delegate method can subscribe notification. or maybe there's delegate use? in case expect "will s...

memory - heap_corruption and memory_corruption in Windows Phone 8 -

i develop app windows phone 8 , i'm testing on device , emulator. working great. can't catch errors, when publish app store, errors these stack traces market: error 1: frame image function offset 0 heap_corruption heap_corruption 0x00000000 error 2: frame image function offset 0 memory_corruption agcore 0x00000000 how diagnose these errors or how fix them?! try search in google, not find results problems. if dont have more details or stack trace hard determine whats happening. there strong possibility may faulty device throwing error. how many users have using app , how many errors being thrown? can give more details on app?

.net - "CLR_E_ENTRY_NOT_FOUND" error while compiling the project -

i using netmf 4.1 , have error source, can found @ http://www.skewworks.com/ftpserver/ i trying deploy ftp server on fez cobra ii ( https://www.ghielectronics.com/docs/48/fez-cobra-ii-developer ) the error ** clr_e_entry_not_found ** ....in mmp file. how resolve application run. resolved error.....well error because using outdated namespaces ghi electronics (v 4.1) netmf namespace, must replaced using ghi.premium (v 4.2)package there set, except few other networking clasees must chaged. if 1 comes across 1 ....i hope helps people.

delphi - How get URL after using idhttp post -

i'm using idhttp content of site. after content, site change url www www8 or www9 or www10, example: www.sample.com before posting, after posting www10.sample.com. how it? thank you. what encountering http redirect. tidhttp handles redirects automatically if handleredirects property set true. tidhttp has onredirect event can new url being redirected to, or can @ tidhttp.response.location property (which can filled in non-redirect responses well, such when uploading file amazon s3 via tidhttp.put() ).

ruby - Get Lat Long from Google -

i want code put location search , return lat , long. using google's geocode api. have code sends request etc., , returns following: {"results"=>[{"address_components"=>[{"long_name"=>"london", "short_name"=>"london", "types"=>["locality", "political"]}, {"long_name"=>"united kingdom", "short_name"=>"gb", "types"=>["country", "political"]}], "formatted_address"=>"london, uk", "geometry"=>{"bounds"=>{"northeast"=>{"lat"=>51.6723432, "lng"=>0.1478797}, "southwest"=>{"lat"=>51.38494009999999, "lng"=>-0.3514683}}, "location"=>{"lat"=>51.51121389999999, "lng"=>-0.1198244}, "location_type"=>"approximate", "viewp...

c# - Cannot create a UdpClient on IPv6 -

what thought simple task, has turned bit of nightmare. what boils down now, need create udp listener on port 8888, on specific link local ipv6 address. i exception thrown when following line executed: _udpsoc = new udpclient(monitor_input_event_socket, addressfamily.internetworkv6); (where monitor_input_event_socket const int of value 8888) having tried support, find an msdn article describing same line. the socketexception thrown "the requested address not valid in context" errorcode of 10049 stacktrace of: at system.net.sockets.socket.dobind(endpoint endpointsnapshot, socketaddress socketaddress) @ system.net.sockets.socket.bind(endpoint localep) @ system.net.sockets.udpclient..ctor(int32 port, addressfamily family) @ [my code...] alternatively, if change problem line to: _udpsoc = new udpclient(_groupep); (where _groupep ipendpoint set ipaddress.any, scopeid set the correct interface, , port of monitor_input_event_socket) ...and exception of ...

jQuery UI Datepicker Month & Year Menus Only Work Once -

i'm using jquery ui's month , year menus . here's what's happening , i'm running issue: click date field change month dropdown jan change year dropdown 2003 click calendar day 1 the date field correctly populated 01/01/2003 here's run issue: click date field (again) change month (or year) dropdown the date not change click off of datepicker hide it the date still not change is there way use month or year dropdowns after date has been entered? http://jsfiddle.net/ryanburnett/8n9xq/ <p>date: <input type="text" id="datepicker" /></p> $(function() { $( "#datepicker" ).datepicker({ changemonth: true, changeyear: true }); }); by design, month-year change doesn't refresh datepicker; can set new selected date (from dropdowns too) using onchangemonthyear option: called when datepicker moves new month and/or year. function receives selected year, month (...

Perl Implementation of finite state machine where each state is a class object -

i trying build finite state machine in perl. wanting each state of finite state machine class way can instantiate these objects , use them greater control in program writing. in each state have keep track of lot of information , code. so make finite state machine easier program , read want able use these classes states. now have looked class::statemachine turns 1 class fsm. i have looked @ fsa::rules , fsm::simple not figure out way make states classes them. does have ideas on this?

java - Web application with Enunciate: where to put the static resources -

i use enunciate ( http://enunciate.codehaus.org/ ) our web-service layer , want simple not find documentation. i want deploy images , other static resources , accessible e.g http://localhost:8080/myapp/images/img01.png i tried create folder images under src/main/resources not deployed want (all files/folder inside there goes myapp/web-inf/classes, expected). someone can point me static resources enunciate project? i not have web.xml automatically generated enunciate framework. static resources structured using standard project structure of maven-war-plugin . basically, put image under src/main/webapp/images/img01.png .

php - Fetch db data depending on selected drop down value -

is possible fetch data db upon changing value of drop down, want pull data corresponds value of drop down , show text area, got codes i've tried create don't know how make work want. i want page show drop down after selecting value show data in text area without refreshing page, here code: <div id="maincontent"> <table width="619" border="0" align="center"> <td align="center"><form id="form1" name="form1" method="post" action="" > <fieldset> <legend><strong>ea</strong></legend> <p> <select name="ea_name" id="ea_name"> <option value="" selected="selected">please select...</option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4...

javascript - res.redirect not working after the page is rendered with data -

i have simple functionality of forget password, when user requests change in password recieves email token , email on clicking of redirected page take new passwords. what when click on link in email , server gets request , function take data out of link renders page data (using res.render) , should redirect rendered page. the problem facing when click on link getting data , page rendered can't let res.redirect() work. my link looks http://localhost:3000/api/resetpassword?_csrf=ab8aa6a41567f817330e3e0a214725f8b2f88b487d5bef16f162e033c6a63dc41933511ddb79cb44ca049f472b3e0c593dbbaf&email=dummyemail%2540dumyurl.ca and request on server using app.get(). app.get('/api/resetpassword', admin.resetpasswordpage); and rendering , redirecting function looks this; resetpasswordpage: function (req, res, next) { req.query.email = decodeuricomponent(req.query.email) ; res.render('resetpassword', { email: req.query.email, csrf : req.que...

Error in writing excel docs with python -

i writing program fetch bunch of data web write in excel document. in last step getting error while trying write cells , not sure error means or fix it. the error looks this: file "/library/frameworks/python.framework/versions/2.7/lib/python2.7/site-packages/xlwt/worksheet.py", line 1030, in write self.row(r).write(c, label, style) file "/library/frameworks/python.framework/versions/2.7/lib/python2.7/site-packages/xlwt/row.py", line 235, in write self.__adjust_bound_col_idx(col) file "/library/frameworks/python.framework/versions/2.7/lib/python2.7/site-packages/xlwt/row.py", line 78, in __adjust_bound_col_idx raise valueerror("column index (%r) not int in range(256)" % arg) valueerror: column index (256) not int in range(256) 149-166-202-213:peter peter$` the error supposedly on line 106, blank. seems trying write cells not within range of document, how extend range of excel document or change way i'm writing cells help? btw, modu...

python - System Paths and Modules -

i have following setup: /project/ /api/ __init__.py test.py /modules/ __init__.py api.py i trying to, /project/ directory, run api.py: python modules/api.py the api module attempts import test module api package, fails. have tried following: import api.test import project.api.test # (with __init__.py in /project/ directory) i have attempted add api package's parent directory system path described: import sys import os sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) question how can set project in such way each package has knowledge of other packages in it's parent directory, project's root directory? your problem have project/modules/api.py file projects/api directory __init__.py file in - you're getting descriptor collisions. rename 1 of them else, , code should work: /project/ /api/ __init__.py test.py /modules/ __init__.py ...

java - How can I detect if all JSON fields are being parsed? -

i using gson annotations parse json fields restful service dto. wanted write test detect if there fields in jsonobject not yet being parsed java dto object has annotations. if on server add ten fields have no way of knowing this? there way test dynamically if fields being parsed java object? to put way, names of dto fields (including annotation info), , compare fields on json object. trying compare dto jsonobject see if have covered everything. gson doesn't have this. "extra" fields in java or json silently ignored. fields present in java not in json set null the way via reflection, either during gson's deserialization custom deserializer or parsing json jsonobject using gson's jsonparser class , doing test. you'd need field names jsonobject via entryset() , field names java class using class.getdeclaredfields() , compare 2 sets find ones not present in both.

HTML5 Microdata: Correct way to use multiple Itemtype's -

see http://microdatagenerator.org/ example. what standardized way of, example, declaring page localbusiness automotivebusiness ? , standards document specifies definitively? there 2 specifications: a section in html living standard , published whatwg html microdata , published w3c ( currently working draft) work on specification done @ whatwg. w3c html working group actively pursues convergence whatwg, required w3c html working group charter. the w3c microdata specification says itemtype attribute : the itemtype attribute, if specified, must have value unordered set of unique space-separated tokens case-sensitive, each of valid url absolute url, , of defined use same vocabulary. attribute's value must have @ least 1 token. so can specify several item types in itemtype attribute, if same vocabulary (e.g. schema.org).

I need the my jquery counter to reset after the last img within a div -

i need add page counter the bottom of each <div> class of page_container . i need reset page counter 1 each div tag class of resource_container . right code keeps counting total page_container , not reset 1 when new resource_container starts. here jquery: $("document").ready(function() { buildpagebottoms('img'); }); function buildpagebottoms(strwhichtag) { var cpagecount = 1; $(strwhichtag).each(function() { $(this).after($("<div class='pagenumber'><p>page " + cpagecount++ + "</p></div>")); }); } here html: <div class="resource_container"> <div class="page_container" id="1"><img src="01a.png"> </div> <div class="page_container" id="2"><img src="02a.png"> </div> </div> <div class="resource_container...

sql - Connect By Level In Subquery Slow -

i using connect_by_level subquery in oracle database supply dates join table. connect level appears causing query run slowly. here slow query: select t.code, d.month_end, count(*) device t, (select add_months(trunc(sysdate, 'mm'), - (level - 1)) - 1 month_end dual connect level <= 1) d (d.month_end between t.date , t.exp_date) group t.code, d.month_end the slow query above took 2 hours run other day. query below should equivalent runs in less 30 seconds: select t.code, trunc(sysdate, 'mm') - 1 month_end, count(*) device t ((trunc(sysdate, 'mm') - 1) between t.date , t.exp_date) group t.code ultimately, want 1st query return data past 24 months, need figure out why running 1 month criteria. suggestions on causing slow completion time connect level query? edit add explain plan output slow query: | id | operation | name | rows | bytes | cost...

batch file - Change password for all users accounts in command prompt -

alright, need of batch scripting guru me out of corner i've backed myself into. i have program runs system , want change password accounts appear in output net user. i'm not sure how command line or ahk-based scripting. when perform net user command output me: c:\users\resident>net user user accounts \\9100baseline ------------------------------------------------------------------------------- administrator guest resident command completed successfully. i need way change password on accounts here (be 3 or 50) of choosing. can me out this? tried slapping loop each item token before realized don't know how regex usernames out of there. i'd recommend employing of little vbscript: set accounts = getobject("winnt://.") accounts.filter = array("user") each user in accounts wscript.echo user.name next save listusers.vbs , run this: @echo off setlocal set /p "newpw=enter new password...

.htaccess - How to create dynamic subdomain using PHP and htaccess? -

i have 1 problem: want set php , htaccess make dynamic subdomains. , can not figure out how. url looks this: www.exemple.com/index.php?subdomain=mike&component=content&id=26&title=people-love-apps i need this: www.mike.exemple.com/content/26/people-love-apps.html i know can done not know solution how it. important me $ _get [] functions read parameter in url. the problem users on site make web site , free domain (sub-domain) automatically. should automatic. thanks! you can't make dynamic subdomains .htaccess you need configure apache virtual host accept requests multiple domains see apache documentation - using name based virtual hosts <virtualhost *:80> servername www.example.com serveralias example.com *.example.com documentroot /www/domain </virtualhost> adding wildcard subdomain *.example.com , php application receive requests domain below example.com , ie garbage.example.com , busted.example.com , llama.exa...

Python + mod_wsgi/mod_python + Apache + user's public_html -

i'm interested in making pretty basic python webapp, literally form takes in input, calls python function on input, receives results returned function, , uses web development trickery make them pretty. i've seen numerous solutions using cherrypy, flask, bottle, web.py, of great, haven't seen example of uses apache . seem all-in-one web server framework, totally overkill me , not need. have apache running here, rather start second web server , have worry keeping running, i'd rather have apache serve app along else day long. we have standard http://myserver.com/~user/ setup public_html dirs in /home/user , life of me can't figure out how create page calls python function served , has python code execute when browsing http://myserver.com/~user/ . let's assume moment mod_python or mod_wsgi setup correctly...what need on end? need call script via php exec() , me defeats need mod_python in first place, or there more elegant solution (that uses mod_pyth...

Bonjour service discovery not complete with Android's APIs. Am I missing something, or should I just use JmDNS? -

i have bonjour service running on macbook pro on local network trying detect in client app on android device (galaxy nexus). i have implemented bonjour service discovery 2 ways. first via android's nsd package, detailed here . have implemented code suggest in section "discover services on network". discovers service fine, there no api call access txt records service, need access can build url hit service, making method kind of deal-breaker until can access that. that prompted me try other method of bonjour service discovery detailed here in "discover nearby services" section, since have api txt record discovery. know service discovery starts, because it's not logging errors, method not discover bonjour services me, not ones apple has on macbooks default. it's implemented on website, need make work? macbook need run in addition bonjour service recognized wifi-direct device? or not possible using android's api set up, , should looking librarie...

c# - Adding the results of multiple queries to a collection and displaying collection in a div -

i want able run queries below , return results line line in div. results added hashtable passing method , display in div. the first query in array arrayofqueries[0] can return multiple lines que: how can write handle multiple lines returned query in array --- arrayofqueries[0]. i.e want able store multiple lines in harsh table or maybe should using stringbuilder object. how can display content of hashtable in div. public hashtable displayresultstousers(int genjobid) { hashtable myht = new hashtable(); try { string[] arrayofqueries = new string[4]; arrayofqueries[0] = "select generic, customernumber, productcode u_generic_data row_status = 2 , generic_job_id =" + genjobid; arrayofqueries[1] = "select count(*) u_generic_data row_status = 2 , generic_job_id =" + genjobid; arrayofqueries[2] = "select count(*) u_generic_data row_status = 1 , generic_job_id =" + genjobid; arrayofqueries[3] = "s...

Google Places Api randomly stops working -

my google maps api works hour , returns correct results. then, after hour, stops displaying results. google limits api queries 1000/day. possible have exceeded limit? source

objective c - Retain cycle deallocation solution -

given following code: nsmutablearray *a = [nsmutablearray array]; nsmutablearray *b = [nsmutablearray array]; [a addobject:b]; [b addobject:a]; what options make array objects deallocate when set , b nil? ive tried few things (like weak references) doesn't seem work.. (probably because don't understand enough - new objective c ). would love assistance. thank you you can make entire array not retain elements with: cfarraycreate() this can problematic in arc if no longer use elements iterate through array later.

symfony - symfony2 entity customized function: call to undefined function error -

i trying add 3 functions slugifying non-ascii characters in url, slugify function doesn't recognize sanitize() function although in same scope.:| class blog { /** * @orm\onetomany(targetentity="comment", mappedby="blog") */ protected $comments; ... public function slugify($text) { return sanitize($text); } ... public function sanitize($title) { $title = strip_tags($title); ... } ... } i can't load fixtures , exception says "call undefined function ..\sanitize() in ..\entity\blog.php ..." why happens? tried these: clearing cache, dropping database, recreating database, recreating schemas, recreating entities, reloading fixtures... i've got same error:( can tell me what's wrong it? missing $this return statement. when calling sanitize() without $this it's resolving method scope , not class scope. class blog { /** * @orm\onetomany...

Using TypeScript with PhoneGap/Cordova Plugins -

i'm running bit of roadblock start using google analytics cordova plugin i'm composing of javascript assets in typescript. here example of specific problem i'm having: window.plugins.googleanalyticsplugin.starttrackerwithaccountid("ua-xxxxxxx-x"); typescript balks @ window.plugins , throwing compilation error: the property 'plugins' not exist on value of type 'window'. and makes complete sense. however, can't around using declare var window; statement, creates duplicate identifier window. step 1 extend window interface, can this: interface window { plugins: any; } this mean no compiler errors, unless extend definition means no auto-completion. line work: window.plugins.googleanalyticsplugin.starttrackerwithaccountid("ua-xxxxxxx-x"); to take things notch , auto-completion (and spellings checked too) can use extended version of definition. interface googleanalyticsplugin { starttrackerwithac...

c# - Populate a ListView with Strings -

Image
i'm bit new asp.net, bear me. came across this solution allow me add array of strings listview row of data. however, i'm not sure on proper way set up. in trying solution listview dropped onto website, i'm told new listviewitem() requires parameter of type listviewitemtype. sample solution doesn't provide that, different in asp.net? so main question i'm asking is: if have array of strings, how can add listview row of data in asp.net? edit: i'd make sure i'm asking right control. under impression listview like this (but in asp.net), i'm getting far not. it's line of text. if want display in example, want use gridview instead of listview . string collection not enough display in multiple columns. need collection of objects. screen shot (top listview, bottom gridview) sample code <asp:listview runat="server" id="listview1"> <itemtemplate> <%# eval("name") %>, ...

python - A way to gaurantee ordering of key/value list from unordered dictionary? -

i have dictionary, contains title , data. there way split data 2 lists while keeping order extracted dictionary? have process key list , value list separately, , use lists build string. it's important because print them out separately, , output has match. doesn't matter if lists out of order when entered. long positions match in lists, it's fine. here simple example represent case: mydict = {'hello':1, 'world':2, 'again':3} keys = mydict.keys() values = mydict.values() print 'the list of keys are: %s' % stringify(keys) print 'the corresponding values are: %s' % stringify(values) # output: > list of keys are: hello, again, world > corresponding values are: 1, 3, 2 i know can build ordered dictionary , getting key/value ordering guaranteed, handle case (non-ordered dictionary). even though order see pairs in arbitrary, output keys() , values() will align, assuming don't modify dictionary. docs : ...

Doxygen - latex issue -

i need hel regarding doxygen. have c++ code , want generate pdf documentation using doxygen. problem doxygen runs, produces html output expected, refman.tex file isnt generated (it generates "d" folders , doxygen.sty file). have activated "generate_latex" option on configuration file , there no visible error on console... im running doxygen 1.8.1.2 on ubuntu 12.10 x64 , have texlive 2012/debian (latest available). any appreciated.

sql - IM001 Driver does not support this function (ODBC) -

i'm building custom odbc driver. my main method: int main(int argc, char** argv) { sqlreturn status; //sqlhandle henv; //sqlhandle hstmt; sqlhenv henv; sqlhdbc dbc = 0; sqlhstmt hstmt; sqlchar connstrout[1024]; sqlsmallint x; // startup banner //printf(); messagebox(getdesktopwindow(), "odbc client\n\n", "driver", mb_ok); // show query executed printf("query: %s\n", "select visits traffic"); // allocate environment status = sqlallochandle(sql_handle_env, sql_null_handle, &henv); // check error odbc_chk_error(sql_handle_env, henv, status, ""); // set odbc version behaviour expected status = sqlsetenvattr(henv, sql_attr_odbc_version, (sqlpointer) sql_ov_odbc3, 0); check_status(status, (uchar*)"sqlsetenvattr", henv, sql_handle_env); // check error odbc_chk_error(sql_handle_env, henv, status, ""); // allo...

AngularJS - Watch the creation of an input element -

i working on making repatcha (www.google.com/recaptcha) work angularjs. i running problem. every time refresh button clicked, new image appears destroy recreate new 1 new key. my problem listening input ng-model add (thanks thread , jason) because element destroyed, watch not work. ideas : listen creation of child of element have field updated number of children element has , watch it's value. other suggestions welcome. thanks in case looking, solution worked me : http://www.brandonturner.net/blog/2009/02/reload_recaptcha_with_error/ i still can't find how watch new created child (unless used livequery time consuming) hack above works recaptcha. the other solution delay whatever had second image loaded not "safe" so.

python - Import Image into tkinter -

ok i'm writing simple image viewer , have enough code able view images, problem view images want. have put them in same directory script , rename them. want user able click file-open , import images. i'm using tkinter gui , pil displaying images. here latest code: from pil import image, imagetk tkinter import tk, label, both ttk import frame, style import os import pil import tkinter filename = "test.jpg" filename2 = "test1.jpg" filename3 = "test2.jpg" filename4 = "test3.jpg" basewidth = 300 img = image.open(filename) wpercent = (basewidth / float(img.size[0])) hsize = int((float(img.size[1]) * float(wpercent))) img = img.resize((basewidth, hsize), pil.image.antialias) img.save('resize.jpg') basewidth = 300 img = image.open(filename2) wpercent = (basewidth / float(img.size[0])) hsize = int((float(img.size[1]) * float(wpercent))) img = img.resize((basewidth, hsize), pil.image.antialias) img.save('resize2.jpg') bas...