Posts

Showing posts from March, 2010

How to solve for the analytic solution of a recurrence relation in mathematica -

Image
i have recurrence such following: rsolve[{f[m, n] == f[m, n - 1] + f[m - 1, n], f[0, n] == 1, f[m, 0] == 1}, f[m, n], {n}] i tried use rsolve, got error: rsolve::deqx: supplied equations not difference equations of given functions. appreciate help! the difference equation , initial conditions mathematica (7 , 8) not solving it... both , without initial conditions. rsolve expressions left unevaluated in[1]:= rsolve[{f[m,n]==f[m,n-1]+f[m-1,n],f[0,n]==f[m,0]==1},f[m,n],{m,n}] rsolve[{f[m,n]==f[m,n-1]+f[m-1,n]},f[m,n],{m,n}] out[1]= rsolve[{f[m,n]==f[-1+m,n]+f[m,-1+n],f[0,n]==f[m,0]==1},f[m,n],{m,n}] out[2]= rsolve[{f[m,n]==f[-1+m,n]+f[m,-1+n]},f[m,n],{m,n}] i know mathematica uses generating functional methods (probably among other things) solve such recurrences, don't know why fails in such simple case. so let's hand. let g(x,n) generating function f(m,n) now examine sum of f(m+1,n) x^m now solve simpl

android - How to override the enter activity animation if it is stated by launcher -

i tried google search found solution intra-activity animation using overridependingtransition() method. however, there solution if have own animation when application started launcher? thanks lot! you can define animation custom theme. here need. assuming know how use theme, if not separate question. below delete line don't want define own animation , fall default android animation. <!-- goes in theme --> <item name="android:windowanimationstyle">@style/myactivityanimations</item> <!-- standard animations full-screen window or activity. --> <style name="myactivityanimations" parent="@android:style/animation.activity"> <item name="activityopenenteranimation">@anim/activity_open_enter</item> <item name="activityopenexitanimation">@anim/activity_open_exit</item> <item name="activitycloseenteranimation">@anim/activity_close_enter<

mysql - How should I store tags for domain names in a database? -

lets google.com has tags called: search,google,searchengine,engine,web facebook has tags called: facebook,social,networking,friends,community how should store both domain , respective tags in database? you should create 3 tables store stuff: domains: id | name tags: id | name domains_tags: tag_id | domain_id domains: id | name ------------------ 1 | google.com 2 | stackoverflow.com tags: id | name ------------------ 1 | web 2 | lol 3 | facepalm.jpg domains_tags: domain_id | tag_id ------------------ 1 | 1 1 | 2 2 | 3 in sample there 2 tags related google domain , 1 tag related so and each relation need add 1 more record domains_tags store relation between domain , particular tag. this technique named many-to-many as proposed in answer - can add additional field domains named tags , store tags there separated comma, solution weird, since you'll troubles when you'll need have analytics/statistics/s

combobox - wpf listbox checkbox combination, really stuck -

i trying link checkbox , listview together, , use binding method set path object in order set check-box ischecked status in listbox. list<test1> datas = new list<test1>(); var data = new test1 {key = 1, value = "hello", isselected= true}; datas.add(data); data = new test1 {key = 2, value = "hello2", isselected= false}; datas.add(data); what need happen if checkbox checked ( isselected true ) need populate values , when click , unclick checkbox in gui need select proper listeview item can tag property. this code below not set checkbox ischecked. <listbox itemssource="{binding}" name="lstswimlane" width="225" height="125" selectionchanged="lstswimlane_selectionchanged"> <listbox.itemtemplate> <datatemplate> <stackpanel orientation="horizontal"> <checkbox ischecked="{binding relativesource={relativesour

algorithm - What is the most efficient way to find elements in an unsorted list? -

given unsorted list in array, take @ least linear time find number of elements smaller x? if so, why? yes, need examine every number @ least once know if less specified threshold. if numbers not sorted there nothing can infer them.

c++ - How do I use the windows network API in Qt? -

i going put network status icon in gui application. network status notification, trying use windows api. thinking use networkavailabilitychangedeventhandler in application. new programming windows api , framework. can me in following things: can api networkavailabilitychangedeventhandle used in c#? can use in c++ (qt)? which header file must include? (i checked in msdn this. using namespace this. examples in c#. not able understand how implement in c++ code.) i grateful if can give me detailed code snippet using windows event handler, including .h file or namespace included. where did idea use networkavailabilitychangedeventhandler delegate? that explicitly not part of windows api, rather delegate function used .net framework in conjunction networkchange.networkavailabilitychanged event . explains why examples on msdn in c#—because intended used in applications targeting .net framework. if you're writing unmanaged c++ using qt, you're not using .net

