Posts

Showing posts from January, 2010

c# - Minimize lag when using System.Speech.Synthesis -

i playing using tts built .net 4 , want speech happen immediately, instead encountering lag between when call speak , when audio. i developing simple count-down timer calls off last 5 seconds , completion (5... 4... 3... 2... 1... done), when screen updates new time, tts lags behind, getting worse every invocation. tried using speakasync, made worse. currently, speak being called outside ui thread (in timer tick event handler). is there way minimize lag, such pre-computing speech , caching or creating kind of special tts thread? i somehow read past api call needed @ least hundred times. looking speechsynthesizer.setoutputtowavestream . memorystream stream = new memorystream(); speechsynthesizer synth = new speechsynthesizer(); synth.setoutputtowavestream(stream); synth.play(text); stream.position = 0; soundplayer player = new soundplayer(stream); player.play(); this code use tts turn text wav file streamed stream. need reset position of memorystream when creat...

c - GtkTextView can't wrap line -

hello i'm using gtk on c, need have gtktextview in middle of window many other widgets, can't make widget wrap lines. annoying behavior, have idea of missing? code i'm using set it's properties: gtk_text_view_set_left_margin(gtk_text_view(commentstextview),20); gtk_text_view_set_right_margin(gtk_text_view(commentstextview),290); gtk_text_view_set_wrap_mode(gtk_text_view(commentstextview),gtk_wrap_word); gtk_text_view_set_pixels_inside_wrap(gtk_text_view(commentstextview),0); gtk_widget_set_size_request(commentstextview,300,300); edit: i solved in different way, still problem remains unsolved :s did put text view gtkscrolledwindow ?

sql server - Does Transact-SQL have a similar function to MS Logparser Quantize? -

if familiar microsoft log parser recognize quantize function truncate value nearest multiple of value. quite handy grouping date-time fields increments. date-time count 1/1/2010 00:00 100 1/1/2010 00:15 134 1/1/2010 00:30 56 .... i'm trying find similar function in transaction-sql (specifically sql server 2005 or 2008) allow me similar grouping on date-time. not directly, doesn't. can group function (that write) rounds datetime column nearest quarter-hour (or whatever quantize does). select dbo.quarterhour(datecolumn) date-time , count(*) count mytable group dbo.quarterhour(datecolumn)

c - Easiest way to read this line of text into a struct? -

i have text file data in form: lee aus 2 103 2 62 true check aus 4 48 0 23 false mills aus 8 236 0 69 false i need each line struct like, i'd avoid using fixed length arrays (the problem fgets far can tell): struct data { char *sname; char *country; int *a; int *b; int *c; int *d; char *hsisno; }; i new c. should use fscanf, or fgets? fscanf stands "file scan formatted " , user data unformatted can get. you should never use naked "%s" format strings on data don't have absolute control on can read. the best solution use fgets read line since allows prevent buffer overflow. then, once know size of line, that's maximum size of each string require. use sscanf heart's content actual fields. one final thing. it's bit wasteful having int* types integers, since know have specific maximum size already. i'd use non-pointer variant, like: struct data { char *sname; char *country; i...

android - Getting list item index -

other using listeners, there way can index of item in list? if using 'getcheckeditemposition' dont forget set choice mode single in order ensure 1 item can selected @ time. ie via getlistview().setchoicemode(listview.choice_mode_single); and answer question : yes , can used without listener.

mysql - How to lock a single row -

i have user table field lastusedecnumber . i need access , increment lastusedecnumber . during accessing time need lock particular user row (not entire table). how do this? the table type myisam . mysql uses table-level locking myisam tables. if can, switch innodb row-level locking. here's link mysql site describing locks set sql statements innodb tables. http://dev.mysql.com/doc/refman/5.0/en/innodb-locks-set.html

gcc - Running a compiled C program on a shared hosting account? -

is possible run compiled program on shared hosting account?i dont think have permission run gcc, can compile elsewhere , download - work? yes work in cases, long can match system libraries / link statically. anyway, banned :-) ps. try vps, it's cheap , have no such embarassing restrictions.

c++ - List of boost::Unique_Ptr objects -

why can not this? typedef boost::interprocess::unique_ptr<queuelist, queuelistdeletor> uqlist; typedef boost::intrusive::list<uqlist> list; // compiler (vs 2003) complains the queuelist class derives public boost::intrusive::list_base_hook<> make part of intrusive linked list. i want use unique_ptr able pass around object between threads , have 1 single thread have ownership of object @ time. edit: errors: error c2039: 'pointer' : not member of 'boost::intrusive::detail::default_list_hook' see declaration of 'boost::intrusive::detail::default_list_hook' see reference class template instantiation 'boost::intrusive::list_impl' being compiled [ config=boost::intrusive::listopt::value_traits,boost::intrusive::size_type::pack>::type,boost::intrusive::constant_time_size>::type>::size_type,true> ] error c2039: 'const_pointer' : not member of 'boost:...

