Posts

Showing posts from August, 2014

extjs - How can I get the current row in a grid with a combobox editor -

i have editorgridpanel combobox in 1 of columns. within 'select' event listener combobox, i'd know grid row (not combobox row) on. reason i'd update different column in grid every time item selected. think i'm missing obvious. thanks help. as of 4.1, might best use edit event of grid instead. passed in event contains edited record. http://docs.sencha.com/ext-js/4-1/#!/api/ext.grid.panel-event-edit

assembly - Moving contents of RAX to C variable (x86-64 asm) -

this rather naive question. i'm playing around allocating executable memory , manually assembling x86 code run in it. i'm bit confused how addressing works in 64-bit mode. if have variable in c code, , want move contents of rax variable, form of mov instruction should use? (this isn't using inline assembly, can't compiler me; have value of &var play with.) using intel syntax, mov [var],rax , var 64-bit immediate address. i think intel call mov moffs64*,rax in "intel® 64 , ia-32 architectures software developer’s manual".

include - JSTL taglibs not recognized when declared in common header -

i had idea while put of taglib declarations (uri's, etc) in common header file don't have manually write them of jsps. initially, things seemed fine, although don't use actual taglibs as simple el syntax. however, i'm having trouble in jsp files except 1 explicitly has taglibs declared. of other jsp's (that include header file) treat <c:something.../> tag if it's html , don't evaluate it. did googling , found this post on o'reilly suggesting i'm trying can done, i'm doing wrong. what's more other stuff in header file (common page headers, page titles, etc.) show fine. header file , sample of inclusion below. header file: <%@ page language="java" contenttype="text/html; charset=iso-8859-1" pageencoding="iso-8859-1"%> <%@ page session="false" %> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@ taglib prefix="fmt"

http - Python urllib2, how to avoid errors - need help -

i using python urllib2 download pages web. not using kind of user_agent etc. getting below sample errors. can tell me easy way avoid them. http://www.rottentomatoes.com/m/foxy_brown/ server couldn't fulfill request. error code: 403 http://www.spiritus-temporis.com/marc-platt-dancer-/ server couldn't fulfill request. error code: 503 http://www.golf-equipment-guide.com/news/mark-nichols-(golfer).html!! server couldn't fulfill request. error code: 500 http://www.ehx.com/blog/mike-matthews-in-fuzz-documentary!! failed reach server. reason: timed out incompleteread(5621 bytes read) traceback (most recent call last): file "download.py", line 43, in <module> localfile.write(response.read()) file "/usr/lib/python2.6/socket.py", line 327, in read data = self._sock.recv(rbufsize) file "/usr/lib/python2.6/httplib.py", line 517, in read return self._read_chunked(amt) file "/usr/lib/python2.6/httplib.py&

How to initialize Qt resources from a shared library? -

i can not figure out how initialize qt resources declared in , used shared library under red hat enterprise linux 5.2. i added qt resource file shared library, added prefix named "resource", , added file "files/stylesheet.xsl". resource file named "resources.qrc". qfile::exists returns false? mysharedlib::mysharedlib() { // think q_init_resource expands this: // resource file named "resources.qrc" extern int qinitresources_resources(); qinitresources_resources(); qstring resourcepath = ":/resource/files/stylesheet.xsl"; if( false == qfile::exists(resourcepath)) { printf("*** error - resource path not found : \"%s\"\n", resourcepath.tolatin1().data()); } } thanks in advance tips or suggestions, the problem under linux, can not have identically named qt resource files (*.qrc) in both shared library , application. not problem under windows under lin

ios - Zooming frame graphics in Flash CS5 -

i developing flash cs5 ios app. on 1 of frames drawing many rectangles in particular pattern. use two-finger zoom , gestures zoom these rectangles on frame keep general pattern of these rectangles same. once zoomed in, user need pan around enlarged graphics. i know create event handler when zoom in adds width , height each of rectangles have worry increasing x , y positions of each of rectangles keep same distance between each 1 , forth. i there easier way this? thanks if you're drawing rectangles vectors, should able use scale property think, otherwise might need redraw bitmap rectangles based on new scale. to use zoom gesture must first set inputmode touch: multitouch.inputmode = multitouchinputmode.gesture; and you'll need listen transformgestureevent.zoom , use event's scalex,scaley: yourrectangles.addeventlistener(transformgestureevent.zoom,onzoom); function onzoom(event:transformgestureevent):void{ trace(event.scalex,event.scaley); }

Web analytics application guidelines (HTML5 or Silverlight) -

i have been asked implement web analytics application display charts. performance important. either thinking of using html 5 or silverlight. suggestions? the main aim of application include drill down charts (line, bar, pie) animations. components recommend (for html5 or silverlight)? do recommend books preferred technology? as performance important might better measurement rather rely on (albeit informed) opinion. take 1 of metrics , implement key features in html5 , silverlight , compare performance. use technology delivers best times.

c# - How to load XML file that is stored on my laptop from HTTPS using WebClient/HTTPWebRequest - WP7 -

i need load xml file, stored in laptop, on wp7 application. have used code found on similar topic: private void button2_click(object sender, routedeventargs e) { webclient wc = new webclient(); wc.downloadstringcompleted += httpscompleted; wc.downloadstringasync(new uri("https://domain/path/file.xml")); } private void httpscompleted(object sender, downloadstringcompletedeventargs e) { if (e.error == null) { xdocument xdoc = xdocument.parse(e.result, loadoptions.none); this.textbox1.text = xdoc.firstnode.tostring(); } } the path file need load c:\test.xml so need fill in uri? i tried following : "https://localhost/c:/test.xml" doesnt work anyone can me ? you can't access file system on pcs directly in way. you'd need have http service of kind running on laptop server file(s) want. a similar project published during ctp might check out (will need updating wo

How do I write an android JUnit test when my activity relies on extras passed through an Intent? -

i writing android junit test class relies on extras passed through intent. able class working properly, still know how write unit test such class, test still fails. public class addclassevent extends activity{ private string eventtype; @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); bundle extras = getintent().getextras(); final string cno = extras.getstring("coursenum"); // create model instance final studentdbmodel model = new studentdbmodel(this); setcontentview(r.layout.add_class_event); ..... ..... } } the test class looks like... public class addclasseventtest extends activityinstrumentationtestcase2<addclassevent>{ private studentdbmodel model = null; private renamingdelegatingcontext context = null; public addclasseventtest() { super("com.ui", addclassevent.class); } /** * method called before each test. */ @override public void setup() { cont

java - Load whole project from Eclipse(about source code) -

i working on buid plugin of eclipse. in 1 step, load project through scan classpath,but feedback requirement is: loading projects encompasses 2 things: loading multiple files same directory/package including files other packages through instance eclipse's .classpath files since prototype built eclipse plugin anyways, fine use eclipse stuff, .classpath files? loading , reading these files yourself. might more convenient use eclipse code this, since has there. i have no idea how deal eclipse, can help? i think you're looking pde build. have @ tutorial .

python - How to set border color of certain Tkinter widgets? -

i'm trying change background color of tkinter app, widgets leaves white border around edges. for example, this: from tkinter import * color = "black" root = tk() root.config(bg=color) button = button(text="button", bg=color) button.pack(padx=5, pady=5) entry = entry(bg=color, fg='white') entry.pack(padx=5, pady=5) text = text(bg=color, fg='white') text.pack(padx=5, pady=5) root.mainloop() how can set border colour of tkinter widgets? turns out wasn't hard defining custom style. just use: widget.config(highlightbackground=color)

Why does Ruby "script/generate" return "No such file or directory"? -

i having trouble using script/generate . following tree based navigation tutorial, says use script/plugin install git://github.com/rails/acts_as_tree.git or script/generate nifty_layout . i keep getting: no such file or directory -- script/plugin i've tried these variations: script/generate nifty_layout rails generate nifty_layout ruby script/generate nifty_layout ruby generate nifty_layout and tell me: -bash: script/generate: no such file or directory am missing something? total ruby nuby here , can't seem find answer. edit : rails 3 on mac os x 10.6 rails 3 problem (or rather cause of). since rails 3 of "script/whatever" commands have been replaced "rails whatever". so want "rails generate ..." or "rails server" instead. be sure watch version numbers or post dates when looking @ tutorials :) linkage: missing script/generate in rails 3

Silverlight Combobox setting the selected item to selected item of datagrid -

i have 2 silverlight controls on form; datagrid bound list of items, combobox bound list of values. scenario...when user selects row on grid want set update combobox value of property of selected item in datagrid displayed. my combobox looks like < combobox displaymemberpath="description" x:name="cbtopics" margin="141,170,0,0" verticalalignment="top" width="300" horizontalalignment="left" selecteditem="{binding elementname=datagrid1, path=selecteditem.topic.description, mode=twoway}"/> in load event set itemssource of combo list of values. set combobox description of item selected in datagrid. items in datagrid collection of objects object code object code has property topic has property of description (hence why trying selecteditem.topic.description). any ideas doing wrong here? trying setup relationship between datagrid se

forms - A simple Jquery file upload tutorial? -

i need guys help, please sample/demo code of file upload form using jquery? number 1 rule of software development: never re-invent wheel - if wrote code fulfills requirements , well-documented , well-supported - use it. on note, should check out uploadify , slick jquery file upload plugin

process - How do I execute command in c#? -

i want execute command call microphone config. control mmsys.cpl,,1 i try following code throw win32exception, system cannot find file specified. process.start("control mmsys.cpl,,1"); it should be: process.start("control","mmsys.cpl,,1") documentation: http://msdn.microsoft.com/en-us/library/h6ak8zt5.aspx

iphone - How to Edit MSWord documents in an iPad application -

there appears ipad applications can edit msword documents such "pages". question how can accomplished programmatically? these apps using openxml or there way it. api or something? in advance. these applications such pages use private code read documents , edit it. @ time there no openxml library iphone sdk. ios provides way display documents (doc, ppt, xls, pdf) using uiwebview no other api. developing word editor real challenge, did small rich text editor , interesting project. good luck!

java me - J2ME Gtalk Connection over XMPP fails -

i developing j2me app connect gtalk. using wtk2.5.2. here code sample, streamconnection connection = (streamconnection) connector.open( "socket://gmail.com:5222", connector.read_write); inputstream instream = connection.openinputstream(); int = instream.read();//returns -1 it doesn't connected on port 5222 port.(with 5222 port open in firewall) when connect 443 port, connects input stream not read correctly. while reading stream, first read character return -1. please me!

javascript - document.getElementById("someId") Vs. someId -

this question might seem silly, what's difference between accessing element (with id "someid") using document.getelementbyid("someid") vs. typing someid ? eg: document.getelementbyid("someid").style.top = "12px"; vs someid.style.top = "12px"; here's sample code http://jsfiddle.net/prata/ (i found doesn't work in firefox) the difference while someid works in browsers, document.getelementbyid("someid") complies w3c standard.

android - Is there a faster way to decode html characters to a string than Html.fromHtml()? -

i using html.fromhtml(string).tostring() convert string may or may not have html and/or html entities in it, plain text string. this pretty slow, think last calculation took 22ms on avg. large batch of these can add on minute. looking faster, performance built option. is there anyway speed or there other decoding options available? edit: since there doesn't appear built in method faster or built performance specifically, reward bounty can point me in direction of library that: works android licensed free use faster html.fromhtml(string).tostring(); as note, tried jsoup method: jsoup.parse(string).text() , slower. what org.apache.commons.lang.stringescapeutils's unescapehtml() . library available on apache site.

c# - Can't open serialport on Windows CE application -

i working on windows ce application involves using serial ports of machine. when try open port gives ioexception. below example code: serialport newserialport = new serialport("com7", 115200, parity.none, 8, stopbits.one); newserialport.handshake = handshake.none; //opening serial port newserialport.open(); i have tried close connection before open statement , checked isopen status before opening (which false before opening). serialport.getportnames function gives back: com1 / com2 / com5 / com7. tried including in diffrend way this: com1: / com2: / com5: / com7:. can't seem work. my first thought forgot add in windows ce image. can't seem find in catalog seem important serial communication. does have thought on this? at system.io.ports.serialstream.winioerror() @ system.io.ports.serialstream.winioerror() @ system.io.ports.serialstream.checkresult() @ system.io.ports.serialstream.setbuffersizes() @ system.io.ports.serialport.open()

javascript - Adding x-axis and y-axis to barchart in gRaphael? -

i want create barchart using graphael javascript library. graphael support labeled axes? i see axis although without labels in example . think can add text desired position using raphael function text() . var t = paper.text(50, 50, "x label");

javascript - Excluding prototype in rails 3? -

in rails 3, when using <%= javascript_include_tag :defaults %> , includes number of javascript files include prototype.js page. i know can use config.action_view.javascript_expansions[:defaults] = %w(jquery) in application.rb include more javascript files :defaults set. how how exclude files in :default set? thanks in advance. it's easy, take @ http://shiningthrough.co.uk/speed-up-your-ruby-on-rails-application-by-only-including-the-scriptaculous-libraries-you-need

deployment - Licensing problem with ClickOnce application -

Image
i've got 3rd party video capture control in system ( leadtools capture control ), licensed , works in dev environment. when it's deployed clickonce app, however, bombs out following error: what problem be, , how fix it? heya bud, not @ familiar control, of course, near can tell relies on activex / com component - requires registration. however, clickonce not support registration of com components. (this because of sandboxing model has in place). thats why crashing, since com component isn't - , cannot - registered. check out these links how around it: http://msdn.microsoft.com/en-us/library/ms165432(v=vs.100).aspx http://msdn.microsoft.com/en-us/magazine/cc188708.aspx

iphone - Why can't I write Dictionary to plist? -

hey all,i got weird problem here first create small project try write dictionary plist declared textfield , button , code ibaction: nsarray *localpathstemp = nssearchpathfordirectoriesindomains(nsdocumentdirectory, nsuserdomainmask, yes); nsstring *localdocpathtemp = [localpathstemp objectatindex:0]; nsstring *localfilepathtemp = [localdocpathtemp stringbyappendingpathcomponent:@"inputpassword.plist"]; nsmutabledictionary *localdictreadtemp = [[nsmutabledictionary alloc] initwithcontentsoffile:localfilepathtemp]; nsmutabledictionary *localserialnumber = [nsmutabledictionary dictionarywithobject:setsn.text forkey:@"input_serial_number"]; i try log write in nslog(@"local dictionary : %@",[localdictreadtemp valueforkey:@"input_serial_number"]);//"input_serial_number=1" nslog(@"dictionary-localserialnumber %@",[localserialnumber val

c# - Login to web page using HttpWebRequest -

i trying login website below using httpwebrequest. passing in username , password using credentials property keep getting login page of website. can explain doing wrong. https://oyster.tfl.gov.uk/oyster/entry.do (login page) httpwebrequest request = (httpwebrequest)httpwebrequest.create(url); request.contenttype = "application/x-www-form-urlencoded"; request.credentials = new networkcredential(username, password); request.method = "post"; request.accept = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"; request.headers.add("accept-language: en-us,en;q=0.5"); request.headers.add("accept-encoding: gzip,deflate"); request.headers.add("accept-charset: iso-8859-1,utf-8;q=0.7,*;q=0.7"); request.keepalive = true; request.headers.add("keep-alive: 300"); request.referer = url; request.useragent = "mozilla/4.0 (compatible; msie 6.0; windows nt 5.1; .net clr 1.0.3705;)"; httpwebresponse re

database - SQL calculations: Perform AVERAGE using THIS year, LAST year and NEXT year data? -

i’m struggling recreate calculation in sql can in excel. concerns averages. we collect data on many years. 1 table create 3 year average. below tables show: 1) raw data, , 2) new table average data. ‘dimensions’ [year] & [itemcode]. the average data based on averaging year’s figure 2 years either side. i.e. 1991 average figure = average (1990,1991,1992). =average(b2:d2) 1) raw alt text http://i55.tinypic.com/o9pc8g.jpg 2) average alt text http://i56.tinypic.com/5d12dz.jpg in excel seems simple do: average formula dragged other cells, or in vba using r1c1 referencing. but in sql? how use ‘this’ year & year before & year after data? also, realise if there’s empty cell throw calculations, how manage null values calculates when there 3 figures use?...and again until finished (many years , many, many itemcodes) any appreciated. you don't state technology, assuming mssql. assume mydate 2010 select dateadd(year, -1, mydate), mydate, dateadd(