iphone - Universal app crashes on iPad simulator at each alternate time -

my app crashes on ipad simulator in alternate builds, crash run crash, etc. objc[1116]: class protocol implemented in both /developer/platforms/iphonesimulator.platform/developer/sdks/iphonesimulator4.2.sdk/usr/lib/libobjc.a.dylib , /users/nga24imac3/library/application support/iphone simulator/4.2/applications/c0ffa7d7-7684-4854-b641-62bd11cfd226/innovations.app/innovations. 1 of 2 used. 1 undefined. 2011-02-09 11:53:01.446 innovations[1116:207] *** terminating app due uncaught exception 'nsinternalinconsistencyexception', reason: '-[uiviewcontroller _loadviewfromnibnamed:bundle:] loaded "padloginscreen" nib view outlet not set.' *** call stack @ first throw: ( 0 corefoundation 0x01286be9 __exceptionpreprocess + 185 1 libobjc.a.dylib 0x013db5c2 objc_exception_throw + 47 2 corefoundation 0x0123f628 +[nsexception raise:format:arguments:] + 136 3 corefoundation

objective c - AutoresizesForKeyboard and Multiple TTTextEditors -

when creating form using three20 components methodology found in this example code , there strange behaviors multiple tttexteditors , uitextfields. fields disappear when touching next 1 enter text. after scouring solution, found else same problem. thought useful see it in his/her words . my code hardly differs example given three20 suspect bug library. have tried self.autoresizesforkeyboard = no; find makes typing in hidden (by keyboard) field impossible. i may have found few lines of code fix it! http://github.com/noahmiller/three20/commit/577af26ed4cd636f152e2321fdc6ab08787452af i found link via message https://github.com/facebook/three20/issuesearch?state=open&q=autoresize#issue/139

Accessing Label inside a Row in JQuery -

i have textbox , labels inside rows of table. access textbox i'm using data= $(this).find('#txtname').val(); now i'm not able access label in same way. label rendered as <label for="total">$65.00</label> how can access label's value , assign value it? it's hard when haven't shown html structure, couple of possibilities: 1) label separate if label separate, this: <tr> <td><label for='txtname'>some field</label></td> <td><input type='text' id='txtname'></td> </tr> ...then given id of textbox txtname , can use attribute selector search label for attribute: var label = this.find("label[for=txtname]"); // if label within `this` // or var label = $("label[for=txtname]"); // find no matter edit : if name of field total , be: var label = this.find("label[for=total]"); // if label within `this` /

Loading numbers into a PHP array - unexpected problems -

i'm trying define array of numbers this: $days_pages = array( 'monday' => array(001, 002, 003, 004, 005, 006, 007, 008, 009, 010, 011, 012, 013, 014, 015, 016, 017, 018, 019, 020), ... ); however, when do: print_r($days_pages); it shows array ( [monday] => array ( [0] => 1 [1] => 2 [2] => 3 [3] => 4 [4] => 5 [5] => 6 [6] => 7 [7] => 0 ************** [8] => 0 ************** [9] => 8 [10] => 9 [11] => 10 [12] => 11 [13] => 12 [14] => 13 [15] => 14 [16] => 15 [17] => 1 ************** [18] => 1 ************** [19] => 16 [20] => 17 i dont understand why happening - doing wrong? if invalid digit given in octal integer

iphone - Get Twitter Posts with Profile Images -

i'm new iphone application development. show comments posted in twitter time , user profile image. have url rss feed twitter. i'm able posts cannot retrieve user profile image. have idea in please me show comments user profile image. suggestions accepted. currently, i'm using url ( http://twitter.com/statuses/user_timeline/19496136.rss ) in advance. i think better idea use twitter api kind of interaction. you can write own "rest client" suggest not reinvent wheel , use amazing mgtwitterenginge provide convenient objective-c api don't have deal rest api directly .

Jar with compressed music with java? -

i've tried add music application i've made. first tried .wav files though became huge application became large upload anywhere. so changed files .mp3 , tried jmf , jlayer though both of them won't work on runnable jars (even if work fine when haven't exported them). so got tips on how play compressed music runnable jar? here's code jlayer, when exported stops working @ f = new file(u.touri()) without throwing exceptions... try { url u = cl.getresource("new beginnings.mp3"); f = new file(u.touri()); } catch (urisyntaxexception e1) { e1.printstacktrace(); } try { fileinputstream fis = new fileinputstream(f); p = new player(fis); p.play(); } catch (exception e) { system.out.println(e); } edit: fixed changing above code to: try { inputstream fis = classloader.getsystemclassloader().getresourceasstream(temp+".mp3"); p = new player(fis); p.play(); } catch (exception e) {

