language

What are good examples to get a feeling of a languages OO features and constructs?

I have been searching for short and good examples to demonstrate OO features of a language as an introduction to fellow programmers. By "good", I mean, they can be run and output something rather meaningful not foobar stuff. For instance, you can demonstrate most control flow constructs by a mandelbrot set example or functional aspects ...

C# 3.0: Fill in objects with different behaviour in collections

I want to fill items in a combobox, each of them has different behaviour. Yes I know I could simply create 3 classes deriving from a base class. But my question is kind of "is there another way" and "what is possible". In Java one can do "new MyClass(){public void overriddenmethod(){...} }" but in C# we can not, can we? Now I use a lamb...

Why too little index on chinese sites from google?

It is really strange that my company website has been release for long time already and I also submit sitemap to google but the index seem very very little (about 300 links only) which is really unbelievable. I do the same for the English portal it has very big index on google. I just wonder if google has problem with index portal in ch...

How can I write my context-free grammar?

I'm trying to write a CFG over the alphabet Σ = {a,b} for all words starting and ending with the same number of a's, with at least one b in the middle. Now I understand the basic concept of CFG, variables, production rules, etc. Unfortunately I've run out of ideas for writing the aforementioned CFG. All I've got so far is S → aYXYa X →...

How to make a .Net or JVM language?

I am seeing all these new languages for .NET and JVM. How does one begin to make one? I can't find any good documentation on JVM or MSIL specifications. Edit I already know how to parse, I am more interested in how there are so many people making new languages that are based on those platforms. ...

Please help me define a language in EBNF

Give the EBNF specification for the language L that is made up of the chars a, b and c such that sentences in the language have the form L : sqsR -s is a string of any combination of the characters a and b -sR is that same string s reversed -q is an odd number of c's followed by either an odd number of b's or an even number ...

Making a language, need a good backend.

I want to make a compiled language. I am currently evaluating backends. So far I am looking at C because of its speed of execution, compiling, and a small, easy to use compiler called TCC. Having read the discussions here about using it as an intermediate language, I am trying to think about how to make it compatible with garbage collec...

Which web-development language is best for a C programmer?

Question I program in C (ANSI C89/ISO C90) in a *n*x environment on a regular basis. I am now in a position where it would be beneficial for me to learn a web-development language. In particular, I'm looking to learn a language which: ...exploits my background as a C programmer. ...can produce the level of interactiveness of a web-sit...

Language for controllers names in ASP.NET MVC

Should my controllers names be in my native language or in English? What is the current best practice? And if in English, how do I make sure that the urls stays in my native tongue? I know that my webapp won't be multilingual and I rather not write a lot of boilerplate. ...

Why isn't the 'D' language picking up?

Anybody using language 'D'? Why isn't it more popular? ...

Visual-small size language

I need to develop a simple Windows application with 6 or 7 forms. Its main purpose is to manage files and launch a external program. These are my wishes, in descending importance order Free Be Visual, I mean, the possibility to paint forms and object in the screen. Possibility to carry it in a USB pen-drive. I need a light/small s...

Static method hides instance method ! Anybody, please throw light!

Edit: I have asked question to understand why C# designers chose it to behave in particular fashion? Similar question has been asked, but this is little different. Should following code give warning? class Foo { public void Do() { /*...*/ } /*...*/ } class Bar : Foo { public static void Do() { /*...*/ } /*...*/ } It gives: "warning...

xhtml document - Lang options question...

Dear all What is the difference between the 2 lines shown below?: <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-GB"> <meta http-equiv="content-language" content="en-GB" /> If i didn't have the meta tag, what would be the consequence? Does the meta one affect screen readers and the top one not? I'm a bit confused as to wha...

How to find world region (or country) or language from the windows registry?

I'm working with a very old installer that can read Registry entries but has a difficulty (complex) time executing Windows APIs. I'm trying to detect whether the PC it's being installed on is in Australia. Any ideas? ...

Split a text into single words

Hello! I would like to split a text into single words using PHP. Do you have any idea how to achieve this? My approach: function tokenizer($text) { $text = trim(strtolower($text)); $punctuation = '/[^a-z0-9äöüß-]/'; $result = preg_split($punctuation, $text, -1, PREG_SPLIT_NO_EMPTY); for ($i = 0; $i < count($result); $i...

What does it really mean that a programming language is stackless?

According to this answer http://stackoverflow.com/questions/551950/what-stackless-programming-languages-are-available/671296#671296 all of these programming languages are stackless Stackless Python PyPy Lisp Scheme Tcl Lua Parrot VM What does it really mean for them to be stackless? Does it mean they don't use a call stack? If the...

How do I get foreign characters in a select/dropdown list to display properly in IE 7?

I have tested in IE6, Firefox 3.0.5 and Chrome and they all work. In IE7 it displays as boxes. For example: <select name="selectact" id="selectact"> <option value="page" selected="selected">网 页</option> <option value="news">新 闻</option> <option value="trade">行 业</option> <option value="area">区 域</option> <option value="web">网 站</op...

MySQL Fulltext Searching ideographic (Asian) characters

I have a database full of Asian-character filled records (Chinese, Japanese, and Korean) alongside those with Latin-character filled records (English, Français, you name it), and I want to perform fulltext searches on them. MySQL http://dev.mysql.com/doc/refman/5.1/en/fulltext-restrictions.html%29">says: Ideographic languages such a...

Does anyone know of a good library for mapping a person's name to his or her sex?

I am looking for a library or database that can provide guesses about whether a person is male or female based on his or her name or nickname. Something like john => "M", mary => "F", alex => "A", #ambiguous I am looking for something that supports names other than English names (such as Japanese, Indian, etc.). Before I get anoth...

C Programming Data Types

A question was asked, and I am not sure whether I gave an accurate answer or not. The question was, why use int, why not char, why are they separate? It's all reserved in memory, and bits, why data types have categories? Can anyone shed some light upon it? ...