Posts

Showing posts from February, 2013

android - startActivity with an implicit category-less intent -

it seems me if startactivity called implicit categoryless intent, activities intent filter specifying default category (android.intent.category.default) can launched. the category not needed in intent filter services if use startservice instead of startactivity. does see same behavior ? is documented somewhere in android official documentation ? i think documented. see http://developer.android.com/reference/android/content/intent.html : the categories, if supplied, must listed activity categories handles. is, if include categories category_launcher , category_alternative, resolve components intent lists both of categories. activities need support category_default can found context.startactivity(). my experience category-less activity can used startactivity() if class explicitly set in intent, though. in case, no intent matching done.

linux - Allow outgoing connections using 'iptables' -

greeting all, "iptables -l" gives following output [root@ibmd ~]# iptables -l chain input (policy accept) target prot opt source destination chain forward (policy accept) target prot opt source destination chain output (policy accept) target prot opt source destination server has global ip , can accessed outer ips.but cannot ping nor telnet port (including tcp 80) server. has 'iptables' settings ? tips on allow access server? thanks in advance. it seems have empty iptables, i.e. have no firewall. take care.

c# - Why does this not work? -

i have class act variables store data textboxes: public class business { int64 _businessid = new int64(); int _businessno = new int(); string _businessname; string _businessdescription; public int64 businessid { { return convert.toint64(_businessid.tostring()); } } public int businessno { { return _businessno; } set { _businessno = value; } } public string businessname { { return _businessname; } set { _businessname = value; } } public string businessdescription { { return _businessdescription; } set { _businessdescription = value; } } i have code store data textbox session , list (there can many businesses uploaded database @ 1 time) - database irrelevent now. want display list of businesses stored session onto gridview: (b = class business) list<business> businesscollection = new list<business>(); protected list<business> getbusinesses() {...

c# - selecting word from textbox -

i'm looking method value selected word textbox. for example: i have textbox.text =" how you"; when select "are" should message selected word messegebox.show(selectedword); windows forms textbox doesn't have selectionchanged event, although richtextbox control does. use variety of hacks such timer, handling mouse , key events trigger selection change logic. use selectedtext others have suggested.

c++ varargs/variadic function with two types of arguments -

i trying implement variadic function. searched web , ended finding out examples handle 1 type of arguments (for example calculating average of many integers). im case argument type not fixed. can either involve char*, int or both @ same time. here code ended : void insertinto(int dummy, ... ) { int = dummy; va_list marker; va_start( marker, dummy ); /* initialize variable arguments. */ while( != -1 ) { cout<<"arg "<<i<<endl; /* or c here */ = va_arg( marker, int); //c = va_arg( marker, char*); } va_end( marker ); /* reset variable arguments. */ now work okay if had deal integers see have char* c variable in comments use in case argument char*. so question is, how handle returned value of va_arg without knowing if int or char* ? since you're doing c++ there's no need use untyped c-style variadic function. you can define chainable method like class inserter...

Using Guava in a Maven GWT Project -

i have project utilize google guava libraries (on both server-side , client-side), however, having trouble setting up. i able add gwt , guava dependencies, , gwt projects compiling correctly. server-side code using guava works correctly. but if try add gwt project using following: <inherits name="com.google.common.collect.collect" /> and use application in development mode via mvn gwt:run , brings google development mode interface , gives errors of flavor: unable find 'com/google/common/collect/collect.gwt.xml' on classpath... presumably because maven dependency compiled class files, , not source/.gwt.xml files needs compile down javascript. found if go guava website, , download files, there file called guava-r08-gwt.jar, think heading in direction of solution. ideally, there dependency add in maven lets me use inherits command, other workarounds welcomed. as mentioned in 1 of answers, in works. in meantime, have set temporary public ma...

AJAX deeplinking with jQuery Address -

i have website has many pages: for example: home: http://mywebsite.com/index.html some page: http://mywebsite.com/categorie/somepage.html i decided make pages load dynamically ajax without reloading page. decided use jquery address plugin ( http://www.asual.com/jquery/address/docs/ ) in order allow deeplinking , back-forward navigation: <script type="text/javascript" src="uploads/scripts/jquery.address-1.2rc.min.js"></script> <script type="text/javascript"> $('a').address(function() { return $(this).attr('href').replace(/^#/, ''); }); </script> now, after installing plugin, if go on http://mywebsite.com/index.html (home) , click on some page link, jquery loads http://mywebsite.com/categorie/somepage.html without reloading page , address bar on browser displays: http://mywebsite.com/index.html/#/categorie/somepage.html g...

ruby on rails - In RoR, is there an easy way to prevent the view from outputting <p> tags? -

i'm new ruby , rails , have simple controller shows item database in default view. when displaying in html outputting <p> tags along text content. there way prevent happening? suppose if there isn't, there @ least way set default css class same output in statement such this: <% @items.each |i| %> <%= i.itemname %> <div class="menu_body"> <a href="#">link-1</a> </div> <% end %> so problem <%= i.itemname %> part. there way stop wrapping in own <p> tags? or set css class output? thanks! you need enclose html tag of choice. if required can escape bad code using <%=h i.itemname %> example: <% @items.each |i| %> <div><%=h i.itemname %></div> <div class="menu_body"> <a href="#">link-1</a> </div> <% end %> edit: ryan bigg right. rails doesn...

javascript - Outline sales territory on Google Maps using V3 API and a list of Zip Codes -

i'm trying create tool take list of zip codes input , output google map using v3 of api. area on map corresponds these zip codes needs outlined/color. so far, can draw shapes , distance circles, have been unable add zip coverage. pointer tutorial or sample code appreciated!!!

SQL Server: Views that use SELECT * need to be recreated if the underlying table changes -

is there way make views use select * stay in sync underlying table. what have discovered if changes made underlying table, columns selected, view needs 'recreated'. can achieved simly running alter view statement. however can lead pretty dangerous situations. if forgot recreate view, not returning correct data. in fact can returning messed data - names of columns wrong , out of order. nothing pick view wrong unless happened have covered test, or data integrity check fails. example, red gate sql compare doesn't pick fact view needs recreated. to replicate problem, try these statements: create table foobar (bar varchar(20)) create view v_foobar select * foobar insert foobar (bar) values ('hi there') select * v_foobar alter table foobar add baz varchar(20) select * v_foobar drop view v_foobar drop table foobar i tempted stop using select * in views, pita. there setting somewhere perhaps fix behaviour? you should stop using select *. can l...

.net - Understanding Covariant and Contravariant interfaces in C# -

i've come across these in textbook reading on c#, having difficulty understanding them, due lack of context. is there concise explanation of , useful out there? edit clarification: covariant interface: interface ibibble<out t> . . contravariant interface: interface ibibble<in t> . . with <out t> , can treat interface reference 1 upwards in hierarchy. with <in t> , can treat interface reference 1 downwards in hiearchy. let me try explain in more english terms. let's retrieving list of animals zoo, , intend process them. animals (in zoo) has name, , unique id. animals mammals, reptiles, amphibians, fish, etc. they're animals. so, list of animals (which contains animals of different types), can animals has name, safe name of animals. however, if have list of birds only, need treat them animals, work? intuitively, should work, in c# 3.0 , before, piece of code not compile: ienumerable<animal> animals = getfishes...

C++ sin() returns incorrect results -

i have piece of code bool position::hasinline(const unit * const target, float distance, float width) const { if (!hasinarc(m_pi, target) || !target->iswithindist3d(m_positionx, m_positiony, m_positionz, distance)) return false; width += target->getobjectsize(); float angle = getrelativeangle(target); float abssin = abs(sin(angle)); return abs(sin(angle)) * getexactdist2d(target->getpositionx(), target->getpositiony()) < width; } problem ran is, when debug gdb , try "p sin(angle)" returns weird values - angle 1.51423 states sin = 29 (so yes, putting in radians :-) ). more weird is, when try "p abssin" returns 0, , yes, on next line, "float abssin = abs(sin(angle))" line done. originaly there wasnt included cmath, m_pi const returning correct value, though added #include @ start of .cpp file make sure, nothing changed. if helps, im using linux kernel 2.6.26-2-xen-amd64 ideas? the function abs (...

WCF PollingDuplexHttpBinding in non-Silverlight .NET app? -

i trying implement .net client-application connecting web service. clients may sit behind firewalls or have no public ip addresses service perspective. the service needs use callbacks, wsdualhttpbinding supports them cannot used because: "this binding requires client has public uri provides callback endpoint service" (from msdn wsdualhttpbinding remarks), not case. similar scenario can handled in silverlight app, pollingduplexhttpbinding connection can leveraged. pollingduplexhttpbinding seems not available in .net 4.0 , previous. is there solution .net app (not-sl) similar pollingduplexhttpbinding binding ? thanks zuraff

Terminat or Stop HtmlUnit -

i use htmlunit test website , noticed htmlunit got stuck on webpages. problem making thread within htmlunit call not terminating. please know of way stop htmlunit in real web browser click browsers stop button. want stop/terminate htmlunit when stuck/hangs while accessing webpage. thank you. this should it webclient.closeallwindows();

find replace text in file with Phing -

does know how find , replace text inside file phing? the simplest way achieve using 'traditional' tools sed : sed -i 's/old/new/g'  myfile.txt and if ant-based should help: http://ant.apache.org/manual/tasks/replace.html the simplest form <replace file="myfile.html" token="old" value="new"/> . and if need it, run external tools ant explained @ http://ant.apache.org/manual/tasks/exec.html , means among other things call sed ant like: <exec executable="sed"> <arg value="s/old/new/g" /> <arg value="$my_file" /> </exec>

c++ - Is the second term in Qt's foreach evaluated only once? -

if have code: foreach (qlistwidgetitem *ii, selecteditems()) { urls.push_back(ii->data(qt::tooltip).tostring()); } would selecteditems() called once? yup. create copy of returned container, , use that. (see qt foreach keyword documentation) related: since qt foreach copies container, it's best used either qt-containers (which copy-on-write) or small stl containers. boost's foreach handles better, , avoids copies unless necessary.

c# - ASP.NET MVC - Views location Issue: The view 'Index' or its master was not found -

i've create asp.net mvc 2 project, works fine!! i've been asked integrate project in existing web project in classic asp.net (i've add folder containing source, , not make new project, because have bee in same project) i've configured web.config file <pages pagebasetype="system.web.ui.page" > <controls> <add tagprefix="asp" namespace="system.web.ui" assembly="system.web.extensions, version=3.5.0.0, culture=neutral, publickeytoken=31bf3856ad364e35" /> <add tagprefix="asp" namespace="system.web.ui.webcontrols" assembly="system.web.extensions, version=3.5.0.0, culture=neutral, publickeytoken=31bf3856ad364e35" /> </controls> <namespaces> <add namespace="system.web.mvc" /> <add namespace="system.web.mvc.ajax" /> <ad...

How to create touch interactive charts for android -

i need charts application user use gesture redraw charts in android. suggest charting api,tool or software supports. zingcharts javascript library can included in html page loaded webview. can pass data in json format javascript function. graphs animated, interactive, eye-catchy , fast well. used evaluation version , worked well.

WPF - Freezable in a style of a button not inheriting DataContext -

i modeling attached command pattern after attachedcommandbehavior library here . button looks this: <button> <button.style> <style targettype="{x:type button}"> <setter property="vms:attached.behaviors"> <setter.value> <vms:behaviors> <vms:behavior event="click" command="{binding clickcommand}" /> </vms:behaviors> </setter.value> </setter> </style> </button.style> </button> everything works great, when setter on behavior executed, command null . behavior freezable , , behaviors freezablecollection<behavior> . doesn't seem inheriting datacontext button. on other hand, works correctly: <button> <vms:attached.behaviors> <vms:behavior event=...

Rails 3 + activerecord, the best way to "mass update" a single field for all the records that meet a condition -

in rails 3, using activerecord, there single-query way set :hidden field true records meet condition ... say, example, :condition => [ "phonenum = ?", some_phone_number ] if single query cannot it, optimal approach? use update_all optional second parameter condition: model.update_all({ hidden: true }, { phonenum: some_phone_number})

actionscript 3 - How do you play an external .mov file in actionscript3? -

how load mov file flash 9 i checked post out , looks normal way adding flv, tried on sample .movs apple , doesnt seem work. do movs have encoded specially playback in flash? .mov files encoded in h.264 work in flash, although wasn't happy playback performance on mac.

Find all the varchar() fields in sql server? -

is possible find varchar() columns in database? i using sql server 2008 , list in sql server management console. jd. yep, should work: select * information_schema.columns data_type = 'varchar'

r - How to get ranks with no gaps when there are ties among values? -

when there ties in original data, there way create ranking without gaps in ranks (consecutive, integer rank values)? suppose: x <- c(10, 10, 10, 5, 5, 20, 20) rank(x) # [1] 4.0 4.0 4.0 1.5 1.5 6.5 6.5 in case desired result be: my_rank(x) [1] 2 2 2 1 1 3 3 i've played options ties.method option ( average , max , min , random ), none of designed provide desired result. is possible acheive rank() function? i can think of quick function this. it's not optimal loop works:) x=c(1,1,2,3,4,5,8,8) foo <- function(x){ su=sort(unique(x)) (i in 1:length(su)) x[x==su[i]] = return(x) } foo(x) [1] 1 1 2 3 4 5 6 6

c# - asp:Button is not calling server-side function -

i'm instantiating asp:button inside data-bound asp:gridview through template fields. of buttons supposed call server-side function, weird reason, doesn't. buttons when click them fire postback current page, doing nothing, reloading page. below fragment of code: <asp:gridview id="gv" runat="server" autogeneratecolumns="false" cssclass="l2 submissions" showheader="false"> <columns> <asp:templatefield> <itemtemplate><asp:panel id="swatchpanel" cssclass='<%# bind("status") %>' runat="server"></asp:panel></itemtemplate> <itemstyle width="50px" cssclass="sw" /> </asp:templatefield> <asp:boundfield datafield="description" readonly="true"> </asp:boundfield...

How do I convert a Hash to a JSON string in Ruby 1.9? -

ruby-1.9.2-p0 > require 'json' => true ruby-1.9.2-p0 > hash = {hi: "sup", yo: "hey"} => {:hi=>"sup", :yo=>"hey"} ruby-1.9.2-p0 > hash.to_json => "{\"hi\":\"sup\",\"yo\":\"hey\"}" ruby-1.9.2-p0 > j hash {"hi":"sup","yo":"hey"} => nil j hash puts answer want returns nil . hash.to_json returns answer want backslashes. don't want backslashes. that's because of string#inspect . there no backslashes. try: hjs = hash.to_json puts hjs

php - Facebook Photo Upload into Album on Fan Page failed -

i have written application posts photos on fanpage specific album long time ago. now didn't used half year. had set application again , grant extended permissions fan page (streamm_publish) again. i've problem, i'm using old rest api gives me error: unknown error ocurred error code 1. then tried post throught facebook graph api. tried make call api /pageid/albumid/photos what's not working(unknown path components) tried makea call /albumid_from_my_page/photos photos posted profile tried upload /pageid/photos same 1 above but code fpr rest api worked well, what's problem there, , why new graph api isn't working how should?(bug?) to post photo album, code: $post_data = array( "message" => "my photo caption", "source" => '@' . realpath($file) ); $album_id = "xxxxx"; $facebook->api("/$album_id/photos", 'post', $post_data); now suppose interact page albums need ...

What is a great resource for learning about the implementation details of .NET generic collections? -

i'm interested in understanding underlying implementation details of generic collections in .net. have in mind details such how collections stored, how each member of collection accessed clr, etc. for collections analogous traditional data structures, such linkedlist , dictionary, think have understanding of what's going on underneath. however, i'm not collections list (how set such both indexable , expandable?) , sortedlist, leads learn more them appreciated. a great way start looking @ implementation details opening reflector , decompiling original source code. can decompile source code c# or vb , analyze dependencies in code. downside reflector isn't able produce easy read code optimized code , enumerators (which important part of collections implementation). microsoft has released original source code, additionally provide original comments , unobscured variable names. see here how enable it. you'll need write small demo program make visual...

Calling a phone using UIWebview -

i calling phone using uiwebview giving me alert "cancel" , "call" want handle "call" , "cancel" btns, if press "call" able call , if dismiss call coming application, please me in handling "call" , "cancel" btns uiwebview *webview = [[uiwebview alloc] initwithframe:[uiscreen screen].applicationframe]; [webview loadrequest:[nsurlrequest requestwithurl:[nsurl urlwithstring:[nsstring stringwithformat:@"tel:%@",newnumber]]]]; thanks lot! that default behavior of application. [[uiapplication sharedapplication]openurl:[nsurl urlwithstring:[number stringbyaddingpercentescapesusingencoding:nsutf8stringencoding]]]; or uiwebview *callwebview = [[uiwebview alloc] init]; nsurl *telurl = [nsurl urlwithstring:]; [callwebview loadrequest:[nsurlrequest requestwithurl:telurl]]; see difference.

c# - Calling web services from a CRM Plugin -

we designing system business calculations encapsulated in crm plugins called workflow in crm. many of these business calculations in legacy systems in several different technologies. question is: have move code plugin c# code, or can call via web service plugin? a custom workflow plugin windows workflow foundation activity. whatever can in workflow activity can workflow plugin - so, answer yes. however, may want give configuration parameters input workflow activity (ie. url service) or store in custom entity. way can configured crm. can export workflow xaml, modify in designer , reimport crm. in crm 2011 supported approach (so say). note crm online, custom workflow activities not supported.

SQL Server 2005: When copy table structure to other database "CONSTRAINT" keywords lost -

snippet of original table: create table [dbo].[batch]( [customerdepositmade] [money] not null constraint [df_batch_customerdepositmade] default (0) snippet of copied table: create table [dbo].[batch]( [customerdepositmade] [money] not null, code copy database: server server = new server(sourcesqlserver); database database = server.databases[sourcedatabase]; transfer transfer = new transfer(database); transfer.copyallobjects = true; transfer.copyschema = true; transfer.copydata = false; transfer.dropdestinationobjectsfirst = true; transfer.destinationserver = destinationsqlserver; transfer.createtargetdatabase = true; database ddatabase = new database(server, destinationdatabase); ddatabase.create(); transfer.destinationdatabase = destinationdatabase; transfer.options.includeifnotexists = true; transfer.transferdata(); the transfer...

What does ^ mean in PHP? -

i came across line of code in application revising: substr($sometext1 ^ $sometext2, 0, 512); what ^ mean? it's bitwise operator . example: "hallo" ^ "hello" it outputs ascii values #0 #4 #0 #0 #0 ( 'a' ^ 'e' = #4 ).

loops - merging and manupulating files in matlab -

is there way run loop through folder , process 30 files month , give average,max of each columns , write in 1 excel sheet or so?? i have 30 files of size [43200 x 30] ran different matlab scrip generate them names easy file_2010_04_01.xls , file_2010_04_02.xls ..... , on cannot merge them each 20mbs , matlab crash. ideas? thanks you can first list of files using function dir . here's example: dirdata = dir('file_2010_04_*.xls'); %# match file names wildcard datafiles = {dirdata.name}; %# file names in cell array once have these files, can loop on them using xlsread load data. note xlsread can return different versions of data in excel file: [numdata,txtdata,rawdata] = xlsread(filename); %# filename string here, numdata contains cells numeric data in file, txtdata contains cells text data in file, , rawdata cell array contains of data in file. have determine data array use , how index 43200-by-30 matrix of data process. putting t...

c# - DataTable select help -

i trying convert datatable list. please me query? var result = datatable1.asenumerable().select(e => {e.field<int>("mid"), e.field<string>("mtx")}).tolist(); javascriptserializer ser = new javascriptserializer(); string json = ser.serialize(result); thank you.. you need provide names properties inside select call. these names not automatically , unambiguously resolve in particular case. try var result = datatable1.asenumerable().select(row => new { mid = row.field<int>("mid"), mtx = row.field<string>("mtx") }); javascriptserializer serializer = new javascriptserializer(); string json = serializer.serialize(result); those names become part of json result. such [{"mid":1,"mtx":"a"},{"mid":2,"mtx":"b"}]

delphi - Setting the Index of a Node in VirtualStringTree? -

i trying change index of node, because there specific nodes @ times needs @ bottom of tree. tried change node.index, did not change anything. question is: how change index of pvirtualnode? thanks! - jeff given still using tree view control container, ideal solution offered smasher not available you. one rather obvious solution, given tree view has no hierarchy (i.e. it's list) use sort method own compare function ( oncomparenodes ). the other blindingly obvious strategy add node want @ bottom last. if need add other nodes later, insert them above special last node insertnode . simple approach suffice problem have described it.

wpf - Not able to make cascading comboboxes work -

here code create cascading comboboxes. trying populate family combobox(combobox2) based on value selected segment name(combox1).i able populate first combo static resource second 1 shows blank. calling method called "fillcomboboxfamilydata(segmentcode)" on selection change event of first combobox. xaml code: <grid height="142" horizontalalignment="left" margin="49,113,0,0" name="grid3" verticalalignment="top" width="904"> <combobox height="23" horizontalalignment="left" margin="35,26,0,0" name="combobox1" verticalalignment="top" width="205" itemssource="{binding source={staticresource tblsegmentviewsource}}" displaymemberpath="segment name" selectedvaluepath="segment code" selectionchanged="combobox1_selectionchanged"/> <combobox height="23" horiz...

c - Calling convention for function returning struct -

for following c code: struct _astruct { int a; int b; float c; float d; int e; }; typedef struct _astruct astruct; astruct test_callee5(); void test_caller5(); void test_caller5() { astruct g = test_callee5(); astruct h = test_callee5(); } i following disassembly win32: _test_caller5: 00000000: lea eax,[esp-14h] 00000004: sub esp,14h 00000007: push eax 00000008: call _test_callee5 0000000d: lea ecx,[esp+4] 00000011: push ecx 00000012: call _test_callee5 00000017: add esp,1ch 0000001a: ret and linux32: 00000000 <test_caller5>: 0: push %ebp 1: mov %esp,%ebp 3: sub $0x38,%esp 6: lea 0xffffffec(%ebp),%eax 9: mov %eax,(%esp) c: call d <test_caller5+0xd> 11: sub $0x4,%esp ;;;;;;;;;; note sub ;;;;;;;;;;;; 14: lea 0xffffffd8(%ebp),%eax 17: mov %eax,(%esp) 1a: call 1b <test_caller5+0x1b> ...

stored procedures - .NET: Writing DataAccess dll -

i write data relations processes (general functions regarding dataaccess via .net) in dll , want use repeatedly. kinds of functions should have in dll? want use stored procedures , statements. can suggest me? please guide me! all! microsoft enterprise library , using data access application block should need. framework itself. another interesting data access library known orm nhibernate . if want speed dal development, ought consider these 2 either individually or used together. the entlib daab allow provide named connectionstring application configuration file(s) won't need deploy new build of application upon connectionstring change, config file. common practice manage , configure 1 connectionstring per configuration file, if 1 connection string changes, deploy new configuration file connection, , you're done! entlib allows manage connection pool according best practices. , through quite simple xml configuration files. as nhibernate, object/relational map...

jquery - Why is this nth-child returning an unexpected element? -

the html & jquery below , it's @ http://www.jsfiddle.net/4fwuu . expecting second child of 'wrapper' div id 'parent2'. returned id 'child1_1_1_2' don't expect. i can proper div using $o1.children()[1] wanted know why nth-child not working right. any ideas why? <div id="wrapper"> <div id="parent1"> <div id="child1"> <div id="child1_1"> <div id="child1_1_1"> <div id="child1_1_1_1"> </div> <div id="child1_1_1_2"> </div> </div> <div id="child1_1_2"> </div> </div> <div id="child1_2"> <div id="child1_2_1...

web technologies - Alternatives to HTML for website creation? -

it seems common aproach web design use html/xhtml & css in conjunction other technologies or languages javascript or php. on theoretical level, i'm interested know other languages or technologies used build entire site without using single html tag or css style styling/positioning? could website made using xml or php alone, including actual styling , positioning? presumably flash sites till embedded in html tags? thanks there several solutions allow avoid css , html. gwt: google web toolkit written in java , allow build both server , client code in java. used build google wave. cappuccino , objective-j: objective-j javascript objective-c c. extends javascript many near features, including type-checking, classes , types. cappuccino cacoa (mac os x gui toolkit). using these 2 can build incredibly rich , desktop webapps. run on client side , can use whatever want on server. example 280slides sproutcore similar cappuccino, uses pure javascript instea...

sql - Best API for reading a huge .pdf file from java -

i have huge pdf file (20 mb/800 pages) contains information. it has got index hyperlinks. of remaining information in tabular format (in pdf). need retrieve information using java , store in sql server. which best api available read kind of file java? it unlikely in tabular format inside pdf pdf not contain structure information unless explicitly added @ creation time. wrote article explaining of issues text extraction @ pdf @ http://www.jpedal.org/pdfblog/2009/04/pdf-text/

repository - Svn log - svn: '.' is not a working copy -

i'm getting "svn: '.' not working copy" when use svn log command. i know need working copy log command work can done directly on repository? my goal display information (change history) of repository. think updating working copy whenever need log information not solution. is there alternative solution or updating working copy every time need log way go? thanks in advance. try svn log [repository_url] that log of particular repository rather local, checked-out repository. see this documentation .

.net - What does the variable name "lsSQL" mean? -

i've noticed in recent article on tdwtf using variable name lssql . have noticed similar variable names in legacy application working on , in other places around web , have never found out ls prefix stands for. what ls mean? kind of notation that? thanks, tom i expect usage of hungarian notation basic-like language (i.e. without strong typing). here expect l denote "local variable" opposite "argument" or "global variable", , s denote type i.e. string here.

osx - ShowWindow/HideWindow in Cocoa -

in carbon change window's visibility hidewindow(windowref) , showwindow(windowref). in cocoa know can call nswindow's orderout: hide , orderfront:, orderback: or orderwindow:relativeto: put on screen, none of respect ordering of window relative other windows when last visible. for example, if have 2 windows, 1 above other, , call orderout: on window, how show window again such still behind front window without calling orderwindow:relativeto: . the thing can think of right remember window id of window above , use orderwindow:relativeto: when showing again, haven't thought through happens if window above closed before rear window made visible again. i don't think there's method available in cocoa. guess need mimic using idea. by way, carbon behavior if start 4 windows ordered as b x c d e then hide x b c d e now user reorders them, , removes some: e c and show x again. did x go in carbon in case?

encryption - Best Practices / Patterns for Enterprise Protection/Remediation of SSNs (Social Security Numbers) -

i interested in hearing enterprise solutions ssn handling. (i looked pretty hard pre-existing post on so, including reviewing terriffic automated "related questions" list, , did not find anything, not repeat.) first, think important enumerate reasons systems/databases use ssns: (note—these reasons de facto current state—i understand many of them not good reasons) required interaction external entities. valid case—where external entities system interfaces require ssn. typically government, tax , financial. ssn used ensure system-wide uniqueness. ssn has become default foreign key used internally within enterprise, perform cross-system joins. ssn used user authentication (e.g., log-on) the enterprise solution seems optimum me create single ssn repository accessed applications needing ssn info. repository substitutes globally unique, random 9-digit number (asn) true ssn. see many benefits approach. first of all, highly backwards-compatible—all systems "ju...

domain driven design - How can I get a property as an Entity in Action of Asp.Net Mvc? -

i'd know how can property entity, example: my model: public class product { public int id { get; set; } public string name { get; set; } public category category { get; set; } } view: name: <%=html.textboxfor(x => x.name) %> category: <%= html.dropdownlist("category", ienumerable<selectlistitem>)viewdata["categories"]) %> controller: public actionresult save(product product) { /// produtct.category ??? } and how category property ? it's fill view ? asp.net mvc know how fill object id ? thanks! this 1 of reasons why it's bad bind directly entities. consider public class productform { public int id { get; set; } public string name { get; set; } public string categoryid { get; set; } } public actionresult save(productform form) { var product = new product { id = form.id, name = form.name, category = database.getcategory(form.categoryid) }; } in cas...

objective c - How to share information across controllers? -

i started programming first cocoa app. have ran problem hope can me with. i have maincontroller controls user browsing computer , sets textfield = chosen folder. i need retrieve chosen folder in analyzecontroller in order work. how pass textfield objectvalue maincontroller analyzecontroller? thanks alright came with: maincontroller.h: #import "analyzecontroller.h" @interface maincontroller : nsobject { analyzecontroller* analyzecontrol; } maincontroller.c: analyzecontrol = [[analyzecontroller alloc]init]; [analyzecontrol setdevelopmentpath:filename]; analyzecontroller.h: @interface analyzecontroller : nsobject { nsstring* developmentpath; } @property(assign) nsstring* developmentpath; analyzecontroller.c: @synthesize developmentpath; nslog(@"final test: %@", developmentpath); but end test returning null. bit unsure property parameter should be. can help? or did wrong? how pass textfield objectvalue maincontroller analyzecontroll...

model - Rails: How do I run a before_save only if certain conditions are met? -

i have before_save method call renames uploaded image. before_save :randomize_file_name def randomize_file_name extension = file.extname(screen_file_name).downcase key = activesupport::securerandom.hex(8) self.screen.instance_write(:file_name, "#{key}#{extension}") end that method part of item model. that works great when create new item or need update image associated item...but problem if need update item not image, randomize_file_name method still gets run , renames file in database (though not file itself, obviously). so, i'm thinking need figure out way run randomize_file_name if file included in form submission...but i'm not sure how pull off. use dirty objects . before_save :randomize_file_name def randomize_file_name # assuming field holds name # called screen_file_name if screen_file_name_changed? extension = file.extname(screen_file_name).downcase key = activesupport::securerandom.hex(8) self.screen.instanc...

Why are my WebLogic clustered MDB app deployments in warning state? -

i have weblogic cluster on i've deployed numerous topics , applications use them. applications uniformly show in warning status. looking @ monitoring on deployment, see mdb application connects server #1, on server #2 shows this: mdb application appname not connected messaging system. my jms server targetted migratable target, in turn targetted #1 server , has cluster identified. , messages sent either server flow expected. don't know why these deployments show in warning state. weblogic 11g this can avoided using parameter below <start-mdbs-with-application>false</start-mdbs-with-application> in weblogic-application.xml , setting start-mdbs-with-application false forces mdbs defer starting until after server instance opens listen port, near end of server boot process. if want perform startup tasks after jms , jdbc services available, before applications , modules have been activated, can select run before application deployments option in a...

informix odbc connection slow to open in asp.net -

i have application takes long time open odbc connections (like 20 sec) takes forever using arcmap , arcsde but when try connection on odbc data source administrator, tests fast does have idea of causing this? btw application works fine in computer database thanks. in odbc administrator can enable tracing. compare trace file both slow , fast machine. if there "fast" open machine using odbc administrator , "slow" app try other ways open such connection. try use other tool such querytool (free trial), or create simple script in python win32 extension. in python (i recommend active python has win32 included) can open odbc with: import odbc import time t_start = time.time() conn = odbc.odbc('db_alias/user/passwd') t_stop = time.time() print('open: %.3f [ms]' % (t_stop-t_start)) cursor = conn.cursor() cursor.execute("select first 1 dbinfo('version','full') systables;") row in cursor.fetchall(): print(...

php - How can I separate words in td with an html tag? -

how can use jquery separate multiple words in td html tag such <br/> ? for example, <td>hello bye</td> become <td>hello <br/> bye</td> . this work if html in td 's not contain tags. $("td").each(function(){ this.innerhtml = this.innerhtml.replace(/ +/g,"<br/>"); });

PHP Facebook API. How can I tell if my application is active via the API? -

does know whether there api call tell me whether application still active? example, have login system users can sign in facebook credentials, wiould periodically check application login uses, still active facebbok side. any ideas? check existence of facebook api cookie. in facebook api have facebook.php file manages session , cookies. file shall included @ beginning of every php page uses fb authentication. locate part : $session = $facebook->getsession(); $fb_me = null; // session based graph api call if ($session) { try { $fb_me = $facebook->api('/me'); $fb_uid = $facebook->getuser(); } catch (facebookapiexception $e) { d($e); } } later in code, check whether fb_me exists, if yes authenticated via fb , can use other variables of api information user. if( $fb_me ) { echo "you authenticated via fb api user id:".$fb_uid; }

javascript - How to correctly call clearTimeout? (Timeout id lost?) -

i trying make simple settimeout, make div tag invisible after 2 seconds. the settimeout function makes div invisible irregularly, , after 1 sec, , on. here code: function begintimeout(){ t = settimeout(function(){hidesubmenu()},2000); } function hidesubmenu(){ var elem; elem = document.getelementbyid("ul_navlist1"); elem.style.visibility="hidden"; cleartimeout(t); } by way, t global variable. have tried too: t = settimeout("hidesubmenu()",2000); same irregular results. update op: this div contains menu , submenu. edited little bit readable here. the right_rect div contains menu , submenu. in div call onmouseout hide submenu. <div class="right_rect" onmouseout="begintimeout();"> <div class="menu2" > <ul > <li onclick="hideorshow();"><a href="#">item1</a></li> </ul...

profiling - Fail to profile remote java app using TPTP -

i trying profile cpu usage using tptp. application profile run on linux rh as5. installed , configured agent controller described here i ran java application using command java '-agentlib:jpibootloader=jpiagent:server=standalone,file=log.trcxml;cgprof' myapp the monitoring station all-in-one tptp version 4.6.2. followed stepes described here on eclipse - on "profile configuration" choose new configuration "attach agent", set host remote linux machine myapp running, test connection succeed , when "agents" tab , see " pending... ", background process " feching children host " running , can't find makes impossible profile. any idea? you have run agent controller on java application in server mode. command runs 'headless' , writes log file. website linked has list of various options server parameter. java '-agentlib:jpibootloader=jpiagent:server=enabled;cgprof' myapp

sql server - sqlcmd turn off text -

i have sqlcmd i'm outputting results text file. first cmd use mydatabase command , logs info in output file "changed database context mydatabase" how turn off in log? perhaps related problem following link using sp_send_dbmail, needed use parameter "@execute_query_database=xxxxx"; or pass -m flag mentioned here check sqlcmderrorlevel , -m flag passed sqlcmd. c:\>sqlcmd -q "use master" -e changed database context 'master'. c:\>sqlcmd -q "use master" -e -m 1 c:\>

How to convert QList<QByteArray> to QString in QT? -

i have qlist<qbytearray> want print out in qtextbrowser . qtextbrowser->append() takes qstring. despite ton of searching online, have not found way convert data have qstring. try: for(int i=0; i<list.size(); ++i){ qstring str(list[i].constdata()); // use string needed }

java - Eclipse 3.6 frequently stalls during Content Assist -

has ever solved issue? auto complete stalls , long, quit using altogether. i've seen 1 other post , answer did not help. guidance appreciated. i've had success following using eclipse (classic) 3.6.1 on windows 7 x64. "a workaround, until fix released in 3.6.2 summarized here: http://groups.google.com/group/android-developers/msg/0f9d2a852e661cba " (copied convenience) "you can replace /plugins/ org.eclipse.jdt.core_3.6.1.v_a68_r36x.jar plugin 1 http://www.google.com/url?q=http://adt-addons.googlecode.com/svn/patches/org.eclipse.jdt.core_3.6.1.v_a68_r36x.zip&ei=vg5atf2rimrugaei-qtvda&sa=x&oi=unauthorizedredirect&ct=targetlink&ust=1297749446528273&usg=afqjcnfv7fgltrnovhrge35jpjhxowi_bw , restart eclipse. content assists better. try it. don't forget backup original plugins. "

C# analog for sql in operator -

there in operator in sql select * mytable id in (1, 2, 3, 4, 5) is there similar sintax in c#, mean if(variable in (1, 2, 3, 4, 5)){ } there isn't 1 can write extension method: public static class extensions { public static bool in<t>(this t value, params t[] items) { return items.contains(value); } } if (v.in(1,2,3,5)) { /* stuff */ } i haven't tested it, should good. update: suggested op, i've corrected few typos.

mysql - Error on rename of a column during a migration in rails -

i trying run migration in rails change name of column getting error: mysql::error: error on rename of './databasename/#sql-478_17b' './databasename/zz_portal_users' (errno: 150): alter table `zz_portal_users` change `user_id` `zz_user_id` int(11) default null here migration trying run: class renameusersidtozzusersidinzzportalusers < activerecord::migration def self.up rename_column :zz_portal_users, :user_id, :zz_user_id end def self.down rename_column :zz_portal_users, :zz_user_id, :user_id end end any idea come from? thanks! changing id columns in mysql bit tricky fk must have same data type. can check fks have id int(11). if doesn't help, please paste ddl of users , related tables.

unit testing - Java Hamcrest : Collection contains item of type -

i'd assert list<achievement> contains member of type testachievement . here's assertion: list<achievement> achievements; // populated elsewhere assertthat(achievements,hasitem(isa(testachievement.class))); this doesn't compile, reporting error: the method assertthat(t, matcher) in type assert not applicable arguments (list, matcher<iterable<testachievement>>) what's correct syntax type of assertion using hamcrest? thanks help. the posts here suggested defect hamcrest, headed on hacmrest site register bug, whien discovered mvn / ivy dependency declaration using out-of-date, giving me old version of hamcrest. this bug exists 1.1, latest if declared using <dependency org="org.hamcrest" name="hamcrest-all" rev="1.1"> however, correct depedency declaration is: <dependency org="org.hamcrest" name="hamcrest-library" rev="1.3.rc2"/> updat...

gnuplot - Begin a plot on a specific day of the week -

i'm learning gnuplot working on tidal data, in monthly files, in format: 2011/03/01 tue 08:42 9.39 h 2011/03/01 tue 15:04 0.2 l 2011/03/01 tue 21:18 8.67 h 2011/03/02 wed 03:16 0.71 l 2011/03/02 wed 09:31 9.51 h 2011/03/02 wed 15:49 0.09 l 2011/03/02 wed 22:01 8.91 h 2011/03/03 thu 04:01 0.48 l 2011/03/03 thu 10:14 9.58 h 2011/03/03 thu 16:28 0.05 l 2011/03/03 thu 22:39 9.11 h all far: can output stacked plots pdf multiplot layout setup, i'd have weekly plots run monday-sunday. with fractional weeks, first week, how can this? can set xrange manually, need re-done each weekly plot command. what i'd figure out 2 things: a way handle first week problem; a way automate xrange each succeeding week (i.e., have gnuplot parse timestamp , start new plot each monday? can perhaps using ternary operator?) setup: gnuplot: version 4.4 patchlevel 2 osx 10.6.6 setup & plot commands: set timefmt ...

unit testing - Is the test suite setup method executed once for each test, or only once for all? -

i know answer may differ each test framework. ones know, should happen? in nunit, have testfixturesetup runs once before tests in fixture run , setup runs before each test method run.

iphone - iPad and UIPickerView (or UIDatePickerView) -

has had luck using uipicker in 3.2 sdk? i'm in middle of porting iphone application on ipad , that's 1 thing can't seem work. i've tried... -creating action sheet, add picker subview , displaying it. -creating above action sheet, making view of generic viewcontroller, adding vc uipopover -making picker view of generic viewcontroller, adding vc uipopover with action sheet doesn't attempt draw it. in popover view attempts draw doesn't rendered correctly. just wanted check see if has accomplished , if how. thanks everyone! i author of tutorial mentioned above. picker work in popover , add selected value textbox in main view need use protocols. have created sample project show this. creating tutorial on soon. sample project

Can you use an xml datasource with Dundas Chart for SharePoint (v2.5)? -

can use xml datasource dundas chart sharepoint (v2.5)? i don't know if can (i've been using dundas chart asp.net), can read in xml , create array or ilist of data work source chart control.

wix guid using rules -

for example have: <component id='mainexecutable' guid='0436e0ca-8612-4330-a70d-642910d9f19a'> <file id='foobarexe' name='foobarappl10.exe' diskid='1' source='foobarappl10.exe' keypath='yes'> </file> </component> if create update package should use same guid component include foobarexe? know rule product, upgradecode etc rule other guids? scope? the component id versioning rules tricky. have found real explanation in old books (german only). depending on update creating several rules apply. update update (only patch or add files, no remove or relocation allowed) component id has stay same. minor upgrade (product code remains stable) update rules relaxed. stay clear should stick update or major upgrade easier reason about. rules when product code must changed described here. major upgrade uninstall (the msi action removeexistingproducts called) , reinstall. th...

How do I sync a list on a site from a list on a subsite in SharePoint? -

our group has main site , subsite dedicated our projects. each project has project lead , completion % associated it. have list on project site goes each project's dedicated subsite within project site. want duplicate list project site on main site, changes or additions made project site list appears in main site list including project lead , completion %. how accomplish this? here simple example of hierarchy: main site - project list derived project list below project site - project list project 1 site project 2 site project 3 site what want approach similar one suggested in previous question. now, question linked reverse of situation: person wanted copy information master site onto of child sites. incorporating in reverse work well, need flip logic. basically, instead of attaching these event handlers master site, attach them project list site, , updates passed master site instead of iterating across of subsites.