android - Way to know if my application is installed -

is there way (intent) know if application installed ? followed below link, application don't intent when app installed android - how intercept 'install application' intent if want execute code app a, has installed (it's obvious, isn't it?), can't check app whether app app installed or not. it's if want know when dead: after die, impossible know it. on other hand, else can know when die... same android scenario: app b can know whether app installed or not (by using getinstalledpackages or intents or whatever).

c++ - How to allocate from heap with the correct memory alignment for InterlockedIncrement function? -

this code seems work, have used interlockedincrement function correctly? correct memory alignment of m_count of primary concern. assume we're on x86-64 system , compile 64-bit application (in case matters). way, actual purposes can't declare m_count volatile long , use interlockedincrement(&m_count); must pointer data in heap. #include <windows.h> #include <malloc.h> class threadsafecounter { public: threadsafecounter() { // arguments size , alignment correct? void* placement = _aligned_malloc( sizeof(long), sizeof(long) ); m_count = new (placement) long(0); } ~threadsafecounter() { _aligned_free( const_cast<long*>(m_count) ); } void addone() { interlockedincrement(m_count); } long getcount() { return *m_count; } private: volatile long* m_count; }; the heap allocator aligns returned addresses native platform word size. 4 bytes x86, 8 byte

tfs - I cannot edit any files (checkout error or user cancellation) -

