programming-languages

How to write that in assembly?

I have just started a part time course and I have limited class time. I am really stuck on this question, any help solving it is greatly appreciated! here's the question.... (a) write a subprogram which will take one argument, x, and return x*3 + 1. I.e. a Java method would be int fun(int x){ return x*3 + 1; } (b) Write a fragment o...

What is the actual definition of an array?

Possible Duplicate: Arrays, Whats the point? I tried to ask this question before in What is the difference between an array and a list? but my question was closed before reaching a conclusive answer (more about that). I'm trying to understand what is really meant by the word "array" in computer science. I am trying to reach an...

language popularity figures (C++, C#, Java, PHP, flash script, etc.)

I need to find figures that show how many programmers world wide, has each of the following languages as their primary programming language. C C++ C# Object-C Java JavaScript VB.NET VB6 (or older) VBA PHP flash scripts Ruby Does anyone know of such comparison figures? If not. Do you know of a good way to research this? I could compare...

Recommend a language or tool for manipulating large sets of data

Greetings, I have a large dataset (1GB of pure compressed text). Right now I'm rewriting the dataset based on information in the data, for example: Turn 2009-10-16 into Friday Count the number of times something happen and how long they last for Right now I'm doing all this in Java. I'm wondering if anyone knows of a tool or langu...

How Does Static Typing Limit Macros?

I was reading Paul Graham's "The Hundred-Year Language" article. http://www.paulgraham.com/hundred.html In there he makes a claim that static typing "preclude[s] true macros". For example, types seem to be an inexhaustible source of research papers, despite the fact that static typing seems to preclude true macros-- without...

C++ programmer looking to broaden perspective

I've been programming C++ for about 5 years now, and I now realize the value of knowing how to think "differently." This question is for C++ programmers who tried out other programming languages and came across moments like: "Whaoo..this is sooo cool! I didnt know I can program like that." "Wow, I never thought a design problem could ...

What programs should I learn to be able to do computational modeling?

I've got some free time and I'm looking to learn a programming language or two that I can use for computational modeling (I'm in cognitive science & psychology). I'm not sure if I'll end up doing neural nets, machine learning, AI, or something altogether different, so I'm just looking for a good, broad base to start with, like a nudge in...

Why are closures suddenly useful for optimizing programs to run on multiple cores?

I read an article that claims that closures (or "blocks") are a useful weapon in the "War on Multicores", because [...] they allow you to create units of work, which each have their own copy of the stack, and don’t step on each others toes as a result. What’s more, you can pass these units around like they are values, when ...

Why don't I see pipe operators in most high-level languages?

In Unix shell programming the pipe operator is an extremely powerful tool. With a small set of core utilities, a systems language (like C) and a scripting language (like Python) you can construct extremely compact and powerful shell scripts, that are automatically parallelized by the operating system. Obviously this is a very powerful ...

IBasic Accumulator

I am trying to do an accumulator in IBasic for a college assignment and I have the general stuff down but I cannot get it to accumulate. The code is below. My question is how do I get it to accumulate and pass to the different module. I'm trying to calculate how many right answers the user gets. Also, i need to calculate the percentage ...

What features should Java 7 onwards have to encourage switching from C#?

C# has a good momentum at the moment. What are the features that you would need to have in order to switch (or return) to Java? It would also be quite useful if people posted workarounds for these for the current Java versions, e.g. Nullables being wrapped around custom classes, to make this a much more interesting wiki. ...

Use of special characters in function names

In Ruby, a standard convention is to use a question mark at the end of a method name to indicate the method returns a boolean result: [].empty? #=> true Another standard convention is to end a method name with an exclamation point if the method is destructive (that is, it modifies the original data): mylist.sort! # sort mylist in-p...

What's this language token/keyword/thingy mean?

At the following URL: https://developer.mozilla.org/en/XPCOM_Interface_Reference/nsICacheVisitor is the following code chunk: boolean visitDevice(in string deviceID, in nsICacheDeviceInfo deviceInfo); I thought I was dealing with c++, but "in" is not a c++ keyword according to c++ keyword lists i looked up, nor is it a java keyword. S...

Would aspect oriented programming be a positive addition to the C# language?

I've had some interesting debates with colleagues about the merits if incorporating aspect oriented programming as a native paradigm to the C# language. The debate seems to be divided into three camps: Those folks who think that C# is already too complicated as it is, and another major feature like AOP would only muddy the waters furt...

Writing a native language compiler.

I've to implement my custom native-compiled Windows programming language. Is there an easier way then translating it to ASM, or translating it to C/C++ and then use a C/C++ compiler? Is there any SDK or something? Thank you. ...

What is Haskell actually useful for?

I really hope nobody deems this question as closable because it's a pretty straight forward one. I Googled this question, but not much information was found that was concise and informative for me. For instance, if I start learning Haskell, what can I find myself using it for. What are some common uses for this language that I hear is ...

What features should C# 4.0 onwards have to encourage switching from Java?

Java is a popular language & platform, having a huge ecosystem. Are there any features that C# 4.0 onwards and its platforms should have, to make you completely switch to C# programming? ...

Categorizing Programming Languages

I've worked among others with Java, Prolog, SQL and C# languages so far. I know that Java and C# are imperative, Prolog declarative and SQL somewhat declarative languages. Java and C# are object-oriented and you can develop aspect-oriented programs with them. That's already four different characteristics that certain languages might fit...

What are common file extensions for web programming languages?

What file extensions are used most commonly by different languages? Please don't put source file names (like .java) but rather extensions that would be present in a URL for rendered pages. Here is my (alphabetized) list so far ASP Classic asp ASP.NET aspx axd asx asmx ashx CSS css Coldfusion cfm Erlang yaws Flash swf HTML ...

Should query languages have priority of operator OR higher than priority of AND ?

Traditionally most programming languages have priority of AND higher than priority of OR so that expression "a OR b AND c" is treated as "a OR (b AND c)". Following that idea search engines and query/addressing languages (css,xpath,sql,...) used the same prioritization. Wasn't it mistake ? When dealing with large enough data, that prior...