java - Tiles2 group all the scripts inside a ¿definition? -

i'm using struts2+tiles2, , following. have baselayout, define menu, body, etc this: <tiles:insertattribute name="menu" /> <tiles:insertattribute name="body" /> and in tiles.xml set them this: <definition name="/index" extends="baselayout"> <put-attribute name="title" value="/public/menu.jsp" /> <put-attribute name="body" value="/public/index.jsp" /> </definition> so, times have more complex layouts can use several jsp in body, , of jsp have inline scripts. know if there way can set these inline scripts appended on same place. example, define page head in baselayout, , have inline scripts appended head. hope there way this, find tiles documentation confusing , haven't discovered way this. thanks! in tiles1 i've done stuff this: baselayout.jsp <html> <head> <tiles:getasstring name="appendedfil...

database - Command to get identity of newly inserted record in Interbase 2007 -

in interbase (i'm using 2007, don't know if matters) there command identity of newly-inserted record, similar scope_identity() in sql server? no, interbase doesn't have identity feature. what interbase has, instead, generator feature. generators kind of identity, logically separated primary key column. generator, in other words, give guaranteed unique value, value you. you use value primary key values single table, or multiple tables. assigning primary key value must yourself. in addition not having feature scope_identity , interbase not have kind of feature return values insert statement. not can not generated primary key value insert statement, cannot other values, such values set trigger. workarounds one possible workaround generate primary key value in advance. following (i'm going use interbase stored procedure syntax example, since don't know programming language using, can same thing in programming language): declare variable id int...

encryption - How would you make a simple cipher for an integer in rails? -

i have integer output private controller action store 'encrypted' in database. methods use codify integer such can retrieve ~200 of these numbers , served in view right user? have @ http://github.com/spikex/strongbox

testing - c program code for testcases -

i have asked write c program hdmi edid test cases in set top box....i new c programming..i dont know how write c program testing set top box respond kind of resolution...that means set top box have convert sourse signal resolution display device resolution....if know small idea it useful me are coding program run on set top box? if so, need cross compiler target. you need find out how upload compiled binary set top box , how make execute there. you need find out os, if any, set top box runs (commonly embedded linux) , cpu uses. (ppc common in chinese dreambox clones, arm popular. have seen mips too.) one way of getting cross compiler use cross tool dan kegel.

oracle10g - Load a structured text data file using only one control file -