i trying work on new project, accessed through team foundation server 2008. don't have experience in working tfs, seems pretty straight forward do. here did: 1) tools -> connect team foundation server... 2) select project, ok. 3) in source control explorer, right-click , select "get specific version..." , choose "overwrite files if local version matches specified version", "get" 4) asks "projects have been added solution. want them source control?" , select "yes". 5) there error. "unable read project file '...commonlogic.documentutile.csproj. 'd:...commonlogic.documentutil.csproj' not found. click ok. 6) project "commonlogic.documentutils" unavailable in solution explorer. says "the project file cannot loaded." anyway, don't know if error cause. when try edit file in solution (not in above project), popup says: "checkout error or user cancellation" , text of cur

about zrank command in redis -

zrank returns rank of member in sorted set, with scores ordered low high. zrevrank returns rank scores ordered high low . when given member not exist in sorted set, special value 'nil' returned. returned rank (or index) of member 0-based both commands. what 'with scores ordered low high. zrevrank returns rank scores ordered high low' meaning? in mind, zrank member's score. why pharse said orderd low high? the important thing here zrank returns zero-based index of member, not it's score @ all. thus, "scores ordered low high" or "scores ordered high low" provide reference "direction" sorted set being read. consider this: redis> zadd foo 0 (integer) 1 redis> zadd foo 1 b (integer) 1 redis> zadd foo 2 c (integer) 1 redis> zrank foo c (integer) 2 redis> zrevrank foo c (integer) 0 note rank of c 2 when being read "scores low high" it's revrank 0 when being read "scores high low"

