Search Results

Search found 40999 results on 1640 pages for 'duplicate files'.

Page 159/1640 | < Previous Page | 155 156 157 158 159 160 161 162 163 164 165 166  | Next Page >

  • Python faster way to read fixed length fields form a file into dictionary

    - by Martlark
    I have a file of names and addresses as follows (example line) OSCAR ,CANNONS ,8 ,STIEGLITZ CIRCUIT And I want to read it into a dictionary of name and value. Here self.field_list is a list of the name, length and start point of the fixed fields in the file. What ways are there to speed up this method? (python 2.6) def line_to_dictionary(self, file_line,rec_num): file_line = file_line.lower() # Make it all lowercase return_rec = {} # Return record as a dictionary for (field_start, field_length, field_name) in self.field_list: field_data = file_line[field_start:field_start+field_length] if (self.strip_fields == True): # Strip off white spaces first field_data = field_data.strip() if (field_data != ''): # Only add non-empty fields to dictionary return_rec[field_name] = field_data # Set hidden fields # return_rec['_rec_num_'] = rec_num return_rec['_dataset_name_'] = self.name return return_rec

    Read the article

  • Can't see how to compile a header file with /clr switch in a mixed class

    - by MattN
    When creating a mixed mode class, on compilation the header file complains that it needs to be complied with the /clr switch as it is a mixed mode class, however, I can't see any option to specifically compile that header with /clr from visual studio, and I don't want to set the entire project with a /clr flag, Does anyone know how I can specify that this header file is compiled correctly with /clr? Thanks in advance!

    Read the article

  • gem install cannot find a header file

    - by Milktrader
    Following along the github README for talib_ruby: sudo port install ta-lib Complete. Next is where the trouble begins. sudo env ARCHFLAGS="-arch PLATFORM" gem install talib_ruby -- --with-talib-include=ABSOLUTE_PATH_TO_TALIB_HEADERS --with-talib-lib=ABSOLUTE_PATH_TO_TALIB_LIBS This install fails I believe because apparently it cannot find the ta_abstract.h file talib.c:2:25: error: ta_abstract.h: No such file or directory . . . many more errors I have included in my .bash_profile file the following: export ABSOLUTE_PATH_TO_TALIB_HEADERS=/opt/local/var/macports/software/ta-lib/0.4.0_0/opt/local/include/ta-lib export ABSOLUTE_PATH_TO_TALIB_LIBS=/opt/local/var/macports/software/ta-lib/0.4.0_0/opt/local/lib And indeed the ta_abstract.h file is located where I'm saying in the ABSOLUTE_PATH variable assignment. What gives?

    Read the article

  • Bash: how to supress newlines?

    - by gilgongo
    I'm trying to extract fields from a pipe-delimited file and provide them as arguments to an external program in a loop. The file contains lines like this: value1|value2 value3|value4 So I came up with: while read line; do echo -n "${line}" | awk -F '|' '{print $1}'; echo -n " something "; echo -n "${line}" | awk -F '|' '{print $2}'; echo " somethingelse"; done < <(cat $FILE) I want to see the following output: value1 something value2 somethingelse value3 something value4 somethingelse But instead I'm getting: value1 something value2 somethingelse value3 something value4 somethingelse Perhaps I shouldn't be using echo?

    Read the article

  • Copying file to client machine

    - by Shoba Anandhan
    Hi We have a requirement to copy a .txt file into the client machine and open the file using notepad.exe. We develop our application using MS Visual Studio 2008 VB .Net. Any experencied this kind of requirement? Help required... Thanks Shoba Anandhan

    Read the article

  • Is there a Scala version of .irbrc or another way to define some default libraries for REPL use?

    - by Tom Morris
    I've written a little library that uses implicits to add functionality that one only needs when using the REPL in Scala. Ruby has libraries like this - for things like pretty printing, firing up text editors (like the interactive_editor gem which invokes Vim from irb - see this post), debuggers and the like. The library I am trying to write adds some methods to java.lang.Class and java.lang.reflect classes using the 'pimp my library' implicit conversion process to help you go and find documentation (initially, with Google, then later possibly with a JavaDoc/ScalaDoc viewer, and maybe the StackOverflow API eventually!). It's an itch-scratching library: I spend so much time copying and pasting classnames into Google that I figured I may as well automate the process. It is the sort of functionality that developers will want to add to their system for use only in the REPL - they shouldn't really be adding it to projects (partly because it may not be something that their fellow developers want, but also because if you are doing some exploratory development, it may be with just a Scala REPL that's not being invoked by an IDE or build tool). In my case, I want to include a few classes and set up some implicits - include a .jar on the CLASSPATH and import it, basically. In Ruby, this is the sort of thing that you'd add to your .irbrc file. Other REPLs have similar ways of setting options and importing libraries. Is there a similar file or way of doing this for the Scala REPL?

    Read the article

  • Clojure load files

    - by Nate
    I'm trying to set up a simple clojure project, and I'm not sure how to load files between the project. I'm sure that the answer is in the documentation, but I can't find a simple answer any where and I'm not sure where to look. Essentially, my directory looks like this: Clojure/ clojure/ clojure.jar other clojure files clojure-contrib/ clojure-contrib.jar other contrib files project/ main.clj utils.clj And I want main.clj to be something like this: (ns project.main (:require project.utils)) (greet) and utils.clj to be something like this: (ns project.utils) (defn greet [] (println "Hello, World!")) But that fails with: Exception in thread "main" java.io.FileNotFoundException: Could not locate project/utils__init.class or project/utils.clj on classpath: (main.clj:1) When I attempt to run it. How do you set up a simple clojure project?

    Read the article

  • Running a batch file with parameters in python OR F#

    - by Ramy
    I searched the site but didn't see anything quite matching what I was looking for. I created a stand alone application that uses a web service I created. To run the client I use: c:/scriptsdirecotry "run-client.bat" param1 param2 param3 param4 how would I go about coding this in python or F#. seems like it should be pretty simple but I haven't seen anything online that quite matches what i'm looking for. Thanks in advance.

    Read the article

  • Generics in custom configuration sections

    - by Jonn
    I tried making a custom configuration class that went on like this: WatcherServiceInfoSection<TWatcherServiceDetailElement> where TWatcherServiceDetailElement is a ConfigurationElement inside it. Now when I call the type in the ConfigSections area of AppConfig I get the error: An error occurred creating the configuration section handler for WatcherServiceInfo: Could not load type 'Library.Common.Utilities.ConfigurationHandler.WatcherServiceInfoSection<ASNDPService.Configuration.WatcherServiceDetailElement>' from assembly Is what I'm doing possible? Can I have generic types in the type attribute for a custom section element? EDIT Additionally, how about ConfigurationElementCollection objects? Like in the above example, how could I do a [ConfigurationProperty("WatcherServiceDetails", IsRequired = true, IsDefaultCollection = true)] [ConfigurationCollection(typeof(TWatcherServiceDetailElement), AddItemName = "WatcherServiceDetail")] public WatcherServiceDetailCollection<TWatcherServiceDetailElement> WatcherServiceDetails I'm aware that type parameters aren't allowed for attributes and that's what I want to know how to do.

    Read the article

  • Prepending to a multi-gigabyte file.

    - by dafmetal
    What would be the most performant way to prepend a single character to a multi-gigabyte file (in my practical case, a 40GB file). There is no limitation on the implementation to do this. Meaning it can be through a tool, a shell script, a program in any programming language, ...

    Read the article

  • php : open a file download dialog

    - by Hugh Valin
    I have a mpg file hosted in Amazon S3, that I want to link to a page I have, so the user will be able to download it from the page. I have in my page a linke: bla bla" The link to the file workds when I right click it and choose "Save Target As" , but I would like it to work also when I left click it, and that it will open a file download dialog. right now, a left click will direct to a page that has the video directly played in it (in FireFox) or just won't load (in Explorer) I am working in php, anyone has a clue why this happens?

    Read the article

  • Visual Studio Config File Editor - Not Formatting

    - by Ian
    Hi All, My VS 2008 seems to be acting a bit weird and the solution is eluding me. The problem is that if I open a config file; app.config or web.config, this looks and behaves as a plain text document. I have no formatting, no coloring, no intellisense and no collapsible or expandable regions. I have reset all setting and restored default file associations. If I go into the setting menu, Text Editor, XML, formatting I see an error "An error occurred loading this property page" Has any one seen this before and have you go a solution. Thanks

    Read the article

  • multiple definition in header file

    - by Jérôme
    Here is a small code-example from which I'd like to ask a question : complex.h : #ifndef COMPLEX_H #define COMPLEX_H #include <iostream> class Complex { public: Complex(float Real, float Imaginary); float real() const { return m_Real; }; private: friend std::ostream& operator<<(std::ostream& o, const Complex& Cplx); float m_Real; float m_Imaginary; }; std::ostream& operator<<(std::ostream& o, const Complex& Cplx) { return o << Cplx.m_Real << " i" << Cplx.m_Imaginary; } #endif // COMPLEX_H complex.cpp : #include "complex.h" Complex::Complex(float Real, float Imaginary) { m_Real = Real; m_Imaginary = Imaginary; } main.cpp : #include "complex.h" #include <iostream> int main() { Complex Foo(3.4, 4.5); std::cout << Foo << "\n"; return 0; } When compiling this code, I get the following error : multiple definition of operator<<(std::ostream&, Complex const&) I've found that making this fonction inline solves the problem, but I don't understand why. Why does the compiler complain about multiple definition ? My header file is guarded (with #define COMPLEX_H). And, if complaining about the operator<< fonction, why not complain about the public real() fonction, which is defined in the header as well ? And is there another solution as using the inline keyword ?

    Read the article

  • saving a records containing a member of type string to a file (Delphi, Windows)

    - by wonderer
    I have a record that looks similar to: type TNote = record Title : string; Note : string; Index : integer; end; Simple. The reason I chose to set the variables as string (as opposed to an array of chars) is that I have no idea how long those strings are going to be. They can be 1 char long, 200 or 2000. Of course when I try to save the record to a type file (file of...) the compiler complains that I have to give a size to string. Is there a way to overcome this? or a way to save those records to an untyped file and still maintain a sort of searchable way? Please do not point me to possible solutions, if you know the solution please post code. Thank you

    Read the article

  • Project. Properties.Settings versus plain old appSettings?

    - by BryanG
    I have an assembly built that uses appSettings in the app.config...pretty straight forward. however, I'm referencing this assembly in a web service, and that web service contains the nAnt build file for this service plus being the entry point for everything. Ideally I'd like to be able to set the assembly's appConfig values from the build file, but is this possible? Or do I have to switch to using the Settings values of the assembly and do something like this in the build: <xmlpoke file="${PublishLocation}\web.config" xpath="//applicationSettings/Namespace.AssemblyClass.Properties.Settings/setting[@name='ExchangeServer']/value" value="${ServerName}" /> You get the idea. Is this possible with just a config? My ideal situation would be to keep the settings more flexible in the appConfig so that when everything is on the server, if frogs rain down, I can update the assembly's config values without rebuilding the solution. Is this even possible (the xpath is wrong, it's just an example of what I'd like to do): <xmlpoke file="${PublishLocation}\web.config" xpath="//appSettings/Namespace/AssemblyClass/add[@key = 'ExchangeServer']/@value" value="${a}" />

    Read the article

  • How to get the Entire Function from a file

    - by SoLoGHoST
    Ok, I'm reading through a file now, line by line. I know each functions name in the file, since it is defined elsewhere in an XML document. That is what should be this: function function_name Where function_name is the name of the function. I get all of the function definitions from an XML document that I already have put into an array of function names, and I need to grab just those functions from the php file. And rebuild that php file so that it only has those functions in it. That is to say, if a php file has more functions than what is defined in the XML tag, than I need to strip out those functions, and rewrite the .php file with only the functions that the user specified in the XML file. So, the dilemma I face is how to determine the END of a function reading line by line, and I'm aware that functions can have function within them. So I don't want to remove the functions within them. Just functions that are standalone and aren't defined within the accompanying XML file. Any ideas on how to do this?? Thanks :)

    Read the article

  • can't list files in a directory

    - by Anthony
    I'm using CF 7 and this code is not returning any files: <cfset fileLocation = "\\server\uploader\pass-fail"> <cfdirectory action = "list" directory = fileLocation name = "pass_fail_files" > <cfdump var="#pass_fail_files#" expand="yes" label="files in pass-fail" > <cfoutput>#pass_fail_files.name#</cfoutput> <cfoutput>#pass_fail_files.directory#</cfoutput> <cfoutput>#pass_fail_files.size#</cfoutput> <cfoutput>#pass_fail_files.type#</cfoutput> <cfoutput>#pass_fail_files.dateLastModified#</cfoutput> <cfoutput>#pass_fail_files.attributes#</cfoutput> <cfoutput>#pass_fail_files.mode# </cfoutput> I have checked to make sure that the directory indeed has several text files. But when I run the code, all I get is: What am I doing wrong?

    Read the article

  • VIsual Studio : ASP.NET Extra Page Files

    - by Matthew
    Is there any way to write a VS Add-In or something else that would allow me to be able to link files to an ASPX page in ASP.NET. My goal is to be able to have this extra file created with every ASPX page, and then use a custom MS Build Task to analyze those files and do some stuff. So for example, when I created "MyPage.aspx", I'd actually see these files on disk... MyPage.aspx MyPage.aspx.cs MyPage.aspx.designer.cs MyPage.aspx.MyExtension I want to be able to see the file when I expand a page and be able to edit the file. Possible?

    Read the article

  • Seamlessly use large background images on webpages

    - by Ben Shelock
    I want to have huge background images on my site but without giving the user a hard time downloading them and the site looking ugly as the background loads. They would be no bigger than 1920 X 1080 in size, however it's hard to say in terms of kilobytes/megabytes. What are my options here and which are most effective? I'm not too bothered about bandwidth, just want to user to think everything looks nice ;)

    Read the article

  • What's the best way to return a random line in a text file using C?

    - by jeremy Ruten
    What's the best way to return a random line in a text file using C? It has to use the standard I/O library (<stdio.h>) because it's for Nintendo DS homebrew. Clarifications: Using a header in the file to store the number of lines won't work for what I want to do. I want it to be as random as possible (the best being if each line has an equal probability of being chosen as every other line.) The file will never change while the program is being run. (It's the DS, so no multi-tasking.)

    Read the article

  • Detecting and handling third-party library filehandle leaks in Java

    - by tucuxi
    Is there any way to detect and handle whether a Java library is correctly releasing file-handles (via "close") from within a Java program that is using said library, short of having access to the actual library code and inserting the corresponding "finally close" statements? If detection is feasible, is there any way to close those file-handles without a reference to the Reader (or FileInputStream) that was reading the file?

    Read the article

  • htpasswd, secure specific files in zend framework

    - by AKFourSeven
    Hi I have been bashing my head against the wall with this riddle and cannot find the way to solve this. I would like to secure couple of files to restrict access to certain pages but my attempts so far are unsuccessful. I do not want to use Zend Auth as it is a very small web site doing simple stuff. Here is a sample of what I have done: AuthUserFile /path/to/my/.htpasswd AuthName "Admin Restriction" AuthType Basic <Files file.phtml> require valid-user </Files> Is there any way to achieve this ?

    Read the article

  • Has Windows 7 Fixed the 255 Character File Path Limit?

    - by The Matt
    As I understand it, the limitation of 255 characters in a file path is a Windows limitation. What is the reasoning for this? If so, has this been resolved in Windows 7? In our continuous integration practices, we often have deeply nested project structures and it would be extremely useful to be able to go beyond 255 characters. Right now we are somewhat forced to structure our projects in such a way as to not hit this artificial ceiling.

    Read the article

< Previous Page | 155 156 157 158 159 160 161 162 163 164 165 166  | Next Page >