i have text file need loaded have structure (badly, don't have permit change): mm/dd/yyyy 24hh:mi:ss no_of_rec emp_id,empname,salary ..... ex: 12/24/2010 20:30:10 number_of_datarow_below e0001,smith,5000 e0002,john,7000 e0003,kewell,9000 into 1 table: emp(isheader, head_data_time, no_of_rec, emp_id,empname,salary) columns data type can flexible. expected load result: isheader head_data_time no_of_rec emp_id empname salary 1 12/24/2010 20:30:10 3 2 e0001 smith 5000 2 e0002 john 7000 2 e0003 kewell 9000 my solution: using 2 control files:    1. first load header (using option load=1 , truncate mode).    2. second load rest of data (using option skip , append mode). is there resolving way use 1 control file? ...

jquery - Change FORM element to something else or delete it while keeping all child elements -

i've integrated asp.net mvc sharepoint site. works great. i'm using default sharepoint master page ( ~masterurl/default.master namely). problem particular master page has whole page wrapped in form element while sharepoint pages normal asp.net webform pages. my mvc content should have it's own form , input elements i'd submit server. ajax calls not problematic. i'm not able use $("form").serializearray() if keep original form element. nonetheless normal postbacks problematic, since there's webform functionality on submit events , send way data server. i using normal postbacks ajax postbacks. main problem being normal postbacks. so have 2 possibilities both should run on $(document).ready() : delete form element , keep other content is. in jquery mean prepend form element div , move content div , delete form . directly change form element div . faster in terms of browser processing, don't know how it. so if can elaborate so...

How to convert a String to a unique INTEGER in php -

how can convert string(i.e. email address) unique integers, use them id. the amount of information php integer may store limited. amount of information can store in string not (at least if string isn't unreasonably long.) thus need compress arbitrary-length string non-arbitrary-length integer. impossible without data loss. you may use hashing algorithm, hashing algorithms may have collisions. if want hash string integer collision probability pretty high - integers can store little data. thus shall either stick email or use auto incrementing integer field.

.net - How can write a C function in a C# code -

i want add c file .net application. how can built this? how can write unmanaged code in c#. can explain few lines code. thanks you either have build c file it's own dll , use p/invoke in c# code call them or... you try port c code c# give managed codebase.

symbian - bld.inf not found error in carbide.c++ using qt -

i trying build qt gui main window project , following errors: bldmakeerror:can't find "\symbian....\bld.inf bldmake returned exit value=1 in last 2 days, i've re-installed above apps many times following installation guides; setting environment variables nothing worked out. kindly i've been able build helloworld program. thanks in advance. bld.inf gets generated qmake .pro file. have run qmake on project? in carbide.c++ qt perspective it's project->run qmake.

sql - Query to count the exact number of records in all tables -

ihello, i'm trying count each table in mysql database how many records there in it. all of tables happen in innodb , this query select table_rows information_schema.tables table_schema = 'myschema'; is way of estimate (there +846 records , tells me there +-400) is there way count more exact number of rows similar query? doen't matter how long query takes tot run. (p.s. not using php or similar language) if length of query doesn't matter doing following each table in database: select count(*) mytable

html - Formatting E-Zine correctly for Outlook embedding -

my client wants e-zine can embedded in email along edited , managed in email. a solution creating basic html file embedded email, upon clicking "forward" html file can edited. client wants, i'm having trouble formatting correctly. has else created e-zine , can me understand how it's embedded or edited before it's sent out? cheers, dan creating complex html emails in possible mail clients impossible. @ least there basic rules should make life easier. article can found here .

shell - list of file owners in folder on linux -

i have folder many files. files have been created many different users. not know shell scripting. i need list of username (only) of owners of files. i may save output of ls -l , parse using perl python etc... but how can using shell scripting? a simple 1 is ls -l /some/dir/some/where | awk '{print $3}' | sort | uniq which gets unique , sorted list of owners.

c# - Referencing a non-existent user Control? -

i have created application searches directory , loads of usercontrols form , uses "getresult()" method grab answers form. did not oop style because still learning how utilize oop , going design oop can move onto next part lot easier if working objects. right have created "requestform" class , want requestform.result reach uc , call getresults() method. having difficult time getting though due lack of knowledge perhaps can point me in right direction. formusercontrol - abstract class namespace accessrequest { public abstract class formusercontrol : usercontrol { public abstract string name(); public abstract string getresults(); public abstract string emailusers(); } } requestform - object class namespace accessrequest { public class requestform { public string name { get; set; } public string controlid { get; set; } public string stepname { get; set; } public string filepath { get; set; } public str...

c++ - Transparently manipulating strings inserted into an ostream -

i'd provide std::ostream may or may not, user's point of view, encrypt contents. imagine random function uses std::ostream& : void write_stuff( std::ostream& stream ) { os << "stuff"; } whether stuff output in cleartext or encrypted dependent on how stream argument initialized. i'm thinking inheriting std::basic_streambuf , i'm not sure it's best way go. think ideal scenario sort of filter object run before contents output. way it'd easy chain operations, e.g. encrypting , hex-encoding, benefit making own basic_streambuf not seem give (not @ least). any advices? thanks. update : followed strategy laid out accepted answer. found article on writing custom streambuf performs xor obfuscation extremely helpful starting point. a streambuf can implemented in terms of arbitrary streambuf that's either passed in argument constructor or set special member function. , allows stack streambuf implementation...

asp.net - How can I use jQuery Ajax and PageMethods with instance variables? -

one reason use updatepanels doing our ajax because our bl , da layers pass around page.user.identity authentication. is there way access this? yes, can current user via httpcontext.current.user . msdn documentation page.user : this property uses httpcontext object's user property determine request originates. as broader question, "how can use jquery ajax , pagemethods instance variables?" answer "not directly." no instance of page created when executing page method. ( why asp.net ajax page methods have static? great conceptual overview of differences between normal page operations , static page methods). way access instance variables in page methods first put variables session during initial page request - rather fragile strategy: you're better off figuring out way data or values in question.

negative numbers modulo in python -

i've found strange behaviour in python regarding negative numbers: >>> = -5 >>> % 4 3 could explain what's going on? unlike c or c++, python's modulo operator ( % ) return number having same sign denominator (divisor). expression yields 3 because (-5) % 4 = (-2 × 4 + 3) % 4 = 3. it chosen on c behavior because nonnegative result more useful. example compute week days. if today tuesday (day #2), week day n days before? in python can compute with return (2 - n) % 7 but in c, if n ≥ 3, negative number invalid number, , need manually fix adding 7: int result = (2 - n) % 7; return result < 0 ? result + 7 : result; (see http://en.wikipedia.org/wiki/modulo_operator how sign of result determined different languages.)

c++ - What is the recommended way of working with QActions in multiple level hierarchy of widgets? -

i'm planning on using qactions use globally in application. idea have action available @ level in widget parent/child hierarchy. let's have following gui: +--------------+ | +----------+ | | | +----+ | | | | | w2 | | | | | +----+ | | | | w1 | | | +----------+ | | mainwindow | +--------------+ w2 has qpushbutton want use qaction defined in mainwindow. question is: recommended way of working qactions in multiple level hierarchy of widgets? here approaches: define actions in mainwindow singleton, , access w2 add qaction qpushbutton. define actions in mainwindow , add them w1, in turn add qaction w2, in turn add action qpushbutton (i don't one). create delegate singleton class hold qactions , access mainwindow make global connections of qactions' triggers backend (model), , access w2 add action wanted qpushbutton. thanks personnally, i'd go modified version of second option, in other way, because keeps hierarchy of program. oth...

asp.net - jqGrid multiselect is very slow with large local data and jQueryUI 1.8, jQueryUI 1.7 is fine -

i using jqgrid in asp.net page , injecting datainto script block on page , loading there. 1 use case necessary have large amount of data visible on screen @ once. involves 300~500 records 30 columns on each row. paging case not fit. user needs able scan mass amount of data, select 40~60 rows , move off screen. i unsure if fit in begging jqgrid in prototyping worked plenty fast enough. moving production painfully slow in multi-select mode. i have narrowed down pain point jqueryui 1.8. if revert jqueryui 1.7 plenty fast enough. example of jqueryui 1.7 ~ 17.htm example of jqueryui 1.8 ~ 18.htm note: examples show difference in firefox , ie, chrome seems ok both pages use latest jqgrid 3.8 options selected. loading jquery , jqueryui google cdn <base href="http://ajax.googleapis.com/" /> <link href="/ajax/libs/jqueryui/1.8/themes/start/jquery-ui.css" type="text/css" /> <script src="/ajax/libs/jquery/1.4/jquery.min.js...

c++ - Namespace refactoring tool for Eclipse? -

i'm doing housekeeping on files, , need move classes new namespace. have manually edit files, wondering if there's more efficient way of doing this? i heard resharper visual studio need, there similar tool eclipse? i'm not sure if eclipse intellij idea (from same vendor resharper) have refactoring move classes between packages. available refactor > migrate menu if remember correctly.

workflow foundation 4 - WF4 : Custom activity with child activity -

how can create custom activity workflow foundation 4 host child activity (or several)? the idea create similar trycatch activity can specify activity goes in try part , in part. need own custom business logic. derive nativeactivity. use public properties hold children. like public activity body { get; set; } override nativeactivityexecute(). call nativeactivitycontext.scheduleactivity(this.body). use overload takes completion handlers - if want kind of sequential execution, is, because scheduled activities executed after execute() returns. this basics.

Adding a SOAP / XML parameter in PHP -

i using soap in php. at moment submitting tag <tag>data</tag> but want submit <tag parameter=value>data</tag> for life of me, can't find out how this. don't know parameter=value pair referred as? can please? okay - after bit of hard looking, , lucky google, have found out answer own question. to add parameter (or several) xml tag use 'soapvar' command : $xmlvar = soapvar('<anytype xsi:type="invoiceline">'.$line_xml.'</anytype>',xsd_anyxml) this produce following xml : <anytype xsi:type="invoiceline"><otherstuff>data</otherstuff></anytype> so , good. problem appoach need able isolate 'otherstuff' goes in middle of tag sandwich - in case it's $line_xml variable. long can this, approach seems work fine.

c# - Splash screen does not return focus to main form -

i everyone. have problem focus when using splash screen. using vs2008, .net framework 2.0. also, have linked project visualbasic.dll since use applicationservices manage single instance app , splash screen. here code snippet simplified of tried debugging. namespace myproject { public class bootstrap { /// <summary> /// main entry point of application. creates default /// configuration bean , creates , show mdi /// container. /// </summary> [stathread] static void main(string[] args) { // creates new app manages single instance background work application.enablevisualstyles(); application.setcompatibletextrenderingdefault(false); app myapp = new app(); myapp.run(args); } } public class app : windowsformsapplicationbase { public app() : base() { // make single-instance applicat...

What does the function then() mean in JavaScript -

i've been seeing code looks like: myobj.dosome("task").then(function(env) { // logic }); where then() come from? the traditional way deal asynchronous calls in javascript has been callbacks. had make 3 calls server, 1 after other, set our application. callbacks, code might following (assuming xhrget function make server call): // fetch server configuration xhrget('/api/server-config', function(config) { // fetch user information, if he's logged in xhrget('/api/' + config.user_end_point, function(user) { // fetch items user xhrget('/api/' + user.id + '/items', function(items) { // display items here }); }); }); in example, first fetch server configuration. based on that, fetch information current user, , list of items current user. each xhrget call takes callback function executed when server responds. now of course more levels ...

.net - Non-LINQ implementations of Union, Intersect, and Except -

linq objects has incredibly useful union , intersect , , except methods. sadly, there's client i'm doing work , mandating .net 2.0 linq not option. looked through reflected code , didn't reverse @ all. is there .net 2.0 library or easy implementation of union , intersect , , except ? any reason not use linqbridge ? linq objects goodness while still targeting .net 2.0 :)

android - super simple custom view -

this should easy reason isn't working. wanted figure out how custom views, started doing 1 overrides button, adds no functionality, make sure works. java (file foobutton.java): package com.foo.bar; import android.content.context; import android.widget.button; public class foobutton extends button { public foobutton(context context) { super(context); } } xml (within main.xml): <view class="com.foo.bar.foobutton" android:text="blah" android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/buttonfoo" android:textsize="24px" android:paddingleft="16px" android:width="100px" android:textstyle="bold" /> if replace "com.foo.bar.foobutton" "button", well, , button. if run above, crashes on startup , in logcat get: e/androidruntime( 1411): caused by: android.view.inflateexception: binary xml file line #11:...

Calling a file in python -

i'd call .py file within python. in same directory. effectivly, same behavior calling python foo.py command line without using of command line tools. how should this? it's not quite clear (at least me) mean using "none of command-line tools". to run program in subprocess, 1 uses subprocess module. however, if both calling , callee python scripts, there alternative, use multiprocessing module. for example, can organize foo.py this: def main(): ... if __name__=='__main__': main() then in calling script, test.py: import multiprocessing mp import foo proc=mp.process(target=foo.main) proc.start() # stuff while foo.main running # wait until foo.main has ended proc.join() # continue doing more stuff

Finding the nth prime number using Python -

when run code, counting 10th prime number (instead of 1000) skewed/jacked output--all "not prime" titles is_composite variable, test_num giving me prime , composite numbers, , prime_count off some of answers developers have shared use functions , math import--that's haven't yet covered. not trying efficient answer; trying write workable python code understand basics of looping. # test prime diving number previous sequence of number(s) (% == 0). # counting 1 way 1000. test_num = 2 #these numbers being tested primality is_composite = 'not prime' # counted prime_count prime_count = 0 #count number of primes while (prime_count<10): #counts number primes , make sures loop stops after 1000th prime (here: running tenth quick testing) test_num = test_num + 1 # starts two, tested primality , counted if x = test_num - 1 #denominator prime equation while (x>2): if test_num%(x) == 0: is_composite = 'not prime' else: ...

crash - Visual Studio 2010 crashes upon editing a C# string literal -

my vs2010 premium rtm installation has developed nasty habit of crashing when edit string literal. 'feels' intellisense bug , have unreasonable , unsupported hunch has resharper, because resharper integrations slower , slower until crash happens when edit string literal. this happening on 2 seperate pcs not pc-specific. r# build is: 5.1.1751.8 dated 2010-08-31. anyone else seeing this? insight?

C#, UAC, installer, Windows 7 -

i have client-side app downloads nullsoft installer server , runs installer external process verb set "runas". nullsoft installer has line in script requests elevated privileges. on windows 7, works -- windows displays uac dialog, clicking ok allows installer run. other times, uac dialog never shows , result installer never launches. if manually double-click same installer, works, i.e. uac dialog shows up, etc. confusing part behavior being inconsistent, on same machine exact same uac settings works , hangs other times. have tried different uac levels too, still hit-or-miss. ideas? what did set requestexecutionlevel to? setting "requestexecutionlevel admin" should enough, no need use runas verb, start process shellexecute. (requestexecutionlevel deals vista , later when uac on, use userinfo nsis plugin cover other cases)

entity framework - Formatting Date on Html.TextBoxFor - other solutions not working -

using ef-generated classes, here's metadata class: [displayname("approved date")] [datatype(datatype.datetime)] [displayformat(applyformatineditmode = true, htmlencode = false, nulldisplaytext = "", dataformatstring = "{0:mm/dd/yyyy}")] public object approveddate{ get; set; } the view: <%: html.editorfor(model => model.standard)%> the editor: <%:html.editorfor(model => model.approveddate)%> the datetime.ascx: <%string name = viewdata.templateinfo.htmlfieldprefix;%> <%string id = name.replace(".", "_");%> <div class="clear"> <div class="editor-label"><%:html.labelfor(model => model)%></div> <div class="editor-field"> <%:html.textboxfor(model => model)%> <%= html.validationmessagefor(model ...

java - JTable: grabbing data? -

how can parse data table model, can readily loaded , displayed jtable ? for example, loaded jtable, drag , drop columns change orders. how of table information ? there standard store data in can read next jtable ? dragging of columns supported automatically. however, not change order of data in tablemodel , should not so. if want access data in model in order in model created use: table.getmodel().getvalueat(...); if want access data in current view of table use: table.getvalueat(...); if reason need convert indexes between view/model can use 1 of convertxxx(...) methods found in jtable api. additionally, how can parse data table model, can readily loaded , displayed jtable ? this doesn't make sense. if data in tablemodel there no need parse it. if talking saving data file, many people use simple format like: data1|data2|data3 then when read data in line line can use string.split(...) method each individual method. can use defaulttablemod...

windows services - How to start a notify icon -

hi have windows service application running on users local computers. have application updater app invoked service check if there latest updates avaliable. if there pop notification on task bar notify user there updates avaliable. user can click on the notify icon , start update process stop service, install updates , restart app. my question how can notify icon appear on desktop. tried updater pop icon since windows service starts updater, updater runs under system user , hence cannot open uis. can suggest solution please you don't mention language you're using develop app, answer may vary slightly. basically, windows services cannot interact logged in user directly, since run in different windowstation. this page on msdn describes common techniques achieve ui interaction windows service; of them involve calling non-manage code. in particular, suggest call createprocessasuser service launch separate app runs in user context , displays icon on notify area. if...

c - GtkButton just shows text but no image -

i have gtkbutton inside gtkhbuttonbox doesn't show image i'm adding it. shows text. here's code: gtkimage *image = (gtkimage *) gtk_image_new_from_file("gateway-lt21-netbook-2-540x359"); gtkbutton *button = (gtkbutton *) gtk_button_new_with_label("test"); gtk_button_set_image(button, (gtkwidget *) image); is there i'm missing? make sure "gtk-button-images" setting set true. gtksettings *default_settings = gtk_settings_get_default(); g_object_set(default_settings, "gtk-button-images", true, null); note: should follow construction of first window (and of course precede main loop). if i'm not mistaken, rather recent change in gnome - reason, decided icons not appear on buttons default (this seems apply standard ms windows theme).

Iphone dev app for companies -

lets have client wishes me build business app iphone. still need enroll standard developer program app can installed on real devices , way client install app through app store? cannot distribute client directly? i'm reading how start developing iphone, i'm total noob. information appreciated. thanks, you need developer certificate put app on ios device stock os. what kind of certificate , how many need depends on type , amount of distribution require, , size of client's company. you need join ios developer program ($99/annum) install , test apps develop them. in addition can deploy ad hoc installations 100 devices (including own, testers, clients, plus, importantly, including repair replacements , upgrade devices). your client may not need license if want few copies , willing have renew ad hoc installs few times per year. if client wishes deploy app in own name outside company or through itunes app store, need apply ios developer program themselves...

c# - How to Configure SQLCE connection on Smart Device Application using Emulator? -

i created simple test opens connection of sqlce located on desktop p.c. when start run debug mode throws me cant open connection. use pocket p.c 2003 emulator this test code on smart device application. connection string private sqlceconnection conn = new sqlceconnection("data source=c:\\sdb.sdf"); test connection public bool test() { try { conn.open(); {} status.text = "connected"; } catch (exception ee) { throw ee; status.text = "not connected"; } { if (conn.state == connectionstate.open) conn.close(); } return true; } is there things need configure?thanks in regards! that's correct behavior. aspects, emulator physical device nesxt pc. doesn't know pc drives (you can share pc folder going emulator configuration) , therefore can't see them. doesn't know drive letters. if want emulator use file on pc, again can share fo...

vb.net - one sub procedure / change text color in rich text box / without button handler -

everyone! i've been @ while, , i'm not sure how issue can resolved: i'm working on project in vb.net, , have form rich text box. have groupbox 4 radio buttons inside intended change font color of text. coincidentally, have repeat same functionality 2nd set of radio buttons change text font family. at rate i've been able following change font color of whatever text highlight in rich text box: private sub rbtnblack_checkedchanged(byval sender system.object, byval e system.eventargs) handles rbtnblack.checkedchanged rtbxtexteditor.selectioncolor = color.black end sub private sub rbtnred_checkedchanged(byval sender system.object, byval e system.eventargs) handles rbtnred.checkedchanged rtbxtexteditor.selectioncolor = color.crimson end sub private sub rbtngreen_checkedchanged(byval sender system.object, byval e system.eventargs) handles rbtngreen.checkedchanged rtbxtexteditor.selectioncolor = color.darkgreen end sub private sub rbtnblue_checkedchange...

How do I implement jQuery scrollTo for links on the same page? -

i'm noob jquery , know scrollto, not quite how function on site. did quick google search , found lots of results, @ glance reliable 1 (or @ least popular) used one: http://plugins.jquery.com/project/scrollto however, again, being total noob scripting, not sure how use accomplish task. (html , css bag, baby). so here's i'm trying do...very simple stuff i'm sure. on http://joelglovier.com i'm building 1 page "gateway" site links lots of other fun web content. have top navigation links anchors further down page. want scrollto take users down anchors in nice, animated fashion. told simple! any appreciated on best way implement this, , whether there current standard type of scrollto use (i see everywhere nowadays). refer : .offset() , .scrolltop() , .animate() you can thing $(function() { $('#nav-find-me-at a').click(function() { var pos = $('#find-me-at').offset().top; $('html, body').anim...

c++ - Is there a way to flag (at compile time) "overridden" methods whose signatures don't match base signature? -

basically, want c# compiler functionality of override keyword in c++ code. class base { virtual int foo(int) const; }; class derived : public base { virtual int foo(int); // wanted override base, forgot declare const }; as know, above code compile fine, yield strange runtime behavior. love c++ compiler catch poor implementation c#'s override keyword. there keywords "override" being introduced c++, or stuck #define override virtual show our intent? (actually, not - hate using preprocessor "extend" language). if can't wait c++0x, visual c++ has override keyword. (since 2005 believe). there syntax is: virtual int foo(int) override; you're not obliged type it, however. , non-standard microsoft extension.

c++ - Is it possible to have an animated QSystemTrayIcon? -

i can't seem find info this. lot of kde apps use animated icons. as know setting qicon gif won't work, first frame displayed. i didn't try possible setting new icon every few milliseconds. /* list of frames */ qlinkedlist<qicon> frames; /* frames icons created images in application resources */ frames <&lt qicon(":/images/icon1.png") <&lt qicon(":/images/icon2.png"); /* set timer */ qtimer timer = new qtimer(this); timer->setsingleshot(false); connect(timer, signal(timeout()), this, slot(updatetrayicon())); timer->start(500); /* update icon every 500 milliseconds */ /* updatetrayicon function (slot) sets next tray icon (i.e. iterates through qlinkedlist frames) */

MSBuild, FxCop and StyleCop integration with CruiseControl.Net -

i had integrated msbuild, fxcop , stylecop cruisecontrol.net, facing problem related logfile, contains lot informations due size of file around 150 mb , want error , warning can easly load in cruisecontrol.net dashboard thanks in advance you need modify settings of msbuild fxcop , stylecop tasks. thus, cut off size of xml logs produced these tasks , size of merged xml log. easier view in dashboard. msbuild : add /v:m (for verbosity=minimal) arguments. fxcop : see http://social.msdn.microsoft.com/forums/en-us/vstscode/thread/3f8931da-9a4d-47a6-b331-8b6b07aea8d6 stylecop : doesn't know how adjust verbosity.

javascript - The best way to bind event on a cell element -

i've webpage fullfilled js script creates lot of html tables. number of <table> created can vary between 1 , 1000 100 cells in each of it. my question : how bind efficiently click on theses tables? should bind click on each cell of <table> or directly <table> , retrieve cell clicked in bind function? or have idea? thanks p.s: i'm using ie6+ i suggest use delegate . $("table").delegate("td", "click", function(){ alert($(this).text()); // alert td's text. }); delegate bind 1 event, , context(in example, <table> ).

javascript - Hooking into browser rotation -

i'd execute javascript code when mobile phone rotated. i'm using jquery . there custom hook can use mobile browsers? one way can think of hooking change of viewport size, , checking if height/width ratio has changed. there api method use instead? it should "onorientationchange" event attached on <body> tag. looking @ window.orientation property should angle in degrees.

c++ - function try block. An interesting example -

consider following c++ program struct str { int mem; str() try :mem(0) { throw 0; } catch(...) { } }; int main() { str inst; } the catch block works, i.e. control reaches it, , program crashes. can't understand what's wrong it. once control reaches end of catch block of function-try-block of constructor, exception automatically rethrown. don't catch further in main(), terminate() called. here interesting reading: http://www.drdobbs.com/184401316

python - pythonic way to optimize the logic to filter/extract data from list -

i have list below: ['1 (uid 3234 flags (seen \\seen))', '2 (uid 3235 flags (\\seen))', '3 (uid 3236 flags (\\deleted))', '4 (uid 3237 flags (-flags \\seen +flags))', '5 (uid 3241 flags (-flags \\seen +flags))', '6 (uid 3242 flags (\\seen))', '7 (uid 3243 flags (\\seen))', '8 (uid 3244 flags (\\seen))', '9 (uid 3245 flags (\\seen))', '10 (uid 3247 flags (\\seen))', '11 (uid 3252 flags (\\seen))', '12 (uid 3253 flags (\\deleted))', '13 (uid 3254 flags ())', '14 (uid 3256 flags (\\seen))', '15 (uid 3304 flags ())', '16 (uid 3318 flags (\\seen))', '17 (uid 3430 flags (\\seen))', '18 (uid 3431 flags ())', '19 (uid 3434 flags (\\seen))', '20 (uid 3447 flags (-flags \\seen +flags))', '21 (uid 3478 flags ())', '22 (uid 3479 flags ())', '23 (uid 3480 flags ())', '24 (uid 3481 flags ())'] ...

web applications - What is the technology behind OpenOffice.org Anywhere -

i able launch open office through web browser, not have copy of open office. http://www.ooanywhere.com/ may know technology behind? (although launched open office quite slow , not responsive) thanks. our service based on following technologies: linux based machines running in cloud (datacenter located in eastern , may indeed slower distant locations); for remote access we're using open source nx server nomachine ; on client side we're running custom-built java applet talks our servers via ssh; let know if want know more.

Using C#, how can I manually validate a html tag? -

i have example image tag: <img src="http://... .jpg" al="myimage" hhh="aaa" /> and mantain, example, image tag list of valid attributes l1=(alt, src, width, height, align, border, hspace, longdesc, vpace) i parsing img tag , getting used attributes this: l2=(src, al, hhh) how can programaticaly validate image tag? 'al' attribute should become 'alt' ('alt' attribute more 'align' contains more characters) , 'hhh' tag disappear (because there no attribute it)? for result tag should this: <img src="http://... .jpg" alt="myimage" /> thanks. jeff you use linq2xml parse code: xelement doc = xelement.parse(...) then correct wrong attributes using best-match algorithm against valid attributes in-memory dictionary. edit: wrote , tested simplified best-matched algorithm (sorry, it's vb): dim validtags() string = { "widt...

iphone - UIImage to base64 String Encoding -

how convert uiimage base64 encoded string? couldn't find examples or codes detailed regarding. i wonder why didn't find question because it's old question & can found here , here . anyways, need first add nsdata categories project available here - header , implementation convert uiimage object nsdata following way: nsdata *imagedata = uiimagejpegrepresentation(image, 1.0); and apply base64 encoding convert base64 encoded string: nsstring *encodedstring = [imagedata base64encoding];

Making a vb.net application blend in with the Windows theme -

previously used piddle around vb6 develop couple of personal projects. following upgrade windows 7, i've decided piddle vb.net express edition 2010. if wanted vb6 application blend in visual style of windows, use code , techniques described here . in short, use manifest file , couple of calls within application , of elements similar xp theme applied. if run on 2000, 95 or 98 standard windows app. good. now i've moved onto vb.net, i've written simple "hello, world" application have absolutely no idea on how make windows 7 theme (eg. font matches system font , widgets styled correctly). just changing font hack , out of place on machines set-up differently or run different version of windows default font different. how ensure application matches applied windows theme irrespective of version of windows? a lot of automatic if create windows forms app. (mostly) use standard native windows controls draw theme colors. there exceptions: the form i...

image - Graph mining matlab -

Image
i have written matlab code image analysis searches clusters in image , builds adjacency matrix clusters, discribing clusters touiching eachother in image. i can use adjacency matrix derive graph. for completion of algorithm have mine graph nodes of maximum degree of 2 node index either higher of neigbor (when degree 1) or between indexes of 2 neighbors. basically in image here: i need in matlab , important know try available adjacency matrix looking like: 1 2 3 4 1 0 0 1 1 2 0 0 0 1 3 1 0 0 1 4 1 1 1 0 probably quite simple don't see solution... here's attempt @ this: %# adjacency matrix m = [0 0 1 1; 0 0 0 1; 1 0 0 1; 1 1 1 0]; %# degree == 1 n = find(sum(m,2) == 1); %# nodes degree(n)==1 nodes1 = n(n>find(m(n,:))); %# nodes index higher of neigbor %# degree == 2 n = find(sum(m,2) == 2); %# nodes degree(n)==2 nb = zeros(numel(n),2); i=1:numel(n) nb(i,:) = find( m(n(i),:) ); %# two...

php - Any disadvantages to using iframes -

i've been advised use iframe share form between 2 websites, got impression iframes bad or shouldn't used. not sure remember gave me impression. can clarify if using iframe bad practice or not, , if bad practice, why? if using php, it's better put form in it's own file, , include it. http://php.net/manual/en/function.include.php

Extending a Php class which extends another class -

i have requirement process can implemented in 2 different situation. 1 situation start date cannot in past , other can. currently utilise value objects perform series of validation items on each field submitted using zend validate objects. the validation extends base class e.g. class valueobject_test1 extends filter() filter made of: - class filter { protected $_filter; protected $_filterrules = array(); protected $_validatorrules = array(); protected $_data = array(); protected $_objdata = array(); protected $_options = array(zend_filter_input::escape_filter => 'striptags'); protected $_runvalidation = true; protected function _setfilter() protected function _addfilter() protected function _addvalidator() protected function _adddata() protected function _addobject() protected function _addoption() public function getdata() public function haserrors() public function getmessages() public fun...

linq to sql - SQL server Timeout – only happens very occasionally -

i have web application throw error…. exception message: timeout expired. timeout period elapsed prior completion of operation or server not responding. when unable connect sql server, through management studio, it’s says server timed out , cannot connect. as reset iis, comes instantly. means it’s in code that’s causing this. have mvc site uses linq sql , sql cache dependency service broker enabled. i have used using statement thoroughly throughout code, im sure it’s not leaky connections. reading through server logs makes things more confusing there many information , warning events, im not sys admin it’s hard know what’s going on. it begins me getting asp.net 4.xxxxx event id 1309 exception message: timeout expired. timeout period elapsed prior completion of operation or server not responding. error i think got round last time on previous server restating iis when ever error popped up, don’t want resort on new server. so question is, steps can take tr...

NANT: Style task passing parameter to xslt -

i have problem passing arguments nant style task xslt sheet. nant code snippet. properties path , file definetly set. <style style="${xslt.file}" extension="xml" in="${xml.file}" destdir="."> <parameters> <parameter name="path" value="${path}" namespaceuri="http://www.w3.org/1999/xsl/transform" /> <parameter name="doc" value="${file}" namespaceuri="http://www.w3.org/1999/xsl/transform" /> </parameters> </style> my parameter declared following: <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform" xmlns:ms="http://schemas.microsoft.com/developer/msbuild/2003"> <xsl:param name="path"></xsl:param> <xsl:param name="file...