|
You probably need to write a web scraper. Google will find samples and tutorials on the subject.
|
|
|
|
|
I haven't found any reliable answers on google so I am asking here. I know these two expressions produce the same results but I would like to know which one is faster and why is it faster. If I were to use them in two different loops with each one iterating about 100 times, would one loop finish earlier than the other? and by what margin?
|
|
|
|
|
So why not try it out?
It could vary with the implementation, and with the Python version. If you try it out for yourself, you get the right answer for your installation.
I would be very surprised if there was any difference at all. There will always be some random fluctuations, due to interrupts and OS activity, but that should affect both alternatives equally.
In any case: In 100 iterations, the difference would be so small it would not be possible to measure. Iterate at least a few million times before drawing any conclusion.
|
|
|
|
|
Well I don't know how to try this out for myself. I am just a beginner in python so I don't know much about measuring the time taken by a program to complete. Could you please explain how this could be done?
|
|
|
|
|
I do not code in Python on a regular basis, and if I do, I have to google a lot...
So I googled "python timing", and the first hit, at performance - Measure time elapsed in Python - Stack Overflow[^] discusses a few alternatives. It looks like the best solution would be something like
from timeit import default_timer as timer
start = timer()
# ...
end = timer()
print(end - start) # Time in seconds, e.g. 5.38091952400282 Obviously, the "# ..." indicates where you put you one-million iterations loop.
|
|
|
|
|
|
There hardly is a difference in the work python performs for either statement:
>>> import dis
>>> def inplace_add():
... a = 0
... a += 1
...
>>> def add_and_assign():
... a = 0
... a = a + 1
...
>>> dis.dis(inplace_add)
2 0 LOAD_CONST 1 (0)
3 STORE_FAST 0 (a)
3 6 LOAD_FAST 0 (a)
9 LOAD_CONST 2 (1)
12 INPLACE_ADD
13 STORE_FAST 0 (a)
16 LOAD_CONST 0 (None)
19 RETURN_VALUE
>>> dis.dis(add_and_assign)
2 0 LOAD_CONST 1 (0)
3 STORE_FAST 0 (a)
3 6 LOAD_FAST 0 (a)
9 LOAD_CONST 2 (1)
12 BINARY_ADD
13 STORE_FAST 0 (a)
16 LOAD_CONST 0 (None)
19 RETURN_VALUE
|
|
|
|
|
I have two C# apps that address the same server "\stlmo1". stlmo1 has a C:, D: and E: drive. The E: drive is the data drive that I need to address. I used to be able to address the share called "\stlmo1" and it mapped to the root of the E: drive but that was before a ransomware hit. Then the share was gone. I can share the E: drive, but it is "\stlmo1\E" now. That causes all kinds of problems since 3 servers are looking at that location. Can anyone suggest how to share the E: drive on \stlmo1 as "\stlmo1"
|
|
|
|
|
That doesn't look like a valid UNC path. The share name is always required, not just the host name.
Even with Distributed File System[^] you'd still need a domain name and a namespace.
Do you have any documentation on how the server was set up previously?
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I have no idea how it was set up originally, but it did work and only had the server name. ... My research agrees with you though, it shouldn't have worked.
|
|
|
|
|
I am not sure this is the place to ask. I found this site when a Google search return a page for EMLReader.
My issue is with our mail archive/journaling. When we retrieve messages they are downloaded with file names like: 00db2d52a8081ad5e1e8e8da3fd020c3bc06e12a7b87798056be9e45f68dba8c.eml
When they are uploaded the names contain information like subject, To and From.
Is there a way to grab information from the EML file and rename it with the subject line for example?
|
|
|
|
|
You should be able to use MimeKit[^] to parse the file. If you just want the subject, you don't even need to load the whole file:
public static string GetMessageSubject(string fileName)
{
var headers = MimeKit.HeaderList.Load(fileName);
return headers[MimeKit.HeaderId.Subject];
} NB: Be aware that the message subject could contain characters which are not valid in a filename. It could also be longer than the maximum allowable filename, or make the file's path longer than the maximum allowable file path.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Thank you for your reply.
More specifically I am looking for something that would rename all the files within a folder. We have folders that can contain over 100,000 files.
Unfortunately I am not an expert at scripting so I am looking for a complete script.
If I wanted to add To and From in the name would it be as simple as adding another line like:
return headers[MimeKit.HeaderId.To];
|
|
|
|
|
Yes, headers[MimeKit.HeaderId.To] will return the list of addresses in the "To" field, and headers[MimeKit.HeaderId.From] will return the list of addresses in the "From" field.
There could potentially be multiple addresses in both fields. And the same caveat about invalid characters and filename/path length limitations applies.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Hi. I have been going around to different discussion forms online asking the same question. I want to know if someone on "codeproject.com" could give me some helpful advice regarding these question also (sorry, my post is a little long).
I am a college student and I am in my third year of college. I have an associate degree in general science and I am studying to earn my bachelor's degree in Computer Science. I have been trying to get an internship to get work experience for the summer of 2020 and even got two phone interviews but regardless I keep being denied the internship positions. Now I wonder if I will even get an internship before I graduate. Due to my dilemma I have some questions:
(1) I am looking at other options as far as work experience is concerned. I think I might have to work at the IT department at my school. Will this help me get at least and entry level/ associate level job in software? This job does not relate to software or programming but it relates to the technology field which is why I picked it.
(2) I have also done a research project remotely and I plan on doing more research projects that are teacher lead. Can this help boost my chances at getting an entry level position after graduation?
(3) Should I do more personal projects? If I put an older personal project on my resume, will an employer think that the project is outdated?
(4) Will my resume look competitive enough without a real internship? Having an internship seems like something employees really want (I guess it ensures that the employee can really code) but I think I am running out of options.
(5) I wanted to do some programming competitions at my school even if I lose the competition. Do you think this can be added to my resume?
(6) I wanted to do this program at my school were you visit a company to see what a typical day is like for someone who does the same job you want to do after graduation. Do you think that this can be added to my resume (I know it's not an internship but I am just looking for ways to make my resume look more competitive).
(7) Some companies say that even if you don't get a job with them, they will save your resume and call you back if any other positions are available. Do you think that even though I did not get some of these internships, they could call me back for other positions (if I at least apply to other positions)?
(8) How early should I apply for a job to ensure that I have a chance of getting the opportunity? If I apply for jobs my last year of college, I might run the risk of not knowing enough information to pass the technical Interview. Plus, I could do more things that I can put on my resume. However, if I wait I might spend 6 months after graduation looking for a job when I could have found one already.
(9) I said that I only got two phone interviews because I emailed about 30 recruiters total that were from the companies I applied to. When I start looking for a real job, do you think it would be a bad idea to email them again? I don't want to bother them but I have no other way to network with some of these recruiters.
(10) I wonder if I would be ready to do a job in software if I never worked in the field before. An internship would have helped with this but I think I might need to have a second plan in case I don't get an internship. Do you think an entry level job will be an ok way to learn about the job (if you are willing to try and learn) or should I just get an internship after college.
If anyone can help answer even one of these questions (since I know I wrote a lot), I would greatly appreciate it. Thanks.
|
|
|
|
|
You've asked several question related to the recruiting process, which can be answered separately, but i have one general answer to them.
Stop thinking, start doing! Until you try, you'll never know what skill, experience is important in application process for specific position of job. Every employer is looking for something specific to his profile of bussines. All you have to do is to get as many information as possible about your future employer and create adequate CV.
I'd suggest to read about Recruitment and Hiring Process.
|
|
|
|
|
Yeah I know. I have been to my school's job fair's to try and network with companies in my area. I have sent e-mails to recruiters asking them to review my application if they had the time to do so. I have done mock interviews and resume building workshops at my school also (I only mention these things because I don't want to look like I haven't tried. The opportunity won't just come out of thin air and I realize that). I only asked the the question to see if anyone has any other idea's I can do that can help me out also.
|
|
|
|
|
The most important thing most employers look for is experience. So, how do you get your first job? Include projects from school, personal projects, certifications, anything to show that you know what you are doing.
Then use job websites to search for entry level positions.
Social Media - A platform that makes it easier for the crazies to find each other.
Everyone is born right handed. Only the strongest overcome it.
Fight for left-handed rights and hand equality.
|
|
|
|
|
Thank you. Adding personal projects on my resume is basically what I have been doing so far. I guess it was enough to get my two phone interview for an internship (though I was denied the position). I also wanted to get a certificate to include but a lot of them are expensive to get. However, I will still look into getting one certification before I graduate. Also, I know that when writing a resume you have to include some of the stuff that was mentioned in the job description. Otherwise, your resume might not be picked. It's not like I haven't researched the hiring process. Anyway, thank's for your input.
|
|
|
|
|
If you are in the Atlanta area we'll be hiring a Junior Developer in a few months.
Social Media - A platform that makes it easier for the crazies to find each other.
Everyone is born right handed. Only the strongest overcome it.
Fight for left-handed rights and hand equality.
|
|
|
|
|
Ironically I live in a county around this area but I have no transportation to get to Atlanta (I have never had a job to get a car). Thanks anyway.
Isn't a Junior developer the same as an entry level position? I don't think I have enough skills for an entry level job (which is why I was trying to get an internship)- until I get closer to my graduation day. Also, what company are you referring to? Maybe I can do some research on this company and see (when I hopefully move to Atlanta sometime after graduation because they have more jobs in this field) if I might be qualified to eventually work at that company.
|
|
|
|
|
It all depends on the level of knowledge he shows. He might not have these degrees, but be a very good in soft. Some guys that I know are almost genius, but they do not even have special education. Besides, much depends on the country you live in.
|
|
|
|
|
i'm tareq from palestine
any one could help me in implemented
attached paper (traditional kmeans and enhanced version) in python
|
|
|
|
|
We are more than willing to help those that are stuck: but that doesn't mean that we are here to do it all for you! We can't do all the work, you are either getting paid for this, or it's part of your grades and it wouldn't be at all fair for us to do it all for you.
So we need you to do the work, and we will help you when you get stuck. That doesn't mean we will give you a step by step solution you can hand in!
Start by explaining where you are at the moment, and what the next step in the process is. Then tell us what you have tried to get that next step working, and what happened when you did.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Yes
Social Media - A platform that makes it easier for the crazies to find each other.
Everyone is born right handed. Only the strongest overcome it.
Fight for left-handed rights and hand equality.
|
|
|
|