jquery - Cascading dropdown using asp.net mvc -

i have dropdown tradertype on selection should populate dropdown traders. view looks : `<ul> <li> <label> <span class="mandatory">*</span>trader type:</label> <%=html.dropdownlist("tradertype", (selectlist)viewdata["tradertype"])%> <%--<select id="ddltradertype" name="tradertype"> <%foreach (selectlistitem item in (selectlist)viewdata["tradertype"]) { %> <option value="<%=item.value %>"> <%=item.text %></option> <%} %> </select>--%> <span class="tagline">select trader type here<strong></strong></span></li>

java - What's the right design approach for writing an application for both Android and J2ME by maximizing code-reuse? -

most people asking migrating j2me android. i'm not. i'd develop applications , have them work on both android , j2me. each application have android project , j2me project , both source in shared dependent project have common code. i'd know people think right design approach should maximize code reuse (maximize code in shared project). in typical j2me application there controller/model , bunch of views. each view holds reference controller , when user interacts view, view invokes method of controller , controller decides view should displayed next , data should have in it. views don't know each other. expect controller/model code should reusable if written properly. the question is: how 1 controller many views translate android each activity performs subset of whole application? one approach have single activity (the controller code in it). means application have handle (as anyway j2me). means when onaddcontextmenu called have know kind of page being dis

Simple XSLT template -

there xml document: <data>how;many;i;can;tell;you</data> need xml using xslt version 1 : <manydata> <onedata>how</onedata> <onedata>many</onedata> <onedata>i</onedata> <onedata>can</onedata> <onedata>tell</onedata> <onedata>you</onedata> </manydata> how can it? update: output format must xml . this recursive solution 1 of shortest possible : <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform"> <xsl:output omit-xml-declaration="yes" indent="yes"/> <xsl:template match="data"> <manydata><xsl:apply-templates/></manydata> </xsl:template> <xsl:template match="text()" name="tokenize"> <xsl:param name="ptext" select="."/> <xsl:if test="string-length($

flex4 - Flex 4 - Pass data sent by HTTPService object to result handler -

i have data object gets sent post request httpservice object, want able access data object in result handler. best way this? var token:asynctoken = httpservice.send(); token.yourpropertyname = yourobject; asynctoken dynamic object can add properties @ runtime. then, in result handler, acces token : event.token.yourpropertyname

android - Sending a running application to background programmatically -

is possible send activity background programmatically in android? i creating prank application plays funny sounds after specified time (input user). , don't want application visible when playing sound , display should dark. maybe play sound service instead?

javascript - Start loading the second row after the second image on the first row has loaded -

what have second row of image start loading after second image on first has loaded. waits first row load 10 images, how trigger this? this example url http://satbulsara.com/experiment-04/ and code var delay = 200, t = 0; $("#rowone").children('li').css('display', 'none').each(function(){ t += delay; var $li = $(this); settimeout(function(){ $li.fadein(1900); },t); }); $("#rowtwo").children('li').css('display', 'none').each(function(){ t += delay; var $li = $(this); settimeout(function(){ $li.fadein(1900); },t); }); put t = delay * 2; before code second row set initial delay it. var delay = 200, t = 0; $("#rowone").children('li').css('display', 'none').each(function(){ t += delay; var $li = $(this); settimeout(function(){ $li.fadein(1900); },t); }); t = delay * 2; $("#rowtwo").children('li').css('display&

svn - How to find out in a post-commit-hook if the current revision is creating a branch/tag? -

i want write post-commit hook triggers, if current commit creating new tag. tags copied /tags/*new_tag_name*/ directory. motivation is, if commit creating new tag, new tag should checked out in web root directory. how can in post-commit script, have svn name , revision number function parameters? this answered in svn pre-commit hook avoiding changes tags subdirectories comment.

json - GSON parsing android -

this json: { "curs": [ { "id": "aed", "name": "dirhamul emiratelor arabe", "curs": "0.8503", "multiplier": "1", "data": "2011-02-09" }, { "id": "aud", "name": "dolarul australian", "curs": "3.1572", "multiplier": "1", "data": "2011-02-09" } ] } this class: public class curs { @serializedname("id") public string id; @serializedname("name") public string nume; @serializedname("curs") public double crs; @serializedname("multiplier") public int mult; @serializedname("data") public date data; public string getid() { return id; } public void setid(string id

asp.net - Why do subcontrols initialize before their containers? -

despite working webforms years still find myself getting confused event lifecycle time time. isn't problem needs resolving, hoping better understanding of why things work way do. suppose have form: default.aspx: <form> <mycontrols:usercontrol1 runat="server"> </form> usercontrol1:ascx: <mycontrols:usercontrol2 runat="server"> the oninit events occur in order: usercontrol2_oninit usercontrol1_oninit default_oninit isn't bass-ackwards? shouldn't init code run in order controls created? shouldn't parent control able initialize properties of child before oninit runs? is, while can initialize properties of subcontrols in markup, there's no direct way have parent control able dynamically set properties of child control available oninit event. what i've ended doing stuff this: override void usercontrol2_oninit() { namingcontainer.oninit += new evenhandler(usercontrol1_actualinit); } protected vo

jsonp - How to load data from external JSON into carousel -

guys. i've started playing sencha touch , i've hit wall in first attempt create simple app read json file , put content carousel cell (there 6). here code far: ext.setup({ icon: 'icon.png', glossonicon: false, phonestartupscreen: 'phone_startup.png', onready: function() { var arena_zapad = new ext.component({ title: 'arena zapad', scroll: 'vertical', tpl: [ '<tpl for=".">', '<div class="movie">', '<div class="title"><h2>{title}</h2></div>', '<div class="days">{days}</div>', '</div>', '</tpl>' ] }); var refresh = function() { ext.util.jsonp.request({ url: 'arena_zapad.json', callbackkey: 'callback', callback: function(data) { arena_zapad.update(data)

iphone - problem while validation text field after -

i need validate textfield input allows 2 digits after . . eg: if enter 2.333 wont allow if can able allow 2.33 only. for use code - (bool)textfield:(uitextfield *)textfield shouldchangecharactersinrange:(nsrange)range replacementstring:(nsstring *)string { nsarray *sep = [textfield.text componentsseparatedbystring:@"."]; if([sep count]==2) { nsstring *sepstr=[nsstring stringwithformat:@"%@",[sep objectatindex:1]]; return !([sepstr length]=2); } } if use return !([sepstr length]=2) works fine wont allow enter next value. but if remove value text field wont allow modifications. mean there no user interaction. can't able edit. can 1 please me. how can correct this. thank u in advance. the problem code thomas clayson user still can't edit text field anymore when types example: "1234" , after inserts "." between 1 , 2, or if pastes number in textfield. here's better solution: -

c++ - get instant energy consumption -

i looking instant energy consumption, in shell or c++ any ideas ? thanks your question bit more detail, if understand correctly program named joulemeter following way: joulemeter estimates energy usage of vm, computer, or software measuring hardware resources (cpu, disk, memory, screen etc) being used , converting resource usage actual power usage based on automatically learned realistic power models. that 1 way go. if you're doing own project, guess throw hardware measured wall socket , gave data way. maybe exists already.

Running a c++ console app inside a C# console app -

i have c++ console app runs in visual studio. collects data , displays in console raw data. another app (c#) used collect information , present ui. is possible combine 2 putting c++ 1 inside c# 1 both run @ same time 1 service c++ app outputting info panel or similar? thanks! :) a quick example have said earlier this: private void executecommand(string programfilepath, string commandlineargs, string workingdirectory) { process myprocess = new process(); myprocess.startinfo.workingdirectory = workingdirectory; myprocess.startinfo.filename = programfilepath; myprocess.startinfo.arguments = commandlineargs; myprocess.startinfo.useshellexecute = false; myprocess.startinfo.createnowindow = true; myprocess.startinfo.redirectstandardoutput = true; myprocess.startinfo.redirectstandarderror = true; myprocess.start(); streamreader sout = myprocess.standardoutput; streamreader serr =

ipad - iphone paint on top / overlay with event pass through -

i able paint on top of subviews, or in other words: have overlay not block events. far discovered: - instructions in drawrect painted below subviews, - putting transparent uiview on top blocks events. is there trick can try? use transparent uiview on top, , in ib uncheck "user interaction enabled" view, input events go down controls beneath it. or, in code do: uiview *overlayview = [[uiview alloc] init...]; overlayview.userinteractionenabled = no;

cocoa touch - UISlider core data programing -

im working on simple "point based" app. under settings user set´s number of points needed "goodie" using slider. -(ibaction) sliderchanged: (id)sender { uislider *slider = (uislider *) sender; int progressasint =(int)(slider.value +0.5); nsstring *newtext = [[nsstring alloc] initwithformat:@"%d",progressasint]; sliderlabel.text = newtext; [newtext release]; this works fine, how store slider value in core data model, , how make slider show stored value when view loads. hope u can me out :-d hey gerry3 found error. never set tod-object in settingsviewcontroller, with: nsfetchrequest *request = [[nsfetchrequest alloc] init]; [request setentity:[nsentitydescription entityforname:@"todo" inmanagedobjectcontext:_context]]; nserror *error = nil; nsarray *array = [_context executefetchrequest:request error:&error]; if (array == nil) { // deal error... } if(array.count > 0)

c# - Sortable Object Collection -

i'm direction. i need sortable collection of objects can notify when items added / removed collection i'm binding menu items list of windows open in application. could please advise collection type i.e. list<>, observablecollection et cetera , how go sorting said collection. many in advance. this sortable observable collection and here implementation - use 1 in project, works flawlessly (i had extend it implements ilist interface, can used define collections in xaml).

c# - How to filter a grid view with a RadioBUttonList and Where Clausole -

i use c# in asp.net 4. i have gridview , entitydatasource binding database. source db table contains bool column (0,1). i filter result in gridview using radiolist button or similar. adding whereparameters entity set error: string not recognized valid boolean. any idea how solve it? thanks <whereparameters> <asp:controlparameter controlid="uxfiltermessagetypeselector" name="typemessage" propertyname="selectedvalue" type="string" /> <asp:controlparameter controlid="uxfilterisreplied" name="isreplied" propertyname="selectedvalue" dbtype="boolean" /> </whereparameters> <asp:radiobuttonlist id="uxfilterisreplied" runat="server" autopostback="true"> <asp:listitem value="y">1</asp:listitem> <asp:listitem value="f">0</asp:

Solr 1.4 - Spatial search, missing last query object -

recently i've upgraded solr 1.3 1.4 , i'm happy this. faced strange problem , see if have same problem or i'm missing something. i've run query , put in place latitude , longitude, retrieve spatial search (which works). if run query via id, retrieve place schema info, latitude , longitude correct. when run spatial query (with latitude , longitude of place), in xml result don't see place. xml's place: <add> <doc> <field name="id">plc||77173</field> <field name="document_type">place</field> <field name="document_type_content"><![cdata[poi]]></field> <field name="latitude">45.07475</field> <field name="longitude">7.680215</field> </doc> </add> ok, if i'm going query solr "id:plc||77173" (primary key), here xml: <?xml version="1.0" encoding="utf-8"?> &l

asp classic - Vbscript Set myVar = Nothing only errors on localhost -

on server running iis6, vbscript/class asp code such works fine: set myvar = nothing i think should error, variable not dim correctly , using <%option explicit%>. doesn't error. however running same code on local iis5.1 (with visual studio installed), throws error (which should). i'm not worried error (i think should erroring), there reason why error on ii5.1. rather iis6? this still occurs when turn off server-side/client-side debugging on localhost. ok, since don't have answer yet, i'll post thinkings, maybe it'll lead solution. in framework (qtp), every module- or libraryfile attached main script needs have option explicit switch. when forget in 1 of scripts, option explicit switch ignored in parts of script. second, have checked if myvar not public variable somewhere in framework? can test checking vartype , value/objecttype of variable and/or replacing myvar variable name sure of doesn't exist. and maybe tinkered on error

debugging - Is there a way to get the source code filename and line number in Go? -

in c/c++ can use __file__ , __line__ access current file , line number. does go provide similar? indeed does: http://golang.org/pkg/runtime/#caller runtime.caller can used file name/line number of calling functions, too.

how to change timeout for mysql persistent connections -

where defined timeout of persistent connections? possible change it? check out wait_timeout parameter my.ini

standards - What's the aim of not used java keyword? -

as oracle states , const keyword in java. not used . why , what's use of const being non used keyword in java? (the same goes goto ) from java language specification : the keywords const , goto reserved, though not used. may allow java compiler produce better error messages if these c++ keywords incorrectly appear in programs. (this wording in first edition, think.)

CruiseControl email error -

i m getting following error when trying send email gmail account cruisecontrol. javax.mail.messagingexception: 530 5.7.0 must issue starttls command first. appreciate idea resolve this. see if patch helps you. http://jira.public.thoughtworks.org/browse/cc-277

jquery - Uploadify does not display button -

i'm trying make uploadify 3.0 (jquery based file uploading script) work, seems cant. here's how i'm using it: <script type="text/javascript" src="jquery.uploadify.min.js"></script> <script type="text/javascript" src="jquery-1.5.js"></script> <script type="text/javascript"> $(document).ready(function() { $('#file_upload').uploadify({ 'swf' : 'uploadify.swf', 'uploader' : 'uploadify.php', 'cancelimg' : 'uploadify-cancel.png', 'folder' : 'uploads', 'auto' : true }); }); </script> and here's html part: <fieldset style="border: 1px solid #cdcdcd; padding: 8px; padding-bottom:0px; margin: 8px 0"> <legend><strong>uploadify - single , multiple sample</strong></legend> <h2>multiple file auto upload</h2> <p>images only</p&

javascript - $ undefined error -

i'm developing chrome extension , i've got following... $(document).keypress(function(event){ resizedialogiframe(overlaydiv, iframe.contentwindow); }); but when executed i'm getting following error... uncaught referenceerror: $ not defined however, $('form[name="gs"]').attr('action'); working fine elsewhere in page.. what's going wrong? if jquery loaded correctly (?) try pattern make sure $ references jquery object. (function($) { $(function() { $(document).keypress(function(event){ resizedialogiframe(overlaydiv, iframe.contentwindow); }); }); }(jquery)); if doesn't help, check if jquery loaded correctly. thatfore, call alert('jquery' in window); if alerts false , wrong.

Getters, setters, and properties best practices. Java vs. C# -

i'm taking c# class right , i'm trying find out best way of doing things. come java background , i'm familiar java best-practices; i'm c# novice! in java if have private property, this; private string name; public void setname(string name) { this.name = name; } public string getname() { return this.name; } in c#, see there many ways of doing this. i can java: private string name; public void setname(string name) { this.name = name; } public string getname() { return this.name; } or can way: private string name; public string name { { return name; } set { name = value; } } or: public string name { get; set; } which 1 should use, , caveats or subtleties involved each approach? when creating classes, following general best-practices know java (especially reading effective java). example, favoring immutability (providing setters when necessary). i'm curious see how these practices fit in various ways of providing setters ,

google app engine - Parsing atom response from InsertCalendar in Python on GAE (Calendar API) -

using gdata calendar api via app engine in python, when create event there handy little helper methods parse response: new_event = calendar_service.insertevent(event, '/calendar/feeds/default/private/full') helper = new_event.geteditlink().href when create new calendar: new_calendar = gd_client.insertcalendar(new_calendar=calendar) i wondering if there might related methods can't find in documentation (or are--perhaps--undocumented)? i need store new calendar's id in datastore, along lines of: new_calendar = gd_client.insertcalendar(new_calendar=calendar) new_calendar.getgrouplink().href in code, calendar being created, , g returning atom response 201, before using elementtree or atom.parse extract desired element, hoping here might able help. many in advance :) i've never used gdata api, wrong, but... it looks getlink() return link object specified rel. seems geteditlink() calls getlink() , passing in rel of edit link. should able

iphone - Is something leaking from the following code -

my app seems crashing on line (console not give exact idea). program received error signal. please let me know if there leak or other issue in following code...i releasing properties in dealloc method; - (void)viewwillappear:(bool)animated { [super viewwillappear:animated]; self.curr_rep_date = [[nsmutablestring alloc] init]; retrievedarray = [[shared sharedmanager] books]; nsstring *urlstr_replist_curr = [[[nsstring alloc] initwithformat:@"http://xyz.com", [[retrievedarray objectatindex:selectedindex] booknumber]] autorelease]; nsdata* xmldata_replist = [nsdata datawithcontentsofurl:[nsurl urlwithstring:urlstr_replist_curr] ]; replist_rptdt_dict = (nsmutabledictionary *)performxmlxpathquery(xmldata_replist, @"//xx/yy[@rd]"); replist_rpttype_dict = (nsmutabledictionary *)performxmlxpathquery(xmldata_replist, @"//xx/yy[@rt='a']"); nsdateformatter *dateformatter = [[[nsdateformatter alloc] init] autorelease]

android - call an imageView inside my .java class -

<?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#444548"> <imageview android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/image" > </imageview> <textview android:id="@+id/textview01" android:textcolor="#ffffff" android:layout_width="wrap_content" android:text="@+id/textview01" android:layout_height="wrap_content"> </textview> </linearlayout> i m calling textview in .java class this: textview tv1 = (textview) findviewbyid(r.id.textview01); tv1.settext("welcome schogini!"); is there way image too?thanks ya sure.. can create object textview did above,and crea

Copy parts of a buffer in C -

gang, doing wrong, wanting take specific offset + length of data out of file , copy allocated buffer of same length... if( stru_ct->size != 0 ){ unsigned char * s_buffer = malloc(stru_ct->size); if( !s_buffer ){ printf( "memory error!" ); return -1; } fseek( file, wp->stru_ct->offset, seek_set ); fread( s_buffer, stru_ct->size, 1, file ); } there's no compilation error, s_buffer still results in 0 after fread. know there's data @ offset + length. thanks help!! check return values fseek() , fread() make sure they're not failing. never assume call make has succeeded.

asp.net - How to fix ViewState serialization error with my custom control? -

i'm writing first asp.net user control. it displays list of locations user can select from. can load list of locations control, , can see location user selected when page posts back, list lost when page posts back. i populate list object of type ienumerable<detailedlocation> detailedlocation class several string fields. when try put list viewstate, following error: type 'system.linq.orderedenumerable`2 [[detailedlocation, at.common, version=1.0.0.0, culture=neutral, publickeytoken=null],[system.string, mscorlib, version=2.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089]]' in assembly 'system.core, version=3.5.0.0, culture=neutral, publickeytoken=b77a5c561934e089' not marked serializable. certainly, type can marked serializable, error message persists. know must possible make work somehow. after all, can pass object of type gridview , data persist thru postback. how fix this? if you've marked type serializable

linux - Git permission error when pushing to remote with new files only -

i'm pushing remote git repo , following on newly created files remote: error: git checkout-index: unable create file changes existing files accepted, causing issues. ideas? you see problem when use git on case-sensitive filesystem, attempting push changes case-insensitive one. make sure aren't trying commit foo if foo in repository.

javascript - jQuery: How can I detect if the html has changed within a given element? -

in javascript, possibly using jquery, how can detect if html content of given element has changed? i'd able somthing like: $('#mydiv').change(function(){ // stuff }); i trying detect if given elements being added div or if inner html of given elements (such labels) has changed , hide or show div depending on content. any alternative idea how achieve smt appreciated . i hoping won't have revert obscure plugin this! note: needs work @ least in ie8! you can use dom level 3 event domnodeinserted . example: $('#mydiv').bind('domnodeinserted', function(e) { console.log('element: ', e.target, ' inserted); }); demo : http://www.jsfiddle.net/vsgdz/1/ the event fire whenever new node appended element on bind handler.

java ee - DeploymentException while deploying the remote EJB -

i getting exception while running dynamic web project error installing real: name=vfsfile:/c:/jboss-5.0.1.ga_1/jboss-5.0.1.ga/server/default/deploy/bookmartear.ear/ state=prereal mode=manual requiredstate=real org.jboss.deployers.spi.deploymentexception: error deploying bookmartejb.jar: container jboss.j2ee:ear=bookmartear.ear,jar=bookmartejb.jar,name=bookmartbean,service=ejb3 failed resolve persistence unit bookmartejb . . . caused by: java.lang.illegalargumentexception: can't find persistence unit named 'bookmartejb' in abstractvfsdeploymentcontext@26167457{vfsfile:/c:/jboss-5.0.1.ga_1/jboss-5.0.1.ga/server/default/deploy/bookmartear.ear/bookmartejb.jar/} the ejb, ear , web project names mentioned. the persistence.xml looks this: <?xml version="1.0" encoding="utf-8"?> <persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:sche