c# - Set Properties and create events for a user control -

i'm creating web user control in asp.net using c# in can select date calendar , display in textbox. when select date calender has displayed in textbox. need set own properties can select datetime patterns in cs codefile. example usercontrol1.dd-mm-yyyy. this 1 example. want datetime patterns of "en-us". when use usercontrol in page want set of properties(datetime patterns) control. please me!!! i tried coding no use... plz review , give me solution public partial class datecontrol : system.web.ui.usercontrol { string dateformat; public string dateformat { { return dateformat;} set { dateformat = value; } } protected void page_load(object sender, eventargs e) { if(!page.ispostback) { pageload(); lnlbtnchangedate.visible = false; ddldateformat.visible = false; calendar.visible = false; } lblerror.visible = false; } public void pageload()

iphone - iOS4 networkActivityIndicatorVisible blocked through UI -

i doing request download images want replace subview them. means ui blocked , new view displays sometime later. i want user understand blocking occurs due download. first tried use [uiapplication sharedapplication].networkactivityindicatorvisible = yes; [self downloadfunction]; [uiapplication sharedapplication].networkactivityindicatorvisible = no; that leads maxium blink (mostly nothing) of activity indicator, since request blocking ui thread. i cannot put downloadfunction background, since depend on downloaded data available before push controller (would lead error "pushing same view controller instance more once not supported" since click button more once). then tried put subview spinning wheel on top of view: [self performselectorinbackground:@selector(showactivitysubview) withobject:nil]; or [nsthread detachnewthreadselector: @selector(showactivitysubview) totarget:self withobject:nil]; but still ui blocked , indicator displayed after download finis

iPhone UIBarButtonItem alpha of button image -

Image
i've added button lower toolbar this: uiimage *locationimage = [uiimage imagenamed:@"193-location-arrow.png"]; uibarbuttonitem *locationbutton = [[uibarbuttonitem alloc] initwithimage:locationimage style:uibarbuttonitemstylebordered target:self action:@selector(updatecurrentlocation)]; nsarray *items = [[nsarray alloc] initwithobjects:locationbutton,nil]; [toolbar setitems:items]; [items release]; [locationbutton release]; this works great, alpha of image picked fine, button displays this: so, took code , modified create button in navigation bar: uiimage *favouriteimage = [uiimage imagenamed:@"28-star.png"]; uibarbuttonitem *favouritebutton = [[uibarbuttonitem alloc] initwithimage:favouriteimage style:uibarbuttonitemstylebordered target:self action:nil]; self.navigationitem.rightbarbuttonitem = favouritebutton; [favouritebutton release]; the alpha doesn't seem picked on 1 - looks greyed out: is there need set when using custom images

java - how to dynamically increase JDialog size in swing? -

i have jdialog , inside having jlabel in contents added dynamically. set size of jdialog , jlabel (both having same size), if contents in jlabel exceeds size of jdialog , content not visible. how can dynamically change size of jdialog size gets matched content using layouts? invoke pack after jlabel content change.

c# - Binding a buttons IsEnabled/Visibility properties using its x:Name as a parameter in a method in the code-behind -

i need pass in controls name method in security object returns boolean value isenabled property , method returns visibility(collapsed, hidden, or visible). these both have checked permission purposes. i have tried using objectdataprovider examples show user input textbox parameters. need pass control name method based off button's x:name property. what simplest , efficient way of handling problem. in advance. update: trying use converter , convert method came with: public object convert(object[] values, type targettype, object parameter, system.globalization.cultureinfo culture) { if (values != null) { datatable tblpermissions = (datatable)values[0]; string sfunctionname = values[1].tostring(); datarow[] rows = tblpermissions.select("fun_name = '" + sfunctionname + "'"); if ((bool)rows[0]["fun_enable"]) return true; else

