|
artificialj posted:Cool, thanks, I'll look into that one. I understand why you're providing a solution but honestly gaming the vote on a conservative echo chamber poll will, at best, feed into a persecution complex.
|
# ? May 13, 2011 22:49 |
|
|
# ? May 18, 2024 06:56 |
|
install a proxy that slows down access to those websites until she gets bored & frustrated of loading them
|
# ? May 13, 2011 23:44 |
|
How long does it take to be able to write code without constantly looking stuff up to make sure I'm doing it right? I've gotten to the point where I know where I need to put stuff and what does what inside the code but when it comes to actually implementing it all into something my brain just cuts out on me. I'm using Python, and am having fun with it regardless of said brain killing difficulties.
|
# ? May 14, 2011 19:12 |
|
Apocadall posted:How long does it take to be able to write code without constantly looking stuff up to make sure I'm doing it right? I've gotten to the point where I know where I need to put stuff and what does what inside the code but when it comes to actually implementing it all into something my brain just cuts out on me. I'm using Python, and am having fun with it regardless of said brain killing difficulties. What kind of "stuff"? Basic syntax? Library APIs? Basic syntax should come naturally pretty quickly -- probably within a couple of projects. As for APIs... You'll be looking those up for the rest of your life.
|
# ? May 14, 2011 19:21 |
|
A question regarding bijection, a few database-free image hosting configurations like the belated Waffles use an extended base path, e.g. base64, base62, or base36, with minor modification for URL encoding. This produces a long URL, 22 characters if using MD5 checksums of the file contents for example: https://wi.somethingawful.com/bf/bfeda567b2173dcc96f2f6b0efba56fba6c6bb93.jpg Many of the popular sites now use shortened identifiers similar to URL shorteners, e.g. http://i.imgur.com/dgsJW.jpg Which would appear to be a base62 ID allowing up to a billion resources with five digits, bijection is used to randomize the number space to prevent idle snooping I guess. Now the dumb question, is the basic psuedo-random number generator (PRNG) also a bijection function? Does reducing the size of the finite field affect the bijection status if not to a round number in the native base? code:
MrMoo fucked around with this message at 19:44 on May 14, 2011 |
# ? May 14, 2011 19:41 |
|
Mobius posted:What kind of "stuff"? Basic syntax? Library APIs? Basic syntax should come naturally pretty quickly -- probably within a couple of projects. As for APIs... You'll be looking those up for the rest of your life. To give an example, I downloaded a nifty little open source game called Singularity and it's written in Python. I can look through the code and tell exactly what everything is doing, but when it comes to me sitting and writing something on my own I have trouble thinking about it.
|
# ? May 14, 2011 21:45 |
|
Apocadall posted:To give an example, I downloaded a nifty little open source game called Singularity and it's written in Python. I can look through the code and tell exactly what everything is doing, but when it comes to me sitting and writing something on my own I have trouble thinking about it. You're just going to have to try and do it wrong a lot. The only way to become a good programmer is to be a bad one first.
|
# ? May 15, 2011 01:30 |
|
GrumpyDoctor posted:You're just going to have to try and do it wrong a lot. The only way to become a good programmer is to be a bad one first. Well you know what they say, you learn more from failure then success.
|
# ? May 15, 2011 02:01 |
|
Apocadall posted:How long does it take to be able to write code without constantly looking stuff up Never. You will always have the documentation open. Sure, you'll memorize the functions you use the most, but for many languages it's just not practical to know the name and arguments of every useful function.
|
# ? May 15, 2011 03:19 |
|
I've been importing a bunch of XML files into a MySQL database. Due to a quirk in my import script that I didn't catch until 20,000 files had already been imported, I have an annoying situation I'm not sure of the best way to fix. The table schema is simple:code:
code:
Is there a better way to accomplish this?
|
# ? May 15, 2011 16:11 |
|
Not having dealt with this before, what are the tradeoffs of storing binary files in a database (I'm thinking about MySQL, but haven't actually settled on anything yet) versus storing paths to filesystem locations? The project I'm thinking about would probably have files up to maybe 10MB, if that makes any difference.
|
# ? May 15, 2011 17:37 |
|
Blegh i've gotten in over my head with some c++ thing so it's time to ask the internet class definitions code:
code:
I could give up and just put a massive switch statement in the base class constructor or something but I prefer to waste lots of time trying to make nice code without the knowledge to do so. Thanks!
|
# ? May 15, 2011 23:42 |
Make a protected function in the base class to set that box, or let all your objects start out in an uninitialised state and then have an Init function that can be called whenever.
|
|
# ? May 16, 2011 00:05 |
|
The easiest solution is to have a separate function build and return a temporary box which you can then pass down to the base constructor:code:
|
# ? May 16, 2011 01:53 |
|
That worked flawlessly, thanks guys
|
# ? May 16, 2011 20:29 |
|
Everywhere, lots of posters use the convention name at domain to show their emails. I'm sure in the early days, it would have thwarted some bot crawling for addresses, but surely all of the possible "easy" variants people use are incorporated into bots now? My question is, is there a point? I get that people who do "my posting name" or such might make it not worth it to parse, but the specific name at domain format seems useless.
|
# ? May 18, 2011 00:00 |
kimbo305 posted:Everywhere, lots of posters use the convention name at domain to show their emails. I'm sure in the early days, it would have thwarted some bot crawling for addresses, but surely all of the possible "easy" variants people use are incorporated into bots now? It still would be much harder for a bot to parse email addresses with various combinations of replaced symbols. Not saying that such bots don't exist but they would probably get a lot of noise data. Shy fucked around with this message at 13:41 on Oct 23, 2018 |
|
# ? May 18, 2011 00:21 |
|
Shy posted:It still would be much harder for a bot to parse email addresses with various combinations of replaced symbols. Not saying that such bots don't exist (I don't know) but they would probably get a lot of noise data. If it were me doing it, I'd probably just have the last group try to match against a huge pile of well-known/used domains. gmail|hotmail|etc. That would filter legit addresses out but probably be more accurate.
|
# ? May 18, 2011 00:28 |
|
kimbo305 posted:Everywhere, lots of posters use the convention name at domain to show their emails. I'm sure in the early days, it would have thwarted some bot crawling for addresses, but surely all of the possible "easy" variants people use are incorporated into bots now?
|
# ? May 18, 2011 04:59 |
|
ShardPhoenix posted:I find spam filters are pretty effective these days anyway. I don't think trying to hide your email address if worth the inconvenience to the people who you actually want to email you, though I suppose for a lot of people it's just habit. I like when the "obfuscated" email address is an unobfuscated mailto link. And I agree, you're not avoiding much spam by using words instead of punctuation. If it's that important to you, make it an image.
|
# ? May 18, 2011 07:54 |
|
I agree that spam filtering has come a long way - Gmail's spam filter is pretty outstanding to the point that I can't remember any false positives and very rarely (like once or twice a month) get a false negative, which is dealt with by hitting the "Report Spam" button. I have noticed a slight uptick in false negatives in the last month, which I'm attributing to the fact that I have a PSN account. Sony!
|
# ? May 18, 2011 09:30 |
|
Right -- I've never had issues with spam in Gmail, but my work's corporate email provider has a garbage filter, and I imagine there's still plenty of non-Gmail users who are getting flooded with spam. I was just curious if it was well established or not that formatting emails was actually defeating bots.
|
# ? May 18, 2011 09:48 |
|
kimbo305 posted:Right -- I've never had issues with spam in Gmail, but my work's corporate email provider has a garbage filter, and I imagine there's still plenty of non-Gmail users who are getting flooded with spam. I was just curious if it was well established or not that formatting emails was actually defeating bots. At this point I doubt it, a few regexps and substitution rules defeat most of the standard formats. As has already been mentioned it all depends on how much noise (invalid email addresses) the spammer is willing to tolerate, but as the financial penalty for sending to an invalid email address is all but non-existent due to the low cost of spamming you'd have to have a really low SNR to make it not worth trying to beat the obfuscation.
|
# ? May 18, 2011 10:22 |
|
kimbo305 posted:Everywhere, lots of posters use the convention name at domain to show their emails. I'm sure in the early days, it would have thwarted some bot crawling for addresses, but surely all of the possible "easy" variants people use are incorporated into bots now?
|
# ? May 19, 2011 03:02 |
|
Scaevolus posted:Someone actually did quantitative testing of different methods a few years ago. "foo AT blah DOT com" nets 250x less spam than plaintext, so it's not completely worthless. It's the usual relative security thing: as long as there's enough people who don't obfuscate, there's no point in trying to do complicated, failure-prone parsing when you could just nab the easy ones.
|
# ? May 19, 2011 09:13 |
|
I'm using regex to parse out some information about files based on their filenames and/or the folders they're contained in. I'm not very experienced in regex, so I can't figure out this surely simple problem. I'm attempting to parse out year data, but I don't want it picking up on the 1080 that appears in 1080p. My regex pattern: "[1,2][9,0][0-9][0-9]". I believe I could change it so that it ignores strings with an 8 in the 3rd position (I may have even got this working), though then I'll fail to match on 1980-1989. Any words of wisdom, regex gurus? It does not need to be efficient or elegant - just work. In case there is any confusion, the logic I'm looking for is (MATCH ON "[1-2][9,0][0-9][0-9]" BUT NOT "1080") Rick Rickshaw fucked around with this message at 13:26 on May 19, 2011 |
# ? May 19, 2011 13:22 |
Unless you are using a rather non-standard regex engine, you don't use commas in [] groups, just: [12][90][0-9][0-9] As for not matching specifically "1080p", if you know it is always in that form and never only "1080", you can add a negated class: [12][90][0-9][0-9][^p] Just be aware that you're then catching one character too much. If your regex engine also does irregular expressions, specifically forward assertions, you could use an assertion that the year must not be followed by a 'p'. Another thing you might be able to do: (19|20)[0-9][0-9] Just be careful about capture groups, if you use those, you should probably use a grouping operator that doesn't capture if you have that available.
|
|
# ? May 19, 2011 14:01 |
|
Rick Rickshaw posted:I'm using regex FFS please tell us what kind of regex.
|
# ? May 19, 2011 14:05 |
|
nielsm posted:Unless you are using a rather non-standard regex engine, you don't use commas in [] groups, just: [12][90][0-9][0-9] Negating the "p" was an option I unfortunately already explored. It's not ideal, since the characters I'm trying to match on could be at the end of the string, plus the annoyance of capturing whatever character followed the year. Obviously a minor one, but when there should be a better option it becomes amplified. However, (19|20)[0-9][0-9] works like a charm. Thanks a lot!
|
# ? May 19, 2011 14:36 |
|
Rick Rickshaw posted:Negating the "p" was an option I unfortunately already explored. It's not ideal, since the characters I'm trying to match on could be at the end of the string, plus the annoyance of capturing whatever character followed the year. Obviously a minor one, but when there should be a better option it becomes amplified. It doesn't matter if they are at the end of a string. Your assertion is basically saying that the date isn't followed by "p". Also, the lookahead assertion doesn't include the next character (if there is one) in the result. Try this: code:
|
# ? May 19, 2011 15:07 |
|
Modern Pragmatist posted:It doesn't matter if they are at the end of a string. Your assertion is basically saying that the date isn't followed by "p". Also, the lookahead assertion doesn't include the next character (if there is one) in the result. There we go. Your syntax for the exclusion of "p" is what I wanted. The syntax I tried (posted above by nielsm) would grab the 5th character. This solution has the added bonus of working up until the year 10,000. edit: However, I may not use it as it will fail in the event that 1080 is not suffixed by p. I guess I'll have to add another condition if I live to the year 2100. Rick Rickshaw fucked around with this message at 15:48 on May 19, 2011 |
# ? May 19, 2011 15:43 |
This is a general question: why is it that just about every single programming book is absolutely terrible at teaching a respective language? I got a book on C# by O'Reilly, and it goes from having you make the usual Hello World program to using various class/constructor things within 30 pages, also using commands such as get/set without literally explaining what they are, how they work, and what they do. It also uses examples in a horrendously confusing way, telling you how you could theoretically do one thing, only to say "well, while it can work, this is actually the wrong way to do it, so here's the right way," only leading to more confusion because it starts talking about a completely different variable type or something with which you can achieve the goal. Am I just really stupid and not meant for programming (at least in terms of languages which are not solely intended for web use), or are these books just awful? Is there any reasonable way to learn the stuff without being confused by poor writers? I'm in a C++ course right now and wanted to supplement it with C# because it/.NET is supposedly a desirable skill to have right now, but when the books are terrible, it's kind of hard to learn anything. I'm not even completely unfamiliar with programming itself, and tried to learn Java when I was much, much younger (I think the age was the biggest difficulty here), but I feel like an idiot.
|
|
# ? May 23, 2011 00:29 |
|
Many books make the assumption that you know the concepts already and just want to learn the particulars of a given language. In your case it sounds like, taking C#, you want this which a friend has had great success with. It really does start from absolute basics but the advantage to that is you can skip those parts if you feel you can. You might find the reviews useful to gauge if it's right for you, although I'd ignore the 1 star one from someone of uncertain intelligence who seemed to be expecting a C# book to teach him ASP.NET. rolleyes fucked around with this message at 01:13 on May 23, 2011 |
# ? May 23, 2011 01:10 |
|
Sulk posted:This is a general question: why is it that just about every single programming book is absolutely terrible at teaching a respective language? object orientation (no, really) They try to teach how to structure programs before people understand the foundations. You may enjoy http://www.htdp.org/2003-09-26/Book/ how to design programs. Once you have a more consistent grasp of programming concepts, it becomes much easier to pick up new languages.
|
# ? May 23, 2011 10:14 |
|
I don't understand why CS courses don't start out with C. It's got everything you need and very little you don't: all the usual datatypes, pointers, arrays, conditionals, and looping, all implemented in a pretty straightforward way. None of it is very difficult, but it's all completely necessary if you're going to get very far in programming.
|
# ? May 23, 2011 13:20 |
rt4 posted:I don't understand why CS courses don't start out with C. It's got everything you need and very little you don't: all the usual datatypes, pointers, arrays, conditionals, and looping, all implemented in a pretty straightforward way. None of it is very difficult, but it's all completely necessary if you're going to get very far in programming. Already covered earlier: C requires you to think about memory management and program organisation from the beginning, and requires much more boilerplate (#include <stdio.h> int main() {semicolons}, then get past the compiler) than many other languages. It removes focus from the task at hand: Instructing the computer how to solve a problem. You can teach the students how to deal with the realities of the machine later. E: Wait was that in the "coding horrors" thread? Maybe it was. nielsm fucked around with this message at 14:44 on May 23, 2011 |
|
# ? May 23, 2011 14:38 |
|
^^ Yeah, that was in the coding horrors thread. I wouldn't be surprised if the discussion has happened in this thread as well, though. C is good to know and makes a good second language, but it has enough up-front complexity that teaching it as a first language means that learning the specifics of the language gets in the way of learning the concepts of programming.
|
# ? May 23, 2011 14:49 |
|
tef posted:object orientation I'd go further and blame the Design Patterns book. It doesn't contain a single pattern and seriously misleads people into a cookie cutter cargo cult programming.
|
# ? May 23, 2011 14:52 |
|
rt4 posted:I don't understand why CS courses don't start out with C. It's got everything you need Because people have a hard time explaining pointers and stack vs heap. And null terminated strings. And Include files. Other people find data structures useful: Lists, Sets, Dictionaries,
|
# ? May 23, 2011 14:56 |
|
|
# ? May 18, 2024 06:56 |
|
tef posted:Because people have a hard time explaining pointers and stack vs heap. And null terminated strings. And Include files. Other people find data structures useful: Lists, Sets, Dictionaries, I still say that introducing data structures before having a solid grounding in flow control is a bad idea.
|
# ? May 23, 2011 14:59 |