Posts

Showing posts from June, 2013

osx - Calling proc_selfppid() from an IOAudio kext in Lion -

i've got kext based on apple's audioreflectordriver sample code (it intercepts audio output , makes copy). on <= 10.6, when call proc_selfpid() inside ioaudioengine subclass, reports pid of process generates audio. on 10.7, reports coreaudio_d process. what changed? know apple has documented change? there way originating process id in lion? update ... apple dts engineer has informed me that: the audio hal rewritten in lion , change side effect of effort. don't believe deliberate change, instead driven larger architectural changes in coreaudio. strictly speaking, don't believe proc_selfpid ever documented return useful in audio context, it's entirely possible information not available anymore. [....] the problem not kernel returing wrong pid, instead coreaudio's architecture has changed such audio coming different process. still waiting hear him if there's way info in 10.7. my suspicion wasn't documented because rewrite di

c++ - In a signal handler, how to know where the program is interrupted? -

on x86 (either 64-bit or 32-bit) linux -- example: void signal_handler(int) { // want know program interrupted ... } int main() { ... signal(sigalrm, signal_handler); alarm(5); ... printf(...); <------- @ point, trigger signal_handler ... } in signal_handler, how can know interrupted @ printf in main()? use sigaction sa_siginfo set in sa_flags. prototype code: #define _gnu_source 1 /* pick reg_rip */ #include <stdio.h> #include <signal.h> #include <assert.h> static void handler(int signo, siginfo_t *info, void *context) { const ucontext_t *con = (ucontext_t *)context; /* know, never call printf signal handler. meh. */ printf("ip: %lx\n", con->uc_mcontext.gregs[reg_rip]); } int main(int argc, char *argv[]) { struct sigaction sa = { }; sa.sa_flags = sa_siginfo; sa.sa_sigaction = handler; assert(sigaction(sigint, &sa, null) == 0); (;;); return 0; } run , hit c

linq to sql - DataContext, Repositories and Unit of Work -

i have 2 repositories 2 different entities , each 1 has own private linq-to-sql datacontext. in addition, have service class must return result these 2 repositories. question 1 - should have common datacontext both repositories? (i guess instantiating datacontext in service class , injecting 2 repositories.) question 2 - unit of work for? many help. this tutorial answered questions: http://www.asp.net/entity-framework/tutorials/implementing-the-repository-and-unit-of-work-patterns-in-an-asp-net-mvc-application

javascript - making parallel ajax requests -

i have javascript code these things in loop create div element,append dom , reference pass reference function makes ajax post request set response of ajax request innerhtml of passed element reference here code window.onload = function () { var categories = document.getelementbyid('categories').children; (i = 0; < categories.length; i++) { var link = categories[i].children[1].children[0].attributes['href'].nodevalue; var div = document.createelement('div'); div.classname = "books"; div.style.display = "none"; categories[i].appendchild(div); getlinks(link, div); } } function getlinks(url, div) { xhr = new xmlhttprequest(); xhr.open('post', 'ebook_catg.php', true); xhr.setrequestheader('content-type', 'application/x-www-form-urlencoded'); url = encodeuricomponent(url) var post = "url=" + url; xhr.no

testing - CakePHP - Basic Unit Test Failing but app works? -

since i've been scratching head on hour - i'm guessing pretty minor , i'm being stupid. i'm testing model method app, , worked 2 hours ago - , added more tests , they've been failing since, when went original basic one: my fixture: class userfixture extends caketestfixture { var $name = 'user'; } var $fields = array( 'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'key' => 'primary'), 'group_id' => array('type' => 'integer', 'null' => false, 'default' => null, 'key' => 'index'), 'username' => array('type' => 'string', 'null' => false, 'length' => 16, 'key' => 'unique', 'collate' => 'utf8_unicode_ci', 'charset' => 'utf8'), 'password' => array('type

c# - How to use a static utility method for property setters in a utility class -

i'm trying achieve two-way binding between datagridview , bindinglist provides data dgv. columns not yet reflect changes in underlying list , think it's because have not provided property setter(s) notify of property changes. rather code setter rows property same way did process property, i'm trying more "elegant" , realize stuck.... i stumbled upon interesting writeup more elegant approach , i'm trying implement concepts of (please see): http://www.gavaghan.org/blog/2007/07/17/use-inotifypropertychanged-with-bindinglist/ here code mike's article want use (established utilities.cs in cbmi.common project): using system; using system.collections.generic; using system.componentmodel; using system.linq; using system.text; namespace cbmi.common { public static class utilities { public static bool set<t>(object owner, string propname, ref t oldvalue, t newvalue, propertychangedeventhandler eventhandler) { // make sur

java - Passing Array to SOAP causes Error 500 -

im stuck in terrible problem, have soap based webservice implemented in java.the client besides other data supposed have "male" , "female" checkboxes user can either select 1 of them or both , client supposed send server stored in database, multivalued entity, gives me error 500, failure on server side here code client, in advance time: private void salvaactionperformed(java.awt.event.actionevent evt) { // todo add handling code here: disease=malattia.gettext(); sexarra=new string[sexint]; if(sexint==1) sexarra[0]=sexone; else if(sexint==0) joptionpane.showmessagedialog(null, "bisogna specificare almeno un valore del campo sesso", "errore", joptionpane.error_message); else{ sexarra[0]=sexone; sexarra[1]=sextwo;} // system.out.print(sexarra[0]); // system.out.println(sexarra[1]); description=descrizione.gettext();

more json c# issues -

this continuation of previous question of mine. solution worked trying @ time broke whole lot of code. know bad practice not make sure beforehand yeah... live , learn. anyhoo, here's q: an easy way serialise c# objects what want know is: there way newtonsoft library handle stuff? if yes, how? if no, suggestions? what i'm doing chatting ror3 app using json, cant deserialise response. here's little code: the response i'm getting ror looks like: [{"directory":{"created_at":"2011-07-20t22:29:38z","drive_info":1,"id":15,"name":"new drive","parent":0,"size":0,"updated_at":"2011-07-20t22:29:39z","user":1}}] i'm trying deserialise list of directory objects using: public static compositecollection deserialise<t>(string json) { compositecollection result = new compositecollection(); jarray arr = jarray.parse(json);

Deployed a version control system for company, how to use it with binary files -

i tasked setup mercurial version control system our small team of developers (2-3 person). there no version control system before, shared folders , multi-copies. don't have experience in setting version control system except personal projects, happened experienced person in term of version control system in our team. code repository in shared folder in centre server, top leve directory client name, 1 level down project name client. the problems haven't figure out how deal binary files in our code repository. read, binary files shouldn't version tracked. code repository centralized on server, shouldn't binary in here well? otherwise things image file, , third-party dll files, project wouldn't build or run when cloned centre server. there nice feature mercurial web interface can download whole source package zip or bz2 compressed file, without necessary binary files, download project wouldn't run or compile. i guess solution including everything version

mongodb - is there a command line to create EmbeddedDocument in a rails project -

is there command line create embeddeddocument in rails project rails generate model mymodelclass filed:string from above command line, create document type of class, , call mongodb create mymodelclass collection. so how if want have embeddeddocument class?? there command line? or have manually create empty file , input text myself? thanks.

html - Insert data into database with jsp and go to next form -

i have 3 different forms(html) related each other, insert.jsp (process data submit db) , 1 table in database. need save data database , continue next form. next data save in same table. when try submit first form save table in database second form not save it. i have 3 forms in html pages used tab menu , want save in same table in database. how solve it? <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>general</title> <link href="css/tabs.css" rel="stylesheet" type="text/css" /> </head> <body> <h1>general</h1> <ol id="toc"> <li class="current"><a href="general.html">general</a></li> <li><a href="contacts.html">contacts</a></li> <li><a href="address.html">address</a></li> <l

How to continue session from iPhone App to a Mobile Website? -

how continue session iphone app mobile website works? for example, facebook app, of features direct internal browser. will still use same session or there different session key mobile website. don't want login again when redirected application's internal browser facebook uses technique called oauth2 authorize other applications facebook service, can check out how use oauth2 iphone here . basically, send site user credentials (username , password) , access token back. then, can use token within app find out information user, actions user, etc.. finally, if need access actual website of application, same access token should allow sign website without having re-enter username , password.

extjs - Mapfish toolbar issue while using ExtJS4 -

we using mapfish toolbar extjs3 in our application.now trying migrate our application extjs4.but facing issue mapfish toolbar.so,we tried extjs4 toolbar,but openlayers code related map not working extjs4 toolbar. so,is there chance extjs4 support mapfish toolbar or else chance work out openlayers code extjs4 toolbar? help appreciated. mapfish doesn’t ship javascript part anymore. there won’t support extjs4, should use geoext instead. http://geoext.org/lib/geoext/widgets/action.html hth,

c++ - Method exclusion in PartCover -

i trying modify partcover source code exclude coverage method. however,it looks main logic in c++ code. since not possible step cpp code while debugging,can please guide me files need modify? thinking should rules.cpp , instrumentator.cpp...and refactoring needed in other .cpp .h , .cs files due changes made in these. if wrong, or if there other places should looking at, please let me know. other hint proceed appreciated. thanks, thanks reply. however, uncommenting debugbreak causing nunit-console-86.exe stop working. changed nunit version 2.5.7 match version of nunit-framework.dll inside partcover bin folder, problem still exists. idea causing this? we have our own console app runs coverage check method wise. makes sure if new method added, or code in existing methods refactored, coverage still should @ least more our decided percentage. there methods testing cannot done whatsoever reason. those, doesn't make sense exclude entire class. the files have mention

c++ - How derived object in base pointer invokes base function? -

how can base pointer holding derived object still point base function ? here after a_ptr = &b_obj; a_ptr->disp(); if base function had been virtual understand involvement of v-table, holds address base function.but here base pointer hodling derived object can manage call base function. can throw light on happens behind scene ? class { public: //virtual void disp() void disp() { cout<< "from class a\n" << endl; } }; class b : public { public: void disp() { cout << "from class b\n" <<endl; } }; int main() { a_obj; *a_ptr; b b_obj; a_ptr = &a_obj; a_ptr->disp(); a_ptr = &b_obj; a_ptr->disp(); } base pointer points base part of derived object. doesn't know information derived object members / methods. if declare method a::disp() virtual , resolved @ runtime. may call a::disp() or b::disp() based on object a_ptr points to. in simple words, if declare method virtual compi

WPF. Get clicked row item values -

i have datagrid. each row element of observablecollection declared in cs file. each datagridrow has column delete button , click event. how corresponding element of observablecollection in button click event function? if hook button's click event, sender should button. datacontext on button should row item: private void button_click(object sender, routedeventargs e) { myclass data = (sender frameworkelement).datacontext myclass; }

mysql - Performance based on searching a integer or a long string (unique) in database? -

i have 5 columns in table in database , 2 unique (one integer , string). integer like 1,5,6,7,9,0 , string http://exmaple.com/book-on-the-self-no-2 . now column should used searching rows??? how impact performance? database sql or mysql? thank.. generally speaking, less comparisons , manipulation of data (like reading disk) mysql has make, faster it'll go. which means searching on integers (a couple of bytes) faster searching on (possibly long) strings. in case, sidenote : don't forget adding index on field searching on -- depending on kind of query you're doing, it'll speed things lot.

WCF Client in ASP.NET Application -

what best practices accessing wcf web service asp.net application? currently, in each page need access service have field private readonly _serviceclient = new wcfserviceclient(); and access it's methods repeatedly, closing on each call , creating new instance everytime it's state faulted . however, don't know whether should or, instead, create new instance per method call. best practices regarding this? i've done similar article rubbleford linked in comment, since dealing multiple services used channelfactory , cached returned object upon initial creation. create new channels needed, use them, close/abort needed. helper methods in separate dll (i'll use common example): // bindingname refers web.config binding section's name public static t getfactorychannel<t>(string address, string bindingname) { string key = typeof(t).name; // openchannels property refers dictionary<string, object> holding key , channel factory i

Android, How to put an ArrayList<myObject> in an Intent? -

i have 2 activities, in first one, instanciate arraylist of object myobject. in second activity, need arraylist. don't know how intent ? (object class have created) thanks in advance. if make object class implement parcelabel can pack arraylist bundle send intent see this link example

database - Finding good ways to transfer big files among Java servers -

there in project major db server, , other servers installed @ different places maintain own local databases. have allow every system update local database version on major db. servers runs java environment. there seems many ways transfer files: simple web download page, web-service, ftp, socket.. think fits better situation? the general procedure looks like: 1, client sends string of version server. 2, server generates patch , sends back. (since patch maybe huge, should separated parts) and i'm thinking inside procedure 2. there lot of choices. 1, should @ first count rows fetched , calculate how many parts should divided. and meet choice, should send number of parts or list of links client, , client uses links request each part if connection based on web request, or can push parts 1 one if servers connected socket, or can following step: 2, can fetch needed records server database part part, each time limited rows, return java list, serialize list file in orde

android - How to get Display object from my service class? -

because many of activities need check screen size following code: display display = getwindowmanager().getdefaultdisplay(); int screenwidth = display.getwidth(); int screenheight = display.getheight(); i decide move code each activity class service class, code can defined in 1 place , invoked every activity class. so, made service class below: public class myservice { private display display; public int screenwidth, screenheight; public myservice(){ display = getwindowmanager().getdefaultdisplay(); //error here screenwidth = display.getwidth(); screenheight = display.getheight(); } public int getscreenwidth(){ return this.screenwidth; } } because service class not extends activity , can not directly use getwindowmanager() . know how rid of problem have display instance in service class not necessary extends activity class? that's activity can access screen width following: public class myact

c# - Multi User Editing -

i have system show warning user if there try , edit record been edited. if case user not able save record view it. i have idea of using kind of class monitor activity of records been edited etc seams little on kill. my other concern if browser crashes or there shut computer down on how effect state of page. another thought use last updated time stamp looks no go because way records been updated. has got thoughts or resources on how implement this. no code necessary. based on comments have added these additional details. database sql server 2008 asp.net 3.5 1 record many parts of database instance, booking table session table , row in interrupter table. the user @ list of sessions need booking select booking , fill out booking form make booking. want stop else trying same booking @ same time or while else doing booking. esentially maintain edit (lookup) table in sql database comprising 4 fields userid, action, entityid , datestamp , link each associated page ,

WPF control default size -

when defining custom resource themes wpf application, can set width / height etc... how can find default value these properties (i.e. values used in controls provided in framework) ? the default width , height frameworkelements double.nan . if don't specify different size wpf controls automatically size try , fit content, containers or both.

c# - Missing Dependency: Castle.DynamicProxy2 after install LINQtoExecl from NuGet -

i added package linqtoexcel .net 4 wpf project , when entering designer presented following error: system.io.filenotfoundexception not load file or assembly 'castle.dynamicproxy2, version=2.1.0.0, culture=neutral, publickeytoken=407dd0808d44fbdc' or 1 of dependencies. system cannot find file specified. linqtoexcel has 1 dependency - log4net, installed part of nuget process. both referenced , set copy local. i'm not sure reference castle coming or how go fixing it. does have suggestions?

sql - Issues with a query on the AS/400 with LIKE clause -

we using hibernate connect as/400. having issues query on as/400 like clause. the following error shown: java.sql.sqlexception: [sql0131] operands of not compatible or not valid my query auto generated hibernate: select tab_parame0_.c1imcd c1_560_, tab_parame0_.c1ninb c2_560_, tab_parame0_.c1jxcd c3_560_, tab_parame0_.c1hltx c4_560_, tab_parame0_.c1hmtx c5_560_, tab_parame0_.c1hdst c6_560_, tab_parame0_.c1ngnb c7_560_, tab_parame0_.c1njnb c8_560_, tab_parame0_.c1nfnb c9_560_, tab_parame0_.c1nhnb c10_560_, tab_parame0_.c1hcst c11_560_ ryc1rep tab_parame0_ lower(tab_parame0_.c1hltx) lower(?) order tab_parame0_.c1imcd asc fetch first 10 rows sql0131 indicates type mismatch. what datatype tab_parame0_.c1hltx? datatype query parameter? please include hql/jpql query source code comparison . you may have set sql trace see as/400 receiving. see how obtain trace information java program using toolbox? i recommend change like lower(:parameter) like :pa

database - mysql key/value store problem -

i'm trying implement key/value store mysql i have user table has 2 columns, 1 global id , 1 serialized data. now problem everytime bit of user's data changes, have retrieve serialized data db, alter data, reserialize , throw db. have repeat these steps if there very small change of user's data (since there's no way update cell within db itself) basically i'm looking @ solutions people use when faced problem? maybe should preprocess json data , insert data proper mysql row separated fields. since input json, have various alternatives converting data: you mentioned many small changes happen in case. occur? happen in member of list? top-level attribute? if updates occur in list members in part of json data, perhaps every member should in fact represented in different table separate rows. if updates occur in attribute, represent field. i think cost of preprocessing won't hurt in case.

android - How to communicate between tabhost and new actvities -

i encountered problem in android application. there 5 tabs in tabhost, can hold 5 activities. if 1 of them jumps activity (not in tabhost), tabhost missing, want of activities display in tabhost. how can , how get/put data between 2 activities in tabhost? you use activitygroup inside tabhost achieve (i.e. content shown individual tab activitygroup)

javascript - A way to pass a variable into a nested function -

is there way can pass information nested function ? problem want use jquery animate object being removed , after have remove object dom. theres no way pass information nested function. first though bellow work no luck, tab = this.tab //this.tab dom element $(this.tab).effect('drop',null,null, function(tab) { $(tab).remove() }) people have suggested store element in global put function part of class , there can many objects may call function @ same time. thankyou! using closures should able do var tab = this.tab $(tab).effect('drop', null, null, function() { $(tab).remove(); }); note tab defined outside "nested function", since javascript supports closures, function can access variables defined in same scope itself. in other words, it'll able access tab . note it's not this.tab , since this refers context in code called. addendum: i'm not jquery-guy (weird, know), i'd imagine function pass effect() executed in t

contextmenu - Silverlight ContextMenuService sharing menus for several controls -

i building both silverlight , wpf clients our project. when try assign context menus controls, seems me context menu can assigned 1 control @ time, true? e.g. when drawing several lines contextmenu contextmenu = createlinemenu(); (int = 0; < points.count - 1; i++) { line l = new line(); ... canvas.children.add(l); contextmenuservice.setcontextmenu(l, contextmenu); } } the menu works line added last. a single context menu can assigned 1 parent object @ time added visual tree under child (and no visual element can have multiple parents in sl/wpf). if @ how context menus defined in xaml become clearer. to share 1 instance of context menu need dynamically assign (e.g. when mouse right button clicked, or other event). this seem inefficient way define context menus, sure others have created generic ways share them... keep on searching (i will).

javascript - populate dropdownlist with an array -

i have array var mylist = new array(); , have drop down @html.dropdownlist("yourlist", model.yourlist). how can fill dropdownlist using javascript. var mylist = new array(); (i=0; i<mylist.length; i++) { master.options[master.options.length]=new option(mylist[i].text, mylist[i].value); } http://www.javascriptkit.com/javatutors/selectcontent.shtml

c - Looping through a changing event list -

i have list of machines ping depending on response time. machines pinged each t milliseonds 5 times. depending on response time these 5 pings on each machine adjust time of ping stretch or contract it, till arriving @ configuration this: machine1: t1....t2....t3....t4....t5 machine2: t1......t2......t3......t4......t5 .. machinen: ..t1..t2..t3..t4..t5 ^ |machine needs pinged @ tick t1..tn represents (millisecond) ticks of clock. having thread per machine ping evident, not optimal solution due number of machines. rather, 1 thread iteratites through global order of events desirable, this: while(true){ fetch_next_machine_to_be_pinged(); ping_it(); if(any_machine_pinged_5_times()); reorder_events(); //adjust time of next 5 ping //continue } what best way achieve this? (ps: language c). i use priority queue . at time, queue contain 1 entry per machine. "priority" of entry m timestamp when machine m needs pinged

uibutton - jquery mobile add click event on nested button -

i have nested buttons , im trying add click events on seems not working. this object <div id="ui-50"> <div class="ui-rpc" data-role="controlgroup" data-type="horizontal" > <input type="button" id="rpc-bor" value="<<" /> <input type="button" id="rpc-back" value="<" /> <span style="margin:3px"></span> <input type="text" id="rpc-jump" value="" /> <input type="button" id="rpc-next" value=">" /> <input type="button" id="rpc-eor" value=">>" /> <span style="margin:20px"></span> <label id="rpc-current" >0</label> <label id="rpc-separator" >/</label> <label id="rpc-total" >0</label> <s

Need to update GTK+ on Ubuntu (10.04) -

trying build wireshark source there no linux installer , getting error when run configure script: checking gtk+ - version >= 2.4.0... no *** not run gtk+ test program, checking why... *** test program failed compile or link. see file config.log *** exact error occured. means gtk+ incorrectly installed. configure: error: gtk+ 2.4 or later isn't available, wireshark can't compiled tried running following commands no luck: sudo apt-get update sudo apt-get upgrade can me how this? thanks in advance. this worked me: apt-get install libgtk2.0-dev

c# - How do I get the latest date from a collection of objects using LINQ? -

i have list of objects , each object has expirationdate property of type datetime . want retrieve latest date in list. there elegant way of doing through linq? something like: datetime latestdate = mycollection.where(r=>r.expirationdate.hasvalue).maxdate(r=>r.expirationdate.value); datetime? latestdate = mycollection.max(r => r.expirationdate); intellisense should have given max() method. =) now, if must assign datetime, consider doing thus: datetime latestdate = mycollection.where(r => r.expirationdate.hasvalue) .max(r => r.expirationdate) .value; this not cover case of empty collection or collection null expirationdates. depending on earlier logic, checking mycollection.any(r => r.expirationdate.hasvalue) might idea before trying assign value.

sql - Storing a List into Python Sqlite3 -

i trying scrape form field ids using beautiful soup this link in beautifulsoup(content, parseonlythese=soupstrainer('input')): if link.has_key('id'): print link['id'] lets assume returns like username email password passwordagain terms button_register i write sqlite3 db. what doing down line in application is... use these form fields' ids , try post may be. problem is.. there plenty of sites form field ids have scraped. relation this... domain1 - first list of form fields domain1 domain2 - second list of form fields domain2 .. , on what unsure here is... how should design column kind of purpose? ok if create table 2 columns - col 1 - domain url (as text) col 2 - list of form field ids (as text) one thing remembered is... down line in application need this... pseudocode if domain "http://somedomain.com": ever item in col2 (which list of form field ids): assign set of values each of form fields &

imageview - How to create views that will run on multiple screen in Android? -

i developing android application. creating views programmatically, , necessary application should dynamic. can put resources per hdpi, mdpi , ldpi want know how set width , height of view proper on android screens. using density factor follows. imageview imgmainpic = new imageview(this); relativelayout.layoutparams rllpimg = new relativelayout.layoutparams(relativelayout.layoutparams.fill_parent, (int)(440*global.ndensity)); rllpimg.addrule(relativelayout.align_top,mainrelativelyt.getid()); imgmainpic.setid(1); imgmainpic.setlayoutparams(rllpimg); imgmainpic.setbackgroundresource(r.drawable.pic1); mainrelativelyt.addview(imgmainpic); it not practice calculate width , heights of views based on device. best way define different layouts different screens using small, large, xlarge etc.. here link android developer supporting multiple screen sizes..

USB mass storage: device side data changes not visible on PC filesystem -

usage detail: usb being used mass storage device. device intelligent component , can create files @ run time. why using mass storage then? since did not want develop usb dd different platforms transferring data. existing universal mass storage driver can used communication between pc , device issue: when device plugged in pc, gets discovered separate drive , visible in file system. if create file on device side, memory visible pc, not reflect on pc's filesystem. updated data visible once perform soft reset of usb device or plug out , plug in device, since device enumeration take place again beginning. question: why modified data in device memory not visible on pc? there method in usb low layer, using can send command pc perform device enumeration again? this predictable, host caches filesystem structure not expect changed externally. may want try making media "removable", inform host of removal/insertion, suspect may annoy os (if medium not read onl

c# 4.0 - MPXJ consistently adds blank task name...is MPXJ better than Interop? -

i'm trying use mpxj create project file hierarchy exists in code. following hierarchy needs converted: division customer contract projects project details (start/end dates, etc.) my code creating .mpx follows: private void buildexport() { net.sf.mpxj.projectfile file = new net.sf.mpxj.projectfile(); net.sf.mpxj.projectcalendar cal = file.adddefaultbasecalendar(); //microsoft.office.interop.msproject.application projapp = new microsoft.office.interop.msproject.application(); //projapp.visible = true; //projapp.filenew(); string firstdate = string.empty; foreach (izcptreeviewitem div in divisions) { net.sf.mpxj.task divtask = file.addtask(); divtask.setname(div.name); //microsoft.office.interop.msproject.task newtask = projapp.activeproject.tasks.add(div.name); //newtask.outlinelevel = 1; foreach (izcptreeviewitem cust in div.subi

eclipse - Display the Tomcat Manager Application? -

using tutorial http://www.eclipse.org/birt/phoenix/deploy/viewersetup.php#install_viewer and tells me display tomcat manager application through link http://localhost:8080/manager/html . however when click error browser saying not connect. why this? how 1 display tomcat manager application if launching tomcat within eclipse (using webtools tomcat server adapter) have make sure have changed settings use installation directory launch instead of default uses separate location loading , deploying webapps. having manager in webapps in tomcat installation wont enough see manager since default tomcat launched eclipse doesn't apps in webapps folder. just make sure catalina.base , catalina.home point tomcat installation directory

objective c - math.h - z-score from percentile -

i'm building app in objective-c ios requires statistics calculations. read on this thread how calculate percentile value, how going in opposite direction? i have percentile, , need z-score (their example uses 5th percentile corresponds -1.645). math.h function w/ formula can use? you need use inverse cdf of normal distribution after: http://en.wikipedia.org/wiki/inverse_gaussian_distribution i did search has written in objective c , can't find it. can adapt code here though: http://home.online.no/~pjacklam/notes/invnorm/

how to set the default css validation scheme in visual studio 2010? -

well problem visual studio tries validate css 1.0 open file , need reset 2.1 every time open css file. asking if there way set default 2.1 ? thanks i found answer on http://forums.asp.net/t/1486063.aspx/1 seems change default css validation need change default html validation tools>options>text editor>html>validation. changed target xhtml 1.0 transitional , css validated 2.1 default :)

devise - Helpers vs controllers in Rails -

i want add function user object, going create user controller (i'm using devise believe should add function existing devise user object). noticed there's folder called 'helpers' in rails project, should putting functions in there instead of inside controller? method enable anonymous sessions, doesn't come out of box devise. thin controller , fat models. try follow principle when creating rails application. put logic , calculations if needed in models. controllers used controller data pass views , how display data. put methods helps display of views in helpers. e.g. put code formating numbers inside helpers. if want share source code between controllers , doesn't fit models, can create library.

c# - When does the .csproj file get updated? -

Image
i open solution file in vs2010, right click on project, go build tab , switch .net framework (say) 4 2. save all. .csproj doesn't change - still says <targetframeworkversion>v4.0</targetframeworkversion> why this? , have line update? right-click on project within vs2010, select properties , set target framework .net framework 2.0. vs close/reopen app , should go. i'm not sure mean to go build shouldn't have explicitly click save all .

mysql - Database better inner join for performance in this case -

i have 2 tables manages time spent on doing various things: @times(id, time_in_minutes) @times_intervals(id, times_id, time_in_minutes, start, end) then @times might relate different things: @tasks(id, description) @products(id, description, serial_number, year) what best practice in order reuse same @times , @times_intervals @task , @products ? i think about: @times(+task_id, +product_id) // add task_id , product_id original @times table but if so, when i'd join @times table @task , @products table slower should choice between 2 ( task_id or product_id ). when task_id not null join on @tasks , viceversa. (i'm using mysql6) thanks lot i drop time_in_minutes column times table. information redundant if sum of detail , premature optimization. i add product_time table containing product_id, times_id , task_time table containing task_id, time_id then total time product: select * product p inner join product_time pt on pt.product_i

nlp - parsing sizes from textual data -

i want extract sizes , textual data ("the missile fifty 5 inches long." , or "he weighted 9 , half pounds.") , convert them data in format usable program. what's way go ? there helpful libraries ? and how complex task ? you approach information extraction (ie) problem. in case, basic approach formulate bunch of regular expressions describe problem approximately , refine until they're either enough or can't further. or, your favorite parser , see kind of trees/dependency structures produces sentences you're after, figure out general pattern, check how , maybe filter results regexp or predicate on returned structure.

c# - How to return the newest file in a directory as a string? -

i able return newest item (that has been created) string within program e.g. s = test.txt the "download" directory text.txt date created 4/5/2011 something.txt date created 1/1/2011 string res = directory.enumeratefiles(direcory) .orderbydescending(f => new fileinfo(f).creationtime).firstordefault();

NHibernate ISession.Query<T> in Mono/NUnit throwing exception -

i'm attempting first nhibernate project , running in mono/opensuse 11.4. unit tests working under windows when attempt run same tests on mono i'm getting exception when try query object nhibernate session. saving data through nhibernate seems working correctly. i'm using mono 2.10.2 , nunit version 2.4.8 fluent nhibernate 1.2 nhibernate 3.1. i've included full output nunit-console in case: >nunit version 2.4.8 >copyright (c) 2002-2007 charlie poole. >copyright (c) 2002-2004 james w. newkirk, michael c. two, alexei a. vorontsov. >copyright (c) 2000-2002 philip craig. >all rights reserved. > >runtime environment - >os version: unix 2.6.37.1 >clr version: 4.0.30319.1 ( 2.10.2 (tarball mon apr 18 15:12:52 utc 2011) ) > >.f >tests run: 1, failures: 1, not run: 0, time: 1.563 seconds > >test case failures: >1) mytests.mytest : system.typeinitializationexception : exception thrown type initializer nhibernate.

navigation - Pausing Android MediaPlayer for Synthesized Speech -

i have android mediaplayer running want pause when speech synthesizer starts speaking (specifically, when google navigation app gives directions). i'm pretty sure possible, standard music player seems have behavior. i've learned (from stack overflow gods) how pause mediaplayer during phone calls: pause music player on phone call , again resume after phone call in android i'm surprised haven't been able find similar mechanism listen events speech synth. assume i've missed something, , if can point me @ link or hint @ answer here, i'd grateful. i have found answer this: http://developer.android.com/reference/android/media/audiomanager.onaudiofocuschangelistener.html the navigation app calls audio focus using "notifications" stream. requested audio focus stream (and music stream well) in application. pause/restart player in callback method audio focus changes , you're go. note: won't work all synthesized speech. i&#

flex - Flash "Double Typing" problem -

i wanted ask whether familiar phenomenon. have small flash application has text box. under osx lion, flash < 10.3. . works fine with osx lion , flash 10.3. . every character typed it, appears twice. same application... anyone heard of remotely similar? i have commercial client application uses flash input , output. seeing issue mac os 10.7.0, flash plugin 10.3.185.5 . our application plays flash swf file using webkit view object. turns out configuration exhibits bug on os 10.7. we able fix bug compiling our application target 64 bit intel platforms, instead of building universal binary. this fixes bug, going have change our installer have both 64 bit binary os 10.7 , universal binary earlier versions of os 10. adobe says bug fixed, no work on when release official build containing fix. https://bugbase.adobe.com/index.cfm?event=bug&id=2935794

java - Looping through XML to build an object -

so im trying loop through xml file shown below , save contents objects each "screen". my xml follows: <?xml version="1.0" encoding="utf-8"?> <screens> <screen id="house" backdropimage = "r.drawable.scene"> <region id="one" rleft = "200" rright = "200" rtop = "10" rbottom = "10"/> <region id="two" rleft = "220" rright = "220" rtop = "12" rbottom = "12"/> <paths left = "park" right = "x" top = "x" bottom = "x"/> </screen> <screen id="park" backdropimage = "r.drawable.park"> <region id="1" rleft = "500" rright = "200" rtop = "10" rbottom = "10"/> <paths right = "house" left = "x" top = "x"

CSS Centering text & adjustable size -

Image
i'm trying make "priority marker" in css. have couple of issues. first : text not centered reasonably @ all. second : i'd prefer width (at least) change dynamically length of text. either doable? result: my understanding of how pick font fits in context beyond current css skills. if has been done don't care reinvent this... .box { border-color: orange; border-style: solid; text-align: center; border-width: 1px 0px 1px 1px; margin: 0px 8px 0px 0px; background-color: yellow; padding-right: 8px; position: relative; height:14px; width:20px; } .arrow { border-color: transparent transparent transparent orange; border-style: solid; border-width: 8px; position: absolute; right: -15px; bottom: -1px; height:0; width:0; } .arrow2 { border-color: transparent transparent transparent yellow; border-style: solid; border-width: 7px; position: absolute; right: -12px; bottom: