Daily Archives

Articles indexed Wednesday March 31 2010

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

  • Python - CSV: Large file with rows of different lengths

    - by dassouki
    In short, I have a 20,000,000 line csv file that has different row lengths. This is due to archaic data loggers and proprietary formats. We get the end result as a csv file in the following format. MY goal is to insert this file into a postgres database. How Can I do the following: Keep the first 8 columns and my last 2 columns, to have a consistent CSV file Add a Column to the file. 1, 2, 3, 4, 5, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, img_id.jpg, -50 1, 2, 3, 4, 5, 0,0,0,0,0,0,0,0,0, img_id.jpg, -50 1, 2, 3, 4, 5, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, img_id.jpg, -50 1, 2, 3, 4, 5, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, img_id.jpg, -50 1, 2, 3, 4, 5, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, img_id.jpg, -50 1, 2, 3, 4, 5, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, img_id.jpg, -50 1, 2, 3, 4, 5, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, img_id.jpg, -50 1, 2, 3, 4, 5, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, img_id.jpg, -50 1, 2, 3, 4, 5, 0,0,0,0,0,0, img_id.jpg, -50 1, 2, 3, 4, 5, 0,0,0,0,0,0,0,0,0,0,0 img_id.jpg, -50

    Read the article

  • Open source alternative to MATLAB's fmincon function?

    - by dF
    Is there an open-source alternative to MATLAB's fmincon function for constrained linear optimization? I'm rewriting a MATLAB program to use Python / NumPy / SciPy and this is the only function I haven't found an equivalent to. A NumPy-based solution would be ideal, but any language will do.

    Read the article

  • Window z-ordering in java

    - by Aaron
    Is there a way to manage the window z-ordering of JDialog windows within java? I would like to able to assign each window to a layer such that windows on lower layers can never go above and obscure windows on higher layers. Even when they have focus. Similar to the Z-order capability that exists for components but for JDialog windows. The solution does not need to work across all OSes. A linux specific solution is acceptable.

    Read the article

  • Error when using StaticResource

    - by James Hay
    Hi, I'm getting this error Attribute {StaticResource StoryboardIntroAnimation} value is out of range when I try and use a staic resource as the Storyboard property of a BeginStoryboard object. The markup looks a little like this: <UserControl ...> <UserControl.Resources> <Storyboard x:Key="StoryboardIntroAnimation"> ... </Storyboard> </UserControl.Resources> <UserControl.Triggers> <EventTrigger> <EventTrigger.Actions> <BeginStoryboard Storyboard="{StaticResource StoryboardIntroAnimation}" /> </EventTrigger.Actions> </EventTrigger> </UserControl.Triggers> ... </UserControl> Does anyone know why this is happening?

    Read the article

  • What is the best way to bind a repeater to an AJAX response?

    - by Murtaza RC
    I am trying to bind a repeater after an AJAX response. Step 1 : Make an Ajax call to the fucntion in the code behind: Step 2 : Do some business logic and finally bind the data to the repeater Step 3 : Get the response back from the codebehind to the Ajax call Step 4 : Once we get the response back what is the right way to strip out extra HTML for example the head and body tags etc. One way is to put a "breaker" logic. for example : <html><body> #breaker REPEATER control HERE #breaker </html></body> and once I get the response back I use a JS function to find anything between the #breaker tags and strip out anything outside and I should get the required HTML response of only the repeated items. Is this the only / Best way to achieve this kind of functionality?

    Read the article

  • Is it possible to calculate distance on GeoDjango in a SELECT statement?

    - by alex
    I am using MYSQL. I have a table with 1 column, a Point field. I want to SELECT all rows that have a point with a distance less than 50 meters of my given point. Simple enough, right? Below is how it's done in RAW SQL. But of course, I want to use GeoDjango to do this. cursor.execute("SELECT * FROM project_location WHERE\ (GLength(LineStringFromWKB(LineString(asbinary(utm), asbinary(PointFromWKB(point(%s, %s)))))) < 50)\

    Read the article

  • Where can I find Object Model Documentation for Microsoft Expression Web Add-ins

    - by JonStonecash
    I am working on an add-in for Microsoft Expression Web. I have gotten enough information on the web to know that I have to add references to Microsoft.Expression.Interop.WebDesigner, Microsoft.Expression.Interop.WebDesignerPage, and Microsoft.Expression.Interop.WebDesigner. The problem is that there does not seem to be any official documentation on the classes within these dll-s. There is even a Microsoft Connect issue about the lack of documentation. I have been using the object browser in Visual Studio 2008 and Reflector but that is pretty thin soup. Does anyone know where there is some reasonable documentation. I am not looking for a sample "hello world" implementation. I want some more substance and depth.

    Read the article

  • Java Bucket Sort on Strings

    - by Michael
    I can't figure out what would be the best way to use Bucket Sort to sort a list of strings that will always be the same length. An algorithm would look like this: For the last character position down to the first: For each word in the list: Place the word into the appropriate bucket by current character For each of the 26 buckets(arraylists) Copy every word back to the list I'm writing in java and I'm using an arraylist for the main list that stores the unsorted strings. The strings will be five characters long each. This is what I started. It just abrubdly stops within the second for loop because I don't know what to do next or if I did the first part right. ArrayList<String> count = new ArrayList<String>(26); for (int i = wordlen; i > 0; i--) { for (int j = 0; i < myList.size(); i++) myList.get(j).charAt(i) } Thanks in advanced.

    Read the article

  • How to make images hosted on Amazon S3 less public but not completely private?

    - by Jay Godse
    I fired up a sample application that uses Amazon S3 for image hosting. I managed to coax it into working. The application is hosted at github.com. The application lets you create users with a profile photo. When you upload the photo, the web application stores it on Amazon S3 instead of your local file system. (Very important if you host at heroku.com) However, when I did a "view source" in the browser of the page I noticed that the URL of the picture was an Amazon S3 URL in the S3 bucket that I assigned to the app. I cut & pasted the URL and was able to view the picture in the same browser, and in in another browser in which I had no open sessions to my web app or to Amazon S3. Is there any way that I could restrict access to that URL (and image) so that it is accessible only to browsers that are logged into my applications? Most of the information I found about Amazon ACLs only talk about access for only the owner or to groups of users authenticated with Amazon or AmazonS3, or to everybody anonymously.

    Read the article

  • Download a file from one ASP.NET web application to other (given the credentials)

    - by Tom S.
    Hi everybody! Im working on a asp.net 3.5 web application (C#), where i have a file with some information that is updated frequently, and only few accounts can access to it (the application is using the asp.net authentication system, stored in a SQL database). My task is to parse that file, so i made a small parser (another web app) a to show the information in a more friendly way. However, everytime i want to parse it, i need to enter in the application with one of those accounts, download the file, put in the parser's folder. Is there any way to, given the username and password, download the file directly from the parser application and use that one? Thanks in advance

    Read the article

  • Debug checklists/Helpers with Visual Studio/.NET

    - by hmm
    I have STAThread process which when called from my process simply bombs with no exceptions and almost nothing in the call stack. If I click Cntrl+Alt+E, I get an exceptions window, how can I use it in this situation, seems like some exception is not being caught here. Also what other debugging aids can I use here in Visual Studio 2010?

    Read the article

  • Should this even be a has_many :through association?

    - by GoodGets
    A Post belongs_to a User, and a User has_many Posts. A Post also belongs_to a Topic, and a Topic has_many Posts. class User < ActiveRecord::Base has_many :posts end class Topic < ActiveRecord::Base has_many :posts end class Post < ActiveRecord::Base belongs_to :user belongs_to :topic end Well, that's pretty simple and very easy to set up, but when I display a Topic, I not only want all of the Posts for that Topic, but also the user_name and the user_photo of the User that made that Post. However, those attributes are stored in the User model and not tied to the Topic. So how would I go about setting that up? Maybe it can already be called since the Post model has two foreign keys, one for the User and one for the Topic? Or, maybe this is some sort of "one-way" has_many through assiociation. Like the Post would be the join model, and a Topic would has_many :users, :through = :posts. But the reverse of this is not true. Like a User does NOT has_many :topics. So would this even need to be has_many :though association? I guess I'm just a little confused on what the controller would look like to call both the Post and the User of that Post for a give Topic. Edit: Seriously, thank you to all that weighed in. I chose tal's answer because I used his code for my controller; however, I could have just as easily chosen either j.'s or tim's instead. Thank you both as well. This was so damn simple to implement, and I think today marks the day that I'm beginning to fall in love with rails.

    Read the article

  • Boost C++ Singleton error LNK2001: unresolved external symbol "private: static long Nsp::HL::flag" (

    - by Soós Roland
    I try to create a multi-threaded singleton pattern class. Header: class HL{ public: static HL* getInstance(); ......... private: static HL* instance; static boost::once_flag flag; HL(); static void initOnce(); } CPP: HL* HL::instance = NULL; HL* HL::getInstance(){ if(instance == NULL){ boost::call_once(flag, initOnce); } return instance; } void HL::initOnce(){ instance = new HL(); } I get this error: error LNK2001: unresolved external symbol "private: static long Nsp::HL::flag" (?flag@HL@Nsp@@0JA) What's wrong?

    Read the article

  • SharePoint 2007 Parser Error after updating master page

    - by Kelly Jones
    A few weeks ago I was updating the master page for a SharePoint 2007 (WSS) site.  The client wanted the site updated to reflect the new look and feel that is being applied to another set of sites in the organization. I created a new theme and master page, which I already wrote about here and here.  It worked well, except for a few pages on a subsite.  On those pages, I got the following error: Server Error in '/' Application. Parser Error Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately. Parser Error Message: Code blocks are not allowed in this file.   I decided to go comb through my new master page and compare it to the existing master page that was already working.  After going through them line by line several times, I had no clue what would be causing the error because they were basically the same! It turns out, it was a combination of two things.  First, on a few of the pages in the site, there was some include code (basically an <% EVAL()%> snippet).  This was the code that was triggering my error “Code blocks are not allowed in this file”. However, this code was working fine with the previous master page. I decided to then try doing a full deployment of the site with the new master page, and it worked fine!  Apparently, if the master page is deployed using a Feature, then it is granted permission to allow code blocks, but if you upload pages either using web UI or SharePoint Designer, then the pages won’t be able to use code blocks. I haven’t been able to pin down the rules or official info about this, but I thought others might find it useful anyway.

    Read the article

  • Windows Embedded CE DiskPrep PowerToy

    - by Bruce Eitman
    Kurt Kennett from Microsoft has offered up a handy new tool. This tool is useful for creating a boot disk for x86 Windows CE systems that use the BIOSLoader. This is especially useful for creating disks with formats other than FAT16, which are fairly easy to create. I am letting you know about this new tool, but I have to be honest in telling you that I haven’t used it myself because it is for Windows Vista and Windows 7 – which I don’t have available right now. But you can bet that I will be setting up a virtual machine to give it a try. Here is what Kurt has to say about the tool: Download the DiskPrep Tool  DiskPrep can prepare any hard disk that can be attached to your development PC so that it can boot your X86-based Windows CE OS Design. USB disks (including disk "keys"), Compact Flash Cards, and SD cards all work if your system bios can boot from that type of media. FAT16, FAT32, and exFAT all supported. DOS is not used - the program prepares the bios loader on the disk and only uses that. If you use Windows Vista or Windows 7, you can use VHD files for VirtualPC. This allows for rapid prototyping of a self-booting system. Copyright © 2010 – Bruce Eitman All Rights Reserved

    Read the article

  • How to make IIS7 stop adding etag to response headers?

    - by user20028
    For performance reasons, I'm using expire headers for static files (adding long expiration periods like 50 years or so). Now I'm trying to get rid of etag headers which are automatically added by IIS7. I've done some searching but it seems harder than what I thought (there doesn't seem to be a straight forward way). I found some workarounds but they all use httpmodules (which I'm keeping as a last resort). I strongly prefer to not get the etag header added in the first place. Did anyone manage to do this? Thanks

    Read the article

  • IIS FTP error: 426 Connection closed; transfer aborted.

    - by Jiaoziren
    Hi, I have an IIS FTP set up on Windows 2003 SP2 (S1). Everyday in the early morning, a script on another server (S2) will run and initiate FTP transfer of pulling log files from S1 to S2. The FTP client we're using is built-in FTP.exe in Windows 2000 on S2. Recently we replaced S1 with a new server however we kept the IP address. There are multiple IP addresses on new S1. Ever since the new S1 was in place, the '426 Connection closed; transfer aborted.' errors haven been occuring randomly. The log indicated that the transfer started ok however the file cannot be transferred completely, as per log below: mget access*.log 200 Type set to A. 200 PORT command successful. 150 Opening ASCII mode data connection for access02232010.log(205777167 bytes). 426 Connection closed; transfer aborted. ftp: 20454832 bytes received in 283.95Seconds 72.04Kbytes/sec. The firewall monitor suggested that the connection was setup in passive mode however I've been told that MS FTP.exe doesn't support passive mode. Though I can see the response of 'entering passive mode' from server when typing in 'quote pasv'. My network admin has told me to try the transfer in active mode however I don't know how to open active mode on client side. It's getting really frustrating. Wish someone here has the right knowledge/experience could shed me a light. Cheers.

    Read the article

  • Missing the "add tab group to favorites " option in IE8

    - by dennis461
    I have internet options selected for quick tabs and tab groups in setting, IE8 WIndows XP. I can open a list of favorites from the menu using the blue arrow as a tab group. I can then use the quick tabs button to show the groups open. However, I do not have the "add tab group to favorites" option in the pull down menu for favotites at the Favorite Bar. Is this a Vista feature only?

    Read the article

  • In windows 7, how do I disable "Ease of Access" pop ups on the logon screen as I am typing my passwo

    - by Silfheed
    Heyas So the question is pretty much in the title. Things to note: 'Use On-Screen Keyboard' is un-checked I have disabled Ease of Access by replacing utilman.exe But my problem now is that when I'm typing my password, It'll stop all together on the 'u' or the 'p' character and I have to click on the ease of access button then move focus back to the password to continue. Yes, one obvious solution is to not use a password that has 'u' or 'p' in it (which I've done), but that's obviously not a completely satisfying answer. Thanks! I feel a tumbleweed badge...

    Read the article

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