Posts

Showing posts from March, 2012

sql - duplicate deletion problem -

i working on database have 2 tables. bill_master (master_table) bill_master_id consumer_no bill_generation (detail table) bill_master_id somehow user has inserted 2 identical consumer #'s in bill master bill_master_id different..here example of bill_master table bill_master_id consumer_no 1 1234567890 2 1234567890 now user has made 1 transaction of bill_master_id "1" , record exists in bill_generation table. what want when pass consumer # in sql statement parameter check if selected consumer# bill_master_id exist in bill_generation or not. if yes count return should 1 else 0. if understand correctly, should want. if (select count(consumer_no) bill_master m inner join bill_generation g on m.bill_master_id=g.bill_master_id consumer_no=1234567890 ) > 1 select 1 else select 0

c# - How to display data in MdiChild forms received from serialport -

sir, created mdi parent form , 3 mdi child forms. each child form contains button. on clicking button new form displayed. mean if click 3 buttons in 3 child form there 3 new forms displayed. fine. my problems : 1- each new form displayed on clicking button shown in taskbar. want each new form(apart mdi child form) mdi child of main mdi parent. 2- these new forms diaplay data received device connected via serialport. how many serialport objects must create? if one, must created, on main mdi parent form or on individual forms(3 new forms) ? if on mdi parent form how can access object in 3 newly opened forms? if on newly created forms there 3 serialport objects accessing same com port result exception stating- "com port not accessible". please reply... passed out graduate , new in c#. please reply can undrstand properly. thanks.... 1) every new form has bool property showintaskbar - set false // create new mdi child // within buttonclick in mainform child...

c - which development software should be used for VLC on mac? -

i want modification , development vlc. download source code, vlc-1.1.5. , written c. development environment should use, xcode or others? thx... i thought vlc developed in qt . see class names starting q? in case developed in qt, qt creator or kdevelop choice of development environment.

jquery - Selecting Text through JavaScript -

i want select text thats on html page , make bold, using following code <script type="text/javascript" > function getselectedtext(){ if(window.getselection){ ; return window.getselection().tostring(); } else if(document.getselection){; return document.getselection(); } else if(document.selection){ ; return document.selection.createrange().text; } } $(document).ready(function(){ $("*").live("mouseup", function() { selection = getselectedtext(); alert(selection); if(selection.length >= 3) { $(this).html($(this).html().replace(selection, "<b>" + selection + "</b>") ); } } ); }); </script> this code works fine when text in 2 different paragraphs/ div or if there link between text doesnt seem work. how make work ? if want kind of highlighting of current selection, using bu...

cck - Drupal: Additional attributes for taxonomy terms -

i need assign dynamic attributes (like entity types) custom content type created. entity types have name , 2 additional attributes. i've not seen way assign additional attributes taxonomy term, think shoud use cck field , make reference in main cck, true? thought typical use-case taxonomy if cannot add attributes not useful me. you use node auto term module (or 1 of several alternatives, nat looks developed), (effectively) turns taxonomy terms nodes, , vocabs content types. means can add fields content type using cck, , add attributes terms. note module (and others perform same function) enforces relationships between vocab , content type, , terms vocab , nodes of type. you can achieve same thing without module if don't need automation or enforcement - create 1 node per term, tagged term, , pull node views access fields.

xamarin.ios - UITableView "Bind()" methods - any tutorials or examples out there? -

i have noticed uitableview comes couple of bind() methods. looks that's alternative implementing uitableviewsource on , on again, or wrong? have samples? other samples of binding interesting, binding textfield model using monotouch. rené the method you're looking @ is: http://developer.apple.com/library/mac/#documentation/cocoa/reference/applicationkit/protocols/nskeyvaluebindingcreation_protocol/reference/reference.html this has nothing uitableview or uitableviewsource data binding.

Convert Text to audio file like .wav or .au in java -

i want create audio file using text. in case tried audiooutputstream , audiosystem.write() methods way audio file created problem in running. if idea helps converting text audio file please write below. thank you. piyush if want make kind of "text speech" you'll need library, handle this. otherwise have lot of work. try project: http://freetts.sourceforge.net/docs/index.php

php - Force Symfony to save the embedForm -

