Posts

Showing posts from May, 2010

string - Sentences division -

i have divide text separated sentences. ok. seem simple. just search "." or "?" or "!" , add next sentence array. but unfortunately not great , simple. how can avoid situation when: washington, d.c. will splitted for: "washington, d" , "c". or “one time set off explosive under chair of our teacher, mrs. thurman." is splitted on: "one time set off explosive under chair of our teacher, mrs" and "thurman" maybe database acronyms contains "." ? thanks tips in advance! check out nltk . has out-of-the-box solutions problems described

html - CSS unordered list item not fully occupying unorderedlist -

i've created drop down menu using <ul> , <li> <li> items ordered vertically. <li> items don't occupy <ul> , there vertical bar of unoccupied space @ left. causing this? margin , padding , border , box-model propeties.

javascript - Using slash in window.location.hash -

if change hash so: window.location.hash = "main/0/sub/1/na/false"; . address in browser changes http://mysite.com/#main/0/sub/1/na/false . page's onhashchange function fires , works supposed to. however, in firebug can see i'm sending request to: http://mysite.com/main/0/sub/1/na/false ... url without hash, results in silent 404 in console. when debug find happens @ window.location.hash point. but, if change hash so: window.location.hash = "main=0&sub=1&na=false"; no additional request sent. why additional request being sent in first example? update: noticed sends request after window.location.hash , before (during?) $(window).bind('hashchange') . example if have ... window.location.hash = 'main/0/sub/1/na/false'; // breakpoint 1 in firebug $(window).bind('hashchange', function(e) { e.preventdefault(); // breakpoint 2 in firebug e.stoppropagation(); }); when stops @ breakpoint 1, no request se...

javascript - Generating forms to fit in a table -

so have 2 forms side side, , i'm trying allow user generate many forms he/she wants, , have each form stored table data, 2 per row. issue i'm having forms won't store in table, , i'm not entirely sure i'm doing wrong. start out making form find out how many forms user wants generate. <table border='1'> <span id='exforms'> <input type='text' name ='number' id='number'> <button type='button' onclick="add()">add</button> </span> </table> next number sent add() add() { var number = document.getelementsbyname('number')[0].value; var x = document.getelementbyid('exforms'); number = parseint(number); var i; x.innerhtml=""; x.innerhtml+="<tr><th>form1</th> <th>form2</th></tr>"; for(i = 0; i<number; i++) { x.innerhtml+="<tr><td><input type='t...

css - A border issue of suggestboxPopup in GWT -