entity framework 4 - IDbSet and Exposing Include method via Extension Method -

i using code-first approach ef , wanted use idbset instead of dbset unit testing mocks. problem use include() method eager loading necessary include() not exposed via idbset. saw example code using extension method expose include() doesn't seem work me; objectquery object in example null. please let me know how fix this. public static class iqueryableextension { public static iqueryable<t> include<t>(this iqueryable<t> source, string path) t : class { objectquery<t> objectquery = source objectquery<t>; if (objectquery != null) { return objectquery.include(path); } return source; } public static iqueryable<t> include<t, tproperty>(this iqueryable<t> source, system.linq.expressions.expression<func<t, tproperty>> path) t : class { objectquery<t> objectquery = source objectquery<t>; if (objectquer

sql - PTC WindChill query reads deleted links too -

i'm trying query windchill database child parts of given part (assembly). have right this: -- how sql server management studio rewrites oracle join select m1.wtpartnumber component, m2.wtpartnumber assembly, max(wtpartusagelink.amounta7) amount wtpart, wtpartmaster m2, wtpartusagelink, wtpartmaster m1 wtpart.ida3masterreference = m2.ida2a2 , wtpart.ida2a2 = wtpartusagelink.ida3a5 , wtpartusagelink.ida3b5 = m1.ida2a2 group m2.wtpartnumber, m1.wtpartnumber order m2.wtpartnumber, m1.wtpartnumber it works in sense list of every assembly , parts, can later filter when building tree. fine, there's 1k assemblies total. the problem lines deleted windchill (they don't show in windchill web app). realize long shot, there table need join or whether or not include potential child part? i believe should using specific version of part, not part master. the way boms , assemblies handled within windchill, snapshots o

c# - Using TransactionScope in Service Layer for UnitOfWork operations -

is approach right bundle 3 dataprovider.getxxx methods in transactionscope in service layer unitofwork? would different? from transactionscpe ts know concrete connectionstring? should transaction object connection , pass transaction objekt constructor of transactionscope ? service layer administrationservice.cs private list<schoolclass> getadministrationdata() { list<schoolclass> schoolclasses = null using (transactionscope ts = new transactionscope()) { schoolclasses = _admindataprovider.getschoolclasses(); foreach (var s in schoolclasses) { list<pupil> pupils = _admindataprovider.getpupils(s.id); s.pupils = pupils; foreach (var p in pupils) { list<document> documents = _documentdataprovider.getdocuments(p.id);

Android: restart remote service and bind it again -

i have remote service in android. it's binded list activity , sends messages it. service contins scheduled task in it. have preference: refresh interval service. want restart service when user changes refresh interval. butif in onsharedpreferencechanged() loose connection list activity. how can solve it? thanks. i know can use broadcast reciever. there way? i have remote service in android. why? why not local service? the service contins scheduled task in it. why? why not use alarmmanager , service isn't sitting around in ram, watching time pass? all want restart service when user changes refresh interval. why? why not change alarmmanager schedule? if use local service, service can use sharedpreferences , setonsharedpreferencechangelistener() automatically notified of changes in refresh interval.

gnuplot - Simple plot with pgfplots and LaTeX -

i've been searching hour on how draw simple function in latex, example f(x)=x^2. examples i've tried did not work unknown reason, because pdflatex not start gnuplot (the -enable-xxx options not work), found latex package works: pgfplots. problem documentation not contain simple example need. yes, if wanted draw complex diagrams whatnot might find something, simple example of function -- no luck! maybe need new glasses. please, i'd glad simple example of function plot in latex, x , y axis , graph! edit: i've found best solution far, i'm not yet satisfied, example x label in middle. want standard plot without fancy colors or 3d or similar. \begin{tikzpicture} \begin{axis}[ axis x line=bottom, axis y line=middle, xlabel=$x$, ylabel={$x^2$}, xmin=-4, xmax=4, ymin=0, ymax=4, width=0.8\textwidth, height=5cm ] \addplot[mark=noner,smooth,domain=-1:1]{x^2}; \end{axis} \end{tikzpicture} for simple functions don't need gnup

c++ - Cannot find hash_map header under Mac OSX -

#include <iostream> #include <vector> #include <list> #ifdef __gnuc__ #include <ext/hash_map> #else #include <hash_map> #endif the compiler says " hash_map: no such file or directory " need help. thank you. on macosx correct header @ <ext/hash_map> not <hash_map> . here worked fine: #if defined __gnuc__ || defined __apple__ #include <ext/hash_map> #else #include <hash_map> #endif int main() { using namespace __gnu_cxx; hash_map<int, int> map; } by way, prefer use <tr1/unordered_map> .

c# - web service request call SOAP request missing empty parameters -

i'm new both web services , c# please forgive me if question simple. i've searched around cannot find answer -- @ least 1 based on keywords. i trying call web service via c# (visual web developer 2010 express) error response. when call same web service via soapui not error. when compare soap request c# against soap request soapui c# soap request missing intentionally empty parameter <aclobjectid> . when take empty parameter out of soapui request same error. me, answer c# send parameter though empty. tried setting null or "" no avail. there way force c# web service client send empty parameter or perhaps send parameters if not have value? wsdl <?xml version="1.0" encoding="utf-8"?><!-- published jax-ws ri @ http://jax-ws.dev.java.net. ri's version jax-ws ri 2.1.3-b02-. --><!-- generated jax-ws ri @ http://jax-ws.dev.java.net. ri's version jax-ws ri 2.1.3-b02-. --><definitions xmlns:soap="http://schem