data-files

setup.py's sdist, bdist and install behaving differently regarding data_files

☆樱花仙子☆ 提交于 2019-12-12 15:22:09
问题 I'm trying to distribute web assets along with a web app that I'm trying to package, but I'm failing miserably. I don't understand why I have a different list of files installed or packages when I run bdist, sdist, or install. Project Layout The project runs with python 3 on Arch. The results are the same with Py3 on Raspbian. I've done a very trimmed down version to make things simpler, which I describe here. The files layout is as follow : data/index.html MANIFEST.in mylib.py setup.py The

How can I make each line in a data file a tuple in a list of tuples?

穿精又带淫゛_ 提交于 2019-12-12 04:28:51
问题 I have a text file called CustomerList.txt and it looks like this 134998,Madison,Foxwell,825 John Street,Staunton,VA,24401,6655414998 The end result should be like this with open("CustomerList.txt", "r") as fin: ID, Firstname, Lastname, Address, City, State, Zip, Phone = zip(*[l.split() for l in fin.readlines()]) That's what I have so far, but I get an error that says I need more than 3 values to upack. I just started using tuples yesterday so please keep things as basic as possible for this

Reading and Displaying Data Files, Correct results, but code is unfeasible

跟風遠走 提交于 2019-12-11 06:39:55
问题 I have a program in class that reads a data file for a store and then prints them out on a prompt. 1 Suits 300 100 92 1 Coats 200 60 65 1 Shirts 1000 12 13 2 Dresses 400 60 65 2 Coats 185 184 200 2 Shoes 600 40 30 3 Jeans 200 40 35 3 Shoes 200 30 34 4 Jeans 300 42 43 The numbers being department, item name, quantity, cost to buy, and cost to sale. #include <stdio.h> #include <stdlib.h> #ifndef min #define min(a,b) ((a) < (b) ? (a) : (b)) #endif int main() { FILE *in; char item[8]; int

Merging data - Error in fix.by(by.x, x)

微笑、不失礼 提交于 2019-12-08 07:42:38
问题 I am trying to merge data in R as suggested in an answer to my other post here. Yet, I have an error. First let me explain what I try to do. I have 100 files (each have x_i and y_i), I want to merge them in this way: from: x1; y1 ; x2 ; y2 1 ; 100 ; 1 ; 150 4 ; 90 ; 2 ; 85 7 ; 85 ; 10 ; 60 10; 80 ; to x1; y1 ; x2 ; y2 1 ; 100 ; 1 ; 150 2 ; 100 ; 2 ; 85 4 ; 90 ; 4 ; 85 7 ; 85 ; 7 ; 85 10; 80 ;10 ; 60 The simple script works fine on the toy example: xx <- read.table(text='x1; y1 ; x2 ; y2 1 ;

Reading next line from data file VB Script

▼魔方 西西 提交于 2019-12-06 09:48:58
I am trying to get the next line of data tag file, however because there are multiple lines with the same tag it is going through and taking the last one but I need the first one. Example tag file below. Summary SA2100|7775555 Summary SUM100|9674555 Summary SUM100|8544555 Summary SUM100|8555554 From this it is taking 8555554 and not 7775555. I was trying to put the first line in the if condition and set the string to be the next line is this possible ? if Left(strLine, 14) = "Summary SA2100" Then strSummary = mid(strNextLine, 16, 7) End If Is there a way to use StrNextLine or something similar

Fortran is reading beyond endfile record

元气小坏坏 提交于 2019-12-04 23:54:32
问题 I'm trying to read some data from a file, and the endfile record detection is important to stop reading. However, depending of the array dimensions of the array used to read data, I cannot detect properly the endfile record and my Fortran program stops. The program is below: !integer, dimension(3) :: x ! line 1.1 !integer, dimension(3,10) :: x ! line 1.2 integer, dimension(10,3) :: ! line 1.3 integer :: status,i=1 character(len=100) :: error open( 30, file='data.dat', status='old' ) do print

SQL Server - Is it possible to find the size actually used in an MDF or LDF file

假装没事ソ 提交于 2019-12-04 11:00:35
When adding a .MDF ( .NDF ) or .LDF file to a SQL Server, we have the option to set its initial size, auto-growth, and incremental (percent or absolute). After the database is in operation for a while, is it possible find how much of the actual size is used by the data? For example, if the actual size of the file is 5M, but only 2M is used to store the data, the file can still take 3M of data before it needs to grow. I need a way to find out the "2M" (used size) in the total current size (5M) of the file. Song Li After some research, I noticed the FILEPROPERTY function. SELECT FILEPROPERTY

Fortran is reading beyond endfile record

只谈情不闲聊 提交于 2019-12-03 15:54:19
I'm trying to read some data from a file, and the endfile record detection is important to stop reading. However, depending of the array dimensions of the array used to read data, I cannot detect properly the endfile record and my Fortran program stops. The program is below: !integer, dimension(3) :: x ! line 1.1 !integer, dimension(3,10) :: x ! line 1.2 integer, dimension(10,3) :: ! line 1.3 integer :: status,i=1 character(len=100) :: error open( 30, file='data.dat', status='old' ) do print *,i !read( 30, *, iostat=status, iomsg=error ) x ! line 2.1 !read( 30, *, iostat=status, iomsg=error )

Read in file for constants #java

北战南征 提交于 2019-12-02 18:13:27
问题 I want to read in a datafile that has several constants for my program (e.g. MAXARRAYSIZE). I then want these constants to be accessible anywhere in my program by typing something like: ConstantsClassName.MAXARRAYSIZE. How do I implement this class? Once assigned from the datafile, these constants will never again change value during program execution. Thanks. 回答1: Use a static bloc in ConstantsClassName class. public class ConstantsClassName{ public static final String MAXARRAYSIZE; static{

Changing MongoDB data store directory

强颜欢笑 提交于 2019-11-26 19:19:05
Until now I have not been specifying a MongoDB data directory and have had only one 30 GB primary partition. I just ran out of space and added a new hard disk. How can I transfer my data (that is apparently in /var/lib/mongodb/ ) and configure MongoDB so that everything runs off of the new disk without affecting my existing installation? Brendan W. McAdams The short answer is that the --dbpath parameter in MongoDB will allow you to control what directory MongoDB reads and writes it's data from. mongod --dbpath /usr/local/mongodb-data Would start mongodb and put the files in /usr/local/mongodb