Posts

Showing posts from April, 2013

Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

vb6 - Can not open VB 6.0 files in Visual Studio 2010 -

if visual studio includes visual basic, why can't open vb 6.0 file in visual studio 2010? because there's difference between visual basic 6.0 , visual basic .net visual studio 2010 includes.

c# - List/Collection of references to Properties -

consider these properties, double _temperature; public double temperature { { return _temperature; } set { _temperature = value; } } double _humidity; public double humidity { { return _humidity; } set { _humidity = value; } } bool _israining; public bool israining { { return _israining; } set { _israining = value; } } and want make list/collection/container of properties this, propertycontainer.add(temperature); //line1 propertycontainer.add(humidity); //line2 propertycontainer.add(israining); //line3 i want make such later on may able access current values of properties using index , this, object currenttemperature = propertycontainer[0]; object currenthumidity = propertycontainer[1]; object currentisraining = propertycontainer[2]; but obviously, not going work, since propertycontainer[

clearcase - Has 'find' similar capability as 'ls -visible pname' -

i can use " ls -visible pname " find visible elements under ' pname '. through ' find ', can not find way find visible elements. is, ' find ' list hidden elements config spec also. does know if ' find ' can find ' visible ' elements under specific ' pname '?? thanks cleartool man find http://publib.boulder.ibm.com/infocenter/cchelp/v7r0m1/index.jsp?topic=/com.ibm.rational.clearcase.cc_ref.doc/topics/ct_find.htm note: find command similar unix , linux find(1) command. limited set of standard find options supported; way commands invoked on selected objects (–exec , –ok options) differs find(1). to answer question vonc, no, wrong. -visible not need work -all, , can use -visible achieve want do.

android emulator - Landscape mode not working with no keyboard in AVD? -

i've created 2 avds, 1 hardware keyboard, , other without..the 1 keyboard shows landscape mode in android screen when click ctrl + f11/f12 or 7/9 on numpad, in avd no hardware keyboard, hardware things change orientation, first avd, android screen stays , doesn't change orientation landscape, this: http://img571.imageshack.us/img571/3624/landscapeh.jpg this bug in 2.3 avd , answered here android - emulator in landscape mode, screen not rotate

facebook - Is it possible to implement friends.getMutualFriends using FQL? -

i looking way implement friends.getmutualfriends of facebook's old rest api fql. reasons twofold: 1. getmutualfriends returns list of ids, , i'd use multi-query fetch additional information each returned id (rather make additional calls facebook) 2. i'd batch few such calls together. batch.run bit limited (20 calls) , presumably slower multiquery. unfortunately, can't use friends table, because while sourceid of user of app, targetid may not user of app (facebook won't let me select friends of target in nested query, understandable due privacy concerns.) since can mutual friends using friends.getmutualfriends, i'm wondering if there's fql equivalent. check out post facebook mutual friends , fql 4999/5000 record limit

objective c - Customized Buttons on a UIActionsheet -

i trying create uiactionsheet several buttons options. is possible?. if is, apple let in onto apps store. have seen in blogs these types of windows rejected? if not possible there alternative uiactionsheet , achieve similar functionallity?. it possible , don't think apple reject (why ?).

pixels - What unit should I use for HTML? -

i use em, , tend stay away % because tends screw design easily, , pt, px, cm... because aren't friendly devices. right in doing so? there reasons why css offers choice. isn't question of right or wrong. if looking way make site more accessible making fonts , elements scale easier, on right path. go em.

Equivalent to CryptoStream .NET in Java? -

i have encrypted string in visual basic. net 2008, functions encrypt , decrypt following: imports system.security.cryptography public shared function encriptar(byval strvalor string) string dim strencrkey string = "key12345" dim bykey() byte = {} dim iv() byte = {&h12, &h34, &h56, &h78, &h90, &hab, &hcd, &hef} try bykey = system.text.encoding.utf8.getbytes(strencrkey) dim des new descryptoserviceprovider dim inputbytearray() byte = encoding.utf8.getbytes(strvalor) dim ms new memorystream dim cs new cryptostream(ms, des.createencryptor(bykey, iv), cryptostreammode.write) cs.write(inputbytearray, 0, inputbytearray.length) cs.flushfinalblock() return convert.tobase64string(ms.toarray()) catch ex exception return "" end try end function public shared function desencriptar(byval strvalor string) string dim sdecrkey string = "k

javascript - Chrome Extension: Skipping red page on created tab -

chrome.tabs.create({ 'url': 'https://www.myserver.com/', 'selected': false }, function(tab) { chrome.tabs.executescript(tab.id, { 'code': "dosomething();" }); }); actually i'm unable execute code, because there's invalid certificate on "myserver.com", chrome displays red page, i'm unable skip , run code. there way how skip red page except adding certification authority trusted = except neccessary step on client side? you cannot inject or manipulate page, due security reasons. makes sense since page there protect user :) the way through native code, npapi. implement plugin bypasses it. know, implementing plugin makes whole computer vulnerable since have access entire host machine. that why creating plugins not favoured, recommended if absolutely cannot wanted current api , limitations.

java - Radix Sort, the value of r -

please refer following code radix sort: class radixsort { public static void radix_sort_uint(int[] a, int bits) { int[] b = new int[a.length]; int[] b_orig = b; int rshift = 0; (int mask = ~(-1 << bits); mask != 0; mask <<= bits, rshift += bits) { int[] cntarray = new int[1 << bits]; (int p = 0; p < a.length; ++p) { int key = (a[p] & mask) >> rshift; ++cntarray[key]; } (int = 1; < cntarray.length; ++i) cntarray[i] += cntarray[i-1]; (int p = a.length-1; p >= 0; --p) { int key = (a[p] & mask) >> rshift; --cntarray[key]; b[cntarray[key]] = a[p]; } int[] temp = b; b = a; = temp; } if (a == b_orig) system.arraycopy(a, 0, b, 0, a.length); } } this downloaded wikipedia. i

asp.net mvc - IF statement not being executed C# MVC -

i have mvc application, has 2 areas - administrator, , user. wanted do, on first login, user activate account, agree terms , conditions, etc. application uses asp membership api. i have inserted if statement post login action in account controller, after debugging, appears if statement never executed. if take @ i'd grateful. have feeling small i'm missing. the login url user is: http://localhost:80/account/logon?returnurl=/user the administrator url is: http://localhost:80/account/logon?returnurl=/administrator however both use same login action in account controller hence need use if statement differentiate between two. here code post logon action. string returnurl "/user" not "user" discovered after debugging through code. [httppost] public actionresult logon(logonmodel model, string returnurl) { if (modelstate.isvalid) { if (membershipservice.validateuser(model.username,

autocomplete - Why can't I access AutoCompleteBox in any function other than Main Window in WPF? -

i trying codebox.itemssource = codeslist; codebox.populatecomplete(); from populating event have created , error "the name 'codebox' not exist in current context' this working when populated mainwindow. know missing? thanks! this looks it's because codebox not visible scope of populating event handler declared. when populating event handler within mainwindow , codebox control "visible" code. see here more info. where populating event handler declared? also, note sender parameter in populating event should reference codebox . cast autocompletebox , , should work fine, e.g.: private void codebox_populating(object sender, populatingeventargs e) { autocompletebox _codebox = sender autocompletebox; // use _codebox here instead of codebox }

c++ - undefined reference to `forkpty' -

so i'm developing project in eclipse in ubuntu 10.04. have following lines of code: #include <pty.h> pid_t pid; int master; pid = forkpty(&master, null, null, null); but when try build within eclipse, error: undefined reference 'forkpty' any idea how solve problem? you need -lutil command line argument (to use libutil shared library). eclipse: http://zetcode.com/articles/eclipsecdevelopment/ select project properties. expand c/c++ build tab. select settings. tool settings tab, expand gcc c linker option. click on libraries. add /usr/lib/libutil.so libraries window. notice, path may different on system.

java - AspectJ pointcut on method variable, is it possible? -

i have been using aspectj while , works great on object scope fields containing annotations. ran situation want annotate variable of method scope work pointcut having trouble it. here pointcut using. works fine if variable field object, if reduce scope method (variable declared inside method), doesn't work anymore , not sure why. let me know can do, thanks. after(final trigger trigger): set(@triggereable * *) && args(trigger) { system.out.println("trigger flush"); } also, here exmaple of want work. system.out.println above should fire when trigger instantiated: public void foo() { @triggereable private trigger trigger = new trigger(); } aspectj not support pointcuts on local variables (read faq entry ). i seem recall recent discussion such feature possibly added soon, not find in aspectj issue tracker nor in mailing list archives

xsd - XML Schema key/keyref - how to use them? -

long story short : know how use key/keyref xsd let elements have references each other. has have form of example, using simple xsd , xml. long story : familiar usage of id/idref. use connect elements jaxb. have been told repeatedly key/keyref construct in xsd offers enhanced flexibility inter-element referencing. have consulted oreilly xml schema book , seems teach correct definition of key/keyref , how similar id/idref (but better) , doesn't give simple example of use. doesn't seem similar, because define id attribute in 1 element , idref in element , voila. key/keyref have defined in common ancestor of referencing , referenced element (afaik)... i use xsd files generate jaxb-bound java classes xjc i have searched how-tos, tutorials , examples, google gives me scraps. same searches on (also google , inclusive search '+' ). in order make everyone's lives easier have prepared xsd defined key/keyref pair have understood it. <xs:schema elementformdefau

selector - jquery find() combine id and html element possible? -

just wondering: in css can access div through #display div is there similar way in jquery. need find div id="displayfirst" (a page) , within div div data-role=content. along lines of: .find('#displayfirst', 'div[data-role=content]')); thanks, frequent just use space (the descendant selector ) current selector (just css): $('#displayfirst div[data-role=content]'); the same applies when using .find() : .find('#displayfirst div[data-role=content]');

c# - How to consume WCF method with "DataSet" return type in Silverlight -

10+ methods in wcf webservice returns object of type dataset public system.data.dataset returndata() { dataset dataset = new dataset(); //do work on dataset return dataset; } i want consume wcf webservice in silverlight application. problem: dataset not resolved system.data.dll not appear in silverlight application's add reference section. is there workaround or solution? take on dataset silverlight applications but advise write classes edit: show how can use instead of classe, give example public class person { private int gid; private string gfirstname=""; private string glastname = ""; public int id { { return gid; } set { gid = value; } } public string firstname { {

Programmatically 'unselect' a jQuery UI selectable widget -

is there way programmatically 'unselect' , selected elements given $("#selectable").selectable() widget? the following command works @ http://jqueryui.com/demos/selectable/ $('#selectable .ui-selected').removeclass('ui-selected') since class's existence defines if item selected, removing item deselect it. note, can take advantage of toggleclass , addclass functions. edit: try too: $('#selectable').trigger('unselected') . might trigger css changes well, , way unselected event gets triggered whatever else may hooked it.

gridview - How to attach a jQuery event to a grid view that is not visible on document ready? -

i trying hook link in gridview jquery grid in update panel , not visible until user runs report. if add class ".mylink" other "a" tag works fine, gridview not there @ document.ready not sure call from $(document).ready(function(){ $('a .mylink').click(function(){ var link = $(this).attr('href'); alert(link); return false; }); }); you can use .live() handle events on element created @ time, this: $(document).ready(function(){ $('a .mylink').live('click', function(){ var link = $(this).attr('href'); alert(link); return false; }); }); if have container it'll appear in, , doesn't replaced, can use .delegate() more efficient, this: $(document).ready(function(){ $('#containerid').delegate('a .mylink', 'click', function(){ var link = $(this).att

asp classic - Error in code for download a file(txt) in clasic ASP -

i have been trying 2 diferent codes one: nombre="prueba.txt" set stream = server.createobject("adodb.stream") stream.open stream.type = 2 ' binary stream.loadfromfile(server.mappath("./file/"&nombre)) response.binarywrite(stream.read) and other code i'm trying : response.contenttype = "application/x-unknown" ' arbitrary fpath = server.mappath("./file/"&nombre) response.addheader "content-disposition","attachment; filename=" & nombre set adostream = createobject("adodb.stream") adostream.open() adostream.type = 1 adostream.loadfromfile(fpath) response.binarywrite adostream.read() adostream.close set adostream = nothing response.end and have found non especificated/defined data type. @giancarlo solarino: try -- option explicit dim sfilename, sfilepath, ifilesize dim ofile, ofs, ostream sfilename = "prueba.txt" sfilepath = server.mappath(

c - Are string literals const? -

both gcc , clang not complain if assign string literal char* , when using lots of pedantic options ( -wall -w -pedantic -std=c99 ): char *foo = "bar"; while (of course) complain if assign const char* char* . does mean string literals considered of char* type? shouldn't const char* ? it's not defined behavior if modified! and (an uncorrelated question) command line parameters (ie: argv ): considered array of string literals? they of type char[n] n number of characters including terminating \0 . yes can assign them char* , still cannot write them (the effect undefined). wrt argv : points array of pointers strings. strings explicitly modifiable. can change them , required hold last stored value.

java - Getting a reference to the current KeyboardFocusManager -

is there way reference current keyboardfocusmanager in swing application? have checked keyboardfocusmanager.getcurrentkeyboardfocusmanager() returns current keyboardfocusmanager instance calling thread's context.

c# - RhinoMocks use default implementation for property -

i have code use entity framework like class person{ pubic person() { address = new address(); } public virtual address address { get; set; } } the reason i'm marking address virtual lazy loading. now test, i'm stubbing person . since it's stubbed, address getter returns null (even though it's set in constructor). if stub out address property ( person.stub(x => x.address).return(new address()); ) things work fine. don't want have stub out property! there way tell rhinomocks not override getter though it's virtual? sure, have use partial mock: var person = mockrepository.generatepartialmock<person>();

AJAX, response headers are not sent by PHP script! -

i'm banging head hours now. have select option updates database using ajax (at least it's trying to!). happens while running php script directly params required database gets updated not when running indirectly through ajax, instead 3 times alert("there problem in returned data:\n"); , gets updated. javascript on <head> , not in external file. here goes: javascript: function updatehub(){ if (window.xmlhttprequest){ // code ie7+, firefox, chrome, opera, safari xmlhttp=new xmlhttprequest(); }else{ // code ie6, ie5 xmlhttp=new activexobject("microsoft.xmlhttp"); } xmlhttp.onreadystatechange = function(){ if (xmlhttp.readystate==4 && xmlhttp.status==200){ document.getelementbyid("hubinfo").innerhtml=xmlhttp.responsetext; }else{ alert("there problem in returned data:\n"); } } var prefhub = documen

java - Does throwing an Exception have to cause the program to terminate -

does throwing exception have cause program terminate? i think no, want make sure it depends on thread exception thrown, , on other threads running on same time in application. an uncaught exception terminates thread thrown. if rest of threads daemon threads, yes, application terminated. according thread.setdaemon(boolean) documentation: the java virtual machine exits when threads running daemon threads.

java - if multiple threads are updating the same variable, what should be done so each thread updates the variable correctly? -

if multiple threads updating same variable, should each thread updates variable correctly? any appreciated there several options: 1) using no synchronization @ all this can work if data of primitive type (not long/double), , don't care reading stale values (which unlikely) 2) declaring field volatile this guarantee stale values never read. works fine objects (assuming objects aren't changed after creation), because of happens-before guarantees of volatile variables (see "java memory model"). 3) using java.util.concurrent.atomiclong, atomicinteger etc they thread safe, , support special operations atomic incrementation , atomic compare-and-set operations. 4) protecting reads , writes same lock this approach provides mutual exclusion, allows defining large atomic operation, multiple data members manipulated single operation.

c# - How can I make this generic method more flexible? -

i'm working library (treeview in gtk specific) allows sort passing function compares 2 rows. simplified version of function signature might this: int somesortfunc (foo foo1, foo foo2) { // return -1 if foo1 < foo2, 0 if foo1 == foo2, 1 if foo1 > foo2 } i can't implement foo.compareto (foo) , because want sort differently depending on context. there several fields in foo sort by. sort priority of each field depends on context. write this: int sortfunc<t> (foo foo1, foo foo2, params func<foo, t> [] selectors) t : icomparable<t> { return selectors .select (s => s (foo1).compareto (s (foo2))) .firstordefault (i => != 0); } // compare somestring, someint, somebar int somesortfunc (foo foo1, foo foo2) { // won't compile, because string, int, , bar different types. return sortfunc (foo1, foo2, f => f.somestring, f => f.someint, f => f.somebar); } this won't compile, because t in func<f

Java and Python Together in Single Google App Engine Project -

i have java application running on google app engine, want add features python module's searchablemodel provides (for search features of course). possible run python code in same project java code, under different version? if not, 2 separate apps (current java app , new python-based search app) running against single datastore, don't think possible. it possible run python , java applications on different versions. from : last not least: remember can have different version of app (using same datastore) of implemented python runtime, java runtime, , can access versions differ "default/active" 1 explicit urls.

Cobol technical demonstration -

i'm working cobol programmer - have 6 months work experience - consulting firm . today, rest cobol "department", had meeting new director of company. after initial analysis made new team in charge, noticed that, comparing other services/technologies our company has offer - java, c++, objective-c, etc - cobol lacking "advertisement". stated whenever members of other teams in-between projects implement small demos can shown our clients whenever there presentation of our company. gave examples of widgets mobile devices in objective-c, cool web-pages html5, etc. , noticed there nothing in cobol that. wants develop kind of tool/app show our competences. we told him cobol used under hood, , doesn't have bells , whistles show. when hiring cobol programmer/analyst important client shows has "business logic" knowledge. i know coding part important after 2 weeks introduction mainframe environment , cobol capable of doing programming tasks easily. 6

website - .Net - Accessing GPS Data from Plethora of Devices -

is aware of utility can retrieve gps data other devices? such handhelds, mobile phones, etc. i'm building website want users able import various gps coordinates may have collected - handheld gps garmin, lowrance, etc or mobile phone (android, iphone, xyz) know garmin came software - overkill - , requires owner read-up , figure out. i'm sure dad can plot points , markers on gps - figuring out how data out (exporting) import may overly-complicated. i'm looking see if there's anyway bridge gap. can shed light how attack issue? there software available that's achieved similar? i'm developing in c# - , have seen garmin has nice api - other's don't - , not sure how interact phones. most gps devices output (serial, usb, etc...) output nmea sentences (http://www.gpsinformation.org/dale/nmea.htm#nmea).`

ruby - nested forms for 2 models in rails using dm-accepts_nested_attributes and dm-is-tree -

i have 2 models: post , image in forum application posts arranged in parent-child format using dm-is-tree. point, images had been part of post model. post model gets unwieldy , need add more depth notating image, i'm working spin off image own model, still part of post in output. so started integrating dm-accepts_nested_attributes in simple arrangement: class post include datamapper::resource property :id, serial property :istop, string property :created_at, datetime property :updated_at, datetime property :content, text has n, :images accepts_nested_attributes_for :images :tree, :order => [:istop, :created_at] class image include datamapper::resource property :id, serial property :created_at, datetime belongs_to :po

javascript - How to bind a click event to the document so that it fires only when no object is clicked -

i event fire whenever other dom element clicked, , separate event when image clicked. right have: $( document ).click( function() { /*do whatev*/ } ); and in place: $( "img" ).click( function( e ) { e.stoppropagation(); /*do whatev*/ } ); it not work. both events fired. other ideas? simple , concise: jquery(document).click(function(event) { if (jquery(event.target).is('img')) { alert('img'); } else { // reject event return false; } }); if user clicks on img element 'img' alerted, otherwise click event stopped.

java - Allman-style anonymous classes -

any recommendations on how use anonymous classes while staying consistent allman indent style ? don't i've come with, e.g. // pass parameter. foo(new clazz( ) { // stuff. }); // assign variable. clazz bar = new clazz( ) { // stuff. }; the best compromise came own code, indenting anonymous class single tabbing level, , putting closing parentheses on new line. // pass parameter. foo(new clazz( ) { // stuff. } ); void func () { foo(new clazz( ) { // stuff. } ); } // assign variable. clazz bar = new clazz( ) { // stuff. };

Algorithm - How to delete duplicate elements in a Haskell list -

i'm having problem creating function similar nub function. i need func remove duplicated elements form list. element duplicated when 2 elements have same email, , should keep newer 1 (is closer end of list). type regist = [name,email,,...,date] type listre = [regist] rmdup listre -> listre rmdup [] = [] rmdup [a] = [a] rmdup (h:t) | isdup h (head t) = rmdup t | otherwise = h : rmdup t isdup :: regist -> regist -> bool isdup (a:b:c:xs) (d:e:f:ts) = b==e the problem function doesn't delete duplicated elements unless in list. slightly doctored version of original code make run: type regist = [string] type listre = [regist] rmdup :: listre -> listre rmdup [] = [] rmdup (x:xs) = x : rmdup (filter (\y -> not(x == y)) xs) result: *main> rmdup [["a", "b"], ["a", "d"], ["a", "b"]] [["a","b"],["a","d"]]

operations - What is devops? -

what devops? has combining dev , ops don't it. it's not combining dev , ops, rather providing platform, tools, knowledge, , resources these 2 teams work better together. increase of agile development, operations have become bottle neck in organizations, , not capable of deploying applications data center on-time , error-free. there lot of movement around application release automation (such nolio asap), , provisioning automation (puppet, chef, etc.).

objective c - Using "generated strings" (stringWithFormat) as keys for NSDictionary -

i this: #define getkey (a) ([nsstring stringwithformat:@"%d",a]) nsmutabledictionary *mutabledictionay=[nsmutabledictionary dictionary]; //population of dictionary [mutabledictionary setobject:anobject forkey:getkey(someintvalue)]; //... retrive object [mutabledictionary getobjectforkey:getkey(someintvalue)]; but i'm concerned stringwithformat method returns different instance of nsstring same value, mean having, 2 strings: "0" , instance value "0". know if is safe way , set objects in dictionary . if not, what other way best way "generate" key object integer? yes, you're doing safe, , work expected. keys of dictionary when getting , setting compared using isequal method, checks values of strings, , not addresses. "0" , "0" equal, regardless of whether same instance or not. you can read more isequal documentation in nsobject protocol reference . aware == , isequal not same thing ( == checks add

asp.net - Convert this PHP function to get server variables to VB .Net -

i having trouble getting server variables remotely in vb .net need mimic php function. function showvar($string) { if(isset($_server[$string])) { echo "$string: ".rawurldecode($_server[$string])."\r\n"; } } /*normal vars*/ showvar("http_accept"); showvar("http_accept_encoding"); showvar("http_accept_language"); showvar("http_accept_charset"); showvar("http_host"); showvar("http_keep_alive"); showvar("http_cookie"); showvar("http_ua_cpu"); showvar("http_referer"); /*important vars*/ showvar("http_user_agent"); showvar("remote_addr"); showvar("remote_host"); showvar("http_connection"); showvar("http_x_forwarded_for"); showvar("http_forwarded"); showvar("http_via"); showvar("keep_alive"); showvar("http_max_forwards"); showvar("max_forwards"); showvar("http_cach

java - .nextval JDBC insert problem -

i try insert table sequence .nextval primary key, sql in java sql = "insert user (user_pk, accountnumber, firstname, lastname, email ) values (?,?,?,?,?)"; ps = conn.preparestatement(sql); ps.setstring(1, "user.nextval"); ps.setstring(2, accountnumber); ps.setstring(3, firstname); ps.setstring(4, lastname); ps.setstring(5, email); however, error ora-01722: invalid number all other fields correct, think problem of sequence, correct? the problem first column numeric data type, prepared statement submitting string/varchar data type. statement run as-is, there's no opportunity oracle convert use of nextval sequence value. here's alternative via java's preparedstatement syntax: sql = "insert user (user_pk, accountnumber, firstname, lastname, email ) values (user.nextval, ?, ?, ?, ?)"; ps = conn.preparestatement(sql); ps.setstring(1, accountnumber); ps.set

javascript - Loop over Json using Jquery -

below json data received ajax response. { "error": { "errorcode": "0001", "errortext": "success" }, "responselist": [ { "count": 2, "event": [ { "startdate": null, "eventid": 1234, "eventname": "interview", "modifieduser": "user", "eventtypecode": "1", "eventvenue": null, "eventspecialinst": "isnsdf", "eventstatuscode": "op", "eventlangcode": "eng", "eventdesc": "sdfsadfsd", "fromemailid": "abcd@apple.com",

iphone - Deployment error -

hi getting deployment error when try run app in device. says "no provisioning ios devices connected". have ios sdk 4.1 installed on mac , in device version of ios 4.2. have conected device mac. can run app under these conditions or need update ios sdk 4.2 in mac also. if yes there update available can update sdk version 4.1 4.2 or have download whole new version of 4.2 (almost 3.5 gb). please help. no. testing device's version cannot higher xcode's version. i think you'll have download entire new 1 since xcode doesn't provide way update. (if wrong, please correct me)

.net - Extracting contents of ConnectionStrings in web.config in Silverlight Business application -

i trying read datasource ad catalog <connectionstrings> in web.config in silverlight business project. unfortunately when used sqlconnectionstringbuilder , not read connection string has connectionstring="metadata=res://*/maindatabase.main.csdl|res://*/maindatabase.main.ssdl|......." where work connectionstring="data source=my-pc\sql_2008;initial catalog =.... i them using "split" however, don't solution. there way requirements? thanks your first connection string (that isn't working) entity framework connection string - isn't in format sqlconnectionstringbuilder can understand. however, entityconnectionstringbuilder will understand that, , has property called providerconnectionstring . property have actual sql connection string in it, can pass sqlconnectionstringbuilder in second example.

php - min and max in multidimensional-array -

hi trying find min , max values of x , y how can find min , max functions not working correctly $datapoints = array( array('x' => 2343, 'y' => 4322), array('x' => 103, 'y' => 303 ), array('x' => 2345,'y' => 2321 ), array('x' => 310, 'y' => 2044 ), array('x' => 173, 'y' => 793 ), array('x' => 456, 'y' => 2675), array('x' => 24, 'y' => 819 )); i thinik have write own function: <?php function max_with_key($array, $key) { if (!is_array($array) || count($array) == 0) return false; $max = $array[0][$key]; foreach($array $a) { if($a[$key] > $max) { $max = $a[$key]; } } return $max; } $datapoints = array( array('x' => 2343, 'y' => 4322), array('x' => 103, 'y' =&

Using CSS for layout, clearing float for stating on next line ?? Need to create a layout of 2 cols and 5 rows -

i have created layout using divs rather tables. seems working... had clear:none after each div consisting of column , content. but end line under each 2 columns before other 2 columns start. outlay code below, doing wrong?.. want create table layout using divs consisting of 5 rows , each row have 2 columns. <div id="column1" style="float:left;width:200px;">1st title</div> <div id="container1" style="float:left;"> <asp:dropdownlist id="dropdownlist1" runat="server"></asp:dropdownlist></div> <div style="clear:both;"></div> <div id="column2" style="float:left;width:200px;">2nd title</div> <div id="container2" style="float:left;"> <asp:dropdownlist id="dropdownlist1" runat="server"></asp:dropdownlist></div> <div style="clear:both;"></div>

filter out nodes with certain id expression using xpath -

currently i've got following example xpaths of nodes want: /html /body /div[@id='wp'] /div[@id='ct'] /div /div[@id='threadlist'] /div[2] /form /table /tbody[@id='normalthread_1174131'] /tr /th /a and don't need: /html /body /div[@id='wp'] /div[@id='ct'] /div /div[@id='threadlist'] /div[2] /form /table /tbody[@id='stickthread_1174132'] /tr /th /a of course, select them using: /html/body/div[@id='wp']/div[@id='ct']/div/div[@id='threadlist'] /div[2]/form/table/tbody[@id]/tr/th/a but want select nodes id normalthread_xxx. each node has different id. in other words, target page may have following nodes: /html/body/div[@id='wp'] /div[@id='ct'] /d

.net - Turn URL into Anchor tag using Regular Expression -

i want following different input types converted following anchor tag: http://www.stackoverflow.com https://www.stackoverflow.com www.stackoverflow.com replaced with: <a href='http(s)://www.stackoverflow.com' title='link opens in new window' target='_blank'>www.stackoverflow.com</a> i think write similar myself, i'd know if there standard script doing has been throughly tested? many thanks! found function: public shared function converturlstolinks(byval msg string) string dim regex string = "((www\.|(http|https|ftp|news|file)+\:\/\/)[&#95;.a-z0-9-]+\.[a-z0-9\/&#95;:@=.+?,##%&~-]*[^.|\'|\# |!|\(|?|,| |>|<|;|\)])" dim r new regex(regex, regexoptions.ignorecase) return r.replace(msg, "<a href=""$1"" title=""click open in new window or tab"" target=""&#95;blank"">$1</a>").rep

visual studio 2010 - Tool for examining potential casting problems in C# -

i have following situation on hands. in project work on have abstract class a has 2 descendants, a_concrete1 , a_concrete2 . these 2 around time now. the time has come add third descendant, a_concrete3 . problem is, lot of time in existing codebase you'll find that: a instance; // ... // assignment of instance // ... if (!(a a_concrete1)) a_concrete2 = (a_concrete2)a; so now, when a has more 2 descendants, code broken , fail @ runtime. my question is: how locate these situations automatically fix them? best way/tool it? tried use resharper, doesn't provide casting analysis. i'd glad hear suggestions , pointers on one. thanks in advance the best way have methods in (that might overridden in subclasses) , code given use call methods of a, , never cast either subclass. way won't have again. probably find in files (the toolbar button features binoculars on file folder) best way find (a_concrete2) , is a_concrete1 . don't in there , replac

javascript - OAuth2 User-agent flow + two-legged OAuth -

i have 2 questions oauth2's user-agent flow. (the current rfc draft of oauth2's user-agent flow here: http://tools.ietf.org/html/draft-ietf-oauth-v2-11#section-2.2 ) 1) step c: access token has given in fragment, because user-agent (browser) have access it. why such problem if server-side (if there server-side) there easy workarounds client-side can pass server-side (cookie, hidden fields, ...) 2) i want implement oauth2 user-agent flow, two-legged version (request_token enough, consumer app can act users, no need authenticate user @ service provider) i have 1 major security gap combination of oauth2's user-agent flow , two-legged version: the web browser handles redirection. means though service provider thinks it's sending user specified host , domain, host , domain trivial user redirect own machine -- or anywhere, tweaking dns setup or /etc/hosts file. let's see 3-legged , 2-legged version: with 3-legged oauth isn't major problem because

php - Magento - How do I add an invoice fee to an order during checkout process -

how add invoice fee order payment module? guess should done during checkout process through payment method model. perhaps should create , add item/product cart/quote/order object? i don't know how of these things though. please help although possible not feint-hearted. here rough run-down of steps add line totals area, add fee grand total. in config node <global><sales><quote><total> add new entry (see app/code/core/mage/sales/etc/config.xml more examples) <paymentfee> <class>yourmodule/quote_address_total_paymentfee</class> <!-- model --> <after>subtotal</after> </paymentfee> also in config.xml add following <global> ... <fieldsets> <sales_convert_quote> <payment_fee><to_order>*</to_order></payment_fee> </sales_convert_quote> </fieldsets> create model calculate fee. class your_module_model_quote_address_total_

rdf - Mixing EquivalentClass and SubClass in OWL -

i'm curious mixing subclassof , equivalentclass in class description, , how reasoner behave. specifically, if have both equivalentclass , subclassof assertion same class, both equivalentclass , subclassof conditions need satisfied individual classified in class, or equivalentclass? or bad practice? for example (declarations omitted): objectpropertyrange(:format :bar) objectpropertyrange(:format owl:thing) equivalentclass(:foo objectsomevaluesfrom(:format :bar)) subclassof(:foo :sna) i want ensure in case below, :x classified :foo , because both equivalentclass , subclassof assertions satisfied: classassertion(:x :sna) objectpropertyassertion(:format :x :somebar) but :y not, because subclassof not satisfied: classassertion(:y :notasna) objectpropertyassertion(:format :y :someotherbar) thanks, jonathan i don't understand question i'll try clarify things. first of all, following axioms seem irrelevant question (and second redundant anyway bec

Has anyone been successful in using 64-bit Eclipse for Android 2.3 dev on 64-bit Windows 7? -

has been successful in using 64-bit eclipse android 2.3 dev on 64-bit windows 7? please answer positively only if , when invoke emulator via eclipse's run (ctrl+f11), app-to-be-debugged's apk installed automatically onto android emulator and running same exact configuration: windows 7 ultimate 64-bit. jdk 64-bit (jdk-6u23-windows-x64.exe installed.) jdk 32-bit (jdk-6u23-windows-i586.exe installed.) eclipse classic 3.6 64-bit (eclipse-sdk-3.6.1-win32-x86_64.zip) android 2.3 sdk starter package if able fully use 64-bit eclipse android 2.3 dev on 64-bit windows 7, please describe steps performed make happen. as of now, following steps did not work me: install 64-bit jdk install 32-bit jdk unzip android-sdk_r08-windows.zip c:\android-sdk-windows append c:\android-sdk-windows\tools %path% in system env vars. run c:\android-sdk-windows\tools>android.bat install adt plugin via eclipse create "android 2.3 - api level 9" virtual device via e

java - Tomcat - The requested resource () is not available -

i message when try start small test project vaadin component on tomcat server. funny thing had worked , without changes @ project or tomcat settings stopped ?? i read every comment on net there is, hasn't helped. here java code: package com.example.test1_vaadin; import com.vaadin.application; import com.vaadin.ui.*; public class test1_vaadinapplication extends application { @override public void init() { window mainwindow = new window("test1_vaadin application"); label label = new label("hello vaadin user"); mainwindow.addcomponent(label); setmainwindow(mainwindow); } } and here web.xml application: <?xml version="1.0" encoding="utf-8"?> <web-app id="webapp_id" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://java.sun.com/xml/ns/j2ee http://java.su

api - process information in C# -

is there way find information process, such type (browser, player.. ) c#? or api function? no, not possible information what process does, can information start-time or whether has window that: process p = process.getprocessbyid(pid); label1.text = p.starttime.tostring(); //<-- start-time label2.text = p.mainwindowhandle == intptr.zero?"no window.":"a window"; //<-- display window?? hope helps.

.net - Catch dll loading -

i trying build .net client software package downloads components on demand. let's have program split main executable , 20 other dll files. main program references 3 of them, reference others, anyway... have kind of tree dependency structure. the thing trying achieve distribute main executable , else server location on-demand. something this: main program , these dll projects in single solution , built other solution. while distributing, exe distributed, other dll's (including third party libraries used) put in server location available download. the exe runs, shows ui, when user clicks menu item, ui window 1 dll files shown os looks dll (which not there), intervene, download required dll server, put next exe , let os load if there beginning. this looks achievable use of common interface class , reflection magic hoping more, includes building dll's altogether in single solution, includes on-demand download of 3rd party libraries. any ideas how this?

android - Using AlertBuilder with cursors -

i want alertdialog show list of countries selected database cursor, selects id , country name, have following code don't know how selected item: alertdialog.builder ab=new alertdialog.builder(this); ab.settitle(r.string.msg_title_pais_resid); locale locale = locale.getdefault(); final cursor items = daoprovider.getlistapaisescursor(this, (locale.getlanguage()).touppercase()); ab.setcursor(items,new dialoginterface.onclicklistener() { @override public void onclick(dialoginterface dialog, int which) { //here: selected item object (or id) } }, internacionalizacion.colinternacionalizaciontraduccion) thanks you should able do: items.movetoposition(which) string text = items.getstring(the_column_number) the which parameter either button clicked, or position of item selected (in case of list). docs here .

php - Subversion Hook wont run 'svn update' when run automatically but will when run from bash prompt -

i have created subversion hook various things including sending out emails , updating working copy on server. when run bash propt works perfectly. when run through either tortoisesvn or netbeans on commit, emails etc sent update not executed, no errors appear either. file php file , using backtick method run bash commands. other bash commands run compose emails isn't issue. here line should run update , log outcome. $location pulled database of working copy locations. $update_output = `/usr/local/bin/svn update /home/$location >> update.log`; thanks james edit, more complete script: #!/usr/local/bin/php <? $repos = $argv[1]; $rev = $argv[2]; $output[] = `/usr/local/bin/svnlook dirs-changed -r $rev $repos`; foreach($output $line) { preg_match("$([^/]+)$", $line, $array); $projects[] = $array[0]; } $projects = array_unique($projects); $mysqli = new mysqli('localhost', 'svn_user', 'pringles', 'svn_maind

MSpec and ASP.NET MVC Unit Test, Visual Studio Integration -

when 1 creates new asp.net mvc project in visual studio, new project wizard provides option create unit test project @ same time. typically, choice offered mstest, want use mspec. mvc supposed pluggable, including unit test frameworks, i'd able choose 'mspec' wizard , have mspec project created alongside mvc project. is aware of mspec integration that's been done lets users going mspec right new project wizard? there's no integration new project wizard of today. creating mspec test project ist easy, argue there's no real benefit in having new option in project wizard: download mspec teamcity server @ codebetter extract zip file project's lib or tools folder create new class library , reference machine.specifications.dll write specs run tests resharper or testdriven.net (or use console runner, that's not preferred)