|
You need to answer csammis's questions but generally your assembler should have some way to store a string constant as a variable in memory. Now all you have to do is send that variable as an argument to whatever function you are using to print. If your using 16 bit x86 DOS you can just call int 21h. quote:INT 21 - DOS 1+ - WRITE STRING TO STANDARD OUTPUT Here's a tiny example, but be advised that this isn't the best way to do it since it's old school DOS. code:
Janitor Prime fucked around with this message at 10:36 on Mar 6, 2008 |
# ¿ Mar 6, 2008 10:34 |
|
|
# ¿ May 2, 2024 15:25 |
|
Most *nix installs have Perl installed by default, so that might be your best choice.
|
# ¿ Mar 10, 2008 07:23 |
|
What about something like Dominoes and we each have to create a client that has to beat the rest.
|
# ¿ Mar 12, 2008 08:02 |
|
JoeNotCharles posted:Python. I don't it's fair to dismiss a language as terrible without any explanation. In fact you didn't even mention why ruby or python are any better than Perl at text processing which has always been Perl's forte.
|
# ¿ Apr 2, 2008 21:06 |
|
Plastic Jesus posted:Can't you just do strchr('\n') (or strstr("\r\n") on windows)? No the problem is that when you use scanf it removes the endline characters from the string.
|
# ¿ Apr 9, 2008 16:09 |
|
WTF does the ^ character mean? Is it supposed to be a better *?
|
# ¿ Apr 30, 2008 07:54 |
|
Well most open source programs are written in Linux so you should familiarize yourself with the build environment and tools. The languages vary but I'd say that the majority are written in C/C++. Other than that you can get started by just checking out the source code and looking at their data structures. A lot of OS projects have developer wikis which can steer you in the right direction.
|
# ¿ May 6, 2008 18:21 |
|
A regular expression can do this easily. You just need a text editor that lets you replace using a regular expression. This will match the test and separate it into 3 tags. code:
Then all you have to do is replace using the 3 tags. This is how you would do it in notepad++. Notice the spaces between the 3 classes. code:
Janitor Prime fucked around with this message at 08:12 on May 7, 2008 |
# ¿ May 7, 2008 08:02 |
|
Yes you need to switch to the replace tab and then you push the replace all button.
|
# ¿ May 7, 2008 11:17 |
|
Interfaces allow you to have more freedom than simple inheritance while at the same time giving you all the benefits like polymorphism. I'll give you a good example of one I did recently. I was writing a B+ tree data structure. If you've ever studied the B+ tree you know that it has 2 different kinds of nodes. It has index nodes which are really just 2 arrays with one being an array of pointers to other nodes and it has the leaf nodes which is where the data is actually stored. Now both these classes share a lot of methods like insert, search and delete but each one has to implement it differently since they have different internal structures. So I created a Node interface with the above methods which these two classes implement. Now I can pass around Node objects without having to worry if they are leaf nodes or index nodes*. Now I could have used normal inheritance with abstract functions but then if I ever wanted to inherit from another class I couldn't. e: csammis where those methods come from? You have to inherit them from some place and in languages that don't allow multiple inheritance you have to use interfaces so that you can have multiple even handlers for one object. I think Incoherence said it wrong, I'm sure he meant that one object can have multiple even't handlers like keyboard and mouse, not that many objects can share the keyboard event handler. Because in that case you are correct, interfaces have nothing to do with it. Janitor Prime fucked around with this message at 20:43 on May 7, 2008 |
# ¿ May 7, 2008 20:27 |
|
csammis posted:I know what Incoherence meant about one event having multiple handlers, but I'm not sure where you're coming from. Inheriting a method? Where are you inheriting the method from when you use a delegate in C#? How about registering a method callback in C++? Event handling is a concept that has absolutely nothing to do with interfaces. Interfaces only come into it as an implementation detail of Java's Listener pattern. Well that shows how much I know about either of those languages.
|
# ¿ May 7, 2008 21:54 |
|
Rather than worry about it, why don't you just give one of them precedence? Like if the user select both options just take the one in the text field. If you really care about it, then what you want is the XOR operator. It returns true only when one of the options are selected. So you could do: code:
|
# ¿ May 14, 2008 09:30 |
|
Tripwire what you want to do is divide your population into n parts where n is the number of processes you want to run in parallel. Each child process finds the worst and best member of their segment of the population and returns the results. Then the parent thread makes n comparisons from the results and finds the best/worst of the entire population and generates the new offspring. This is probably the easiest way to distribute the work. I know jack poo poo about python, so your efficiency problems might be solved by the other recommendations.
|
# ¿ Jun 11, 2008 04:28 |
|
Scaevolus posted:Macs, because OS X is Unix-derived, which is a much better programming environment than Windows. Unless your doing .Net
|
# ¿ Jul 14, 2008 06:35 |
|
Geno posted:I've been programming for less than a year and am not really good at explaning things so bare with me. I have no idea what the gently caress you're trying to do. Try telling us what you want to do in words rather than code.
|
# ¿ Aug 16, 2008 00:49 |
|
Incoherence posted:The XOR trick probably works in more languages than tuple-unpacking in Python, but it has a significant effect on code clarity (what the gently caress are all of these ^=s doing in my code), and as an optimization it's fairly negligible. If everyone knows about the trick then how does that make it unreadable. I think a comment like this would do just fine. code:
|
# ¿ Aug 26, 2008 15:42 |
|
Munkeymon posted:I think teapot got permabanned from here, but that would have been further back than a few months. Yeah I remember teapot getting banned, but that was a while ago.
|
# ¿ May 18, 2009 17:45 |
|
Ari posted:This works for some people and not for others. For me, it's crucial sometimes to see a code listing on paper, because that's how my head works. I therefore recommend this if you've never tried it, to see how it works for you. I'm taking a PSP course right now and for each code review we have to print all the code.
|
# ¿ Oct 19, 2009 21:09 |
|
Avenging Dentist posted:Why would learning about how to code for the Playstation Portable necessitate printouts of code? PSP
|
# ¿ Oct 19, 2009 21:11 |
|
Contero posted:PSP is good, but have you tried the team-oriented synergy production process management using the fred brooks extreme software-driven data requirement metric analysis documentation for mythical man usability unit coverage tests in agile object oriented model-view-controller business logic development? Sounds just like what I need to get that promotion. Do you accept blank cheques?
|
# ¿ Oct 20, 2009 05:28 |
|
ufarn posted:I have an assignment in CS to make a concatenator that merges several text files into one (Java ClassName text1.txt text2.txt text3.txt compilation.txt), but we've received no useful reading resource for doing so. Check out the BufferedReader class in the API, it has a clear example on how to open a file. code:
For writing a file check out the PrintWriter class. code:
|
# ¿ Nov 12, 2009 18:31 |
|
Here is some pseudo code to help you. code:
Janitor Prime fucked around with this message at 01:52 on Nov 18, 2009 |
# ¿ Nov 18, 2009 01:49 |
|
Get everyone on the team to agree on a set of coding standards and then refactor the whole code base with some automated tool.
|
# ¿ Dec 10, 2009 03:15 |
|
Avenging Dentist posted:Python is strongly typed. The word you're looking for is "statically". God I hate the strong and weak type terminology. It's pretty useless since most languages are strongly typed anyways.
|
# ¿ Jan 17, 2010 08:59 |
|
Javascript is too I think, but I just don't like the term because like you said C and C++ could both be considered weakly typed.
|
# ¿ Jan 17, 2010 09:09 |
|
OverloadUT posted:D&D poo poo I actually did this for django project, I'll upload it later so that you can all laugh at how bad it is
|
# ¿ Apr 8, 2010 22:11 |
|
TheGopher you don't seem to "get" SA, you should have lurked more in CoC before making your posts. You've seriously gotten a lot a help and attention from some of the most experienced software developers on this board. Why did you come here expecting everyone to play nice with you? Here is another valid answer to your questions. Teach Yourself Programming in Ten Years
|
# ¿ Apr 19, 2010 07:47 |
|
notMordecai posted:I drink lots of it but it's not really THAT kind of internship. It pays really well and am basically like one of the employees in both status and responsibility. I guess it's why I am worried about slowing things down a tad. But that is inevitable even if you were going to be a full time employee, so stop worrying.
|
# ¿ Jun 7, 2010 06:34 |
|
Well it is if he doesn't want to create a ton of sites that aren't full of SQL and XSS vulnerabilities, otherwise sure he can learn to code in 6 months.
|
# ¿ Jun 8, 2010 15:05 |
|
You realize that people can just clone your mac and still use your wifi?
|
# ¿ Jul 15, 2010 23:02 |
|
Magnum1371 posted:The guy I'm trying to help out lives in a apartment that is 50/50 retired people and college kids. In the router go to the wireless security setting and it should have an option to filter by MAC address. Enable it and only add the MACS that you want to connect to the network. To find the mac address on windows open the command prompt and type [code]ipconfig /all[code], that will tell you the MAC address of every network card on the computer and you just have to find the one that belongs to the wireless card.
|
# ¿ Jul 16, 2010 14:45 |
|
This post is full of spoilers, so don't read if you want to figure it out yourself. A better solution to that problem is start at the row last-1, and last. You then compare the position below and the position below+1 and add the greater of them to the current one. I probably said that in a retarded way, so this example will help clear it up. Looking at the last two rows in the problem: 63 66 04 68 89 53 67 30 73 16 69 87 40 31 04 62 98 27 23 09 70 98 73 93 38 53 60 04 23 You add the greater of 04 and 62 to 63, which gives you 125. You repeat for everything number left in the row until your row last-1 equals the following: 125 164 102 95 112 123 165 128 166 109 122 147 100 54 You repeat this process all the way to the top and you'll know the answer.
|
# ¿ Aug 30, 2010 02:52 |
|
It depends on what you want people to do with it. If you don't give a poo poo then go for BSD. If you do want them to contribute any modifications back then use an lgpl. If it's a library and you want people to use it, then you really shouldn't release it as GPL. lgpl, Apache or BSD are more appropriate and will help in convincing others to use it. edit: This question has some good commentary. http://stackoverflow.com/questions/40100/apache-licence-vs-bsd-vs-mit Janitor Prime fucked around with this message at 00:44 on Sep 25, 2010 |
# ¿ Sep 25, 2010 00:37 |
|
mr_jim posted:Well, you see, there isn't a need for an integer type because numbers are represented by the depth of the call stack. drat you all.
|
# ¿ Dec 1, 2010 16:43 |
|
Take a look at this http://docs.python.org/library/string.html#formatspec and this http://docs.python.org/library/functions.html#format. The line should look like this: code:
Janitor Prime fucked around with this message at 18:39 on Dec 24, 2010 |
# ¿ Dec 24, 2010 18:36 |
|
csammis posted:Feelin' sorry for all you guys with computer science degrees that should have been labeled "software engineering" Haha I was about to respond before you edited it. But honestly that's the problem with most schools they either teach too much of one thing or the other. It's hard to find the right balance, but I feel it's what most schools should strive for if they want to create marketable graduates.
|
# ¿ Feb 2, 2011 16:43 |
|
Bob Morales posted:There's a lot to be said for people who program in the old 'BASIC interpreter' style. Write a few lines, run it, change some stuff, run it again... I find myself doing this a lot when I don't know the API of some library I want to use.
|
# ¿ Mar 20, 2011 03:37 |
|
Otto Skorzeny posted:BigRedDot, half the poo poo you mentioned doesn't apply to mobile or console processors, none of it applies to embedded processors, as mentioned several items are designed to be tranparent to the programmer at any level above microcode (eg. instruction pipelining and out-of-order execution, the latter of which is ironic to mention as it transparently mitigates some of the penalties associated with branching and dependency hazards in light of the former and thus makes the abstraction less leaky) and just... ugh. You're straining at gnats and swallowing camels. This is probably the biggest gap in my programming knowledge, but how the hell can I know if my high level (Python, Java, C#) code is provoking cache misses? Is there some profiling tool that can tell me? Do I have to necessarily be programming in some kind of assembly code to get the most out of my embedded hardware, or is just following certain best practices? I've never done any kind of embedded/mobile coding so I'm quite curious to know more on the subject.
|
# ¿ Apr 15, 2011 03:38 |
|
cannibustacap posted:Thanks, my only concern with just making a simple .JAR file and run it through a command line is that it won't return values. I think that if you do a System.exit(#number) that the number is returned to the process that invokes the jar. Or else you could println the stuff you want and simply read the output stream from your C++ app.
|
# ¿ Jun 16, 2011 23:26 |
|
|
# ¿ May 2, 2024 15:25 |
|
System.exit can only affect the JVM.
|
# ¿ Jun 17, 2011 01:32 |