Jump to content

pzkpfw

Senior Members
  • Posts

    699
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by pzkpfw

  1. My emphasis: Quite simple: there is no God. So it/he/she/they don't need to be time - or anything else. Speaking of time, I'll save some by not waiting 1000 years
  2. Absolutely. I hope none of your socks are missing.
  3. To learn you first need to admit you've got stuff to learn. fiveworlds definitely does know some stuff. He just needs to understand doesn't know everything, and open himself up to learning, and not being defensive about what he's said. (I've been programming since I was 11, in 1981 (BASIC on a Pr1me Minicomputer via dumb terminal). Programming has been the bulk of my career. What's making me most interested and engaged in my current job, is what I'm learning from the contractors who've been brought into the project I'm working on. The methods and patterns they use are making my brain hurt. But hurt in a good way. They know stuff I don't. That's a good thing.) ((P.S. I gave him green for his gobbledigook program, because at least he put some effort into it.))
  4. That's utterly bizarre. Why write each line of the file to separate files (in temp), just to read them again and write them as separate files (to output), to then read them again into one long in-memory string to finally write to the output file, when you could just write them (if they meet whatever criteria) directly to the output file in the first pass? ... I'm off to do this in C# to show the pattern ... Edit: yep, this works fine. As noted, not "production" code, but I'd be surprised if the Python code had to be much different. (Open input file, open output file, read lines from input file and write to output file if they meet some criteria.) using System.IO; namespace FileFilter { class Program { // Expects two parameters - the name of the file to process and the text wanted at the start of lines to keep // This is not production code. There's no error checking (Does input file exist? Will output file be overwritten?). // It may give you a stomache ache. And socks will vanish from your washing. static void Main(string[] args) { using (var inputFile = new StreamReader(args[0])) using (var outputFile = new StreamWriter(args[0].Insert(args[0].LastIndexOf('.'), "_Filtered"))) { string lineIn; while ((lineIn = inputFile.ReadLine()) != null) { if (lineIn.StartsWith(args[1])) { outputFile.WriteLine(lineIn); } } } } } } P.S. re-use of the variable named "txt" is nasty.
  5. That doesn't really make sense (given how C# works; even if you're talking about .Net Native under .NET Framework 4.6 and 4.5). Having said that, C# is what I'd use too - I (more or less) currently make my living as a C# programmer. He didn't ask for mangled HTML either! Still has the issue of reading the file all at once. I don't know Python specifically, but reading line by line seems possible (e.g. http://stackoverflow.com/questions/8009882/how-to-read-large-file-line-by-line-in-python ) Reading line by line also means you'd not be tied to the assumption that there's always 10 lines between the lines wanted. And your code assumes the input ends on a wanted line; but going by the sample (with the "Etc ...") I'd suggest that's not guaranteed. And if that "last line" is not there (or there are less than 10 unwanted lines), the last iteration of your while loop may well have an i that's less than len(txt) ... but adding 11 (i.e. the "print txt[i+11]") would push you past the end of the list. That is, your code will only work if the input file is exactly like: wanted line 10 x unwanted lines wanted line wanted line 10 x unwanted lines wanted line wanted line 10 x unwanted lines wanted line ... etc. What's the point of the "hello" replacements?
  6. Erm, instead of looking for '0' to '9' as the first character of the line (via regex or not) - why not just look for the 'f' of "fixedStep"? (or the whole word). Seems safe enough, going by the specification (which does say "...without the numerical lines..." but equally shows the only non numeric lines to begin "fixedStep ..."). (Minor point, but, well ...) @fiveworlds: the spec says "Etc....". A solution that only shows lines 1 and 12 of the file (elements 0 and 11 of the list) misses all lines in the potential "Etc.". Also, a solution that loads (with the use of "readlines") the entire file at once into a list, will get to be a drag on the system if the input file gets large.
  7. pzkpfw

    T=E+C2.

    ... and this is something "peer reviewers" would have picked up if the Journal of advances in physics was worth anything.
  8. pzkpfw

    T=E+C2.

    (There are plenty of journals which accept anything for inclusion, sometimes for money, sometimes just for padding. Simple inclusion in this on-line journal is not evidence of anything. Frankly, your mangling of the text you're writing here does not give me confidence.) If you wish anyone to take your idea seriously, you need to show the derivation and the evidence. You can't simply say "here it is" and expect anything.
  9. We'd get even better benefits launching rockets from near the equator than the poles.
  10. I'm not disputing the data, I'm disputing your geocentrist interpretation of it. You'll note that in my post #308 I wrote "... item that acknowledges the issues ...". Your head in the sand approach isn't helping you.
  11. There was no question in my post. There was no need for you to reply. (Frankly I think this whole thread is a waste of time. You started in post #1 with the usual disingenuous "I'm just looking" sort of claim, but it's been very clear you actually came in with a definite opinion that you'll never let go of). What I linked was a fair and balanced item that acknowledges the issues and discusses them from a point of view of current science. Whether you read it or not is up to you. (That you reject it based on the site being called "geocentrismdebunked" supports my "waste of time" aside in the paragraph above). I'm simply countering your unsupported assertions about the CMB.
  12. Yeah, I'm happy to take a balanced scientific view on that: http://www.geocentrismdebunked.org/the-cmb-and-geocentrism/
  13. Pick some Galaxy other than our own. Imagine an alien on some planet orbiting some star in that Galaxy. What would that alien read for the direction "pointed" by the CMB?
  14. You had your chance to put forward the case that the claimed phenomena are extraordinary. Nobody bought it. That's why you've resorted to these whiney meta threads.
  15. From our news today (have seen mention before), headline "The hoverboard becomes reality - finally" http://www.stuff.co.nz/technology/gadgets/70846900/the-hoverboard-becomes-reality--finally Woo hoo, sounds all sciency and stuff. Unfortunately ... So really, just a scaled-up version of stuff we've seen before. e.g. this kind of thing:
  16. Just a few days ago I was telling my Father about a John Oliver ("Last week tonight") item on food wastage. My Father made the comment (which from experience I had to agree with) that fruit off the ground is often the tastiest. Yeah, I don't think the average forest dwelling animal (Human or not) is too fussy about such food.
  17. Yes and no. People will often see things they don't expect or they don't understand. To ignore possible mundane explanations and jump to the "what if it's an alien" conclusion - as you seems to be proposing - is a little bit silly. It's very clear, with your posting history, what you are trying to argue for.
  18. An author should care that his or her readers can understand what they are reading. So far, I think everybody has found your posts (on this and other forums I read) incomprehensible gibberish. (i.e. The lack of on-point replies is not proof that no one can find fault; because the truth is that no one can find the point to start with.) If you care whether anybody understands you, you need to break down your concept into smaller pieces, and get each one understood (if not agreed with) before moving on to the next. You also need to use words in standard ways, or at least properly explain how you use them.
  19. Why "no"? That comment was about popularity (right or wrong), not availability. Ability to run on the same server at the same time isn't a counter point.
  20. Organic molecules have been detected "out there", but that doesn't mean "life". No direct evidence of life has yet been found off Earth (apart from on craft we've sent up ourselves).
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.