Is there a WMI namespace and a class that can be used to obtain the extended properties of a file, such as Owner, Author, Title, Subject, Category, Comments?
please suggest.
I have a plain text file with words, which are separated by comma, for example:
word1, word2, word3, word2, word4, word5, word 3, word6, word7, word3
i want to delete the duplicates and to become:
word1, word2, word3, word4, word5, word6, word7
Any Ideas? I think, egrep can help me, but i'm not sure, how to use it exactly....
Yes, There's More Than One Way To Do It™, but what is the most canonical, most efficient, and most concise methods to read an entire file into a string? (The latter two are perhaps at odds.)
I need to be able to download some file from a regular site using my proxy server,
I already try this:
System.Net.WebClient client = new System.Net.WebClient();
client.Proxy = new WebProxy(ip, port);
client.DownloadFile(url);
but it's not works at all, I don't know what I missed,(without a proxy it works)
thanks,
Dani.
Hi,
I'd like to know what interesting open-source projects written in Delphi (or FreePascal) you know?
I'm not asking for components/components packs, I know there were questions for that.
Please do not duplicate answers, vote them up instead ;)
Please do not point components/packs/closed-source projects.
Please provide at least word of description ;)
Two examples from me:
PyScripter - Python IDE written in Delphi - hosted at google code (*)
HeidiSQL - MySQL Frontend - http://www.heidisql.com/
(*)sorry, as a new user I can't post more than one link :(
I know, the general answer will be yes, but here is my situation.
I got a plotting function from one MATLAB's toolbox and modified its m-file to draw what I need. Eventually this function became a part of program I would like to distribute as an open source (or under other license). Can I do this? Well, may be it was not wise to create a function in such a way, but I didn't think about distribution at that time. The function still depends on other functions in this toolbox, so a potential user supposed to have a license for it.
Any thoughts, recommendations?
Have you ever modified MATLAB's m-files directly?
I am a unclear about file system implementation. Specifically (Operating Systems - Tannenbaum (Edition 3), Page 275) states "The first word of each block is used as a pointer to the next one. The rest of block is data".
Can anyone please explain to me the hierarchy of the division here? Like, each disk partition contains blocks, blocks contain words, and so on...
I didn't think this was going to be hard. I have a commmand file, d:\a.cmd which contains:
copy /b d:\7zS.sfx + d:\config.txt + d:\files.7z d:\setup.exe
But this line of C# wont' execute it:
Process.Start("d:\\a.cmd");
Throws Win32Exception: "%1 is not a valid Win32 application."
Process.Start opens .pdf files...why not execute command files?
Thanks in advance,
Jim
Say I have file A, in middle of which have a tag string "#INSERT_HERE#". I want to put the whole content of file B to that postion of file A. I have tried using pipe to concatenate those contents, but I'm wondering if there is more advanced one-line script to handle it.
Thanks.
Hi,
I use Eclipse 3.5 on Windows, with PDT and Subclipse plugins, with both legacy projects using ISO-8859-1 encoding (latin-1), and newers ones wich use UTF-8. I configured my workspace to use UTF-8, and I configured old projects to use latin-1. But every time I open an old project, it use UTF-8.
With a workspace using latin-1 by default, I have the same problem with utf-8 projects edited as iso-8859-1.
My encoding choice is written in the file .settings/org.eclipse.core.resources.prefs but seems to be never read.
The only solution for now is to have a latin1 workspace, and an utf8 one. Any better idea?
Regards,
Cédric
I need to quickly replace a listings website which has the following characteristics:
smallish database (10,000 items, < 1GB)
< 10% of the items updated/created/removed daily
most common activity is searching the whole dataset, returning 1-1000 items
traffic peaks at 1m page impressions per day
Scaling strategy for the existing app has been to separate read-only and read/write activity. Multiple slave databases are used for searching and writes are done to a master, which update the slaves using MS SQL replication.
Since read activity is more common than write, this has proved to be a cheap way to do database load balancing, without true clustering.
I now need to replace the app - are there any C# open-source apps which scale as neatly as this?
I have a file and I don't know how big it's going to be (it could be quite large, but the size will vary greatly). I want to search the last 10 lines or so to see if any of them match a string. I need to do this as quickly and efficiently as possible and was wondering if there's anything better than:
s = "foo"
last_bit = fileObj.readlines()[-10:]
for line in last_bit:
if line == s:
print "FOUND"
We can replace strings in a batch file using the following command
set str="jump over the chair"
set str=%str:chair=table%
These lines work fine and change the string "jump over the chair" to "jump over the table". Now I want to replace the word "chair" in the string with some variable and I don't know how to do it.
set word=table
set str="jump over the chair"
??
Any ideas?
I have two files a.txt and b.txt (henceforth a and b).
My script iterates through a, does some operation, and potentially inserts a line to b.
In the event the script stops, I need it to pick up where it left off. In the example below:
foo was copied to b
bar was copied to b
zim was not copied to b (did not pass some criteria)
gaz was copied to b
Script stops (for whatever reason)
When script starts again, how to open a and start on line "dib"?
a.txt
foo
bar
zim
gaz // <= last successful copy
dib // <= I want to start here on next script execution
gir
b.txt
foo
bar
gaz // <= note omission of "zim" above gaz
I want to throw the last three character from file name and get the rest?
I have this code:
char* remove(char* mystr) {
char tmp[] = {0};
unsigned int x;
for (x = 0; x < (strlen(mystr) - 3); x++)
tmp[x] = mystr[x];
return tmp;
}
I want to pass a command as a command line argument from one batch file to another
e.g.
first.bat
call test.bat "echo hello world" "echo welcome "
test.bat
set initialcommand=%1
set maincommand=%2
%maincommand%
%initialcommand%
Hi
I'm trying to get an SQL query to work within a JSP file. The JSP file is pulled by a VXML file here is my JSP file code:
<?xml version="1.0"?>
<%@ page import="java.util.*" %>
<%@ page import="java.sql.*" %>
<% boolean success = true; // Always optimistic
String info = "";
String schoolname = request.getParameter("schoolname");
String informationtype = request.getParameter("informationtype");
try {
Class.forName("org.postgresql.Driver");
String connectString = "jdbc:postgresql://localhost:5435/N0176359";
String user = "****";
String password = "*****";
Connection conn = DriverManager.getConnection(connectString, user, password);
Statement st = conn.createStatement();
ResultSet rsvp = st.executeQuery("SELECT * FROM lincolnshire_school_information_new WHERE school_name=\'"+schoolname+"\'");
rsvp.next();
info = rsvp.getString(2);
}catch (ClassNotFoundException e) {
success = false; // something went wrong
}
%>
As you can see I'm trying to insert the value of the variable declared as "schooname" into the end of the SQL query. However when I come to run the jsp file it doesn't work and I get an error "ResultSet not positioned properly". When I put a standard query in (without trying to make it value of the variable it works fine)
Hope that makes sense, and thank you for any help!
I wrote an open-source software package, which I'd like to publish (using Apache 2 license). I see various options for how/where to publish/host it:
Get my own domain and put it there
Put it on Sourceforge
Put it on Google Code
Put it on Freshmeat
...?
What are your experiences / recommendations? What's the current trend among software developers?
My only requirements are that I ...
can add my own logo on the website
can put up some documentation there,
get a nice URL that is easy to remember
get SVN support (I would also be fine with just uploading a tarball for each new version, it just shouldn't force me to use CVS or any other version control system I'm not familiar with)
and of course, the site shouldn't take ownership in the code etc.
oh, and it should be free (ok, for registering my own domain I'll be willing to pay a little bit)
I have a process "x" which uses "system" C function to start ntpd daemon. I observed that ntpd are passed the openfile descriptors of "x". ntpd holds on to the file descriptors even after original file is deleted. for ex: Some log files used by "x" are rotated out after sometime, but "ntpd" has file handle opened for these deleted files. Will it cause any problem?
Alternatively I thought of setting "FD_CLOEXEC" flag for all the file descriptors before calling "system" function. But as we are running as an extension library to third process "x"( "x" loads our library based on some condition), there is no easy way to know about all the file descriptors process has opened. One way is to read /proc//fd and set "FD_CLOEXEC" for each file handle and reset it back after "system" function returns. I'm using Linux 2.16. Is there any other easy way to find all the file handlers?
Thanks,
I have a large file (hundreds of megs) that consists of filenames, one per line.
I need to loop through the list of filenames, and fork off a process for each filename. I want a maximum of 8 forked processes at a time and I don't want to read the whole filename list into RAM at once.
I'm not even sure where to begin, can anyone help me out?
Hi,
I want to convert the mysql database table contents to an Excel(.xls) or comma seperated file(csv) using python script... Is it possible? Any one can help me?
Thanks in advance,
Nimmy