i have symfonyform has embedform. want save embedform if filled if main form empty. user can upload many photos wants 1 foo objekt. dont know how force symfony save embedform ?! schema foo: columns: title: {type: string(255), notnull: true} photo: columns: foo_id: {type: integer} filename: {type: string(255), notnull: true} caption: {type: string(255), notnull: true} relations: foo: alias: foo foreigntype: many foreignalias: photos ondelete: cascade foophotoform: $photo = new photo(); $photo->foo = $this->getobject(); $photoform = new photoform($photo); $this->embedform('newphoto', $photoform); photoform: $this->usefields(array('filename', 'caption',)); $this->validatorschema['filename'] = new sfvalidatorfile(...); action: protected function processform(sfwebrequest $request, sfform $form) { $form->bind($request->getparameter($form->getname()), $request->getfiles($form->getn...

Memory allocation order in c++ -

i've written following code trying solve challenge requests array-like structure without using them: #include <iostream> int main(){ int x = 132,y = 33,z = 87; int *i = &x; std::cout << x << " " << y << " " << z << "\n"; std::cout << &x << " " << &y << " " << &z << "\n"; std::cout << << " " << i-1 << " " << i-2 << "\n"; std::cout << *i << " " << *(i-1) << " " << *(i-2) << "\n"; } i found difference between 2 variables' addresses (&y-&x) -1 , i've adapted code subsequently don't understand why last defined variable allocated "before" (meaning, previous address). i have think &y-&x = 1, honestly. can give me few pointers? (n...

GWT Server Push using Jetty Continuations? -

i'm supposed implement web application user log's in , registers sort of events (in case, alarms). when alarm happens, server needs push alarm of clients. at moment i'm using gwt on client side jetty on server side is implementing server push using jetty continuations idea? requirements are: the number of clients quite small (<20) increase in future alarms must not lost (i.e. if client down, must not miss alarms) if client goes down, other clients need informed (or @ least admin should receive sort of notification, e.g. mail). the main reason using comet (e.g. jetty continuations) is, allows reduce polling frequency. in other words: can achieve same thing without comet, using frequent polling client side. alternative choose depends on characteristics of application - depending on that, each alternative can more or less efficent other! in case, since need notifications when client goes down, makes sense use frequent polling. comet (long polli...

c# - Getting KeyInput in Silverlight -

trying catch keyinput in silverlight application gives me problems because of focus of controls. page consists of multiple controls every time diffent control has focus , keydownevent fails. 1 possibility assing keydown event controls , method processes them. there better way? you catch keydown in page contains controls overriding onkeydown. protected override void onkeydown(keyeventargs e) { // distribute listeners here } this works since controls on page bubbles event upwards if control (like textbox/button etc) doesn't handle keypress parent control gets chance.

oracle - Encryption and Decryption compatibility in C# and PL/SQL -

is there kind of encryption , decryption functions in c# , oracle pl/sql? mean can encrypt string in 1 , decrypt in other? help, i'm not in security algorithm! cheers in oracle, can use dbms_obfuscation_toolkit. if want encrypt , decrypt, might try des encryption. oracle, dbms_obfuscation_toolkit.desencrypt , , c# descryptoserviceprovider (in system.security.cryptography). you'll need use same key of course if encrypting/decrypting between two. also, dbms_crypto intended replace dbms_obfuscation_toolkit believe, , should have various encryption algorithms oracle.

c# - Reflection says that interface method are virtual in the implemented type, when they aren't? -

i have following code in unit test public bool testmethodsof<t, i>() { var impl = typeof(t); var valid = true; foreach (var iface in impl.getinterfaces().where(i => typeof(i).isassignablefrom(i))) { var members = iface.getmethods(); foreach (var member in members) { trace.write("checking if method " + iface.name + "." + member.name + " virtual..."); var implmember = impl.getmethod(member.name, member.getparameters().select(c => c.parametertype).toarray()); if (!implmember.isvirtual) { trace.writeline(string.format("failed")); valid = false; continue; } trace.writeline(string.format("ok")); } } return valid; } which call by assert.istrue(testmethodsof<myview, imyview>()); i want ensure methods interface declared virtual. reason because i'm applying spring.net aspect , apply virtual methods. the problem i'm...

python - Speeding up string splitting and concatenation -

i'm trying solve project euler's problem #35 the number, 197, called circular prime because rotations of digits: 197, 971, , 719, prime. how many circular primes there below 1 million? this solution: import numpy np def problem(n=100): circulars = np.array([], np.int32) p = np.array(sieveofatkin(n), np.int32) prime in p: prime_str = str(prime) is_circular = true in xrange(len(prime_str)): m = int(prime_str[i:]+prime_str[:i]) if not m in p: is_circular = false if is_circular: circulars = np.append(circulars, [prime]) return len(circulars) unfortunately for-loop mighty slow! ideas how can speed up? suspect string concatenation bottleneck, not entirely sure! :) any ideas? :) use set membership testing instead of array. hash lookup o(1) instead of o(n). biggest bottleneck. break out of loop see it's not circular prime instead of trying ot...

visibility - Scala - how to make val visible -

i have method def example(something):something { val c=list() if(){ if(){ val a=list() } else{ val a=list() } } //here or b not declared c:::a } how declare , make visible? i can not use var . you can't make visible outside declaration scope, so, maybe, try this: def example(somthing):somthing{ val c = { if (something) { (0 10).tolist } else { (0 5).tolist } } }

string comparison in c# -

i want compare 2 strings , 1 of them may null string, using stringcomparison.invariantcultureignorecase feature of c#. throws exception in runtime when null string encountered. shall able compare null strings? as options given you, can consider using stringcomparer.invariantcultureignorecase instead. stringcomparer handles nulls without throwing exceptions: using system; class test { static void main() { stringcomparer comparer = stringcomparer.invariantcultureignorecase; console.writeline(comparer.compare("a", "a")); console.writeline(comparer.compare("a", null)); console.writeline(comparer.compare(null, "a")); } }

html - 2 col layout with borders collapses when zooming out with browser -

so have 2 column layout, structured this: html structure: #container #content #side-a .janitor css: #container{ width: 501px; } #content { float: left; width: 300px; border-right: 1px solid black; } #side-a{ float: right; width: 200px; } .janitor {clear: both; } when there no border fine, when add it, layout collapses on zooming out. that's because border width added content width specified. #content 300px, #side-a 200px - that's 500px altogether. #container 501px. without border's, you've 1px still left, but... adding border, 1px, makes #content 300px + 2px wide, #side-a 200px + 2px wide. i'm surprised doesn't collapse when zoomed in. you can fix using: box-sizing: border-box; (with appropriate vendor prefixes).

Twitter Application Token Expires -

i connecting twitter application , fetching oauth token values , storing in database. have found token values expires , each time logs in twitter new token values. i searching offline_access provided facebook. please me out, if has faced same issue. thanks in advance are storing token key , secret or access key , secret? token key temporary , should not need stored in database. used once permanent access key , access secret. see this link full oauth flow. see this link oauth rfc.

convert c# to pure java? -

possible duplicate: is there effective tool convert c# java? i'm not experienced java , have lot of c# translate java syntax become compilable. reason: android , google cloud i know api/platforms have different structures, lets dont need 100% compability, "core functionalitet" translated. gui 1 story of own, i've learned. instead of rewriting every switch-case, rebuild every class etc. nice "map" objects java equals , recompile on android/google platform. i sure there cant translated "c# thing" - every language possible generate .net/mono thought there might java -> .net available , therefore decompiler kinda thing? so there easy ways overcome translation frameworks, sdk or other similar methods take 80-95% of task automatically? have here: jsc . but beside, there c# concepts don't easyli translate java.

asp.net - Persisting Session State via multiple request using jQuery $.ajax() -

just been trying recieve session value multiple jquery ajax requests on same domain name. think understand each request kind of virtual browser request session mutally exclusive each request, there must way how, has solved this. im trying do: i have tries using type: , post still no luck. can please, thanks? first request - stores product id in session $.ajax({ url: 'http://localhost/websitetest/test.aspx?storeproduct=' + productid, type: 'get', async: true, success: function(data) { } }); second request - callback variable "data" recieves product id session $.ajax({ url: 'http://localhost/websitetest/test.aspx, type: 'get', async: true, success: function(data) { var productid = data; } }); there no question send ajax request while accessing session variable asp page. simply can : <% string session_var = session("name_of_session_variable"); %> ...

How to store around 12MB of MP3 files in res/raw folder of my Android 2.3 Project? -

i developing small application in android 2.3 using eclipse 3.4 ide, wish store more 200 mp3 files in res/raw folder of project. wen started android emulator,it stop working showing message in console: "install_failed_insufficient_storage" please tell me way out problem i think error explicit enough. app large in size internal storage. think it's time redesign app. instance can download mp3 file network on demand , save sdcard. btw, if plan support android version > 2.2 can add android:installlocation="preferexternal" manifest file , should rid problem

php - Accessing data from form array with codeigniter -

i have form this <form> <input type="text" name="personal_details[]" /> <input type="text" name="personal_details[]" /> <input type="text" name="pictures[]" /> <input type="text" name="pictures[]" /> </form> with php can access data this $name = $_post['personal_details'][0]; $surname = $_post['personal_details'][1]; etc.. etc is possible task codeigniter input class ? they work same. $personal_details = $this->input->post('personal_details'); $pictures = $this->input->post('pictures'); $name = $personal_details[0]; $surname = $personal_details[1];

SharePoint 2010 custom list view returning items in the list according to criteria -

i new sharepoint 2010 , wondering if possible create view list return specific items. let's items in list have column called status , want show items status="pending" in custom view. possible? one way use content query webpart, see: http://blogs.technet.com/b/seanearp/archive/2009/11/17/content-query-web-part-on-sharepoint-2010-supports-multi-value-lookup-fields.aspx

asp.net - Nested virtual directory or application within sitecore site, is it possible -

i nest asp.net web app within sitecore site, this: <sitecore web root folder> . <virtual directory/app folder> i want access sitecore site using following url: http://<whatever site name> and access web app using following url: http://<whatever site name>/<whatever virtual directory/app alias> is possible? i tried when try access web app (not sitecore) web app complains missing sitecore. believe because have 2 config files ans when accessing web app iis/asp.net processing first sitecore web.config. right, assumption correct. see creating project in virtual directory under sitecore root article more information kind of setup.

c - Are temporary values like operands of arithmetic operators put in the stack? -

i know happens in memory when use arithmetics operators like: int i; = 5 + 3; will values 5 , 3 automatically put stack temporarily (like if static variables automatically created them)? suppose need exist somewhere addition happen, where? what happens when there function call involved? i = 5 + f(3); is argument 3 passed f stored somewhere? , return value of f (say f returns int)? many thanks, your first example evaluated @ compile-time (see http://en.wikipedia.org/wiki/constant_folding ), let's ignore one. in case of i = f(3) + g(5) , compiler has many choices on how implement this, depending on particular platform you're working on. may put things in registers, or on stack, or elsewhere, sees fit.

ASP.NET Wizard control downside -

i in process of evaluating asp.net wizard control. need collect data different steps, validate data , towards end should able show data summary. i know group if has used control , issues faced. there usage limitations control? the wizard control can save lot of plumbing time if use - however, learning use may cost more plumbing time save. if plan reuse it, initial investment in learning idiosyncracies may worth it. i have built wizard in steps displayed in side bar depend on step @ (and on have done point). follows step go when press next or previous determined dynamically. to implement this, read lot of stuff dynamically disabling steps, hiding steps, , adding , deleting steps. latter led me deep water viewstate. worth, here basic approach: you can control steps visible in sidebar setting step id (and title if set) empty string e.g. have step names in arrwizardsteps() , steps defined integer constants, use = intcredentials intadditional_information wizard1...

arrays - What is C#'s most effective counterpart to Delphi's TStringList? -

in our delphi application, use tstringlist store strings , corresponding objects. project, need similar in c#, not sure effective way of doing is. far i've thought of using array list, list, or dictionary. 1 of these effective @ want do? if not, way go? it depends features of tstringlist need. there's not direct replacement. a dictionary<string,object> unordered, , cannot have duplicate strings. there's no text property set strings @ once, etc. if ok you, i'd go that. otherwise, might consider defining little class like: public class item { public string string {get;set;} public object object {get;set;} } and use list<item> . gives ordered list of (string,object) tuples.

c++ - What is the value of private members here? -

if have 2 classes a , b , such b inehrits a . in other words, a base class, , b derived class. now, suppose class a has private members. since class b inherited class a , private data members became part of class b . as know, private members said not accessed derived classes, but, in derived class. value of privacy in case? thanks. they aren't usable in way member functions of b , useful member functions of a , b in turn rely on. it's level of encapsulation ( b shouldn't care how functionality of a implemented).

python - Customizing a Django Form Field in Admin Based on Value -

how customize display of form in django's admin based on form field's value? example, have field default value "0". if field has been set non-zero value, want show additional "edit" link on form, link separate page allowing edit other fields related related model. i've found how customize admin's form template, can't find how access form field's actual value in order add if/else statement in template. i've tried digging through source code, , i've traced field instance django.contrib.admin.adminfield.field->django.forms.boundfield displaying boundfield's field , data attribute doesn't show value stored in default form field widget markup. how access specific field's data value inside template can following? {% fieldset in inline_admin_form %} {% line in fieldset %} {% field in line %} {{field.field}} {% if field.field.value != 0 %}<a href="/some/path/to/model/{{field.value}}...

vim - Using Tabularize plugin -

how can modify this… pt1 = [0, 1, 0] pt2 = [0.588, -0.809, 0] pt3 = [-0.951, 0.309, 0] pt4 = [0.951, 0.309, 0] pt5 = [-0.588, -0.809, 0] …to make this… pt1 = [ 0, 1, 0] pt2 = [ 0.588, -0.809, 0] pt3 = [-0.951, 0.309, 0] pt4 = [ 0.951, 0.309, 0] pt5 = [-0.588, -0.809, 0] …using tabularize plugin ? it's regular expressions , not find 1 works in case. i make this :tabularize /[,[]/l1c0r0c1r0c1r0 the spacing after commas isn't quite right when try peter's suggestion, modified slightly.

javascript - Trouble with Div boxes positioning and sine waves -

right i'm trying have 8 div boxes form sine wave in such way the waves goes through bottom-left , top-right of each div, having trouble doing. here's have far: var divarr = new array(); for(i = 0; <= 8; i++){ var ypos = 50 + 50 * math.sin((i/8) * 2 * math.pi); divarr[i] = os.dom.add_element('div', view, {position: 'absolute', width: '50px', height: yheight+'px', 'background-color': '#000000'}); var yheight = 20; divarr[i].style.left = (i * 50)+'px'; divarr[i].style.top = ypos+'px';

c# - Paging Results .net and the grid concept -

i´ve been checking .net available paging options (telerik, others) , 1 recurrent situation found grid concept refer functionality. grid concept mean, columns , rows (even including column name) giving less design customization possibilities. does know implementation or library .net mvc in order deploy paging results using more fancy design implementations not attached column display idea. brgds, sebastian not totally sure follow trying do..but paging data in grid/column type layout recommend jquery datatables plugin. customizable/flexible. allows styling via css , handles paging, filtering, , sorting among other features. you can learn more plugin here and this great article explaining "server-side processing" asp.net mvc using plugin. hope helps.

css - float: right in IE7 dropping to a new line -

i've been stuck on float issue little while hoping community can me again. have new webform here . usual looks fine in ie7 (or ie8 in compatibility). for reason of containers ending form field on new line below form text. css not strong point, otherwise i'd able fix sure. can tell me missing here? i tried adding float: left form text ended whole other mess. try small change markup: place items float before items without (from same row). should help.

mysql db user host -

access denied user 'root'@'xxxxxxxxxxxxx' (using password: yes) even though have entry in mysql.user table has host % , user root. i did grant privileges on . 'root'@'%'; i need see how trying connect server give additional information. possible call client (or whatever using) munged in way.

mobipocket - I want to write a script to convert my .mobi files to epub -

hey guys/girls, in need of script turn 100+ mobi files epub. using stanza (mac) convert each file 1 one. wondering if tell me how of them @ once. ie. script me. time not issue. don't want sit here , it. found couple of sites allow upload file them , give epub format you. great except allow 1 file @ time well. sorry if not clear. english not first language. thanks. try calibre , allows bulk conversion between many ebook formats , used on pdfs wanted read on kobo.

iphone - Setting ContentOffset of a UIScrollView while Scrolling -

this first question have asked here bear me . i've done quite bit of looking have been unsuccessful in finding solution worked figured i'd toss out here. i using uiscrollview try , display bunch of uiimageviews. i have 20 uiimageviews loaded scroll view @ 1 time. i'm doing @ moment show more 20 photo's have uiimageviews update new uiimages every time contentoffset reached. whenever user scrolls down past contentoffset of 95 offset reset 0 , new pictures loaded. picked number gave illusion of continual scrolling user not see reloading/resetting of view. same thing happens when scroll upwards past 0. my problem when flick uiscrollview (so continues scroll itself) seems if contentoffset not resetting it's supposed be. view resetting , 1 iteration offset 0, in next iteration ( split second later ) offset in 120's or 130's , it's jumping down if i've reached end of next screen. anyone have idea how reset contentoffset while uiscrollview sc...

Is there any concurrency package for C-language? -

i know java , c# both have library package support concurrency programming. know whether or not there library package c? thanks qt qthread pthread mpi (for computations on multiple computers) (more)

c# - Is it possible to use WPF on unix? -

i heard mono project in regards winforms. work wpf? wpf under mono not exist. at point, no group in mono project has plans implement windows presentation foundation apis part of project. the mono team propose using silverlight/moonlight instead: silverlight implement subset of wpf apis , available on windows, macos x , through our own open source effort moonlight available on linux , other unix systems.

winforms - 'System.DateTimeOffset' from assembly 'mscorlib, Version=2.0.0.0 -

Image
my windows form application (created in visual studio 2008 using c#) distributed across our company , runs on 50+ pcs no issues. yesterday, had install on old pc running winxp. visual studio 2008 setup project prompted install .net framework 3.5 sp1. installed that, rebooted, continued installation. after installation, turned old machine off, waited 5 seconds, turned on. when attempted run application, got unhandled exception: "could not load type 'system.datetimeoffset' assembly 'mscorlib, version=2.0.0.0, culture=neutral, publickeytoken=b77a5 ... blah, blah, blah. why didn't 3.5 sp1 install datetimeoffset feature? why application trying load mscorlib version 2.0 ? i did search keyword datetimeoffset , not exist anywhere in project. part of datetime (i.e. datetime.now.adddays(1) )? here's copy of full blown exception: see end of message details on invoking just-in-time (jit) debugging instead of dialog box. ************** exceptio...

Android Database Locking Behaviour -

i still haven't wrapped head around synchronization. know it's there, know why it's used , idea behind it, im lacking practical skill , real world examples understand how works , how it's implemented when several activies trying read/write database @ same time. share objects through application, or system intelligent enough synchronize various objects of same type? perhaps content provider better way go understand has built in sync. i digress though. im still confused on database activity. remember have service running every 60 seconds in background reading same table update function writing to. yes im looking change this, right want understand database handling in android more , work out what's happening. if have loop such as: db = provider.getreadabledatabase(); while(theres_still_work_today) { do_some_calculations; update_database; } provider.close(); this works fine standalone. if try , place in thread, errors galore locking. when run this: ...

What if any source code of a rails project should be obscured even for an open source project? -

this hard 1 search for. if have open source rails web application project source code publicly hosted, on github, information should obscured or swapped if application run in production @ public website? assumption things config/initilizers/secret_token.rb, authentication salting stuff, , database login information should not same in production in development. other precautions should taken ensure production site not vulnerable people fiddling sessions or else not considering? rails-specific sources of sensitive information scrub sensitive information out of: config/environments/*.rb config/initializers/cookie_verification_secret.rb config/initializers/secret_token.rb config/initializers/session_store.rb any files added support third-party libraries, such config/memcached.yml config/database.yml db/seeds.rb any rake tasks in lib/tasks . test/fixtures/* general changes including because think it's list of things keep in mind releasing open-source so...

user interface - Customer Dashboard Pattern -

i'm designing ui account management dashboard has handle immense amount of customers immense amounts of information each customer. i'm researching current ui patterns handle well. what services use handle displaying lots of information well? goal here not straight out copy pattern, learn how/why pattern works specific application.

web services - JQuery Autocomplete asp.net Webservice returning key/value pair -

i have been using example http://www.aspsnippets.com/articles/using-jquery-autocomplete-plugin-in-asp.net.aspx in order return data webservice jquery autocomplete. trying find out there way return key/value pair webservice, instead of returning single string context.response.write(sb.tostring());

iphone - iOS 4.3 Beta 2 Build Issue - Device Only -

i installed 4.3 beta 2 , can't build on device (works fine on simulator). build settings are: base sdk: latest ios (ios 4.3) architectures: standard (armv6 armv7) i getting below errors. missing? error #1 undefined symbols architecture armv6: "_objc_class_$_uiprogressview", referenced from: _objc_class_$_pdcoloredprogressview in pdcoloredprogressview.o .... ld: symbol(s) not found architecture armv6 collect2: ld returned 1 exit status error #2 in /developer/platforms/iphonesimulator.platform/developer/sdks/iphonesimulator4.2.sdk/usr/lib/crt1.o, file universal not contain a(n) armv7 slice architecture armv7 collect2: ld returned 1 exit status command /developer/platforms/iphoneos.platform/developer/usr/bin/gcc-4.2 failed exit code 1 considering ios 4.3 under nda, betas are, won't find here. , offer answer remotely you, breaching nda , thrown out of program. suggestion take apple developer forums, there's private...

c# - align wpf tabcontrol strip -

i'm trying align tabcontrol strip on right. just clear - want tabs on top (tabstripplacement), aligned on right. the headers tabitem 's located in panel of type tabpanel . can add horizontalalignment="right" in resources of tabcontrol <tabcontrol ...> <tabcontrol.resources> <style targettype="tabpanel"> <setter property="horizontalalignment" value="right"/> </style> </tabcontrol.resources> <!--...--> </tabcontrol>

Objective C: Accelerometer directions -

i'm trying detect shaking motion in , down direction this: / \ | ________________________________ | | | | | | |o | | | | | |______________________________| | \ / -(void) bounce:(uiacceleration *)acceleration { nslog(@"%f",acceleration.x); } i thinking it's x axis responds if turn parallel floor. how detect this? i don't have direct answer you, great experiment make quick app spews numbers out onto screen or file (or both). shake way want detect, , see set has greatest change.

Methods call in random order (C#) -

i want write c# program executes several methods a(), b() , c() in random order. how can that? assuming random number generator declared this: public static random rnd = new random(); let’s define shuffle function bring list random order: /// <summary> /// brings elements of given list random order /// </summary> /// <typeparam name="t">type of elements in list.</typeparam> /// <param name="list">list shuffle.</param> /// <returns>the list operated on.</returns> public static ilist<t> shuffle<t>(this ilist<t> list) { if (list == null) throw new argumentnullexception("list"); (int j = list.count; j >= 1; j--) { int item = rnd.next(0, j); if (item < j - 1) { var t = list[item]; list[item] = list[j - 1]; list[j - 1] = t; } } return list; } this shuffle implementation court...

android - app crashes when alert dialog is open and phone(emulator) changes its orientation -

guys i've been searching , studying whole day. app crashes not when dialog open, when spinner open (and i'm sure bunch of other scenarios haven't come across). choosing between onretainnonconfigurationinstance() , onconfigurationchanged(configuration newconfig) won't me. (maybe i'm wrong) - prefer use first one. but want ask: single open dialog box or open spinner have create scratch? way? it's worthless reinitialize big class lot of widgets inside time maybe user changes orientation. plz give me hints , guidance. in advance. edited ::: error code: 01-25 17:56:48.182: error/windowmanager(312): activity xxx has leaked window com.android.internal.policy.impl.phonewindow$decorview@43e63058 added here 01-25 17:56:48.182: error/windowmanager(312): android.view.windowleaked: activity xxx has leaked window com.android.internal.policy.impl.phonewindow$decorview@43e63058 added here 01-25 17:56:48.182: error/windowmanager(312): @ android.view.viewroot...

javascript - Troubleshooting css background-image not loading -

i have code snippet below. expecting div have background logo. it's not happening. js files loaded correctly other parts of page work fine. two questions: 1- using network sniffer don't see request logo.png. possible reasons why? 2- there way know url path browser using without using network sniffer? wanted know if should use ./ or ../ or whatever correct full path. <script type="text/javascript"> $(document).ready(function() { $("#test").css("background-image", "somelongmultilevelpath/logo.png" ); }); </script> <div id="test"> </div> try this: $("#test").css("background-image", "url(somelongmultilevelpath/logo.png)" ); ... assuming image path right.

linux - crontab with php started, but sometimes it doesnt end -

i run cron job runs commandline php script call web service , insert data db 7hrs daily. weird thing never ended. i checked , had ensure if exception caught, should still continue end of script. if there's error in script, run.html should show me error. my crontab running bash script runs below every 7 hrs php run.php >> "run.html" the situation sometimes, run.html doesnt has written . 0 bytes. when running, has pid tied process. after 7hrs when nothing written in run.html, checking process again (using command ps -eo pid,lstart,etime,cmd | grep php ), realise process gone. i not time timeout issue there no error shown on php_errors.log , , i've set in script ini_set ("memory_limit",0); what other causes be? depending on hosting webserver, it's entirely possible admin either rebooting server or straightforwardly killing long running process. (perhaps he's mistaking zombie?) i've done lot of work on sites h...

multithreading - VB.NET Do I need multiple SyncLocks if I want to lock multiple things? -

vb.net 2010, .net 4 hello all, my question is, imagine have 2 list(of t) objects , subroutine in multithreaded environment modifies both of these objects. don't understand locks well, i'm unsure whether can do: synclock ctype(list1, ilist).syncroot list1.clear() list2.clear() end synclock or must i: synclock ctype(list1, ilist).syncroot synclock ctype(list2, ilist).syncroot list1.clear() list2.clear() end synclock end synclock ? insight? on right track? comments appreciated. thanks lot in advance, brian first, bad practice lock on non-private object, else might lock on it, , things go downhill there, instead lock on private member object, like class class1 private lockobject new object public sub clear() synclock lockobject ... end synclock end sub end class now, actual question: unless every operation modifies both lists (doubtful), should have 1 lock per list. while possible use 1 l...

vsto - Need to find the name of the current file in excel addin -

i have excel addin 2003 excel. add in adds menu command excel menu. what requirement that, when click on menu command need send name of current file different process... how obtain information.. please me sandeep if you're in addin, try string currentworkbookfilename = this.application.activeworkbook.name (if not think there global, globals.application or globals.thisaddin.application instead)

ruby on rails - Changing the sign_in url for Devise -

how change sign in path devise when using before_filter :athenticate user? i have following in posts controller. eg: class postscontroller < applicationcontroller before_filter :authenticate_user! def index @posts = post.all end end at moment automatically goes '/users/sign_in' i'd use '/login' sorted folks, using devise_for method. devise_for :users, :controllers => { :registrations => 'registrations' }, :path => 'accounts', :path_names => { :sign_in => 'login', :sign_up => 'new', :sign_out => 'logout', :password => 'secret', :confirmation => 'verification' } so sign_in path 'accounts/login'

functional programming - Scheme - define variable as the result of a function? -

the beginning of 1 of programs results in error. problem area. trying define variable result of recursive function. (define (test n) (define (a1func i) (if (= 1) 0 (+ (/ 1 i) (a1func (- 1))))) (define a1 (a1func (- n 1)))) if give (test 10) error be: procedure application: expected procedure, given: #<undefined> ; arguments were: 9 i assumed done in scheme?? ideas? in pure fp languages computations done passing parameters functions, return values result. bind result of test in function called test : (define (test n) (define (a1func i) (if (= 1) 0 (+ (/ 1 i) (a1func (- 1))))) (a1func (- n 1))) (define (calltest x) (define (r (test (+ 2 x)))) (- r 4)) variables bound once , cannot changed. function must return value, result of expression, (define a1 (a1func(- n 1))) rather definition, not expression, correct code be: (define (test n) (define (a1func i) (if (= 1) 0 (+(/ 1 i) (a1func(- 1))))) ...

php - offline browsing for moodle -

here in srilanka don't have internet facilities, using moodle in our universities,but when go home there no way browse net, question is, there capability of moodle browsed offline?? idea develop such component able download necessary files course module , browse offline in our homes? should start if i'm developing such kind of thing? i'm referring moodle documentation now.. moodle documentation please guide me on this, because helpful lots , lots of university students here in srilanka! regards, rangana for information i'm publising have found, there website called http://www.jolongo.net/ , offline browsing moodle available , here uses adobe air

Ways to improve foll. Java code -

any ways improve foll. code block : public class myunits { public static string millseconds = "milliseconds"; public static string seconds = "seconds"; public static string minutes = "minutes"; public static string hours = "hours"; public int quantity; public string units; public myunits(int quantity, string units) { this.quantity = quantity; this.units = units; } public string tostring() { return (quantity + " " + units); } // test code public static void main(string[] args) { system.out.println(new myunits(1, myunits.millseconds)); system.out.println(new myunits(2, myunits.seconds)); system.out.println(new myunits(3, myunits.minutes)); system.out.println(new myunits(4, myunits.hours)); } } any appreciated. the static ints should final. usual modifier "constant" in java is public static final <...

remove a PART of an Anchor Text with jquery or javascript -

i'm trying remove or change part of anchor text. my anchor this: <a href="http://something.com">model 1234 motorbike</a> i remove "motorbike" part of anchor text, end with: <a href="http://something.com">model 1234</a> anyone know how this? thanks update: the anchor links coming different website. can't control html. i'm trying remove "motorbike" part anchors sent, doesn't show 100 times on webpage. @shiv kumar: yes, "motorbike" last part of anchor text. @phrogz: script sending available models site. last part of anchor text "motorbike", first part changes: model 1234, type 4321 etc. but give codes try first. thanks quick replies. much appreciated. erik a) modify html sent browser, don't try patch on client. if user has javascript turned off? b) // rid of last word in text anchors referencing // domain something.com $('a[href*="som...

Elegant way to modify a list of variables by reference in Python? -

let's have function f() takes list , returns mutation of list. if want apply function 5 member variables in class instance (i), can this: for x in [i.a, i.b, i.c, i.d, i.e]: x[:] = f(x) 1) there more elegant way? don't want f() modify passed list. 2) if variables hold simple integer (which won't work slice notation), there way? (f() take & return integer in case) another solution, though it's not elegant: for x in ['a', 'b', 'c', 'd', 'e']: setattr(i, x, f(getattr(i, x)))

iphone - Preventing view from unloading in iOS SDK? -

i've built app uses uitableview inside uinavigationcontroller, inside uitabbarcontroller. every entry in uitableview opens view contains basic text, buttons, importantly, mpmovieplayercontroller plays audio when started. user can click mpmovieplayercontroller , continue browse around rest of app (different tabs, or moving in navcontroller, opening other views tableview) , continue hear audio. i'd user able return view active mpmovieplayercontroller @ time. understand how go allowing user return view view, i'm struggling how prevent view being reloaded when user tries accessing same view. is there way can save view in memory? or save active mpmovieplayercontroller type of global object, can @ least access anywhere? i appreciate , help. thanks! i'd recommend create property mpmovieplayercontroller in app's uiapplicationdelegate (which can access anywhere in code [uiapplication sharedapplication].delegate need cast uiapplicationdelegate subclass). ...

c# - Asp.Net MVC Model with related drop downs -

i building screen in c# asp.net mvc application, has few related drop downs.so, example, select 'category', , 2nd drop down should display related sub categories selected category. so, model contain list, used build category drop down, , list, empty. on selection of category, need post back, passing id if selected category, populate list<> sub categories... , build sub category drop down? hopefully can assist design of model. model have quite few non-list related data item being edited. , think model need 'categoryselectedid', know selected? the nicest way use ajax this. you'll have hook change event first select box, , once changed, you'll ajax request selected value action . action return json list, parsed , put in next select box . update the model json returning action can anonymous type really, or ienumerable of selectlistitem . use linq : `mycollection.select(item=> new selectlistitem() { name = item.name, value = item.id....

Firefox counterpart to Google Chrome - Developer Tools (timeline) -

os:winxp is there plugin ff3 can same chrome developer tools - timeline - showing loading time chart? due compatibility issue, need debug under ff3 see full functionalities. please advise, thanks. firebug

jquery - Select Unselect multiple select fields -

i have multiple select fields following: <select class="projects" id="projects" multiple="multiple" name="projects[]" size="10"> <option value="1">project 1</option> <option value="2">project 2</option> <option value="3">project 3</option> </select> i have feature after user selected, if user click somewhere else, selected options going "unselected", how implement feature in jquery? try using .focus() or .focusin()/.focusout(), respectively. http://api.jquery.com/?s=focus

winforms - Setting max date in .NET DateTimePicker causes drop down calendar to show wrong date -

if use .net datetimepicker maximum date set earlier date today when user clicks button calendar drop down calendar defaults first day of current month instead of day selected in control (as correct behaviour). i believe happening due fact control can't find todays date in available date range. please confirm if true , possibly give me work around? same behaviour here, looks bug me. far, no workaround unfortunately.

XCode automatically generated comments? -

every time when create new file in xcode, makes comment @ top of file. has changed somehow - dont know why , how reset this. its this: // // [filename.cpp] // [projectname] // // created [name] on [date] // copyright 2011 [company]. rights reserved. // but first this: /* * [filename.cpp] * [projectname] * * created [name] on [date] * copyright 2011 [company]. rights reserved. * */ so there setting, can reset style of auto generated comments? can change this? on default installation, directory "/developer/library/xcode/file templates" has new file templates.

A javascript number type question -

why 1.tofixed(2) syntax error while var = 1; a.tofixed(2) won't. moreover, why 1.1.tofixed(2) run alright? 1. starts float 1.tofixed() incorrect syntax. use (1).tofixed() though. 1.1.tofixed() works fine because after 1.1 in float parser won't take . beginning of float object method call.

c - Problem with automake and linking -

so, after spending couple of hours of manually configuring autotools, managed create makefile project. problem? gives me problems linker. let me explain better: have project divided in several subprograms, of linked main program, main.c. problem while can compile gcc, make gives me dreaded collect2: ld returned 1 exit status error, naming undefined reference main reason. now, know it's linking error, , proof of compile files without linking them adding -c among cflags in makefile.am. knew that, guess. my question is: should add makefile.am (the 1 inside src folder, guess?) file in order let link files 1 , not separately, linker find entry point in main.o? basically, equivalent of running "gcc program1.c program2.c main.c". know automake because builds files progressively, 1 @ time, , know it's dumb question it's driving me crazy anyway. it's first time use autotools, me make not last! if foo program's name , you're not doing fancy, ...

c - MPI_Recv: Receiving a different size than the one Sent -

i writing program check shortest path using mpi library. there 2 scenarios: either found better path, in case first slot of buffer state resultbuff[0] = 1 , need go on rest of contents of buffer better path. other case resultbuff[0] = 0 , , won't excpect values in other cells of buffer. is possible me use separate mpi_isend calls: in case found better path , stored in resultbuff[1] resultbuff[10] : mpi_isend((void*)sendbuff, 11, mpi_int, 0, 1, mpi_comm_world, &request); in case didn't found better path: mpi_isend((void*)sendbuff, 1, mpi_int, 0, 1, mpi_comm_world, &request); and in both cases i'll use mpi_recv( (void*)resultbuff, 11, mpi_int, mpi_any_source, 1, mpi_comm_world, &status); to receive result. will work? if does, save communication costs if don't send better path? note: resultbuff of size 11. yes, can this. mpi standard , man pages mpi_recv, "the count argument indicates maximum length of message;...

Zend Framework (PHPUnit) Tests won'r run (phpunit: command not found / Class 'PHPUnit_Framework_TestCase' not found) -

i installed phpunit book: sudo pear channel-discover pear.phpunit.de sudo pear install phpunit/phpunit the include path added in /etc/php5/cli/php.ini include_path = ".:/usr/share/php" $ ls /usr/share/php/phpunit/ extensions framework but now, if want run tests zend framework user@server:/var/www/page/tests$ ./runtests.sh + phpunit --verbose alltests ./runtests.sh: line 72: phpunit: command not found user@server:/var/www/page/tests$ php alltests.php php fatal error: class 'phpunit_framework_testcase' not found in /var/www/page/tests/zend/acl/acltest.php on line 37 of course phpunit: command not found when try follow instructions in phpunit manual http://www.phpunit.de/manual/3.6/en/writing-tests-for-phpunit.html outside of zend framework context. i'm getting feeling i'm missing essential here ... solved looks there problem pear channels, after adding other 2 again, worked: pear channel-discover components.ez.no pear channel-discov...

iphone - didRegisterForRemoteNotificationsWithDeviceToken - Push Notifications -

i wanted confirm "didregisterforremotenotificationswithdevicetoken" meant called everytime application loads , php server or application needs deal whether or not resubmit store in database? or there missing? thanks james first, not meant call method directly. rather, should call registerforremotenotificationtypes: on every launch of app in turn calls application:didregisterforremotenotificationswithdevicetoken: must implement. second, yes, supposed resubmit token server every time. documentation: by requesting device token , passing provider every time application launches, ensure provider has current token device. if user restores backup device other 1 backup created (for example, user migrates data new device), or must launch application @ least once receive notifications again. if user restores backup data new device or reinstalls operating system, device token changes. moreover, never cache device token , give provider; token system whenever need ...

php - PHPunit test not following through after ZF form validation -

Image
i'm brand new phpunit testing. can me on how test lines below in image. so far test is: public function testcansendemail() { $formdata = array( 'subject' => 'test subject', 'email' => 'test@mail.com', 'message' => 'test message', 'name' => 'test name'); $this->request ->setmethod('post') ->setpost($formdata); $this->dispatch('/contact'); $this->assertaction('win'); i under impression if validation succeeded follow through whole action? can please explain happening here, , correct test such action. the obvious explanation $form->isvalid returns false . the coverage report shows if block valid form never got executed. instead, else block executed. thing need find out why , eliminate cause. use debugger , step through execution flow see happens @ runtime. as altern...

java - efficient db operations -

here scenario researching solution @ work. have table in postgres stores events happening on network. way works is, rows inserted network events come , @ same time older records match specific timestamp deleted in order keep table size limited 10,000 records. basically, similar idea log rotation. network events come in burst of thousands @ time, hence rate of transaction high causes performance degradation, after sometime either server crashes or becomes slow, on top of that, customer asking keep table size million records going accelerate performance degradation (since have keep deleting record matching specific timestamp) , cause space management issue. using simple jdbc read/write on table. can tech community out there suggest better performing way handle inserts , deletes in table? i think use partitioned tables, perhaps 10 x total desired size, inserting newest, , dropping oldest partition. http://www.postgresql.org/docs/9.0/static/ddl-partitioning.html this mak...

php - A way to make html form disappear? -

what recommended or efficient way (least code/fastest) make html form dissapear page once submit button has been pressed , put in place output of .php file? use ajax, jquery http://api.jquery.com/jquery.ajax/ create div response (#response_content), , in callback of function like $("#form_id").hide(); $("#response_content").html(data);

android - TextView with drawableTop and textcolor -

this textview. has image selector on top. <textview android:id="@+id/icon_live_ticker" android:layout_width="100dp" android:layout_height="wrap_content" android:drawabletop="@drawable/selector_live_ticker" android:gravity="center" android:textappearance="?android:attr/textappearancemedium" android:textstyle="bold" android:textsize="10dp" android:text="@string/text_icon_live_ticker"> </textview> the problem is, if set textcolor, there no state changes of image selector see anymore. can explain why happen? and solution is, use color-selector textcolor <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_pressed="false" ...

html - Is a iframe src requested from the user's ip address or the website servers ip address? -

is iframe src requested user's ip address or website servers ip address? i suspect users ip, can confirm? thanks, dane iframe content requested user side (e.g. browser). p.s. website server request content if doing sort of server side include (which has nothing iframes feature of web frameworks depending on web server , framework itself). example of ssi include directive or embper's execute() . in case user's browser wouldn't see included url, content included html server.

jquery - Auto Upload Files When Added to a Folder -

i wondering how file automatically upload when added folder on computer. simliar dropdox when add new file folder on desktop automatically recognize start , upload in background , and place on server?? i have been googling point me in right direction on how learn , technology used i.e ajax php jquery. i understand quite broad question want find right places start:) any please. you can use linux server's cronjobs. cronjobs scheduled tasks. have code script checks folder , if there new file, uploads it. , have run script every (for example) 5 minutes , via cronjobs. but computer must open, always. , i'm not sure, can list local folders. maybe can use technologies this.

api - Is there a programming interface / web service for getting Amber Alert information? -

i'd programmatically gather information amber alerts , display in application. however, can't seem find api. 1 exist? i care nj entire country useful too. you can use following site retrieve rss feed disseminate data want. not perfect "api" per se, should work! not official amber alert feed, rather missing children alert nation center missing , exploited children http://missingkids.com/missingkids/servlet/pageservlet?languagecountry=en_us&pageid=1790

python - HTTP Error 400 when trying to send json data with urllib2 to toggl api -

when using following code connect toggl api connect , authorised fine. username = token password = 'api_token' url = 'http://www.toggl.com/api/v3/tasks.json' req = urllib2.request(url) auth_string = base64.encodestring('%s:%s' % (username, password)) req.add_header("authorization", "basic %s" % auth_string) f = urllib2.urlopen(req) response = f.read() when try start new task have send data in json format. test, created json object , added data request object data = simplejson.dumps({ 'task':{ 'duration': 1, 'billable': true, 'start': '2010-02-12t16:19:45+02:00', 'description': 'this test task', } }) req = urllib2.request(url, data) but response recieve "urllib2.httperror: http error 400: bad request". can please point me going wrong? according api documentation , you're missing @ least header. try: req = urlli...

PHP simple text database with SQL syntax -

i looking simple text flat database can work sql-like instructions selct, input, update, delete. there database satisfies me, perl - http://metacpan.org/pod/sprite need that, php class. thank in advance! use sqlite . has php class here: http://www.phpclasses.org/package/2107-php-sqlite-database-access-wrapper.html

Java Connector Architecture and TCP/IP -

so basic question here is: how build tcp interfaces java ee applications ? instead of interacting legacy eis, need interact block of tcp/ip ports. ideally, i'd message-driven bean have it's onmessage method invoked incoming tcp request , able respond on same connection. jca seems general enough capable of within java ee environment. developing custom connector appropriate technique integrating inbound/outbound tcp interfaces in java enterprise ecosystem? as far i've tried far: we're utilizing lifecycle module starts kicking off number of tcp listeners; invokes message-driven bean calls business method, , returns on same tcp stream. working alright, lifecycle support in application server (glassfish) feels has been added afterthought. so, jca seems first-class solution sort of problem , seems enable communicate on tcp. however, initial research we've conducted, seem connector architecture 'targeted' towards legacy information systems, not generali...

iphone - MapView Custom annotation drop -

i trying create custom annotation map. problem have , can't make annotation drop 1 after other. pins drop down @ same time. here delegate code didaddannotations. can me rewrite code can make custom annotations drop 1 after other..just happens when use default annotations. in advance....!!!! - (void) mapview:(mkmapview *)mapview didaddannotationviews:(nsarray *)views { cgrect visiblerect = [mapview annotationvisiblerect]; (mkannotationview *view in views) { cgrect endframe = view.frame; cgrect startframe = endframe; startframe.origin.y = visiblerect.origin.y - startframe.size.height; view.frame = startframe; [uiview beginanimations:@"drop" context:null]; [uiview setanimationduration:1]; view.frame = endframe; [uiview commitanimations]; } // end of } // end of delegate you add delay becomes little longer in each iteration of loop, this: double delay = 0.0; (mkannotationview...