I've been reading through the recent thread about collaboratively learning a language, and it piques my interest. It gave me the idea to organize this shit to actually help /pr/ learn a new language. Basically, people post assignments in this thread for the language we're trying to learn. Those assignments will be coded in a file called answer(question number).txt, uploaded here. Once the answer to a given assignment is confirmed correct, the assignment will be officially CLOSED and all other answers to the assignment after its closing (identified by a post by me indicating the assignment is closed) will be deleted. Follow me so far? For example, Assignment #1 is to display the words Hello, World. You would then post answer1.txt with the correct code and if it was verified correct I would post about it. ----THREAD RULES---- #1 - This thread is a no-troll zone. All completely off-topic posts will be deleted and may result in a ban. #2 - DO NOT post your code in the Message section of the post. All answers go in the accompanying .txt file. #3 - Names/tripcodes are urged in this thread to clear up any confusion. #4 - The language we are going to be doing assignments in is C. That was the overall consensus I got. If you disagree with this and want to do another language, don't worry, other languages will be included in this later on. #5 - Remember, we are learning a language here. Hints and tips on the assignment post are allowed and encouraged. Also, no extreme-difficulty assignments allowed. I'll be in charge of what is okay and what is not okay. Message too long. Click here to view the full text.
Uncommented, far from finished assignment 7. I will implement the dynamic allocation dalek was so kind to help me with and a combat system. I hope the code is understandable enough for everyone but I will post an updated version tomorrow probably. ~~The master.
Hi guys, I'm crossposting >>/b/389653 here to get /pr/'s help on this issue for the new /local/ board idea I'm working on, but still don't have a really concrete way to approach this using PHP. I'd appreciate some input on a good way to approach this, from a programming standpoint.
Javascript based client side word filters. Just ask each user what city they're in, and then make the wordfilter all city names to be whatever city they're from.
Well, I have several php pages, and one of them takes $_POST arguments, does some stuff with my database, and then returns to the page using $_SESSION['url']. However, rather than taking me back to the form page for a nice "it worked" message, it takes me to the last image in the image array that I'm preloading. The image preloading code is something like imageA = new Image(); imageA.src = "http://some.url.here" Is there some way for me to reset the $_SESION['url] to the page's url, rather than the last accessed URL from the website's point of view?
Hi. I jsut wondered if this was the place to ask for help. So i have this problem i would need to make a macro or shortkey to spam space and i mean fast as fast as possible in the matter of fact, how should i proceed? And the need for really fast space -key spamming would be needed for this browser aplication. thanks for the time and ideas.
and by fast i mean like way less than a second^^
Supposing you're on Windows you just need to send a message to the browser saying space was pressed. Search for WM_MESSAGE on MSDN and you should find something.
I want to parse a date formatted like this: Sun, 7 Feb 2010 11:34:04 -0700 to a datetime object in python but after googling I still have no fucking clue how too. Is there any easy way to do this or am I going to have to regex this shit?
"Have to" and "regex" should never be in the same sentence ... just be happy you're coding in a language that has that functionality... In short, yes, regex for the win...
Why regex? I'd just split() the string and use the substrings.
help(time.strptime): strptime(string, format) -> struct_time Parse a string to a time tuple according to a format specification. See the library reference manual for formatting codes (same as strftime()).
Hi /pr/ I have been a programer for about 3 years and for the first time.. I feel like I don't like programing. Have anyone ever felt like that?
I've been programming full time for 8 years, and on-and-off for much much longer. I get that feeling now and then.
If you've been stuck with 1 language for a LONG time, then yes. Been doing Perl for 8 years. Just recently took up Verilog so I could advance my other hobby (electronics). Bringing something I do every day and used to love (programming) with something I don't do as often an brought a whole new lease of life to it. Now I'm throwing around `module`s and 8'hdeadbeef like nobody's business.
>>7684 >i fancy thinking about myself as a Software Engineer more than a programmer I'm sure you do. Hell, that's the whole purpose of the term "software engineer".
So I'm looking for a program to run permutations on a list of words (say a dictionary file), adding in common letter substitutions ($ for s, + for t, etc) I need this because I'm using aircrack, and unlike john, it doesn't have an option to "leet-speak-ize" the dictionary file (and john does not modify the original file, so I can't run john then use the resulting file in aircrack) my googling has found nothing... I will probably have to code a solution in python myself, I'm pretty green to the whole programming thing so it'll be a nice, managably sized project, but it'll be 10x easier if I've seen example code. (plus I wanna run this test _now_ not when I've written the program in 1-2 weeks)
This is the correct one liner to find the positions: findPositions xs = take (length index) $ index <*> [xs] where index = elemIndices <$> leata
findSubSeq = fmap subsequences <$> findPositions And whith this one we can calculate all the subsequences of the positions. Eg: findSubSeq "taasts" gives us: [ [[],[3],[5],[3,5] -- all possible substitions for s ],[[],[0],[4],[0,4]] -- all possible substitions for t ]
Next step is something like this and then we are almost there: zip leatb $ findSubSeq "taats"
#include <iostream> int main() { char *name; std::cin >> name; return 0; } So I compile it, it compiles fine. I run it, enter some letters for char *name, and I get a segment fault. Why is this happening?
>>8190 Wow, I'm an idiot. =/ Thanks. Changed to name[100]
What is this shit, using std::cin, so it is C++, use a motherfucking std::string for Christ sake, enough of the char* faggotry. "Yes!Yes it work, i mean it compile, now what is a segmentation fault?"
>>8192 >char name[100]; >std::cin >> name; hmmmmmm...
So I was reading some programming forums, and I go to thinking: In C++, why do so many people type "std::cout" and "std::cin" when they could just type "using namespace std;" once and be done with it?
>>8156 If it's a small device why are you even using std::count and not a write call in the first place... just sayin'
>>8238 What's the difference?
>>8238 If you really need to ask you do not need to ear the answer... just try both, disassemble a C write Hello World and a C++ cout Hello World and you might then be informed to anwser yourself.
I've been interested in writing a book recently, and I wanted to pick /pr/'s brains for a second. The book would be marketed at people who are curious about computers, how programming works, etc., but who don't want to have a formal education regarding it. So my book would show have a brief overview on what happens on every stage of the computer, from the time you input to the time it outputs. i.e., I would start with pressing a key, say that the signal was propagated to the keyboards circuit board, diverge at this point into gates, transistors, etc., and then continuing, mentioning t he difference between the polling keyboard and the interrupt mouse, etc. And lest it seem like a pure ce book, I would eventually get to mentioning a *very* brief overview of finite automata, and how these lead to scanners, parsers, how things are then compiled, and so on. So let me as you, /pr/, is this a book that anyone here would be interested in pre-colege? Assuming it was well written, do you think that this has a market, or is this more of an interesting topic mainly for me? Any ideas, suggestions that you think would make it more interesting?
>>8202 Bwhahaha, we surely haven't seen this before. >>8153 >the next TAoCP Surely isn't pre-college; way too mathematical approach.
>>8248 >Surely isn't pre-college; way too mathematical approach. I was referring to the scope and length.
>>8233 Top observational skills you got there. Although i would question the quality of a post that was simply a useless one word response. Faggot.