WPF DataGrid: Cancel the first row selection by default -

in datagrid first row becomes selected default. how can cancel this? <window x:class="wpfapplication50.window7" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:dg="clr-namespace:microsoft.windows.controls;assembly=wpftoolkit" title="window7" sizetocontent="widthandheight"> <window.resources> <!--data--> <xmldataprovider x:key="mydata" xpath="/info"> <x:xdata> <info xmlns=""> <item id="isbn 45-f1" name="winner" price="$32.05" author="aka" catalog="business"/> <item id="isbn 54-32" name="c++ inside" price="$10.00" author="john" catalog="language"/> <item id="isbn 14-a0" nam

join - Help me to get better understanding of Digg's Cassandra data model -

http://about.digg.com/blog/looking-future-cassandra i've found article digg's move cassandra. didn't author's idea of bucket pair (user,item). little more details on idea helpful me understand solution better. thanks it sounds using 1 row in super column family per user 1 super column per item; subcolumn item super column represents friend dugg item. @ least in pycassa, makes insert simple as: column_family.insert(user, {item: {friend: ''}}) they have done couple of other ways, , i'm not sure chose. one use standard column family, use (user,item) combination row key, , use 1 column per friend dugg item: column_family.insert(user + item, {friend: ''}) another use standard column family, use (user) row key, , use (item, friend) combination column name: column_family.insert(user, {item + friend: ''}) doesn't sound used, it's acceptable option well.

layout - Customize DatePicker. Android -

is there way customize datepicker? layout-code. <?xml version="1.0" encoding="utf-8"?> <scrollview xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content"> <linearlayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="center_horizontal" android:orientation="vertical"> <datepicker android:id="@+id/ad_date_picker" android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_margin="5dp"/> <timepicker android:id="@+id/ad_time_picker" android:layout_width="wrap_content" android:layout_height="wrap_content"

java - Can IntelliJ automatically create a decorator class? -

sometimes, create decorator class this: class myinterfacedecorator implements myinterface { private final myinterface delegate; ... constructor taking myinterface instance ... @override public object someinterfacemethod(some argument) { return delegate.someinterfacemethod(argument); } ... etc, more methods here... } can intellij automatically create class me? update// i noticed intellij has "generate" option generating delegate methods. create new class: public class mydecoratorclass { private myinterfacewithmanymethods myinterface; } then mark myinterface, go menu > code > delegate methods, select methods want wrap , that's it. //end of update you try "refactoring" -> "replace inheritance delegation" refactoring. should able this, this. call "code alt+enter" go interface want generate decorator for. public interface myinterfacewithmanymethods { void method1(); voi

iphone - Sending anonymous email from MFMailComposeViewController -