i using suggestbox in gwt.i inherit standard theme suggestionbox.gwt.xml as <inherits name='com.google.gwt.user.theme.standard.standard'/> so using default standard css widget suggestbox , making border through image hborder.png,vborder.png etc..i want remove css not working. .gwt-suggestboxpopup{ border : 1px solid #000000; } so how can solve issue.please me. rahul the class used popup defaultsuggestiondisplay default suggestbox. uses decoratedpopuppanel can see in suggestbox.java around line 392. to avoid "heavy" border, have create/override suggestiondisplay uses non-decorated popuppanel , pass suggestbox trough constructor public suggestbox(suggestoracle oracle, textboxbase box,suggestiondisplay suggestdisplay); say, "border" not sufficient, because decoratedpopuppanel uses multiple cells set borders, seen in css. can update css directly apply project, suggestbox not seems handle resource bundle directly. ...

asp.net - Repository for ViewModel -

i have created following 2 repositories in dataaccesslayer application working on now. rolerepository taskrepository rolerepository dealing role related operations adding role in database , retrieving collection of roles database. taskrepository task related operations rolerepository . i want map role task . mean role responsible tasks. relationship m:m. have created table store roleid , taskid . want display roles , corresponding tasks in gridview. need save roleid , taskid in table , need retrieve collection of roletaskviewmodel. in repository these operations need included? do need create new repository? it sounds you're more interested in seeing tasks associated role roles associated task. in case, query rolerepository.

Basic xslt transformation -

i have 1 xml request need modify (to xml) , send further. have no prior knowledge of xslt. have <combined> <profile> <fullname>john doe</fullname> <otherdata> <birthdate>1996</birthdate> <favoritebooks> <book> <id>1</id> <description>libre1</description> </book> <book> <id>2</id> <description>libre2</description> </book> <book> <id>3</id> <description></description> </book> <book> <id>4</id> <description>libre4</description> </book> </favoritebooks> </otherdata> </profile> <loadeddata> <newbirthdate>1998</newbirthdate> <booksupdate> <book id="1"> <booktext>book1</booktext> <...

android - How to use Google Analytics track referrer install from Google Play? -

add libgoogleanalytics.jar project's /libs directory. add following permissions project's androidmanifest.xml manifest file: <uses-permission android:name="android.permission.internet" /> <uses-permission android:name="android.permission.access_network_state" /> add following code snippet project's androidmanifest.xml manifest file: <!-- used install referrer tracking --> <receiver android:name="com.google.android.apps.analytics.analyticsreceiver" android:exported="true"> <intent-filter> <action android:name="com.android.vending.install_referrer" > </intent-filter> </receiver> but never entered ua-xxxxx-yy id. id entered pageviews , events tracking this: tracker.startnewsession("ua-xxxxx-yy", this); google analytics android sdk readme says: (note: not start googleanalyticstracker in application oncreate() method if using referral tracking)...

jquery - If div contains word "example" , then addClass display none to another div -

i trying hide div , if specific word inside div . if (jquery("div.contactus:contains('contact')")) { jquery(".hidethis").css("display","none"); } but not seem work. ideas ? you need check length of returned jquery object: if (jquery("div.contactus:contains('contact')").length) { jquery(".hidethis").css("display","none"); } the reason jquery returns object, if no matching elements found, , never evaluate false . also note can use hide instead of css , make code little bit shorter: if (jquery("div.contactus:contains('contact')").length) { jquery(".hidethis").hide(); }

visual studio 2010 - Change the default behaviour of NullValue in a DataSet -

Image
i have used .net mysql connector import dataset of mysql schema visual studio. visual studio has generated *.xsd file me visual representation of tables, , fields within tables in schema. i running queries against these tables using linq. by default, nullvalue property of every field in every table set (throw exception). means in practice if apply criteria column contains null values in query, exception thrown when try enumerate through results shown below: the easy way fix change nullvalue property of particular column either (null) or (empty) , have lot of columns in lot of tables , changing of these 1 @ time pain. can't use shift key select columns either, (null) , (empty) values apply reference types , nullable value types, if, example, selection contains single integer, none of properties updated. is there option in visual studio change default behaviour of nullvalue property on column in datatable across board? thanks in solution explorer , ri...

Why doesn't "coverage.py run -a" always increase my code coverage percent? -

i have gui application trying determine being used , isn't. have number of test suites have run manually test user interface portions. run same file couple of times "coverage.py run file_name -a" , different actions each time check different interface tools. expect each time ran -a argument, increase code covered line count coverage.py (at least unless new files pulled in). however, gives lower code coverage after additional run - causing this? i not editing source between runs , no new files being pulled in far can tell. using coverage.py version 3.5.1. that sounds odd indeed. if can provide source code , list of steps reproduce problem, i'd take @ it: can create ticket here: https://bitbucket.org/ned/coveragepy/issues

VBA SQL select query but only show some rows -

i have table contains data trying import spreadsheet control on userform in vba/excel. the results viewed end user, have set value of header cells on initialization opposed the column headings sql table. my query looks this dim conn adodb.connection dim rs adodb.recordset dim sconnstring string sconnstring = "provider=sqloledb;data source=mysource;initial catalog=mydatabase;user id=myusername;password=mypassword;quotedid=no" set conn = new adodb.connection set rs = new adodb.recordset conn.open sconnstring set rs = conn.execute("select * woft_tbl_clients userid = '" & userid.value & "';") if not rs.eof ///////////////// /something here!/ ///////////////// else msgbox "error: no records returned.", vbcritical end if if cbool(conn.state , adstateopen) conn.close set conn = nothing set rs = nothing what trying output of selected columns database , able feed them whatever colomn on spreadsheet control. ...

java - Is there a more elegant way of doing this? (Cannot be more descriptive.) -

i have 3 non-static classes representing musical composition. these score, part , note class. score contains instance variable arraylist<part> representing multiple instrument parts of score, , part contains instance variable arraylist<note> representing note sequence. public class score { private arraylist<part> parts; private int resolution; public score(int resolution) { parts = new arraylist<part>(); this.resolution = resolution; } public void addpart(part part) { parts.add(part); } public arraylist<part> getparts() { return parts; } public int getresolution() { return resolution; } } public class part { private arraylist<note> notes; public part() { notes = new arraylist<note>(); } public void addnote(note note) { notes.add(note); } public arraylist<note> getnotes() { return notes; } } public class note() { priva...

testing ember.js apps with jasmine -

does know of resources, examples or tutorials testing ember.js apps ? how test views ? there not seem extensive examples / information on this. i can't propose example how can achieve that, have found project extensively uses jasmine test: should take @ ember-resource project on github. uses jasmine tests, located in spec/javascripts . the project has rakefile , corresponding tasks let execute specs in convenient way. there blog post testing ember.js jasmine: http://www.thesoftwaresimpleton.com/blog/2012/04/03/testing-ember-and-the-runloop/

java - Impossible to update the text of a textview in a RelativeLayout -

i have simple screen created in xml, parent layout "relativelayout" , have child layout (who "relativelayout" containing 3 textview inside). the thing have press button , change values ​​of textviews. to change text this: mytextview.settext("text"); the code runs perfectly, not refresh text of textviews in layout. but when screen rotated, screen refreshes, , label gets correct value. why happen? why when pressing button can not update text? i tried using "asynctask" , text not updated either. did simple can problematic. ? greetings. your code mytextview.settext("text"); should executed on ui thread give effect suppose if want updated after button click code should inside onclickbutton listener of button visit this link more details

.net - Regex to match word including the surrounding square brackets -

in following text, want match first [id], not second [id] part of [something].[id] edit: actual text include square brackets. need match surrounding brackets well. match [id] don't match [something].[id] i used following regex, doesn't match anything. \b\[id\] why regex not working , what's correct one? thanks. as far i'm aware, \b doesn't match beginning of string. try: (^|[\w])\[id\] as regex instead.

javascript - Jquery not deep copying from event handler -

i have event handler set using plain javscript this: myelement.addeventlistener('drop', handledrop, false); then, inside handle drop try this: var mycontainer = $(this.parentnode); mycontainer.after(mycontainer.clone(true, true)); however, appears event not being carried on cloned element. happening because not binding event jquery also? i tried test binding event jquery instead, doesn't support datatransfer object broke other code. one solution write own wrapper addeventlistener remembers listeners added, can "replayed": // set event handler after memoizing function myaddeventlistener(element, type, listener, usecapture) { // store listeners array under element.listeners if (!element.listeners) { element.listeners=[]; } // each element of array array of arguments addeventlistener element.listeners[element.listeners.length] = array.prototype.slice.call(arguments,1); // apply listener element element.adde...

javascript - Jsonp request with MooTools -

i'm studying javascript , right i'm working json files , mootools. problem work json on other domains i'm trying use jsonp. i'm trying write lines of code can't understand i'm doing because i'm not programmer (usually write few lines of code in c# without working json, xml or kind of data). that's code: function getsearchvalue() { var searchvalue = getelementbyid('campo').value; var firstparturl = "http://m.airpim.com/json/public/search?"; var lastparturl = "&k=&e=1"; var finalurl = firstparturl + searchvalue + lastparturl; return finalurl; } var myrequest = new request.jsonp ( {url: getsearchvalue(), oncomplete: function(data) { // here should save json data in 1 array } }).send(); the data receive json object? if yes how can save array ... mean what's mootools syntax parsing?

ios - How do I specify that my app only supports iPhone 4 and iPhone 4s? -

i'm confused parameters need place in plist file. want support iphone 4 , iphone 4s. don't want support other iphone models, ipads or ipod touch. what settings need? you can add key- values in information plist available in iphone 4 or higher version - like - <key>uirequireddevicecapabilities</key> <array> <string>gyroscope</string> </array> you can check information plist - http://developer.apple.com/library/ios/#documentation/general/reference/infoplistkeyreference/articles/iphoneoskeys.html

c++ - Any IPC Mechanisms between Java and C in Windows - Dont want Sockets -

my requirement ipc between c client , java server on windows using json strings. just realized can't use named pipe ("\.\pipe\filename") in windows java. i'm not keen on using network based architecture, because gonna more complicated ensure security , speed. kindly suggest shared memory/fast solution happen know? thanks in advance :)

ios - UITableViewController inside UIScrollView with Horizontal Paging -

this situation: i need horizontal scrolling, , table views inside every page. news app, should display news different categories, when scrolled in 1 horizontal direction, , inside 1 category should display 30 news, vertically scrollable, of course. i have done need, but... i have following scenario: uinavigationcontroller |__ uiviewcontroller, contains scrollview , pagecontrol |__ uitableviewcontroller, holds data in rows, , displayed inside parent, scollview i know not ideal solution, @ least works. base, used apple's code , tutorial pagescroll found on link . instead of simple viewcontroller add scrollview, used tableviewcontroller, add tablecontroller.tableview scrollview. i know, also, adding tableviews inside scrollview sort of adding car inside truck , driving car, couldn't find more reasonable way of doing same thing. so, need thoughts how can accomplished using other approach. use storyboarding , ios 5 this, , seems (and looks) messy right now. t...

iphone - convert long long into string -

what long long type ? it's integer takes 8 bytes , right? want convert long long type nsstring follows. long long fbid = [[friend objectforkey:@"id"]longlongvalue]; i want value of fbid in nsstring *str variable. can do? nsstring *str = [nsstring stringwithformat:@"%lld", fbid];

asp.net mvc - Using Ajax gives stale results -

edit my ajax form gets correct id update content , replace option. submitting clicking <input type="submit" value="submit!" /> . problem : when clicked on submit didn't see update. second trial gave expected result. when refreshed page lost record (first hit successful) on spot. model [serializable] public abstract class abstractentity { public guid id { get; set; } public datetime lastmodified { get; set; } } [serializable] public class product : abstractentity { public product() { this.attachments = new hashset<attachment>(); } public string title { get; set; } public string commentary { get; set; } public datetime placedon { get; set; } public string user { get; set; } public icollection<attachment> attachments { get; set; } } [serializable] public class attachment { public string mimetype { get; set; } public string description { get; set; } public string file...

php - Cakephp cron job to call a controller's action -

i started use cakephp (1.2) few months ago add small features company's application , i'm not familiar it. we test locally on development server before merging production server. i want controller action called every hour assumed best way through researches, cron job. attempt 1 after reading these, http://bakery.cakephp.org/articles/mathew_attlee/2006/12/05/calling-controller-actions-from-cron-and-the-command-line http://book.cakephp.org/1.2/en/view/110/creating-shells-tasks i implement without errors, action not executed. based on these examples, added file named cron_dispatcher.php in app directory (not app/webroot) , did command app dir php cron_dispatcher.php /controller/action/param still nothing happened works perfect when call through url. attempt 2 i tried creating shell (email.php) call action in /app/vendors/shells/. <?php class emailshell extends shell { public function main() { $this->out('test'); ...

serve arbitrary static content on the fly with cherrypy -

i trying create media server using cherrypy , cant cherrypy serve files in directory isn't set @ startup in config. don't want expose drives root directory prefer expose directory @ time need it. there away this? here relevant snippet of current code. @cherrypy.expose def serve_mp3(self, mp3_path): #cherrypy.config.update({"media":{ #"tools.staticdir.on" : true, #"tools.staticdir.root" : "c:\\documents , settings\\sdc\\my documents\\my music", #"tools.staticdir.dir" : "", #"tools.staticfile.root" : "c:\\documents , settings\\sdc\\my documents\\my music" #}}) static_handler = cherrypy.tools.staticdir.handler(section="/media", dir="c:\\documents , settings\\sdc\\my documents\\my music") cherrypy.tree.mount(static_handler, '/media') mp3 = mp3_path.rsplit("\\",1)[1] return "media/" + urllib.quote(mp3) thank...

python - use standard datastore index or build my own -

i running webapp on google appengine python , app lets users post topics , respond them , website collection of these posts categorized onto different pages. now have around 200 posts , 30 visitors day right taking 20% of reads , 10% of writes datastore. wondering if more efficient use google app engine's built in get_by_id() function retrieve posts ids or if better build own. of queries have use gql or built in query language because retrieved on more , id wanted see better. thanks! are doing efficient caching? (or caching @ all). also, if you're using many writes 300 posts, seems might have problem models. have looked @ datastore viewer seem how many writes use per entity? you might read docs on exploding indexes , maybe that's part of problem? it's way better use get_by_id() . finds exact object, , costs way less (counts query 1 entity).

paypal - PayFlow Recurring Payments Refund -

is possible make refund via paypal payflow api on last transaction when i'm using payflow recurring payments. thanks, maciek simple answer "yes". you need credit normal transaction. parameters are: user vendor partner pwd tender=c // c = credit card, p = paypal trxtype=c // s = sale transaction, = authorisation, c = credit, d = delayed capture, origid=xxxx // origid pnref value returned original transaction then may need cancel recurring transaction stop happening again. parameters are: user vendor partner pwd action=c // c = cancel trxtype=r // r = recurring origprofileid=xxxx // original profile id (of recurring transaction) https://www.paypalobjects.com/webstatic/en_us/developer/docs/pdf/pp_payflowpro_recurringbilling_guide.pdf

c# - Dynamic generate column mvvm -

Image
i try make listview dynamic generation of column. use mvvm patern. how can implement this? in momemt have static columns. <listview itemssource="{binding problemproducts}" grid.row="1" grid.rowspan="4" horizontalalignment="left" verticalalignment="top" grid.column="4"> <listview.view> <gridview> <gridviewcolumn header="spisujący" displaymemberbinding="{binding _spisujacy}" width="auto"/> <gridviewcolumn header="miejsce składowania" displaymemberbinding="{binding miejsceskladowania}" width="auto"/> <gridviewcolumn header="typ spisu" displaymemberbinding="{binding _typspisu}" width="auto"/> <gridviewcolumn header="kod" displaymemberbinding="{binding kod}...

how to create a timer which triggers an event after 30 seconds in javascript? -

i working on module in there requirement show timer shows seconds. timer must start 30 , keep on decrementing down 0; , after fire action , again start 30. how can achieve in javascript? there go :) var timer = 30; function decrementafter1second(){ settimeout(function(){ timer--; if(timer==0){ dowhateveryouwantafter30seconds(); timer = 30; } decrementafter1second(); }, 1000); } decrementafter1second(); now next time want in javascript don't slacker , read language first ;) because right i'm assuming either don't know how program or don't know how use google.

java - In a Spring MVC Hibernate Application , image path is getting changed from jsp to controller class? -

in spring mvc hibernate app , selecting image jsp , sending controller , image path getting changed because of getting file not found error... this jsp code : <form name="reguserform"> <input type="file" name="userimage" id="userimage"/> </form> here selecting image d: drive d:\25986.jpeg and below controller class code : public string reguser(@requestparam("userimage") file userimage) { system.out.println("image = "+ userimage); } // here getting : image = c:\fakepath\25986.jpeg because of cannot procced. dont know why image path getting changed automatically. should change input type image ? me ? suppose did want, , suppose use webapp, , choose upload image k:\documents\jbnizet directory. k:\documents\jbnizet\someimage.jpg argument method. useful for? file path on end-user's machine (my machine) doesn't represent meaningful on webapp server (your ...

sql server - How to pass sql function parameter by value -

this part of bigger selection, have stripped down essential question : compare 2 sql queries - first works constant, second variable, both have same value (lets 180). 1 constant displays result (e.g. within milliseconds), 1 variable takes few seconds yield same result. where catch ? query 1: select * table field > 180 query 2: declare @v int set @v = 180 select * table field > @v the catch lies in parameter sniffing . article mentioned: "parameter sniffing occurs when parameterized query uses cached cardinality estimates make query plan decisions. problem occurs when first execution has atypical parameter values. each subsequent execution optimizer going assume estimates though estimates may way off. example, have stored procedure returns id values between 1 , 1000. if stored procedure executed large range of parameter values, optimizer going cache these atypical values, indirectly causes optimizer under estimate cardinality. problem typical ...

php - Does the following call to call_user_func_array() work? -

i have couple of libraries use code similar following one. $args = array_merge(array(&$target, $context), $args); $result = call_user_func_array($callback, $args); the code different in both cases, code shown done. $callback function uses following signature: function callback(&$target, $context); both libraries document that, , third-party code (call plug-in, or extension) adopts function signature, means none of extensions defines callback as, e.g., function my_extension_loader_callback($target, $context) . what confuses me following sentence in documentation call_user_func_array() . before php 5.4, referenced variables in param_arr passed function reference, regardless of whether function expects respective parameter passed reference. form of call-time pass reference not emit deprecation notice, nonetheless deprecated, , has been removed in php 5.4. furthermore, not apply internal functions, function signature honored. passing value when function expec...

Registered COM object not recognized by python's win32com.client.dispatch() -

i'm trying load com object python. i'm using win32com.client.dispatch("name.of.object") load it, , com object has been registered regsvr32 , appears entry in registry in both hklm/clsid , hklm/wow6432node/clsid. can open using vbscript fine, python's win32com.client.dispatch() gives me error: traceback (most recent call last): file "<stdin>", line 1, in <module> file "c:\python27\lib\site-packages\win32com\client\__init__.py", line 95, in dispatch dispatch, username = dynamic._getgooddispatchandusername(dispatch,username,clsctx) file "c:\python27\lib\site-packages\win32com\client\dynamic.py", line 108, in _getgooddispatchandusername return (_getgooddispatch(idispatch, clsctx), username) file "c:\python27\lib\site-packages\win32com\client\dynamic.py", line 85, in _getgooddispatch idispatch = pythoncom.cocreateinstance(idispatch, none, clsctx, pythoncom.iid_idispatch) pywintypes.com_error:...

Fail of org.apache.maven.plugins goal execution -

i'm trying generate war file using maven i'm getting error (most of downloading log output omitted make log more clear): downloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-war-plugin/2.1.1/maven-war-plugin-2.1.1.pom downloaded: ... [info] [info] ------------------------------------------------------------------------ [info] building tn.talan.selenium maven webapp 0.0.1-snapshot [info] ------------------------------------------------------------------------ [info] [info] --- maven-clean-plugin:2.4.1:clean (default-clean) @ tn.talan.selenium --- ... [info] --- maven-resources-plugin:2.5:resources (default-resources) @ tn.talan.selenium --- ... [info] --- maven-war-plugin:2.1.1:war (default-cli) @ tn.talan.selenium --- downloading: http://repo.maven.apache.org/maven2/org/apache/maven/maven-archiver/2.4.1/maven-archiver-2.4.1.pom downloaded: ... [info] build failure ... [e...

Why will deleting 2D array in this way fail (C++)? -

in following codes try build 2d array c++, when run program fails. #include <iostream> #include <vector> using namespace std; int obtain_options( char ** optionline) { vector< char*> options; options.push_back("abc"); options.push_back("def"); std::copy(options.begin(), options.end(), const_cast< char**>(optionline)); return options.size(); } int main(int ac, char* av[]) { char** optionline; int len; optionline = new char* [2]; (int i= 0; i<2; i++) { optionline[i] = new char [200]; } obtain_options(optionline); (int i=0; i<2; i++) { cout<<optionline[i]<<endl; } (int i=0; i<2; i++) delete [] (optionline[i]); delete []optionline; return 0; } i understand there problems allocating memory optionline in function obtain_options(), , if change obtain_options() in way, work: int obtain_options( char ** optionline) { ...

mysql - What is this unusual CREATE TABLE syntax? -

i create db. have script file .sql : create table [allelefreqbysspop] ( [subsnp_id] [int] not null , [pop_id] [int] not null , [allele_id] [int] not null , [source] [varchar](2) not null , [cnt] [real] null , [freq] [real] null , [last_updated_time] [datetime] not null ) go it seems different mysql or postgresql. what type of languige this? how can use it? judging square brackets , go keyword, t-sql (ms sql server). use in mysql, remove square brackets , solve incompatibilities (ie. types or missing escaping) there on. i tested in sql fiddle , , removing square brackets enough in case. other ddl statements however, may have substitute types (ie. datetime2 t-sql not supported in mysql), , may run other problems - need escape column names reserved keywords in 1 dialect not other, etc. usual sql databases do not use 100% standards compliant sql .

ios how to read a crash log -

i've never had read crash log before i'm admittedly n00b in these waters. i can tell there exc_bad_access . how can tell object released before supposed be? *note happens after waking device while app active. doesn't happen, enough. ** edit ** a symbolicated crash log: incident identifier: 14ffd847-61cb-435b-9e98-c06b3b661429 crashreporter key: 7c5fd78cf04b38cfd2aa153f61eb1655ed671274 hardware model: iphone4,1 process: iphone app [2599] path: /var/mobile/applications/abab96ed-a203-48a5-8b50-b34ba3a8e4a4/my iphone app.app/my iphone app identifier: iphone app version: ??? (???) code type: arm (native) parent process: launchd [1] date/time: 2012-07-01 22:17:43.458 -0600 os version: iphone os 5.1 (9b179) report version: 104 exception type: exc_bad_access (sigsegv) exception codes: kern_invalid_address @ 0xb4f05bbe crashed thread: 0 thread 0 name: dispatch queue: com.apple.main-thread thread 0 crashed:...

listbox - Moving item from one list box to another list box (c# webforms) -

i encountering odd issue whereby can move items 1 list box another, cannot move items original list box. here code: private void movelistboxitems(listbox from, listbox to) { for(int = 0; < first_listbox.items.count; i++) { if (first_listbox.items[i].selected) { to.items.add(from.selecteditem); from.items.remove(from.selecteditem); } } from.selectedindex = -1; to.selectedindex = -1; } protected void button2_click(object sender, eventargs e) { movelistboxitems(first_listbox, second_listbox); } protected void button1_click(object sender, eventargs e) { movelistboxitems(second_listbox, first_listbox); } the button2 event works fine, button1 event not. list boxes not data bound , have manually added items them. maybe there obvious missing here? thanks in advance. change this: private void movelistboxitems(listbox from, listbox to) { for(int = 0; < from.items.count; i++) { ...

android - undefined symbols using proguard -

i trying use proguard, got undefined symbols in ant release output. [javac] d:\java\cooktales\icdb\src\org\bj\food4all\activities\recipebook\sel ectcontactslistviewadapter.java:56: cannot find symbol [javac] symbol : variable applanguageenum [javac] location: class org.bj.food4all.activities.recipebook.selectcontacts listviewadapter [javac] if( cooktales.instance().getapplicationlanguage( ) == applanguageenum.hebrew ) [javac] also repeated public members of application class of android application. here config.txt of proguard: -target 1.6 -printusage unused.txt -optimizationpasses 2 -printmapping mapping.txt # -overloadaggressively -dontusemixedcaseclassnames -dontskipnonpubliclibraryclasses -dontpreverify -verbose -dump class_files.txt -printseeds seeds.txt # -optimizations option disables arithmetic simplifications dalvik 1.0 , 1.5 can't handle. -optimizations !code/simplification/arithmetic # keep classes entry points. -keep...

regex - Django regular expression confusion involving unicode -

we're trying use beautifulsoup through django text extraction. we've got odd bug we've traced down following don't understand. if issue following in standard python prompt: import re print re.match("&#([0-9]+)[^0-9]","&#x00bb;") we output of none , should expected. however, when put code in sgmllib.py (which django calls through long string of calls via our website), python does match this, , returns object. it's appearing though django somehow ignoring x in above string. assume has got related unicode settings, , on, can't seem figure out why django running differently opposed when run code ourselves in vanilla python 2.6 session. why should regular expression above not match when run normally, does match, when django tries it? the 'x' part of string testing. if don't account in regular expression won't match. python working correctly. surprised if django behaves differently, maybe there bug...

actionscript 3 - C++ server doesn't recognize AS3 socket -

well, 3 questions in less 24 hours.but suppose lack of helpful documentation (that can find anyway) gives me no choice. now know security stuff adobes got going, policy file deal , sandbox limitations have juggled around. ive done suggested options changes, allowing network access in as3 project. got server ready spit policy file out instantly upon connection; problem flash/as3 whatever wanna call doesn't see server (or other way around) as3 delays few seconds, documentation if struggling make connection/find policy file, never makes connection period, tries while , gives , spits me access error (because didn't find policy file assumes not allowed on network mad @ me trying... lil stubborn buggers) flash never gets looking for, , server never detects connections (failed or succeeded, nothing) know server because i've tested test client wrote in c++ , talk best friends. so i'm pretty , loss ideas now, thought re-creating winsock classes in as3, don't know...

postgresql - Translate postgres VARCHAR query into ruby activerecord -

i need translate following postgresql query activerecord ruby query. select * my_table (my_time between '2010-12-27 00:00:00' , '2011-01-28 00:00:00') , (my_time::time)::varchar '12:00:00.%'; this pulls out 12:00:00.% piece of data each day. can time range part, don't know how translate second half of query. thanks you use to_char convert timestamp appropriate string form , strip off fractional seconds @ same time: where to_char(my_time, 'hh24:mm:ss') = '12:00:00' ... the activerecord version of pretty simple: mytable.where("to_char(my_time, 'hh24:mm:ss') = '12:00:00'") then chain in existing between check. you use extract check each time component separately: where extract(hour my_time) = 12 , extract(minute my_time) = 0 , extract(second my_time) = 0 ... the activerecord version of be: mytable.where('extract(hour my_time) = ?', 12) .where('extr...