Search Results

Search found 3846 results on 154 pages for 'life sciences'.

Page 95/154 | < Previous Page | 91 92 93 94 95 96 97 98 99 100 101 102  | Next Page >

  • Why does Python's __import__ require fromlist?

    - by ieure
    In Python, if you want to programmatically import a module, you can do: module = __import__('module_name') If you want to import a submodule, you would think it would be a simple matter of: module = __import__('module_name.submodule') Of course, this doesn't work; you just get module_name again. You have to do: module = __import__('module_name.submodule', fromlist=['blah']) Why? The actual value of fromlist don't seem to matter at all, as long as it's non-empty. What is the point of requiring an argument, then ignoring its values? Most stuff in Python seems to be done for good reason, but for the life of me, I can't come up with any reasonable explanation for this behavior to exist.

    Read the article

  • Applying a function with multiple inputs using Map? (Haskell)

    - by Schroedinger
    G'day guys, Trying currently to finish up a bit of homework I'm working on, and having an issue where I'm trying to apply map across a function that accepts multiple inputs. so in the case I'm using processList f (x:xs) = map accelerateList f xs x xs processList is given a floating value (f) and a List that it sorts into another List Accelerate List takes a floating value (f) a List and a List Object through which it returns another List Object I know my Accelerate List code is correct, but I cannot for the life of me get the syntax for this code working: processList :: Float -> [Object] -> [Object] accelerate f [] = [] accelerate f [x] = [(accelerateForce f x x)] accelerate f (x:xs) = map accelerateList f xs x xs Any ideas? I've been scratching my head for about 3 hours now. I know it's something really simple.

    Read the article

  • Is there a Chrome extension to add mailto links to email addresses?

    - by Martin Burch
    Wait, wait, this is a programming question! I want to build an extension if none exists. Imagine this: you come across a webpage that says "Just send a message to [email protected]" but to actually send the email, you need to highlight the address and then cut and paste it into the recipient field of a new compose window of your email client of choice. Obviously life would be easier if it were simply a mailto: link, so you could click on it and have a new message created automatically. (Or if the page designer had used a form, perhaps ...) I was originally going to ask if there was an extension to enable similar functionality for unlinked twitter @username mentions but I thought this email address problem would be a simpler situation. If you think it would be useless, perhaps I should look at the twitter username problem instead. Thanks for your feedback.

    Read the article

  • How do I create a view with a picker on the bottom and a table view on the top?

    - by Andy
    Hi - first time asker, long-time lurker. I am trying to create an iPhone view that has a date/time picker on the bottom half of the screen, and a grouped, single-section, four-row table view on the top half of the screen (almost identical to the one Apple shows in Fig. 2-4 of their View Controller Programming Guide (but then never goes on to explain). Conceptually, I think I understand that what I need is a main view with a pair of subviews - one for the picker, and one for the table view. I'm pretty sure I can make the picker function once I have it on-screen, and I'm pretty sure I can make the table view function too. What I can't for the life of me figure out is how, programmatically speaking, to get the two views onto the screen simultaneously. I can lay it out perfectly in Interface Builder, but then it all goes to hell when I switch to Xcode...the view appears with the picker, but no table view. Thanks, in advance, for any help you can offer.

    Read the article

  • lists:keyfind problems

    - by dagda1
    Hi, I cannot for the life of me get lists:keyfind to work as I expect in Erlang. I have the following eunit test: should_find_key_test() -> NewList = lists:keystore("key", 1, [], {"key", "value"}), Value = case lists:keyfind("key", 1, NewList) of false -> notfound; {_key, _value} -> _value end, ?debugVal(Value). Whenever I run this test I get the following error message: indextests:should_find_key_test (module 'indextests')...failed ::error:undef in function lists:keyfind/3 called as keyfind("key",1,[{"key","value"}]) in call from indextests:should_find_key_test/0 Can anyone see what I am doing wrong? Is it saying that lists:keyfind no longer exists? Cheers Paul

    Read the article

  • In C#, What is <T> After a Method Declaration?

    - by Drew
    I'm a VB.Net guy. (because I have to be, because the person who signs my check says so. :P) I grew up in Java and I don't generally struggle to read or write in C# when I get the chance. I came across some syntax today that I have never seen, and that I can't seem to figure out. In the following method declaration, what does < T represent? static void Foo < T (params T[] x) I have seen used in conjunction with declaring generic collections and things, but I can't for the life of me figure out what it does for this method. In case it matters, I came across it when thinking about some C# brain teasers. The sixth teaser contains the entire code snippet.

    Read the article

  • What's the most effective way to interpolate between two colors? (pseudocode and bitwise ops expecte

    - by navand
    Making a Blackberry app, want a Gradient class. What's the most effective way (as in, speed and battery life) to interpolate two colors? Please be specific. // Java, of course int c1 = 0xFFAA0055 // color 1, ARGB int c2 = 0xFF00CCFF // color 2, ARGB float st = 0 // the current step in the interpolation, between 0 and 1 /* Help from here on. Should I separate each channel of each color, convert them to decimal and interpolate? Is there a simpler way? interpolatedChannel = red1+((red2-red1)*st) interpolatedChannel = interpolatedChannel.toString(16) ^ Is this the right thing to do? If speed and effectiveness is important in a mobile app, should I use bitwise operations? Help me! */

    Read the article

  • What default targets do you have in your typical ant buildfile?

    - by altern
    Do you have some predefined set of targets which all build.xml files you create contain? For example, a lot of ant manuals suggest the following list of targets: init clean compile build jar test javadoc dist deploy webapp What is the most large build file you met in your life? How many targets did it have and what are they? How often do you need more than predefined set of targets? The goal is to develop some conventions to have standard buildfile template for any project having the notion of the maven-like approach in mind (when a lot of work happens under the cover, convention over configuration). Also it would be great if you know the place where one can find collection of different buildfiles to choose or to get inspired from.

    Read the article

  • Cookies ignored on Apache/Magento installation

    - by Laizer
    I'm running a Magento based website store on Linux/Apache. In order that user logins are maintained, I've set my cookie lifetime to be close to two years. The cookies are sent out with the right times, I can see them in my browsers. When I visit the site from a previously logged-in browser after about a day, the user is logged out. I can still see the cookies, with their extended life, present in the browser. Where should I start looking to get to the bottom of this issue?

    Read the article

  • An Inaccessible JavaScript Object property - Why is Firebug showing this?

    - by Matty
    So, I'm attempting to access the content of an object and for the life of me can't figure out why I can't. I'm starting to believe that the object doesn't have the properties that Firebug indicates that it does. More likely than that I'm just not using the right syntax to access them. Give the following function: function(userData) { console.log(userData); // statement 1 console.log(userData.t_nodecontent); // statement 2 } Which generates the following FireBug output for statement 1 and unknown for statement 2. Is there something obvious that I'm overlooking in the way I'm attempting to reference the value of t_nodecontent? I'm at a loss :(

    Read the article

  • Programming languages: out of the box legibility and extensibility

    - by sova
    Two excellent results of SOLID development ideology are - Legibility - Extensibility over the life of a project (http://en.m.wikipedia.org/wiki/Solid_(object-oriented_design) Although SOLID is a set of language-agnostic design ideas, some languages inherently support these ideas better than others. Out-of-the-box or after various customizations, in your opinion which language is best-suited to be both easily readable and easy to extend functionality in? Some definitions to pre-empt biases and flamewars: Legibility: amount of thinking done to understand the code proportional to the amount of code: (amount_think-energy / amount_code) is fairly constant and as low as possible in the optimal case. Extensibility: Addition of X amount of functionality requires a change in code or code additions in proportion to X (amount_added_functionality / amount_added_code) is fairly constant and as high as possible in the optimal case. Supporting information and tutorials encouraged. Code snippets welcome.

    Read the article

  • Control webcam from C#

    - by Moulde
    Hi I have a Creative Life CAM Optia AF webcam, the software included in the package is able to control the camera in different ways, like set autofocus to auto or manual, and a bunch of gamma and brightness settings. I'm capturing the feed with the AForge Computer vision library, and it's working great. But i would like to be able to set the manual focus from inside my application. Ive been searching for a tutorial, but come up empty handed. Can i somehow either disassemble the included software, or is there some way to fetch the traffic / instructions being sent to the device? Thanks in advance.

    Read the article

  • Will a Response.Redirect exception go to global.asax?

    - by mgmedick
    I'm aware that when you call Response.Redirect it fires a ThreadAbortException. A co-worker has demonstrated calling response.redirect and then it goes to the global.asax. For the life of me I cannot get the ThreadAbortException to go to the global.asax, its like it is being suppressed naturally in the system. The reason I'm asking this is we believe the response.redirect is the cause of some automated error emails, but I'm not convinced this is the case especially if I can't even get it to debug into the global.asax. Any Ideas why I can't get the Response.Redirect to fire the global error handler?

    Read the article

  • what's wrong with concatenation in blackberry application?

    - by sexitrainer
    For the life of me, I can't understand why adding a concatenated string to the MainScreen is causing the BB simulator to throw an exception. If I run a VERY simple hello program with the following control, all is well: RichTextField rtfHello = new RichTextField("Hello There !!!"); add(rtfItemDescription); But if I add a concatenated string, the entire app breaks: String MyName = "John Doe"; RichTextField rtfHello = new RichTextField("Hello There !!!" + MyName); add(rtfItemDescription); So what am I doing wrong? Why would the simulator throw an exception for the second example?

    Read the article

  • Vimperator and scripts directory on Windows 7

    - by Ted
    Just trying out Vimperator for the first time. For the life of me however, I can't figure out how to add a script (specifically for delicious bookmarks). Running Windows 7 x64. No plugin directory: C:\Users\username\AppData\Roaming\Mozilla\Firefox\Profiles\dgj7o1s1.default\extensions\[email protected] No plugin directory in default location: C:\Users\username\vimperator If I create the "plugin" directory, the script is still not available. Any suggestions? I'm really liking Vimperator, but when you can't figure something out, you really CAN'T figure it out.

    Read the article

  • jQuery ajax request to php, how to return plain text only

    - by jyoseph
    I am making an ajax request to a php page and I cannot for the life of me get it to just return plain text. $.ajax({ type: 'GET', url: '/shipping/test.php', cache: false, dataType: 'text', data: myData, success: function(data){ console.log(data) } }); in test.php I am including this script to get UPS rates. I am then calling the function with $rate = ups($dest_zip,$service,$weight,$length,$width,$height); I am doing echo $rate; at the bottom of test.php. When viewed in a browser shows the rate, that's great. But when I request the page via ajax I get a bunch of XML. Pastie here: http://pastie.org/1416142 My question is, how do I get it so I can just return the plain text string from the ajax call, where the result data will be a number? Edit, here's what I see in Firebug- Response tab: HTML tab:

    Read the article

  • Prims vs Polys: what are the pros and cons of each?

    - by Richard Inglis
    I've noticed that most 3d gaming/rendering environments represent solids as a mesh of (usually triangular) 3d polygons. However some examples, such as Second Life, or PovRay use solids built from a set of 3d primitives (cube, sphere, cone, torus etc) on which various operations can be performed to create more complex shapes. So my question is: why choose one method over the other for representing 3d data? I can see there might be benefits for complex ray-tracing operations to be able to describe a surface as a single mathematical function (like PovRay does), but SL surely isn't attempting anything so ambitious with their rendering engine. Equally, I can imagine it might be more bandwidth-efficient to serve descriptions of generalised solids instead of arbitrary meshes, but is it really worth the downside that SL suffers from (ie modelling stuff is really hard, and usually the results are ugly) - was this just a bad decision made early in SL's development that they're now stuck with? Or is it an artefact of what's easiest to implement in OpenGL?

    Read the article

  • Audio Playback Rate in Android

    - by Marquis
    So, I know that this has been done with a few Android apps before, but I cannot for the life of me figure out how, since it's not currently possible through the API. How does one adjust the playback rate of a sound played through MediaPlayer; either with or without adjusting the pitch is fine for now, though the latter is definitely preferred. If someone can point me in the direction of an open source app that I can use as guidance, that would also be fine. Thanks in advance.

    Read the article

  • Android: Custom Clock widget Service work-around?

    - by Anthony Forloney
    I was interested in developing a clock widget for the homescreen and upon reading Home Screen Widgets tutorial, is there a pre-existing Service I could reference for updating the current time rather than re-inventing the wheel? I have currently Retro Clock on my android phone and noticed that when I click it, it pops up the Alarm Clock settings, but with the default Google Analog Clock widget, upon click does nothing. Is that because the Retro Clock widget implements the Alarm Clock service? If so, how can I go about referencing that service? Or do I have this all wrong and misunderstood? Any help is appreciated. EDIT: I believe implementing the service to update the clock would drain the battery life tremendously, any ideas on a work around or help shed some light on any performance issues with using Service?

    Read the article

  • Three20 Library Cannot find its own headers Xcode iPhone

    - by DieLaughing
    import "Three20/Three20.h" Fails. Go download it and build a sample app. If that works, then make a new app from the templates provided, then watch as it fails spectacularly to find the right HEADER_SEARCH_PATH. 1) I've gone to the info page for the TARGET and not the PROJECT (Well, I tried both) and tried a bunch of different paths for the HEADER_SEARCH_PATH field. 2) I've tried dragging and dropping the dependent files from the finder and COPYING or just referencing both fails. (RANT: WTF?! Really? I wish public code libraries saved me time ONCE in my life.)

    Read the article

  • Python continue from the point where exception was thrown

    - by James Lin
    Hi is there a way to continue from the point where exception was thrown? eg I have the following psudo code unique code 1 unique code 2 unique code 3 if I want to ignore the exceptions of any of the unique code statements I will have to do it like this: try: #unique code 1 except: pass try: #unique code 2 except: pass try: #unique code 3 except: pass but this isn't elegant to me, and for the life of me I can't remember how I resolved this kind of problem last time... what I want to have is something like try: unique code 1 unique code 2 unique code 3 except: continue from last exception raised

    Read the article

  • mysql data being inserted twice via php

    - by Jascha
    I can't for the life of me figure out why this function is causing multiple entries into my database table... When I run the function I end up with two records stacked on top of each one second apart here is the function: function generate_signup_token(){ $connection = new DB_Connect(); // <--- my database connection class $ip = mysql_real_escape_string($_SERVER['REMOTE_ADDR']); $sign_up_token = uniqid(mt_rand(), true); $_SESSION['signup_token'] = $sign_up_token; $sign_up_token = mysql_real_escape_string($sign_up_token); $query = "INSERT INTO `token_manager` (`ip_address`, `signup_token`) VALUES ('$ip', '$sign_up_token')"; mysql_query($query); } generate_signup_token();

    Read the article

  • Virus - How much it can affect?

    - by Sarang
    In our daily life, we come across various Viruses. In this internet world, we do have lots of type of viruses come to visit us ! While for the beginners, Virus is a complicated matter to fight with. Please explain the way how the virus come flow across the PC using Internet. What are the ways to search for them in the Personal Computer ? Also, we do have various solutions available in the market of Anti-Viruses, but also have different comments available for different software. Which is actually, really a useful Anti-Virus in the market that can give reliable performance ? Every Personal Computer connected to internet has to face against the viruses. Isn't there any general solution using Internet itself through which all networked computers get protected against Viruses ? Please give any solution.

    Read the article

  • Android SDK: Create image on touch

    - by dagonal
    Hello, I'm a bit stumped here, I'm trying to make it so an image (already in the drawable folder) gets created everytime you touch the screen and removed when the finger is lifted. I have the touch part coded already, overriding the onTouch method with a couple switch cases that handle each type of action (down, up, move, etc). But I can't for the life of me figure out how to make the image appear and then disappear with the coordinates (matrix?) of where the finger is. Any help would be greatly appreciated!

    Read the article

  • JSF skips phases - How to debug that?

    - by Pentius
    Hey fellows, I have to debug a foreign jsf application thanks god. The problem is, that I submit a form, but the values aren't carried over. With a phase listener I can see, that the life cycle doesn't run completely through, so to say it skips phase 2 -5: After the restore view phase, the render response phase is directly called. I miss the apply values, validation, update model actions and so on. So, this could be a chicken-and-egg problem: 1. The responsible phases aren't called, so the new form input can't be carried over. 2. The system doesn't recognize any new input and therefore directly renders after restoring the view. I checked that there is no call of responseComplete() oder renderResponse(). I'm stuck somehow. Any idea to validate one of the two hypothesis? Or how to debug that in general? Did anybody have a similar problem?

    Read the article

< Previous Page | 91 92 93 94 95 96 97 98 99 100 101 102  | Next Page >