this may stupid question, there possible way (from developer's perspective) send email mfmailcomposeviewcontroller , change from: address default email account set on phone? want upload data application, don't want linked user's email address. even if change from: not accomplish kind of anonymity. well-behaved mail server adds info mail headers.

c# 4.0 - Create 2D modelling tool (as an UML modeller or BPM modeller) using C#.NET? -

i have create modelling tool (just visio, bizagi or graphical uml tool). not have clue where start. i know it's going 2d modelling, always. there relationships between model entities uml diagram or visio workflow. i'm quite new this... how can performed using c#.net? should start digg info? thanks. i suggest try using windows workflow foundation. not mature technology has great features may want try. http://msdn.microsoft.com/en-us/vstudio/jj684582.aspx way, use bizagi here too. bizagi modeler it's free , complies bpml specs.

vb.net - Is it possible to convert vb6 "Val()" to c#? -

i converting vb , vb.net c# have issue. not use visualbasic dlls in converted code , have been doing fine far. but code dim x double 'this error saying integer x = val("1 23 45 x 6") ''#x 12345 x = val("1..23") ''#x 1.23 x = val("1 1,,,,,2,2..3") ''#x 1122.3 does not work same vb6 using "val" visualbasic.conversion.dll there has solved work same? c# solution best. check out site: http://www.dreamincode.net/forums/topic/36064-val-replacement/ others give example how implement own val() function.

How can I remove on-screen keys in Eclipse built Android application -

i developed view based application android navigation keys on touch screen, up/down/select/ok. not need these keys , want remove them don't show on screen application displays full screen. lwuit? please. thanks it can done inside android emulator. press menu on home screen, open "settings", "language , keyboard", , disable keyboards. emulator keyboard (not on screen one, pc keyboard , button keyboard on right) considered hardware keyboard, , still work.

forms - Using Jquery to Disable Submit Button if an option is selected -

Image
i have simple form 4 select fields. if yes selected on form field, submit button needs disabled , hidden div should appear. here's example of markup: <form> have read information on product(s)<select name="field4"> <option value="yes">yes</option> <option value="no">no</option> </select> have allergies ingredients in product(s)? <select name="field5"><option value="yes">yes</option> <option value="no">no</option> </select> pregnant? <select name="field6"> <option value="yes">yes</option> <option value="no">no</option> </select> have ever used type of product , had undesirable results? <select name="field7"> <option value="yes">yes</option> <option value="no">no</option> </select> <input name="

html - IE7 check stops page displaying in IE8 -

i have infuriating issue ie7 , ie8. element of page not display correctly in ie7, , after lot of trial , error found simplest fix add conditional part page header: <!--[if ie 7]> <style type="text/css"> #slideshow {top: -135px;} </style> <![endif]-–> great! find if add page, page not display at all in ie8 - literally shows blank page. if click "quirks" button, page displayed. anyone ideas going on? infuriating. (ie8.0.6001.18702 on windows xp) the comment isn't closed. last "dash" character 0x2013 rather 0x2d. following on page commented out except ie7.

javascript - How to add HTML element that doesn't get parsed until later? -

i'm making webpage , want show preloader before loading rest of it. want first <head> tag parsed browser , rest ignored. ideal: <head> <script src='preloader.js'></script> <script src='more1.js' ignore='true'></script> <script src='more2.js' ignore='true'></script> <script src='more3.js' ignore='true'></script> </head> this drove me wonder how might possible have existing, latent html tags on page, mark later javascript activate them, uncommenting them. thinking commented code answer, wasn't able read html comments jquery's dom. how can create latent html activate later? i'm not looking to: - have valid html. - inject html content residing outside of own file (changing stuff, attribute ok). - unhide has been parsed. you'll have clarify little bit: want html not parsed or not displayed? if don't

sqlite - SQLite3 on windows: Convert epoch to normal time -

i trying convert following timestamp(in milliseconds since epoch) normal date-time. using sqlite3 on windows xp. i using query: select datetime((timestamp/86400000)+25569) table; (timestamp column name contains values 1289325613669,1289325823860, 1289327180545). i dont seem getting right values. doing wrong? do this: select datetime('1289325613', 'unixepoch'); the unixepoch modifier expects value in seconds. currently, provide datetime interpreted julian day number. the reference date , time functions here

javascript - Avoiding ids in html elements -

i'm developing javascript-based application. using id's identify elements considered bit bad, because id's global , instantly mess if happen have collision. what effective ways avoid this? ok use use classes wherever use id's or there drawbacks. note i'm not interested in css side of things, javascript. edit : think got answer, we're clear, wasn't talking duplicates in document object. want build set of re-usable components. i'd access them id. i'm not generating html using dom, there's html template that's 'enriched' javacript. problem starts when want re-use component on same page. namespacing won't here either; though elements 'unique' within context of component, not guaranteed within entire document. using classes might bad practice, other option there? use id's if it's unique, use classes if it's reused an example of using id isn't "bit bad" <div id="header

vb6 - Matching specific items in several discrete collections -

i have problem whereby have several discrete lists of id's eg. list (a) 1,2,3,4,5,7,8 list (b) 2,3,4,5 list (c) 4,2,8,9,1 etc... i have collection of id's... example: 1,2,4 i need try , match 1 each list. if can match id's in secondary collection (one collection id matched id each list) true result.... i have found becomes complicated because if iterate on lists matching first collection/list pair encounter may result in precluding possible combination further on down line hence returning false negative result. for example: list (a) 1,2,3,4 list (b) 1,2,3,4 list (c) 3,4 collection is: 3,1,2 the first id collection (3) matches entry in list a, second id in collection (1) matches item in list b, final id in collection (2) doesnt match entry in list c if rearrange order of collection be: 2,1,3 match found.... therefore looking form of logic attempting match on possible combinations in efficient manner(?) to make more complicated id's gu

iphone - How to reload Data of TableView when Editing ends with animation -

i'm using tableview show, edit , write data file...when editing modes end write them file , afterwards want clear inputfields of tablecells. i'm doing with: - (void) setediting:(bool)editing animated:(bool)animated { [super setediting:editing animated:animated]; if (editing == no) { //write file //clear data [self.tableview reloaddata]; } } but when reload data animation isn't shown. what way can reload data , still animation? why not clear input fields in existing cells instead of calling reloaddata? iterate through of uitableviewcells in self.visiblecells , clear input field in each of them in turn - should leave animation uninterrupted.

blackberry - How to use a button in a VerticalFieldManager to change parent screen? -

i have button in verticalfieldmanager. if user clicks on it, want wipe out screen , load new verticalfieldmanager. currently in homepage, call custom manager returns verticalfieldmanager. because code builds verticalfieldmanager not on homepage , not extend mainscreen, doesn't have access screen methods. how can go fixing issue? if i'm understanding correctly screen has manager , manager has button want modify screen. this: buttonfield button = new buttonfield("button"); button.setchangelistener(new fieldchangelistener(){ public void fieldchanged(field field, int context) { //the manager of field should verticalfieldmanager //and manager of should screen. manager screen = field.getmanager().getmanager(); screen.deleteall(); //now create new verticalfieldmanager , add whatever want } });

c# - Can events only have one call out at a time? -

say have event this: someclass.someevent += mymethodtocall(); ... public void mymethodtocall() { if (checktoseeifformisalreadyshowing()) { someform someform = new someform(); someform.showdialog(); } else { dosomestuff(); } } if user interaction someform causes someevent fire again mymethodtocall called again while someform still showing? my evidence seems show not. my question why? event happened again. why wouldn't mymethodtocall called again (and end calling dosomestuff() ? i guessing not possible (still not sure why). assuming not possible, can show dialog on separate thread ( begininvoke )? (i seem recall ui needs happen on same thread hesitant try that). i need have event called again if happens again (even if someform dialog still showing. ideas on how can great! note: contrived example, have tried condense complex code example demonstrates real issue working with. (meaning please don'

drupal - how do you override a function that exists in another module -

i override comment_save function. there way override can add in functionality? is creating trigger such http://drupal.org/node/375833 best way? doesn't seem reliable since happens after fact. btw, in d6. it's tricky. first off, i'd suggest instead going , seeing if can manage need using hook_comment ( http://api.drupal.org/api/drupal/developer--hooks--core.php/function/hook_comment/6 ). it's more of needed for. if really need override comment_save, choice around @ things call it. situation, you're lucky - comment_save gets called in 1 place, on line 1542 of comment.module, inside of comment_form_submit. now, comment_form_submit form submit function - instead of replacing comment_save, can instead make our own custom version of comment_form_submit (and argument's sake, we'll assume we're working in 'custom_module' module) - create new function called custom_module_comment_form_submit, calls variant of comment_save i'

html - Convert fluid table to div / css -

how can convert 3-column table using divs only? note first , third columns fluid , second (middle) column fixed width. <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td style="background-color:#ccc;">left</td> <td style="width:940px; background-color:#0cf;">middle</td> <td style="background-color:#ff9;">right</td> </tr> </table> this article explains how accomplish div-based layout desire: http://www.barelyfitz.com/screencast/html-training/css/positioning/ essentially, make container div 100% width, position 3 "column" divs within it.

autocomplete - code hinting / completion for array of Objects in Zend Studio (or any other Eclipse based IDE) -

is possible? example, have array of dogs. how code completion work? here's code illustrate problem. advice great! class dog { private $name; public static function init_many(array $names) { foreach ($names $n) { $collection[] = new self($n); } return $collection; } public function __construct($n) { $this->name = $n; } public function bark() { return sprintf('woof! name %s', $this->name ); } } $scoobi = new dog('scoobi'); $scoobi-> // code hinting / completion works! $dogs = dog::init_many(array('scoobi', 'lassie', 'bingo')); $dogs[0]-> // code hinting / completion doesn't work! an indirect way be $dogs = dog::init_many(array('scoobi', 'lassie', 'bingo')); foreach ($dogs & $dog) { /* @var $dog dog */ $dog-> //code hintin

mvvm - Binding DataGridHeader ContentTemplate in Silverlight -

i know not implicitly possible bind text datagrid header via dynamically setting header text of silverlight datagrid column , following code examples online substitute textblock header. however, no matter text i've bound won't show up. my xml view: <dg:datagridtextcolumn binding="{binding path=unitkey}" isreadonly="true"> <dg:datagridtextcolumn.headerstyle> <style targettype="dataprimitives:datagridcolumnheader"> <setter property="contenttemplate"> <setter.value> <datatemplate> <textblock text="{binding path=keylistname}"/> </datatemplate> </setter.value> </setter> </style> </dg:datagridtextcolumn.headerstyle> </dg:datagridtextcolumn> my c# view model: public string keylistname { { return keylistname; } set { keylistname = value; raisepropertychanged

flex4 - Flex 4 change popup's overlay color -

how can change color or transparency of popup's overlay? want have color , alpha 1. http://mprami.wordpress.com/2008/04/22/alert_popup_modal_transparancy_color_blur_changes/ in flex ‘’ tag has 4 attributes related modal properties of pop-ups. modaltransparency modaltransparencyblur modaltransparencycolor modaltransparencyduration in spark looks these renamed slightly: modal-transparency modal-transparency-color modal-transparency-duration modal-transparency-blur (guessing on one)

multithreading - setting up matlab multicore computing -

i'm trying use in matlab parfor = 1 : 100 disp( sprintf('process %d\n', i) ); end how setup number of cores want use (possibly inside script)? @ moment see same (sorted) sequence. thank you use matlabpool open x where x number of cores you'd run computation on.

How do I encapsulate third-party JavaScript files so they don't pollute the global scope? -

one of clients asking if can add javascript track user behavior website. @ first glance fear going interfere other third-party analytics scripts on site because looks both parties have used same javascript compressor. don't want comb through , search every possible naming collision . . . is there way can include third-party scripts (script files live on separate domain) wrap them in own namespace or give them own scope don't collide other globally declared variables , functions? it should not problem. javascript compressors not rename global variables (for obvious reasons), , well-designed script not expose many (any) globals. if want deploy on page, responsibility prevent clashes.

consuming SOAP web service in java -

i looking alternatives of consuming soap web service in java. using stub method consume , it's simple instructor needs. instructor said trivial client, suppose mean? soap submission of xml web server using post method. while xml can verbose, should able construct xml using stringbuilder , use simple http client, apache httpclient construct post request url using xml string body. that's simple come.

css - Entering text in a TEXTAREA while keeping the formatting (just like the text in a PRE tag) -

when enter text line-breaks , long sentences, don't want see wrapped or without line-breaks version. css style accomplish this? far tried white-space property none gives result want. you want wrap attribute of textarea tag. have @ page: http://www.tizag.com/htmlt/htmltextarea.php i'm not 100% sure end result want, if @ options , explanations given via link, should able choose 1 fits needs.

parsing a large html-file (local) - with Perl or PHP -

i have large document - need parse , spit out part: schule.php?schulnr=80287&lschb= how parse stuff!? <td> <a href="schule.php?schulnr=80287&lschb=" target="_blank"> <center><img border=0 height=16 width=15 src="sh_info.gif"></center> </a> </td> love hear you you way (it's not perl more "visual"): load document browser, if possible install firebug extension/add-on install firepath extension copy + paste xpath expression text field labeled "xppath:" //a[contains(@href, "schule")]/@href click "eval" button. there tools on command line, e.g. "xmllint" (for unix) xmllint --html --xpath '//a[contains(@href, "schule")]/@href' myfile.php.or.html you further processing thereon.

c - TCP representation for unacknowledged data in sender's buffer -

what best way keep unacknowledged data buffer (sender's buffer) in tcp? i thinking between keeping data itself, , keeping packets(header + data)? it seems retransmission of packets hard if keep data bytes opposed keeping packets. language: c packet boundaries meaningless in tcp: it's possible half of packet's data acknowledged (say due fragmentation) , have retransmit remaining half. so answer is: should keep raw data, not packets. real question should asking is: how know data has been acknowledged. need bit-mask each byte of data in window, , mark acknowledged data 1 , rest 0. whenever find contiguous block of data beginning of window has been acknowledged, portion can slid out.

iphone - Is it possible to read the contents of a web page into a string so i can parse out the data? -

i'd able iphone load url( or file url points to) string. reason want able can parse string looking tags , extract values it. the files webpages html or .asp etc. anybody able give me hints on need achieve kinda of thing? many thanks, -code first url nsurl *anurl = [nsurl urlwithstring:@"http://google.com"]; then turn string nserror *error; nsstring *htmlstring = [nsstring stringwithcontentsofurl:anurl encoding:nsutf8encoding error:&error]; update: there documentation on getting contents of url using nsurlconnection adc site from there can string representation of downloaded data using nsstring *htmlstring = [[nsstring alloc] initwithdata:urldata encoding:nsutf8encoding];

php - Apache crashing while using Zend Framework -

i have been studying zend framework, have ran problem. apache crashes when run : $this->db->fetchall("select count(distinct userid) numberofusers, count(id) total notebook") but,this don't happen if run $this->db->fetchall("select count(distinct userid) numberofusers notebook") or $this->db->fetchall("select count(id) total notebook") error log : --------------------------- apache.exe - application error --------------------------- "0x019b250a" instruction references of "0x00000000" memory。this memory can't "read"。 termination procedure, please click "ok". should debug program, please click "cancel". --------------------------- ok cancel --------------------------- i don't know why happens. problem version of php running. (currently running php 5.2.8). can me? it's because of php version or configuration.first,checking version.secord,checki

javascript - Need help parsing markdown, remove italic (*) but not bold(**) -

i trying replicate wmd markdown editor. tried modify wmd instead of reinventing wheel code not readable me ... so trying allow removing of italics " * " not bold " ** " so, italics below should removed this *is a* test ***is a*** test but below should untouched this **is a** test i guess should use regexp how? how match * if "alone" or followed 2 or more * s this hard solve straight regexp, handling edge cases asterisks @ beginning or end of string. mixing regexp magic replace magic gets job done though... function removeitalics(str) { var re = /\*+/g; return str.replace(re, function(match, index) { return match.length === 2 ? '**' : ''; }); } alert(removeitalics("this *is a* test")); // test alert(removeitalics("this **is a** test")); // **is a** test alert(removeitalics("this ***is a*** test")); // test we're matching runs of 1 or more asterisks. matches greed

php - How to create a hierarchical CMS page in Magento? -

how go creating hierarchical cms page in magento? i assume question want have tree-like navigation structure series of cms pages? features comes natively magento enterprise, need purchase or write custom extension magento community

silverlight - Seeking good source of FOSS graphics/components for Process Control/Scada -

i want whizz-bang browser graphics impress management - scada/process control. until have been worrying technology - silverlight or not silverlight? but, really, technology doesn't matter when concerned appearance. so, there source of royalty free graphics or animated components - maybe take values database , aimed @ industrial process control? if this doesn't impress them, don't know will. ;-)

how to show mime data using python cgi in windows+apache -

i met problem while using python(2.6) cgi show mime data in windows(apache). example, show image, here code: image.py #!e:/program files/python26/python.exe # -*- coding: utf-8 -*- data = open('logo.png','rb').read() print 'content-type:image/png;content-disposition:attachment;filename=logo.png\n' print data but dose not work in windows(xp or 7)+apache or iis. (i try write these code in diferent way, , try other file format, jpg , rar, no correct output, output data seems disorder in begining lines.) and test these code in linux+apache, , ok! #!/usr/bin/env python # -*- coding: utf-8 -*- data = open('logo.png','rb').read() print 'content-type:image/png;content-disposition:attachment;filename=logo.png\n' print data i feel confused why not work in windows. give me , advice? one newline between each header. 2 newlines between headers , body. , watch line endings. print 'content-type:image/png' print 'co

Android : Adding image in email -

i want add image in email, if add file sdcard working fine given below. emailintent.putextra(intent.extra_stream, uri.parse("file///sdcard/images/thumb.jpg)")); but want add image assest. have tried many pernutation , combination uri.parse , uri.fromfile nothing works, can tel how path should add file assets. urgent. isnt it?: file:/// instead of file/// ... missed " : "

How to add different Description for every Checkbox in Zend MultiCheckbox Class -

how add different description every checkbox in zend multicheckbox class thanks $this->addelement('multicheckbox', 'multicheck', array( 'label'=>'checkboxes', 'multioptions'=>array(1=>'label 1', 2=>'label 2') ));

Problems with Log function in Boost C++ libraries -

i have code in order logarithm of number given generic base: #include <boost/math/special_functions/powm1.hpp> #include <boost/math/special_functions/log1p.hpp> #include <boost/math/special_functions/sqrt1pm1.hpp> // ... // boost log returns boost::math::log1p(x) = log(e, x + 1) double res = (double)(boost::math::log1p(arg - 1)); // base conversion: log(new, y) = log(old, y) / log(old, new) // ==> log(base, arg) = log(e, arg) / log(e, base) res = (double)(res / ((double)boost::math::log1p(base - 1))); return res; as can see boot libs define neperian log , there tricky way log because lib gives not log(x) log(x+1). can see problem solved giving argument arg - 1 , should work. well works, neperian log ok, mean, if run code: #include <boost/math/special_functions/powm1.hpp> #include <boost/math/special_functions/log1p.hpp> #include <boost/math/special_functions/sqrt1pm1.hpp> // ... // boost log returns boost::math::log1p(x) = log(e, x + 1

Generate SOAP Web Service client forms (Java) -

i have web service accessible via soap. let's assume provides method signature sayhello(string name) of course, have wsdl describing web service. what want generate client web application (war archive) gui provides form enter parameter web service method. in case of example, form must allow enter value "name" parameter. then, soap message must assembled , sent ws. is there way or framework generate such webapp automatically !? actual kind of resulting webapp not important, may gwt webapp, jsf, plain servlet jsp or whatever. plain html/javascript client app ok. i mean, there tools generate crud forms out of data models, there must tools create forms web services, too... i've been googling around long time, thing i've found feature of eclipse: http://www.eclipse.org/webtools/jst/components/ws/m3/tutorials/webserviceclient.html . basically, want, i'm looking more ..hm.. elegant way ;-) thanks in advance, frank what looking (i think)