Posts

Showing posts from July, 2014

java - i want to transfer data from pc to android phone for which i am using the following code, i am not able to get working directory -

i getting followin error in code: java.io.ioexception: error running exec(). command: ["/adb", -s, 9774d56d682e549c, push, "c:\documents, and, settings\my, documents\other\music\b.wma, ", \sdcard\music] working directory: null environment: null public class transferdata extends activity { private string device_id ; private string = "c:\\documents , settings\\my documents\\other\\music\\b.wma "; private string ="\\sdcard\\music"; private static final string adb_push = "\"" /*+ utility.getworkdir()*/ + file.separator + "adb\" -s %s push \"%s\" %s"; @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.splash); device_id = secure.getstring(getbasecontext().getcontentresolver(),secure.android_id); push(device_id,from,to); } /** pushes file connected device via adb * @param deviceid device seri...

xaml - Silverlight Usercontrol clr namespace -

i'm building silverlight mvvm app (using galasoft mvvm light template). app has usercontrols. have stumbeld across somthing seems namespace issue. namespaces defined in way: myapp.controls -> user controls myapp.view -> different pages of app (which use user controls) myapp -> namespace of main page (root namespace) this works ok long don't give of usercontrols x:name . x:name defined, build breaks following message: error cs0426: type name 'controls' not exist in type 'myapp.myapp' that realy strange! can resolve issue changing namespace myapp.controls myappcontrols or manipulating generated code, direct reference myapp.controls.mycontrol replaced using myapp.controls , instanciate control mycontrol (however overwritten again, switch desgin view). does know reason strange behaviour? have expected common problem? i think found reason: had resource file name myapp. led generation of class myapp , therefore compiler got confu...

How do I add a column to a JPA entity, and still keep my data? -

during development of jpa application, added field "type" entity. caused application fail start with caused by: exception [eclipselink-4002] (eclipse persistence services - 2.0.2.v20100323-r6872): org.eclipse.persistence.exceptions.databaseexception internal exception: java.sql.sqlsyntaxerrorexception: column 't1.type' either not in table in list or appears within join specification , outside scope of join specification or appears in having clause , not in group list. if create or alter table statement 't1.type' not column in target table. error code: -1 during selection. is there way alter table on startup, match current entity definitions? notice when app starts calls create table each table, fails , carries on. in past when i've added fields entities delete database , start again. ok me if want add field entry when developing next release of software, how upgrade clients without losing there data? thanks in advance - phil. genera...

selenium - How to set Proxy Configuration in java code -

i'm trying program in java class start selenium server in case down reason. found here: http://www.testingexcellence.com/how-to-start-selenium-server-with-java-code/ i see if configuration parameters can set using class remotecontrolconfiguration , methods such setport, setlogoutfilename, settimeoutinseconds, ... the problem selenium server connects proxy in way: java -jar selenium-server.jar -dhttp.proxyhost=my.proxy.com -dhttp.proxyport=8080 unfortunately, haven't found how put java code. question is: possible set proxyhost , proxyport values in java? thanks time =) }panacea{ the easiest way set them globally within jvm system.setproperty("http.proxyhost", "yourproxyurl.com"); system.setproperty("http.proxyport", "80"); http://download.oracle.com/javase/6/docs/technotes/guides/net/proxies.html however affects entire instance of jvm, other outgoing connections try use proxy. that's fine in case, if nee...

Android - Layout Height not updating -

i have scrollview inside have linearlayout. linearlayout has views. ex:- linearlayout height 100. after removed views linearlayout same height 100. how update current height. 0 when no views present. my code: <scrollview android:layout_weight="1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:fillviewport="true"> <linearlayout android:layout_weight="1" android:layout_width="fill_parent" android:orientation="vertical" android:layout_height="wrap_content"> </linearlayout> </scrollview> remove android:layout_weight="1" linearlayout if want 0 height if no views visible.

Is there any way to instantiate a 'Type' in Silverlight XAML? -

it's known silverlight lacks compelling x:type markupextension (markupextension is not supported in silverlight @ all). there dynamic workaround it? what enums ( x:static )? my need have commandparameter set type or enum value, neither of these supported in silverlight! this has done in code-behind. if build custom object exposes property of type type, not "converted" when set via xaml. this limitation prevents creating things custom enumvalueprovider, exposes type property , updates values properties enum values specified enumeration type. having class allow bind combobox or listbox list of enumeration values in xaml. you can create custom typeconverter above type property, work around issue. don't xmlns resolution you'd expect. depending on situation, may enough. here another example , exposes "known" types via properties, can bind to.

multithreading - Android Thread makes the UI blank screen -

i have written thread in application. when thread starts running, ui screen becomes blank. how can avoid this? public class settickertext extends thread { @override public void run() { while(true) { systemclock.sleep(25000); log.i("map", "after wait"); } } it's going (don't have compiler near me): new settickertext().start() essentially, when tell thread object start, spins new thread, invokes run you. you're doing calling run ui thread, other function, it's blocking ui thread returning

xcode - iPhone: Creating Scrolling Image/Text Views within Modal View Tab Bars -

i've begun objective-c , looking find way create iphone app launch main menu consisting of maybe around 8 or 9 buttons. when buttons pressed link scrolling text view (containing few paragraphs of text) accompanying image @ top of screen, act "back" button return main menu. looking animate/behave modalview (where new view scrolls bottom of screen, , scrolls down when dismissed/back-button pressed). i have got tab views working within modal view (which brought pressing button in main menu) , have worked out how assign custom icon each tab. i've added custom background each tab. though i'm still having trouble adding scrolling views each tab, can insert pictures , text programmatically. appreciate give me this.. thanks much!! .h #import <uikit/uikit.h> @interface masseurviewcontroller : uiviewcontroller { uitabbarcontroller *tbc; } -(ibaction)showheadtabbar; -(void)dismisstabbar; @property (nonatomic, retain) uitabbarcontroller *tbc; ...

css - How to add spaces between each row in dataTable -

Image
how add spaces between each row of table. try this <p:datatable styleclass="yourtableclass"> <p:column style="background-color: ##eff2f9"> //content here </p:column> </p:datatable> but not work i used primefaces 2.2.1 firstly, check browser make/version: border-spacing not supported on ie6/7. secondly, border-spacing works when border-collapse of table set separate . primefaces specific stylesheet has set collapse (which general ui preferred form of border representation). way border-spacing won't work. thus, all should work, including ie6/7 hack on last declaration: .yourtableclass { border-collapse: separate; border-spacing: 10px; *border-collapse: expression('separate', cellspacing = '10px'); } with <p:datatable styleclass="yourtableclass"> (favour classes on inline styles) update : per screenshot , comments, primefaces wraps generate...

content management system - Document Storage That Works Well with Grails -

we need manage various documents , files in our grails application. there out there integrates grails document management , not full cms? have looked @ jcr (java content repository) implementations? on past java (not grails/groovy) project, had lot of success apache jackrabbit . however, surprises me grails plugin support jcr and/or jackrabbit seems immature , uncompleted @ time. if you're interested, perhaps partner , write this.

How can I write android binary XML from Android App? -

i've got app pulls xml web, , caches locally. parsing xml expensive compared parsing android binary xml, i'd store local copy android binary xml. haven't spotted api creating android binary xml on fly though, c/c++ code used aapt. my motivation taking approach don't use xml values/attributes, may want use more of them in future version of app, , don't want download xml data again. can point me @ right bits of api create android binary xml @ run-time? many thanks, phil lello android binary xml faster because optimized compiler. in runtime, can't create binary xml without having implementation of compiler you.

winforms - Using programatically created CheckBoxes in Windows Form [C#] -

for example, array of checkboxes: checkbox[] faults = new checkbox[20]; now how place these in form , link them array name? thanks. how that: yourform.controls.addrange(faults);

gem - require': no such file to load -- active_support/core_ext/logger -

when rails s or rails c.. gives me error. tried removing rails , reinstalling uninstalled whole of ruby , reinstalled both rails ruby still same error. line 7 generating error require 'logger' ... running line in irb generates same error.. m using ruby1.9.2 , rails 3.0.6 been looking resolve error hours now... every thing working fine couple of days ago , seems break.. may added gem gemfile broke it.. /usr/local/ruby/lib/ruby/gems/1.9.1/gems/activesupport-3.0.6/lib/active_support/core_ext/logger.rb:19:in `require': no such file load -- logger (loaderror) /usr/local/ruby/lib/ruby/gems/1.9.1/gems/activesupport-3.0.6/lib/active_support/core_ext/logger.rb:19:in `<top (required)>' /usr/local/ruby/lib/ruby/gems/1.9.1/gems/railties-3.0.6/lib/rails.rb:7:in `require' /usr/local/ruby/lib/ruby/gems/1.9.1/gems/railties-3.0.6/lib/rails.rb:7:in `<top (required)>' /usr/local/ruby/lib/ruby/gems/1.9.1/gems/railties-3.0.6/lib/rails/all.rb:1:in ...

php - How do I block HTML in my form input? -

so, have basic little script takes input html form, processes php , writes text file in form of css. i've got jerkwad trying drop tables on server (there no sql i'd keep people trying none less) here code have far, can me block potentially bad input via htmlentities or else? the html form <html><body> <h4>codes form</h4> <form action="codes.php" method="post"> username: <input name="username" type="text" /> usercode: <input name="usercode" type="text" /> <input type="submit" value="post it!" /> </form> </body></html> the php <html><body> <?php $friendcode = $_post['usercode']; $username = $_post['username']; echo "you have recorded following information on server ". $username . " " . $usercode . ".<br />"; echo "thanks contributing!...

haskell - Functional Dependencies / Type Families -

with functional dependencies can constrain type of dependent parameter in type class using multi-parameter type classes. this: {-# language functionaldependencies, multiparamtypeclasses,typesynonyminstances #-} class (num a, integral b) => f b | -> b f :: -> b instance f int int f = id instance f float integer f = truncate and everything'll work perfectly. > f (1 :: int) 1 > f (1.9 :: float) 1 but if try write like instance f double string f = show i'll following compilation error: no instance (integral string) arising superclasses of instance declaration possible fix: add instance declaration (integral string) in instance declaration `f double string' is there way approach type families instead of fundeps? i guess want have this: {-# language typefamilies, flexiblecontexts #-} class num => g type b g :: (integral (b a)) => -> b instance g int type b int = int g = id instance g float type b floa...

visual studio 2010 - Running VS2010 UnitTests project from TFS2008 Team Build -

i have visual studio 2010 mvc 3 application unit tests projects in it. have tfs 2008 build definition build solution. on build agent have got following installed vs2008 team system developer edition vs2010 professional installed i have updated msbuildpath in tfsservice.exe.config .net 4 farmework deleted workspaces have followed steps @ http://blog.aggregatedintelligence.com/2011/03/vs2010-tfs-2008-and-unit-tests.html but when run build following error:- using "testtoolstask" task assembly "c:\program files\microsoft visual studio 10.0\common7\ide\privateassemblies\microsoft.teamfoundation.build.processcomponents.dll". task "testtoolstask" c:\program files\microsoft visual studio 10.0\common7\ide\mstest.exe /nologo /usestderr /searchpathroot:"c:\tfs\core\crime\binaries\release" /resultsfileroot:"c:\tfs\core\crime\testresults" /testcontainer:"c:\tfs\core\crime\binaries\release\\project1.unittests.dll...

c# - How do I debug a deadlock when only one thread shows up in Visual Studio? -

my application blocking indefinitely on call lock ( obj ) , there no other threads in threads window have code browse @ all. isn't kind of necessary there thread involved? why isn't showing up, , cause of not showing up? update: think figured out causing it. had sort of hackish block whereby wait() on manualresetevent inside 2 locks. problem needed release locks before waiting other threads use them, doing this: lock ( 1 ) { lock ( 2 ) { ... monitor.exit( 2 ); monitor.exit( 1 ); syncevent.wait(); monitor.enter( 1 ); monitor.enter( 2 ); } } what wasn't counting on monitor.exit() decrements internal recursion counter, , possible method being called block synchronized; lock not being released . i guess bad idea begin with. i've since moved call wait() outside of locked blocks , seems working fine now. thanks insight. although, think it, if method being called code synchronized on 1 of locks, still...

jquery - Detaching, manipulating, appending -

i reading jqfundamentals weekend, , rebecca murphey talks about: the $.fn.detach method extremely valuable if doing heavy manipulation element. in case, it's beneficial $.fn.detach element page, work on in code, , restore page when you're done. i have table sort this, got "learning jquery", page 140: var rows = $table.find('tr:not(:has(th))').get(); rows.sort(function(rowa,rowb) { ... }); $.each(rows, function(index,row) { $table.children('tbody').append(row); }); i wonder if should detach table , reattach it? detaching element removes dom. so, if detach the table element, whole table disappear or "flash" until re-insert table dom. however, may want detach tbody element dom , reinsert table when done sorting rows.

Cannot dynamically modify external variables in a subroutine in R while use apply on a matix? -

this problem has confused me couple of days. let have 2 matrices: matrix_a <- matrix(0, nrow = 3, ncol = 3, dimnames = list(c("r1", "r2", "r3"), c("c1", "c2", "c3"))) matrix_b <- matrix(c("r1", "r2", "c1", "c2"), nrow = 2, ncol = 2) i want dynamically modify matrix_a in function: change_var <- function(x, matrix_a) { if(any(rownames(matrix_a) == x[1]) && any(colnames(matrix_a) == x[2])) { matrix_a[x[1], x[2]] <- 1 return (matrix_a) } } apply(matrix_b, 1, change_var, matrix_a) however, seems code cannot change matrix_a @ all. intended result of matrix_a should c1 c2 c3 r1 1 0 0 r2 0 2 0 r3 0 0 0 how achieve goal of dynamically modification of matrix_a ? please provide me not-for-loop solution. in advance. as know, <<- or assign can used modify "global" variable. <...

GCC GCJ needs ECJ and Other Libraries? -

so downloaded mingw-w64-bin_i686-mingw_20110410.zip here (gcc 4.7 apparently), , discovered had recent version of gcj compiler. i tried using it, apparently gcj requires ecj1.exe , eclipse compiler java... so, find compatible version of binaries of ecj , associated java libraries needed (libgcj, etc.)? ideally found on mingw-w64 project page, doesn't seem exist. (i've tried copying them older gcc version; it doesn't work .) the cause opensuse version of gcc this: if configure step of compilation of gcc did not find ecj.jar file, ecj1 missing @ time when gcj, has been build, called. ecj.jar can taken ftp://sourceware.org/pub/java/ecj-4.8.jar example. the 2 options are: i) put ecj.jar in $home/share/java/ecj.jar, reconfigure gcc ./configure .... --with-ecj-jar=$home/java/ecj.jar , recompile gcc. future compilations gcc not require ecj1 . ii) put ecj.jar in $home/share/java/ecj.jar , create ecj1(.exe) through compilation gcj -o$home/...

binding - WPF Bind to ViewModel of another element -

just example. customcontrol has viewmodel property called "test" how bind textbox specific property? can access siblings viewmodel? <textbox text="{binding elementname=mycontrol, path=viewmodel.test}"></textbox> <controls:customcontrol x:name="mycontrol" /> siblings viewmodel in datacontext try <textbox text="{binding elementname=mycontrol, path=datacontext.test}"></textbox> <controls:customcontrol x:name="mycontrol" />

Python parse DNS response headers -

i want know if there way generate dns queries via python , dns responses headers see things in dns response nxdomain, connection refused, server failure etc.. thanks in advance sure, there library called dnspython that.

Help with / Tutorial for Styling for GWT Beginners -

i new gwt , having hard time finding tutorials focused on teaching styling gwt. few examples i've found provided google rather paltry, , don't explain much. some things i'm trying be: change global font style change existing widgets' styling, such background color of selected item in celltree replace button's text image instead remove borders of text fields the list goes on i've been searching , searching, , not finding particularly helpful styling, advice/direction appreciated! thank you! styling in gwt done entirely css. can link ordinary css file host html, normal website, , rules apply normal css normal html. gwt provides couple of ways optimize css, , gets pretty complicated, @ basic level can use firebug @ html of app, figure out css need that, , throw in css file. gwt applies many special styles widgets come built-in, , can learn of style names generated html , documentation.

iphone - Does NSNotificationCenter removeObserver: deregister a VC from receiving MemoryWarning Notifications? -

i stumbled issue in app: tested didreceivememorywarning calls uiviewcontroller including follow-up calls viewdidunload . this used work fine in older versions of app, not working within iphone simulator: didreceivememorywarning not called more. this caused calling [nsnotificationcenter defaultcenter] removeobserver:self] in viewwilldisappear (self being uiviewcontroller) unregister lifecycle notifications did add in viewdidappear . that global removeobserver: call did not remove added notifications, apparently system's uiapplicationdidreceivememorywarningnotification notification caused uiviewcontroller's didreceivememorywarning being called. is behaviour design? not find reference/document pointing out, calling removeobserver: within uiviewcontroller breaks standard memorywarning handling. yes, design. this behavior doesn't surprise me @ all. implementation of uiviewcontroller opaque there no way know sure registering instances uiapplication...

jquery - How To Loading Web User Controls Asynchronously -

in default.aspx page have many user controls , take lot of time load. 1 know how make page loaded faster. be sure load information need display on page on initial load. subsequent information should loaded via postback or ajax.

php - Queuing update requests for a giant update? -

i have site, , when user action wish add count of how many actions person has ever done. naturally i'd "update user table each time!" don't feel if that's solution, , i'm interested in seeing if there way this. basically user log in , start using actions, , every time make action [whatever] , @ end of day, take [whatever]s , make query, saving resources on each action. site grow 1,000 users, little queries start adding up! there 1 type of "action", sake of question assume each page load action. if single session, store (queue) "all updates" in session / global variable. update @ end of session. if multiple-session system, suggest doing above , update table @ end of each session. :(upwards of few hundred kbs, not idea): you want make shortcode endcoing /decoding library store sessions vars. if talking huge data. example, if have drag , drop system, intermediate states key<>val pair structures. eg: loc_a=widget_1 ;...

installation - How does Burn in WiX 3.6 bundle MSI files into an .exe? -

i'm interested in knowing how wix bundling exe files created burn. know creating self-extracting exe file pretty straightforward, having done million times in winrar . directory exe file being unpacked to, , how installation writing location add/remove programs? also, how ux file being kept around uninstall? , more interesting, goes on during upgrade? burn doesn't create typical "self-extracting .exe" unpacks contents launches. instead, extracts bits needs (the ux or bootstrapper application) temporary directory , caches packages needed when they're needed. way, no time wasted extracting packages aren't used. the cache directory named "package cache" , stored in appdata folder, 1 depending on whether it's per-user or per-machine package. there's nothing special upgrades, except when 1 bundle upgrades another, previous bundle's cache removed.

cryptarithmetic puzzle - Prolog dot product with variables (constraint satisfaction) -

i'm working on prolog assignment , i'm very close solution. so, problem constraint satisfaction problem have find values set of variables such conditions true. specifically, given 3 words (w1,w2,w3), assign variables such w1+w2=w3. example of send+more=money, or it+is=me. the constraints are: (1) have add correctly, (2) starting letter cannot 0 (3) , variables must distinct. , has work general word problem. issue happening when try ensure add correctly (i've met other conditions , understand problem). in terms of second word problem should have: 10*i + 1*t +10*i + 1*s ___________ 10*m + 1*e so, have made function makes lists of powers of 10 in length, so: powlist(1,l) :- append([1.0],[],l). powlist(n,l) :- n1 n-1, x 10**n1, powlist(n1,l1), append([x],l1,l), !. i have actual list of letters, say, [i,t,i,s,m,e]. constructed list of coefficients (i'll explain part later) out of powlist have following: [10,1,10,1,-10,-1]. d...

jquery - Help appending html data from json encoded data -

i having trouble getting html data json string append after jquery post. the problem having slashes not being removed html select list not displaying , html outputting incorrectly. have tried parsing data after here json string have: {"type":"success","list":"<li id=\"item-1><p>test<\/p><p><select name=\"steps\">\n<option value=\"3\">step 1<\/option>\n<option value=\"2\">step 2<\/option>\n<option value=\"6\">step 3<\/option>\n<option value=\"5\">step 5<\/option>\n<\/select><\/p><\/li><li id=\"item-18><p>testinggg<\/p><\/li>"} and here how created: jquery.ajax({ success: function(data) { if (data) { if(data.type =='success') { jquery("#item-list").append(data.list); } } ...

web applications - Subdomain per client? -

i making web application (hopefully) service many clients. @ first, going have mydomain.com landing page login , have 1 massive database users, anticipated downsides approach. thought basecamp, example, which, when sign up, gives subdomain "instance" of product, such myclientname.basecamphq.com my questions are: basecamp have own separate web application each instance, own separate database? have useful guides setting process? thanks. if gonna have sub-domains, yes each of them separate web application in iis. underlying concept how iis handles requests same ip different addresses. iis reads host http header , if s1.example.com refers peper application based on bindings . having separate databases decision you. if conceptually don't need separation, don't because of technical issues. possible users separated based on parentid in database (a one-to-many relation between tblcustomers -> tblusers). managing multiple databases/subdomains ha...

wpf - How to open a window then load my XAML file to it? (XAML and C#) -

i new wpf , c# , need - sorry newbie question! anyway have control panel 'window' file thats loaded when run project, , have button on control panel, when clicked triggers event. inside 'event function' trying load new window has own xaml code behind, how go doing this? have googled no avail. please explain in laymens terms, still getting hang of all. thanks! private void btncustomers_clicked(object sender, routedeventargs e) { //load in customers.xaml file here - in new window } you need declare instance of class other window call show() on it. if other window call mysecondwindow write following in event handler. mysecondwindow otherwindow = new mysecondwindow(); otherwindow.show(); a basic explination of how windows work can found on msdn site .

r - Formulating Linear Programming Problem -

may quite basic question knows linear programming. in of problems saw on lp has similar following format max 3x+4y subject 4x-5y = -34 3x-5y = 10 (and similar other constraints) so in other words, have same number of unknown in objective , constraint functions. my problem have 1 unknown variable in objective function , 3 unknowns in constraint functions. problem this objective function: min w1 subject to: w1 + 0.1676x + 0.1692y >= 0.1666 w1 - 0.1676x - 0.1692y >= -0.1666 w1 + 0.3039x + 0.3058y >= 0.3 w1 - 0.3039x - 0.3058y >= -0.3 x + y = 1 x >= 0 y >= 0 as can seen, objective function has 1 unknown i.e. w1 , constraint functions have 3 (or lets 2) unknown i.e w1, x , y . can please guide me how solve problem, using r or matlab linear programming toolbox. your objective involves w1 can still view function of w1,x,y , coefficient of w1 1, , coeffs of x,y zero: min w1*1 + x*0 + y*0 once se...

iphone - Compare two NSDates for same date/time -

this question has answer here: how compare 2 dates in objective-c 14 answers is date1 == date2 not valid way compare? if not, correct alternative? here's code: - (nsdate*) datewithnotime { unsigned int flags = nsyearcalendarunit | nsmonthcalendarunit | nsdaycalendarunit; nscalendar* calendar = [nscalendar currentcalendar]; nsdatecomponents* components = [calendar components:flags fromdate:self]; nsdate* dateonly = [calendar datefromcomponents:components]; return dateonly; } - (bool) samedayasdate:(nsdate*)datetocompare { nsdate *date1 = [self datewithnotime]; nsdate *date2 = [datetocompare datewithnotime]; return date1 == date2; // here things seem fail } you're comparing 2 pointer values. need use nsdate comparison method like: return ([date1 compare:date2] == nsorderedsame);

matlab - variable in plot title -

i want do for = 1 : size(n, 2) figure(i); title('n = %d', i); %other stuff but setting title doesn't work. why? because forgot add sprintf for = 1 : size(n, 2) figure(i); title(sprintf('n = %i', i)); %# %i integer %other stuff end

Confused about the terminology when using the orientation sensor in Android -

i've written small app outputs roll, pitch, , azimuth returned device's sensor. however, i'm having difficulty understanding numbers returns. imagine user holding smartphone in portrait mode screen directly in front of him (the pose using snap photograph). jams pencil through middle of screen , rotates device around pencil. if wanted detect when user rotated 90 degrees around pencil (relative it's starting position), should interested in: roll, pitch, or azimuth? the answer seem obvious after little experimentation or reading google docs. however, 3 numbers change @ approximately same rate during tests, i'm thoroughly confused. why not use accelerometer instead? i think that's better solution you, when want detect rotation of phone. using accelerometer give result: when holding phone in example, 1 of x, y or z values either -9.82 or 9.82 depending way hold phone. let's x -9.82, , when rotates value increase until hits 0 , y start ...

sql server - SQL express deployment on multiuser? -

i developing application small user group , decided use sql express. so design normal sql express hosted in 1 machine(as server machine) , users client app connect sql-express host machine accessing db. now problem remote clients not able connect db, host machine can access db. can please if have tried before ?? connection string used below, need change connection string ? data source=hostname\sqlexpress;integrated security=true; attachdbfilename=|datadirectory|\mydb.mdf;user instance=true; note: users not domain connected lan connected. the database service not setup listen on tcp port 1433 default security reasons. need use configuration utility enable remote access. need make sure port not being blocked firewall. these instructions sql server 2005 useful. if users not running under domain account believe have issues authentication. may want add them domain, or enable sql server (password) authentication. after enabling can specify username , password via conn...

html - PHP library to create inlined CSS from files or from <style> tags? -

i library create inlined css+html .html , .css files or html file tags in head. prefer php library if possible. by inlined css mean like <span style="font: bla bla bla">hi there!</span> versus <style> .greeting { font: bla bla bla; } </style> i need put html emails , simplify process greatly. if interested, current solution (for stuff isn't restyled often) use smarty templating engine create document, , assign style="" part variable inside template. then can use variable in each tag (like <td {$td_style}> (fyi - {$variable} how smarty variables inserted template) , have generate appropriate email-friendly html. however want more general, , can feed html , css rather have convert of smarty template. does know if library exists? although don't know of library handles this, if you're set on php, think using csstidy parse css, , using xml parser (ideal if code well-formed--maybe simple...

unit testing - Rails 3-Cucumber-Omniauth and issue .... :( -

i have updated bundle, , since, acceptance tests not pass ... when /^facebook reply$/ devise::omniauth.short_circuit_authorizers! devise::omniauth.stub!(:facebook) |b| b.post('/oauth/access_token') { [200, {}, access_token.to_json] } b.get('/me?access_token=plataformatec') { [200, {}, facebook_info.to_json] } end visit '/users/auth/facebook/callback' end and have following error : devise not missing constant testhelpers! (argumenterror) ./features/step_definitions/users_connect_steps.rb:20:in `/^facebook reply$/' features/users_connect.feature:9:in `and facebook reply' the line 20 is: devise::omniauth.short_circuit_authorizers! and bundle list gems included bundle: * zentest (4.5.0) * abstract (1.0.0) * actionmailer (3.0.6) * actionpack (3.0.6) * activemodel (3.0.6) * activerecord (3.0.6) * activeresource (3.0.6) * activesupport (3.0.6) * addressable (2.2.5) * arel (2.0.9) * autotest (4.4.6) * bcryp...

android - Draw horizontal line in pdf using itext 5.0.6 -

1) can tell me how draw horizontal line in pdf using itext 5.0.6? 2) may sounds strange when capture photo camera , crop it. after display cropped image below part of image has been cut(not whole part cut portion of image has been cut approx. 2 3 horizontal line). how fix ? have @ lineseparator . note doesn't take space on page.

c - USB serial port garbage when the device resets -

when reset usb device connected via usb serial starts printing garbage. if close out serial monitor (using arduino's serial console should not matter) , reopen, clean text starts printing. judging rate of transmission, garbage caused device doing normal serial printing -- is, not random garbage. this homebrew usb serial device problem in there. in fact, can change code in usb serial device, cannot same serial terminal program :-), prefer if solution there. no, not incorrect baud or parity setting please don't suggest it! :-) thanks help/ideas! is printing garbage when nothing being (intentionally) transmitted? if so, there hardware problem. either resets "break" state, or jabbering. if happens when data written through it, then, when device resets, serial settings default to? is caused speed/data bits/stop bits problem.

Retrieve index of a List<> item based in C# using Linq -

it pretty simple question, have list of object has field named "id". how can retrieve index of object in list if know id? example: custom_objects test = new custom_objects{id=50}; list<custom_objects> list = new list<custom_objects>(); list.add(test); i retrieve index of object id = 50 in list, 0 in example. var index = list.findindex(x=>x.id==50);

linux - Geting SIGBUS (Bus error) @ 0 (0)killed by SIGBUS (core dumped) in Redhat -

i have process works in same machine in 2 accounts when copy process other account , run process im getting core dump. when run process strace in end im getting : --- sigbus (bus error) @ 0 (0) --- +++ killed sigbus (core dumped) +++ when open core dump im getting : #0 0x000000360046fed3 in malloc_consolidate () /lib64/libc.so.6 #1 0x00000036004723fd in _int_malloc () /lib64/libc.so.6 #2 0x000000360047402a in malloc () /lib64/libc.so.6 #3 0x00000036004616ba in __fopen_internal () /lib64/libc.so.6 #4 0x0000000000fe9652 in logmngr::openfile (this=0x2aaaaad17010, ilogindex=0) @ logmngr.c:801 i can see opening file logging , why in 1 account , in other fine ? you can sigbus unaligned memory access . using mmap, shared memory regions, or similar ?

javascript - How to bind array to arrystore in order to populate combo in extjs -

i having array as var cars = new array('audi','benz','citron','nissan','alto'); i want add data arraystore below var mystore = new ext.data.arraystore({ data : cars , fields : ['names'] }); on binding array store combo var mycombo = new ext.form.combobox({ store: mystore , displayfield: 'name', valuefield: 'name', typeahead: true, mode: 'local', forceselection: true, triggeraction: 'all', emptytext: 'select state...', selectonfocus: true, }); the combo showing first letter of each word in array a, b, c, n, a how can disply combo arry using is populated programatically , binding arraystore the format of data arraystore consumes array of arrays. reformatting store data follows should allow work: var cars = [['audi'], ['benz'], ['citron'], ['nissa...

android - Remove multiple Activities to go Back to Dashboard from Options menu -

i have optionsmenu in android app, in button go apps dashboad , remove activities laying upon that, removing history. how possible? thx got answer: that's trick: myintent.addflags(intent.flag_activity_clear_top); public boolean onoptionsitemselected(menuitem item) { // handle item selection switch (item.getitemid()) { case r.id.dashboard: intent myintent = new intent(this, dashboard.class); myintent.addflags(intent.flag_activity_clear_top); startactivity(myintent); return true; default: return super.onoptionsitemselected(item); } } that's trick: myintent.addflags(intent.flag_activity_clear_top);

iphone - UI View before camera picker view -

i want able display uialertview and/or actionsheet before camera picker view. possible , can tell me how. in advance, this tutorial explains it: http://www.musicalgeometry.com/?p=821 just add uialertview in overlay view .. if follow tutorial, can it

ctags - How do I create a Vim function-list inside quick-fix window? -

is there way put functions defined in current buffer quick-fix list? imagine tlist (from taglist plugin) opened in quick-fix window. create expression returns list want. eg: let cmd='exctags -x '.bufname('%')." | awk '{print $4\"|\"$3\"|\",$1}'" feed cexpr or cgetexpr cexpr system(cmd)

Searching XML through Java Codes -

i have around 30 xml files proper formatting , huge amount of data. want search these xml files specific data retrival. can suggest site or blog can use aguideline solve problem. i need search inside of each tag keyword provided user. , sometime specific tag name return content inside tag according user request. example : a.xml, b.xml, c.xml inside a.xml <abc> content </abc> user may search abc tag or keyword inside content. in both cases should return content or if more 1 match should return link both clicking user can see them 1 one. i'd recommend using xpath, sql-like language searching in xml documents http://www.ibm.com/developerworks/library/x-javaxpathapi.html

iphone - effect or animation in UItableVIew -

Image
when click on tableview displays show details how can this?: i think need implementation similar accordion. here sample reference can start how implement accordion view iphone sdk app? accordion table cell - how dynamically expand/contract uitableviewcell? accordion sample tutorial accordion sample tutorial 2

.net - How to dispose shared variable in VB.NET -

how dispose shared variable in vb.net i using shared object of asterisk.net manager variable, assigned in form load , dispose in main form closing, problem after closing application, application.exe keeps live in task manager, if not initializing shared object in form load there no problem, my code in form open public shared withevents objmanager asterisk.net.manager.managerconnection public shared sub connectasterisk() try objmanager = new asterisk.net.manager.managerconnection(elastix_ip_address, asterisk_port, asterisk_user_name, asterisk_password) objmanager.login() catch ex exception end try end sub private sub frmmain_formclosing(byval sender object, byval e system.windows.forms.formclosingeventargs) handles me.formclosing asteriskmanager.objmanager = nothing end sub can 1 please that thanks, senthil i think problem not in disposing of managerconnection. asterisk.net manager doesn't implement idisp...

javascript - JSON returning as undefined -

hello have ajax request submits form , sends , email, if email submitted successfully, encode php array looks this, $success = array("state" => "email sent"); i checking state of data in ajax request see if state matches "email sent" when alert(data) undefined, doing wrong? below javascript, $.ajax({ url: "<?php echo base_url(); ?>home/callback", data: $("#callback").serialize(), type: "post", datatype: "json", success: function(data){ $("#fancybox-content div").html(data); alert(data.state); } }); try html value of 'fancybox-content' div. $('#fancybox-content').html();

javascript - double js not working -

can please tell me how 2 times #videocontainer on same page: <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml"> <head> <title>my videos</title> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script> <script type="text/javascript" src="http://code.jquery.com/jquery-1.4.4.min.js"></script> <script src="http://connect.facebook.net/en_us/all.js#xfbml=1"></script> <script type="text/javascript"> function loadvideo(playerurl, autoplay) { swfobject.embedswf( playerurl + '&rel=1&border=0&fs=1&autoplay=' + (autoplay?1:0)+'&version=3', 'player',...

python : Replacing a HTML element depending on its content -

i have html document, in elements contains stuff want hide (like chinese government doing, except want hide confidential information). example have : <div> <span> bkhiu jknd o so yui iou 789 </span> <span> bkhiu <div> 56 898tr secret oij890 </div> </span> </div> and want elements contain string secret , , replace whole content ### : <div> <span> bkhiu jknd o so yui iou 789 </span> <span> bkhiu <div>###</div> </span> </div> i have thought of using minidom , re : xmldoc = minidom.parsestring(my_html_string) # filtering nodes content sensitive_nodes = filter(lambda n: re.search('secret', n.nodevalue), xmldoc.getelementsbytagname()) # replacing content node in sensitive_nodes: node.nodevalue = '###' # output my_html_string = xmldoc.toxml() but first parsing doesn't succeeds : expaterror: mi...

android - How to remove bottom line of custom Tab view -

Image
how can remove line tab view? or can set height or colors it? try defining new theme windowcontentoverlay set null: <style name="mytheme" parent="@android:style/theme> <item name="android:windowcontentoverlay">@null</item> </style> and apply theme activity in manifest (or can apply element apply application-wide): <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.stylingandroid.vectordrawables" android:versioncode="1" android:versionname="1.0"> <uses-sdk android:minsdkversion="10" /> <application android:icon="@drawable/icon" android:label="@string/app_name"> <activity android:name=".mainactivity" android:label="@string/app_name" android:theme="@style/mytheme"...

jquery - Change iFrame src on ajax complete -

using jquery's $.ajax() want retrieve information server, , then, based on info, change src attribute of iframe. something like: $.ajax( { url: "someurl.aspx/getinfo", datatype: "json", data: "{'data':{'data1':'data1'}}", type: "post", contenttype: "application/json; charset=utf-8", complete: function(data, stat) { if (stat == "success" ) { var src = json.parse(jsondata.responsetext).d.src $('#myframe').attr("src",src); } } } ); the page trying load returning pdf file, goal show user dialog choose between downloading or opening file. on ie7 , 8 browser showing ...

.net - Create a sql user from database project Visual Studio 2010 -

i have database project , have script create database user. struggling set password of user. create user [baruser] default_schema = dbo, password='password', default_database=[foo], check_expiration=off, check_policy=on gives exception error 420 sql80001: incorrect syntax near 'n'password''. expecting id, or quoted_id. its works if run query in sql management studio. cant seem find information creating users using database projects, appriciated. your sql command creating login , user, 2 separate sql objects. this stackoverflow question contains solution should you.

java - Can I filter autocomplete suggestions by return type in Eclipse? -

when autocompleting method calls in eclipse, possible filter list of suggestions on these criteria : return type class implementing method i.e. when type myarraylist. find methods returning boolean inherited abstractcollection ? if create local variable , attempt assign it, eclipse puts matching return types first in autocomplete list, e.g. abstractcollection obj; boolean temp = obj.<autocomplete list> if declare obj abstractcollection, won't see other methods.

http status code 404 - Returning 404 Error ASP.NET MVC 3 -

i have tried following 2 things have page return 404 error: public actionresult index() { return new httpstatuscoderesult(404); } public actionresult notfound() { return httpnotfound(); } but both of them render blank page. how can manually return 404 error within asp.net mvc 3? if inspect response using fiddler, believe you'll find blank page in fact returning 404 status code. problem no view being rendered , blank page. you actual view displayed instead adding customerrors element web.config redirect user specific url when status code occurs can handle url. here's walk-through below: first throw httpexception applicable. when instantiating exception, sure use 1 of overloads takes http status code parameter below. throw new httpexception(404, "notfound"); then add custom error handler in web.config file determine view should rendered when above exception occurs. here's example below: <configuration> <system.web...

java - JPA 2.0 CriteriaQuery on tables in @ManyToMany relationship -

i have 2 entities in @manytomany relationship. // output has 4 other @manytoone relationships if matters @entity @table public class output { @id public string address; @manytomany(targetentity = interval.class, cascade = cascadetype.all, fetch = fetchtype.lazy) @jointable(name = "output_has_interval", joincolumns = {@joincolumn(name = "output_address", referencedcolumnname = "address")}, inversejoincolumns = {@joincolumn(name = "interval_start", referencedcolumnname = "start"), @joincolumn(name = "interval_end", referencedcolumnname = "end")}) collection<interval> intervals; @idclass(intervalpk.class) // i'll omit one. @entity @table public class interval { @id pu...

Can one filter the events that are logged by firebug? -

Image
is possible filter events logged log events option in firebug? use search bar towards top right in console? works me on ff4. see also: how debug javascript/jquery event bindings firebug (or similar tool)

r - partial row-sums in multidimensional arrays -

i have question on how apply r functions multidimensional arrays. for example, consider operation, reduce entry sum of other entries. ppl["2012",,,,,1] <- ppl["2012",,,,,1] - ppl["2012",,,,,2] - ppl["2012",,,,,3] - ppl["2012",,,,,4] - ppl["2012",,,,,5] - ppl["2012",,,,,6] - ppl["2012",,,,,7] - ppl["2012",,,,,8] while in case subtracting individual values might feasible, prefer vector-oriented approach. if familiar multidimensional matrix algebra come matrix performs necessary operation when applied, complex given number of dimensions involved. sum(ppl["2012",,,,,2:8]) not correct solution, sum() returns scalars. i use loops perform necessary operations, contradicts paradigm of vector-oriented programming. thanks help! edit: , here solution original problem, based on andrie's suggestion: ppl[paste(i),land,,,,1] <- ppl[paste(i),land,,,,1] - apply(ppl[paste(i...

java - JavaMail - Cannot folder.open() -

as title says, when attempting folder.open() fails, doesn't throw error though proving hard find reason. in debug console following error appear may/may not related (this shows after pressing resume after folder.open() breakpoint). i using javamail api android development. working fine imap servers need able connect pop3 mail servers also. store being connected gmail , neccessary settings have been changed on gmail account. 04-12 13:22:26.682: info/dalvikvm(436): ljava/lang/illegalstateexception;: folder not open 04-12 13:22:26.682: info/dalvikvm(436): @ com.sun.mail.pop3.pop3folder.checkopen(pop3folder.java:512) 04-12 13:22:26.682: info/dalvikvm(436): @ com.sun.mail.pop3.pop3folder.close(pop3folder.java:227) 04-12 13:22:26.682: info/dalvikvm(436): @ com.sun.mail.pop3.pop3folder.finalize(pop3folder.java:506) 04-12 13:22:26.682: info/dalvikvm(436): @ dalvik.system.nativestart.run(native method) the connection method pop3 follows: string ssl_factory = ...

Unicode chars and Spring JavaMailSenderImpl, no unicode chars under Linux! -

i'm using spring , javamailsenderimpl, famous spring class send emails. emails contain lot of unicode chars èéàò or notably dreaded € symbol. classes work fine when run on windows. emails sent chars (plain text, no html). if install app on linux virtual server, i'll ? instead of special chars. spring, java configuration or else? update basically architecture this: there spring web application , use spring javamailsenderimpl work done. configuration in servlet-context: <bean id="mailsender" class="org.springframework.mail.javamail.javamailsenderimpl"> <property name="host" value="${email.server}" /> <property name="username" value="${email.server_user}"></property> <property name="password" value="${email.server_pass}"></property> </bean> i'm using same host on windows , linux send mail (that not same machine application runs on......