Daily Archives

Articles indexed Wednesday April 21 2010

Page 1/126 | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • setResult does not work when BACK button pressed.

    - by alex2k8
    I am trying to setResult after the BACK button was pressed. I call in onDestroy Intent data = new Intent(); setResult(RESULT_OK, data) But when it comes to onActivityResult(int requestCode, int resultCode, Intent data) the resultCode is 0 (RESULT_CANCELED) and data is 'null'. So, how can I pass result from activity terminated by BACK button?

    Read the article

  • how to pass datetime in session value to next page

    - by SmartDev
    Hi , I have textbox which is a date field . i need to store that in a session and pass that value to another page . im using sessions for that . can anyone tell how to convert it to date time and pass in a session . Example: Session["startdate"] = Convert.ToDateTime(textbox1.Text); is this the rite way. Thanks Sachin

    Read the article

  • [Principles] Concrete Type or Interface for method return type?

    - by SDReyes
    In general terms, whats the better election for a method's return type: a concrete type or an interface? In most cases, I tend to use concrete types as the return type for methods. because I believe that an concrete type is more flexible for further use and exposes more functionality. The dark side of this: Coupling. The angelic one: A concrete type contains per-se the interface you would going to return initially, and extra functionality. What's your thumb's rule? Is there any programming principle for this? BONUS: This is an example of what I mean http://stackoverflow.com/questions/491375/readonlycollection-or-ienumerable-for-exposing-member-collections

    Read the article

  • PHP form class

    - by Oli
    I'm used to ASPNET and Django's methods of doing forms: nice object-orientated handlers, where you can specify regexes for validation and do everything in a very simple way. After months living happily without it, I've had to come back to PHP for a project and noticed that everything I used to do with PHP forms (manual output, manual validation, extreme pain) was utter rubbish. Is there a nice, simple and free class that does form generation and validation like it should be done? Clonefish has the right idea, but it's way off on the price tag.

    Read the article

  • Using Monotouch with Google .NET APIs

    - by Bryan
    I am using Mike Bluestein's article, http://mikebluestein.wordpress.com/2009/09/27/using-monotouch-with-the-net-library-for-the-google-data-api/, to build an application that communicates with the google APIs. When I try to add references to my project, the imported projects say "incompatible target framework: v2.0". I can change version to 1.0, 3.0, or 3.5 with the same results. If I add the .dll to the monotouch project I get a compilation error - monotouch failed with no output 134. Any suggestions?

    Read the article

  • UIResponder Delays

    - by Dylan Copeland
    I have a UIView subclass that overrides UIResponder's touchesMoved: message. I've noticed that when I swipe my finger very quickly across the UIView, my touchesMoved: message only gets called every so often and not constantly getting messaged. Any ideas? Thanks.

    Read the article

  • What type of Multimeter is safe to use on computers?

    - by Ssvarc
    In "Upgrading and Repairing PC's - 18th edition" by Scott Mueller on pg. 1278 he discusses multimeters. "You should only use a DMM (digital multimeter) instead of the older needle-type multimeters because the older meters work by injecting 9V into the circuit when measuring resistance, which damages most computer circuits. A DMM uses a much smaller voltage (usually 1.5V) when making resistance measurements, which is safe for electronic equipment." Most DMM's that I've looked at have 9V batteries. Are they internally stepping down the voltage used when making these measurements? Wouldn't the concern of injecting 9V be true when measuring continuity as well? A little off topic, there is a fascinating way to test for laptop screen inverter failure, (http://www.fonerbooks.com/test.htm), is anyone aware of a safe DMM that is capable of this as well?

    Read the article

  • Does killing a process helps avoids spyware

    - by user23950
    I'm downloading something from mediafire which really has many sponsor sites that are not good: ad.xtendmedia.com and mdinfo.com. And possibly the cause of some spyware and adware in my system. Does killing the whole process of firefox and not closing those pop-up windows(ad sites) helps avoid the effects of those bad sites.

    Read the article

  • Disable cookies for selected sites

    - by acidzombie24
    So far all sites have played nice but recently i ran into a site which aggressively tries to get users to sign up and pretty much puts the site on lockdown after 10 pageviews without signing up. What firefox extension can i use to either freeze or disable cookies for this one specific site? I dont want to whitelist every site i visit because one site is giving me trouble.

    Read the article

  • Program Managers: Do you exist? How do I become you?

    - by sixtyfootersdude
    I am a Computer Science major who is interesting in exploring a career as a program manager. I knew since starting my degree that that was the role that was interested in but I just found out the actual job name recently. Q: Is this a common position? Do many companies have "program managers"? What should I do/read to improve my chances to become a project manager upon graduation? I have already completed three co-op terms at different companies none of which had this position.

    Read the article

  • SQL: convert tokens in a string or elements of an array into rows of a table

    - by slowpoison
    Is there a simple way in SQL to convert a string or an array to rows of a table? For example, let's stay the string is 'a,b,c,d,e,f,g'. I'd prefer an SQL statement that takes that string, splits it at commas and inserts the resulting strings into a table. In PostgreSQL I can use regexp_split_to_array() and split the string into an array. So, if you know a way to insert an array's elements as rows into a table, that would work too.

    Read the article

  • jQuery monitoring form field created by AJAX query

    - by Jon Rhoades
    Preface: I am sure this is incredibly simple, but I have searched this site & the jQuery site and can't figure out the right search term to get an answer - please excuse my ignorance! I am adding additional form fields using jQuery's ajax function and need to then apply additional ajax functions to those fields but can't seem to get jQuery to monitor these on the fly form fields. How can I get jQuery to use these new fields? $(document).ready(function() { $('#formField').hide(); $('.lnk').click(function() { var t = this.id; $('#formField').show(400); $('#form').load('loader.php?val=' + t); }); //This works fine if the field is already present var name = $('#name'); var email = $('#email'); $('#uid').keyup(function () { var t = this; if (this.value != this.lastValue) { if (this.timer) clearTimeout(this.timer); this.timer = setTimeout(function () { $.ajax({ url: 'loader.php', data: 'action=getUser&uid=' + t.value, type: 'get', success: function (j) { va = j.split("|"); displayname = va[1]; mail = va[2]; name.val(displayname); email.val(mail); } }); }, 200); this.lastValue = this.value; } }); }); So if the is present in the basic html page the function works, but if it arrives by the $.load function it doesn't - presumably because $(document).ready has already started. I did try: $(document).ready(function() { $('#formField').hide(); $('.lnk').click(function() { var t = this.id; $('#formField').show(400); $('#form').load('loader.php?val=' + t); prepUid(); }); }); function prepUid(){ var name = $('#name'); var email = $('#email'); $('#uid').keyup(function () { snip........... But it didn't seem to work...

    Read the article

  • Optional non-system type parameters

    - by Courtney de Lautour
    C#4.0 obviously brings optional parameters (which I've been waiting for, for quite some time). However it seems that because only system types can be const that I cannot use any class/struct which I have created, as an optional param. Is there a some way which allows me to use a more complex type as an optional parameter. Or is this one of the realities that one must just live with?

    Read the article

  • Using Python to call Mencoder with some arguments

    - by Manu
    Hello, I'll start by saying that I am very, very new to Python. I used to have a Windows/Dos batch file in order to launch Mencoder with the right set of parameters, without having to type them each time. Things got messy when I tried to improve my script, and I decided that it would be a good opportunity to try coding something in python. I've come up with that : #!/usr/bin/python import sys, os #Path to mencoder mencoder = "C:\Program Files\MPlayer-1.0rc2\mencoder.exe" infile = "holidays.avi" outfile = "holidays (part1).avi" startTime = "00:48:00" length = "00:00:15" commande = "%s %s -ovc copy -oac copy -ss %s -endpos %s -o %s" os.system(commande % (mencoder, infile, startTime, length, outfile)) #Pause raw_input() But that doesn't work, windows complains that "C:\Program" is not recognized command. I've trying putting some "\"" here and there, but that didn't help.

    Read the article

  • jQuery datepicker onSelect set multiple row values

    - by d3020
    On the select event of the datepicker I need to add and set values in multiple rows. In other words, I have something like this... Days Value Row 1 1 Row 2 2 Row 3 3 I have the "Days" and "Value" columns as textboxes. When I select a date from the datepicker I need to add the "Days" value for each row to the date selected. That value is what goes into the "Value" column. Example, I select 4/20/2010. The value in each respective row would then be 4/21/2010, 4/22/2010, 4/23/2010. Hopefully this makes sense and thank you for the help in advance.

    Read the article

  • Reading BVH file in pyopengl

    - by Vic
    Hi I am trying to animate a skeleton using a BVH file. I am doing this in pyopengl. Now I have googled and got to know that python has a generic module that can be used to read BVH file but i don't know how to use it or how to import that module. Can anyone help me with that. Any sample code or any other help would be appreciated. Thanks Vikram

    Read the article

  • Is MEF an all-or-nothing affair?

    - by Dave
    I've had a few questions about MEF recently, but here's the big one -- is it really all-or-nothing, as it appears to be? My basic application structure is simply an app, several shared libraries that are intended to be singletons, and several different plugins (which may implement different interfaces). The app loads the plugins, and both the app and all plugins need to access the shared libraries. My first go at MEF was fairly successful, although I made some stupid mistakes along the way because I was trying so many different things, I just got confused at times. But in the end, last night I got my smallish test app running with MEF, some shared libraries, and one plugin. Now I'm moving onto the target app, which I already described. And it's the multiple plugins part that has be a bit worried. My existing application already supports multiple plugins with different interfaces by using Reflection. I need to be able to uniquely identify each plugin so that the user can select one and get the expected behavior exposed by that plugin. The problem is that I don't know how to do this yet... but that's the topic of a different question. Ideally, I'd be able to take my existing plugin loader and use it as-is, while relying on MEF to do the shared library resolution. The problem is, I can't seem to get MEF to load them (i.e. I get a CompositionException when calling ComposeParts()) unless I also use MEF to load the plugin. And if I do this, well... then I need to know how to keep track of them as they get loaded so the user can select one from a list of plugins. What have your experiences been with trying to mix and match these approaches?

    Read the article

  • Vim script to compile TeX source and launch PDF only if no errors

    - by Jeet
    Hi, I am switching to using Vim for for my LaTeX editing environment. I would like to be able to tex the source file from within Vim, and launch an external viewing if the compile was successful. I know about the Vim-Latex suite, but, if possible, would prefer to avoid using it: it is pretty heavy-weight, hijacks a lot of my keys, and clutters up my vimruntime with a lot of files. Here is what I have now: if exists('b:tex_build_mapped') finish endif " use maparg or mapcheck to see if key is free command! -buffer -nargs=* BuildTex call BuildTex(0, <f-args>) command! -buffer -nargs=* BuildAndViewTex call BuildTex(1, <f-args>) noremap <buffer> <silent> <F9> <Esc>:call BuildTex(0)<CR> noremap <buffer> <silent> <S-F9> <Esc>:call BuildTex(1)<CR> let b:tex_build_mapped = 1 if exists('g:tex_build_loaded') finish endif let g:tex_build_loaded = 1 function! BuildTex(view_results, ...) write if filereadable("Makefile") " If Makefile is available in current working directory, run 'make' with arguments echo "(using Makefile)" let l:cmd = "!make ".join(a:000, ' ') echo l:cmd execute l:cmd if a:view_results && v:shell_error == 0 call ViewTexResults() endif else let b:tex_flavor = 'pdflatex' compiler tex make % if a:view_results && v:shell_error == 0 call ViewTexResults() endif endif endfunction function! ViewTexResults(...) if a:0 == 0 let l:target = expand("%:p:r") . ".pdf" else let l:target = a:1 endif if has('mac') execute "! open -a Preview ".l:target endif endfunction The problem is that v:shell_error is not set, even if there are compile errors. Any suggestions or insight on how to detect whether a compile was successful or not would be greatly appreciated! Thanks!

    Read the article

  • undefined method `call' for LiquidView:Class

    - by user181186
    I trying to use Liquid template engine plugin , but I 'm getting the following error while controller tries to render a .liquid template . "undefined method `call' for LiquidView:Class" I installed it as a plugin according to http://wiki.github.com/tobi/liquid/getting-liquid-to-work-in-rails I using Rails 2.3.5 and Ruby 1.8.7. Does anyone had the same problem before ?

    Read the article

  • Having trouble with match wildcards in array

    - by Senthil
    I've a master text file and exceptions file and I want to match all the words in exception file with master file and increase counter, but the trick is with wildcards. I'm able to do without wildcards with this: words = %w(aaa aab acc ccc AAA) stop = %q(/aa./) words.each do |x| if x.match(/aa./) puts "yes for #{x}" else puts "no for #{x}" end end = yes for aaa yes for aab no for acc no for ccc yes for AAA Also which would be the best way to go about this, using arrays or some other way. Edit: Sorry for the confusion. Yes stop has multiple wildcards and I want to match all words based on those wildcards. words = %w(aaa aab acc ccc AAA) stop = %q(aa* ac* ab*) Thanks

    Read the article

  • Interface member name conflicts in ActionScript 3

    - by Aaron
    I am trying to create an ActionScript 3 class that implements two interfaces. The interfaces contain member functions with different signatures but the same name: public interface IFoo { function doStuff(input:int):void; } public interface IBar { function doStuff(input1:String, input2:Number):void; } public class FooBar implements IFoo, IBar { // ??? } In C# this problem can be solved with explicit interface implementations, but as far as I can tell ActionScript does not have that feature. Is there any way to create a class that implements both interfaces?

    Read the article

1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >