Daily Archives

Articles indexed Saturday May 22 2010

Page 11/81 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • how to import a 'zip' file to my .py ..

    - by zjm1126
    when i use http://github.com/joshthecoder/tweepy-examples , i find : import tweepy in the appengine\oauth_example\handlers.py but i can't find a tweepy file or tweepy's 'py' file, except a tweepy.zip file, i don't think this is right,cauz i never import a zip file, i find this in app.py: import sys sys.path.insert(0, 'tweepy.zip') why ? how to import a zip file.. thanks

    Read the article

  • What version of Windows 7 for ASP.NET development on Visual Studio

    - by Bazza Formez
    Hi, I am about to upgrade my pc, and operating system at the same time. I was wondering what version of Windows 7 to get pre-installed, given that I want to do some ASP.NET development using Visual Studio. Specifically : Will all versions of Windows 7 run an IIS server & be suitable for ASP.NET development ? Are all good for running SQL Server etc ? Will Windows 7 have any probs running old versions of Visual Studio (Ie. 2003 & 2005 versions). Are there any other things I need to consider ? I'm probably going for the 32 bit version of Windows 7. Thanks in advance, Bazza

    Read the article

  • Practical programming test in interview

    - by redspike
    I have been invited to do a second interview for a company recruiting for a software engineer. This interview will consist of a 45 minute programmatic test on a laptop followed by a whiteboard presentation on the solution. This position is Java/J2EE based so I'm assuming (hoping) the test will be implemented using Java. Have you ever done anything like this? What was the nature of the problem you had to solve? What is a good way to prepare for this type of interview?

    Read the article

  • Win32 C/C++ Load Image from memory buffer

    - by Bruno
    I want to load a image (.bmp) file on a Win32 application, but I do not want to use the standard LoadBitmap/LoadImage from Windows API: I want it to load from a buffer that is already in memory. I can easily load a bitmap directly from file and print it on the screen, but this issue is making me stuck :( What I'm looking for is a function that works like this: HBITMAP LoadBitmapFromBuffer(char* buffer, int width, int height); Thanks.

    Read the article

  • How to split movie and play parts to look as a whole?

    - by luksow
    I'm writing software which is demonstraiting video on demand service. One of the feature is something similiar to IIS Smooth Streaming - I want to adjust quality to the bandwith of the client. My idea is, to split single movie into many, let's say - 2 seconds parts, in different qualities and then send it to the client and play them. The point is that for example first part can be in very high quality, and second in really poor (if the bandwith seems to be poor). The question is - do you know any software that allows me to cut movies precisly? For example ffmpeg splits movies in a way that join is visible and really annoying (seconds are the measure of precision). I use qt + phonon as a player if it matters. Or maybe you know any better way to provide such feature, without splitting movie into parts?

    Read the article

  • Debuging VBScript in Visual Studios Express

    - by Wil
    I have read around the net that its possible to debug VBScript WSH files Visual Studios 2005 Express (I think Web Edition) but everytime I try cscript.exe myscript.vbs //X the script just executes. I have tried VS Express 2005, 2008 and 2010 all editions. I have also tried Visual Studios Premium 2010 which does infact debug scripts as I would expect however I want to be able to debug scripts with free tools (I don't want to get a VS 2010 licence for all the other people on my team). I know about Microsoft Script Debugger but it doesn't let you discover objects as well as Visual studios does.

    Read the article

  • Receiving the post response using curl

    - by Larry Battle
    Hello, I'm trying to make a script that will download search results from a HTTPS website using POST. So far, I'm able to download the web page before the submission but not the response page containing the search results. The problem seems to be that curl isn't waiting long enough for the response page to appear. The website behaviors likes this. Website appears- input form data - click submit - progressing icon appears - returns new web page with search results( new data but the url doesn't change ) My code: curl -d "postData" -k url

    Read the article

  • Approaches to create a nested tree structure of NSDictionaries?

    - by d11wtq
    I'm parsing some input which produces a tree structure containing NSDictionary instances on the branches and NSString instance at the nodes. After parsing, the whole structure should be immutable. I feel like I'm jumping through hoops to create the structure and then make sure it's immutable when it's returned from my method. We can probably all relate to the input I'm parsing, since it's a query string from a URL. In a string like this: a=foo&b=bar&a=zip We expect a structure like this: NSDictionary { "a" => NSDictionary { 0 => "foo", 1 => "zip" }, "b" => "bar" } I'm keeping it just two-dimensional in this example for brevity, though in the real-world we sometimes see var[key1][key2]=value&var[key1][key3]=value2 type structures. The code hasn't evolved that far just yet. Currently I do this: - (NSDictionary *)parseQuery:(NSString *)queryString { NSMutableDictionary *params = [NSMutableDictionary dictionary]; NSArray *pairs = [queryString componentsSeparatedByString:@"&"]; for (NSString *pair in pairs) { NSRange eqRange = [pair rangeOfString:@"="]; NSString *key; id value; // If the parameter is a key without a specified value if (eqRange.location == NSNotFound) { key = [pair stringByReplacingPercentEscapesUsingEncoding:NSASCIIStringEncoding]; value = @""; } else { // Else determine both key and value key = [[pair substringToIndex:eqRange.location] stringByReplacingPercentEscapesUsingEncoding:NSASCIIStringEncoding]; if ([pair length] > eqRange.location + 1) { value = [[pair substringFromIndex:eqRange.location + 1] stringByReplacingPercentEscapesUsingEncoding:NSASCIIStringEncoding]; } else { value = @""; } } // Parameter already exists, it must be a dictionary if (nil != [params objectForKey:key]) { id existingValue = [params objectForKey:key]; if (![existingValue isKindOfClass:[NSDictionary class]]) { value = [NSDictionary dictionaryWithObjectsAndKeys:existingValue, [NSNumber numberWithInt:0], value, [NSNumber numberWithInt:1], nil]; } else { // FIXME: There must be a more elegant way to build a nested dictionary where the end result is immutable? NSMutableDictionary *newValue = [NSMutableDictionary dictionaryWithDictionary:existingValue]; [newValue setObject:value forKey:[NSNumber numberWithInt:[newValue count]]]; value = [NSDictionary dictionaryWithDictionary:newValue]; } } [params setObject:value forKey:key]; } return [NSDictionary dictionaryWithDictionary:params]; } If you look at the bit where I've added FIXME it feels awfully clumsy, pulling out the existing dictionary, creating an immutable version of it, adding the new value, then creating an immutable dictionary from that to set back in place. Expensive and unnecessary? I'm not sure if there are any Cocoa-specific design patterns I can follow here?

    Read the article

  • SQL: Is there a more efficient way to calculate elapsed hours, minutes, seconds?

    - by hamlin11
    I'm using Computed Columns to provide me with the following information: Hours, Minutes, and Seconds between a Start DateTime and Finish DateTime (Where Minutes and Seconds are between 0 and 59 and Hours can be any value 0 or greater) Computed Column for Seconds: datediff(second,[Start],[Finish]) % 60 Computed Column for Minutes: floor(datediff(second,[Start],[Finish]) / 60.0) % 60 Computed Column for Hours: floor(datediff(second,[Start],[Finish]) / 3600.0) Here's the table for reference Note: I'm also calculating TotalElapsedSeconds, TotalElapsedMinutes, and TotalElapsedHours in other computed columns, but those are easy. I just feel like I might be missing out on a nice built in function in SQL.

    Read the article

  • how to handle this type of things. using asp.net mvc

    - by kumar
    hello friends, i have public jsonresult update(studentinfo s) { for(i=0;i>0;i++) { var x = // i am getting some x so i am checking again if( x != null) { var updateuser = student.update(s.student,"",""); **return json(updateuser.ToString());** // if i keep it here i am getting exceptoin saying not all code paths return value bec this return i can not keep it out for loop bec each and evary updateuser i need to return json.. } } } how to overcome this type of things? thanks

    Read the article

  • What is the MacVim default font?

    - by Alex
    Hey there, I love using macvim, and I really like the default font, but at work I recently got some bigger monitors, and I want to make the text bigger. It says in the macvim docs that it is Bitstream Vera, but trying to set the font like so: :set guifont=Bitstream\ Vera\ Sans\ Mono:h16 results in an invalid font(s) error. So what is the default font then? I'm running the latest version of macvim and I am running Snow Leopard. Thanks!!

    Read the article

  • Android: making a custom ListView independent of adapters ?

    - by wei
    I am adding a local database as a cache to a remote web service in my android application to answer queries. I used ArrayAdapters before for list views to display the results from the web service. Now with a database cache, the result could be either a Cursor(from database) or a List(from web), which means the adapter can be CursorAdapter or ArrayAdapter too. Creating two adapters for one query doesn't seem to be a good idea. So I am wondering what would be the best way to refactor my current code to add this database feature? Thanks,

    Read the article

  • Facebook multi-friend-selector + new javascript API = BROKEN ?

    - by Simon_Weaver
    I am using the fb:serverfbml tag to render a multi-friend-selector inside an IFrame. I am using the new javascript API. I have been trying ALL DAY to get it working. When I click on the underlines 'selected' link (to filter by the selected friends) the whole page refreshes and the selected friends disappear. Does the multi-friend-selector just not work with the javascript API? <fb:serverfbml> <script type="text/fbml"> <fb:request-form action="http://apps.facebook.com/rollingrazor/" target="_top" method="POST" invite="true" type="Blah blah blah" content="Blah blah! &lt;fb:req-choice url=&quot;http://apps.facebook.com/rollingrazor/&quot; label=&quot;Let me check my friends&quot; /&gt;"> <fb:multi-friend-selector showborder="false" actiontext="Invite your friends" rows="5" cols="5" bypass="cancel" target="_top" /> </fb:request-form> </script> </fb:serverfbml> <div id="fb-root"></div> <script> window.fbAsyncInit = function () { FB.init({ appId: 'xxxxxxx', status: true, cookie: true, xfbml: true }); }; (function () { var e = document.createElement('script'); e.async = true; e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js'; document.getElementById('fb-root').appendChild(e); } ()); </script> Can someone give me a working example using new javascript API with a multi-friend-selector?

    Read the article

  • What's the best way of handling permissions for apache2's user www-data in /var/www ?

    - by gyaresu
    Has anyone got a nice solution for handling files in /var/www/ ? We're running Name Based Virtual Hosts and the apache2 user is 'www-data' We've got two regular users & root. So when messing with files in /var/www ,rather than having to... chown -R www-data:www-data ...all the time, what's a good way of handling this? Supplementary question. How hardcore do you then go on permissions? This one has always been a problem in collaborative development environments. Cheers.

    Read the article

  • mod_rewrite directory path to deeper directory

    - by DA.
    I don't usually work with LAMP and am a bit stumped getting a site working locally. The site is set up to be used via localhost: 1) http://localhost/mysite However, the way the site files are physically on the server the root is located as such: 2) /var/www/mysite/trunk/site I'm trying to figure out a way where I could type #1 but have apache actually looking for the files in #2 so that all of the asset/page links in the web application work. Is mod_rewrite the solution? If so, I'm stumped on the syntax. I have this but it won't work (due, I assume, to it causing an infinite loop) RewriteRule ^mysite/ mysite/trunk/site I have a hunch I need to sprinkle on some regex?

    Read the article

  • In MVC2, how do I validate fields that aren't in my data model?

    - by Andy Evans
    I am playing with MVC2 in VS 2010 and am really getting to like it. In a sandbox application that I've started from scratch, my database is represented in an ADO.NET entity data model and have done much of the validation for fields in my data model using Scott Guthrie's "buddy class" approach which has worked very well. However, in a user registration form that I have designed and am experimenting with, I'd like to add a 'confirm email address' or a 'confirm password' field. Since these fields obviously wouldn't exist in my data model, how would I validate these fields client side and server side? I would like to implement something like 'Html.ValidationMessageFor', but these fields don't exist in the data model. Any help would be greatly appreciated.

    Read the article

  • SVN supports historical merges so how is Mercurial better?

    - by radman
    Hi, I'm a long time SVN user and have been hearing a lot of brou ha ha with regard to mercurial and decentralised version control systems in general. The main touted feature that I am aware of is that merging in Mercurial is much easier because it records information for each merge so each successive merge is aware of the previous ones. Now as stated in the red book, in the section to do with merging, SVN already supports this with mergeinfo. Now I have not actually used this feature (although I wanted to, our repo version wasn't recent enough) but is this SVN feature particularly different to what Mercurial offers? For anyone who is not aware the suggested work flow for historical merging in svn is this: branch from the development trunk to do your own thing. Regularly merge changes from trunk into your branch to stay up to date. Merge back when your done with the mergeinfo to smooth the process. Without historical data merging this is a nightmare because the comparison is strictly on the differences in the files and does not take into account the steps taken on the way. So each change in the development trunk puts you further into possible conflict when you merge back. Now what I would like to know is: Does merging using Mercurial provide a significant advantage when compared with mergeinfo in SVN or is this just a lot of hot air about nothing? Has anyone used the mergeinfo feature in SVN and how good is it actually in practice?

    Read the article

  • Is there a better way to get values out of a table row?

    - by chobo2
    Hi Say I have this <table border="1" id="tbl"> <tr> <td><input type="checkbox" name="vehicle" value="Bike" /></td> <td>row 1, cell 1</td> <td>row 1, cell 2</td> </tr> <tr> <td><input type="checkbox" name="vehicle" value="Bike" /></td> <td>row 2, cell 1</td> <td>row 2, cell 2</td> </tr> </table> Now I want to get the row that is checked, then the cell values of that checked row. So I would do this var cells = $('#tbl :checked').parents('tr').children('td'); So lets assume only one checkbox can be checked(so no jqueyr foreach loop). So now say I wanted to get the 2nd table cells value I would just go var secondCell = $(cells[1]).html(); The thing with this though it makes the code so brittle. Like what if I put another table cell after after the checkbox one? <table border="1" id="tbl"> <tr> <td><input type="checkbox" name="vehicle" value="Bike" /></td> <td> I am new </td> <td>row 1, cell 1</td> <td>row 1, cell 2</td> </tr> <tr> <td><input type="checkbox" name="vehicle" value="Bike" /></td> <td> I am new </td> <td>row 2, cell 1</td> <td>row 2, cell 2</td> </tr> </table> So now I have to go through my code and change this var secondCell = $(cells[1]).html(); to this var thirdCell = $(cells[2]).html(); since now I am actually after the 3rd cell and not the 2nd cell anymore. So is there a better way? Thanks

    Read the article

  • F# Blogs to follows

    - by AG.
    Hello All, I have recently started learning F#. I was wondering as which are the recommended blogs you guys are currently following in F# community?. I am currently subscribed to "Tomas Petricek", "Brian McNamara" and "Don Syme's". Would love to hear all your recommendations.

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >