language-features

PHP hidden trick or a supported feature?

Hi, I know that to concatenate strings in php, a dot should be used: echo 'hello' . ' world'; // hello world But incidentally i typed this: echo 'hello' , ' world'; and the result was still hello world without any errors. Why is it so? Can we also concatenate using comma? ...

Where to find resources for learning C++ features and possibilities?

What is the problem? For quite a few years I've been coding workarounds and such stuff cause I didn't know there was an "easier" or actually the normal way to do something - and I didn't ask either. Recently I've discovered plenty of can't live without stuff like templates, forward declarations and similar stuff. Now, what I'd like is a...

Moving from Classic ASP to ASP.net

Hi all! I've come from a Classic ASP background, done it for years and years and moving to .net has been way overdue, so I've started to learn .net. It's very different to say the least! It's structured a lot differently, and seems to work a lot differently, it's a huge leap upwards. However, it is appearing to me to be more and more...

Would JavaScript fare any better had it been multithreaded

This is a follow up question to Is there a point to multithreading? If JavaScript were multithreaded, would it fare better than the existing system? Would multithreading with one UI thread and other tasks in different threads (background) bring in greater responsiveness and efficient usage of resources? Why did the designers of th...

Which existing language features are the most difficult to implement and why?

Looking at some language features I sometimes wonder how on earth would someone implement a functionality like this. So my question is, which of the numerous existing language features are the hardest to implement? An explanation why is it so is most welcome (maybe even required?). To maintain order, please only one feature per post. ...

What advantages does Scala have over Java for concurrent programming?

How can scala make writing multi-threaded programs easier than in java? What can scala do (that java can't) to facilitate taking advantage of multiple processors? ...

Appended '= x' after a method declaration in c++.

In C++, when a method is declared, I've noticed that sometime the method may have an assignement appended to it. Could anyone tell me what this is? For example: virtual void MyMethod () = 0; What doe the '= 0' mean. :) Thanks everyone !!! ...

Is there a better C?

I want a better C. Let me explain: I do a lot of programming in C, which is required for applications that have real-time needs such as audio programming, robotics, device drivers, etc. While I love C, one thing that gets on my nerves after having spent a lot of time with Haskell is the lack of a proper type system. That is, as soon ...

Why cannot I create private classes in C#?

This is question for philosophers in .net. I`m understanding, that Microsoft consciously denied using private classes. So, what are their arguments, why they did so? For example I'm building big application, and part of it is Report Tool. This tool is using lot of business objects, but these objects, are used only there, and they are us...

Convert non-English text into readable format

Hi, I am obtaining strings from the web which often contain accented characters not recognised from within my application. Edit - I'm obtaining my string using the HtmlAgilityPack. I am taking the InnerText of a <title> tag. Whilst doing this the Pack uses a different encoding from the original HTML document (I'm not sure which ones th...

How can I change a site's default language after creation (sharepoint 2010)?

after creating a site you can go to: Site Actions / Site Settings / Site Administration / Language Settings and select some alternate language(s) if you've got some language pack(s) installed, but the default one is fix and you can't cange it anymore. Is there a way or some settings.file where you can change the default language? ...

Does Perl language aim at producing fast programs at runtime?

I recently had a friend tell me "see perl was never designed to be fast" Is that true? The relevant piece of information I can find is this from Wikipedia: The language is intended to be practical (easy to use, efficient, complete) rather than beautiful (tiny, elegant, minimal). But it doesn't directly talk about speed. I ...

How to deal with the immutability of returned structs?

I'm writing a game that has a huge 2D array of "cells". A cell takes only 3 bytes. I also have a class called CellMap, which contains the 2D array as a private field, and provides access to it via a public indexer. Profiling showed that a performance problem is caused by garbage collection of too many Cell objects. So I decided to make ...

What is the name and reason for member variable assignment between function name and curly braces?

Look at this code snippet: Size::Size(int iSetWidth, int iSetHeight) :iWidth(iSetWidth), iHeight(iSetHeight) { } Supposedly, this means the same thing as: Size::Size(int iSetWidth, int iSetHeight) { iWidth=iSetWidth; iHeight=iSetHeight; } Why would you use the former or the latter? And what is the name of the former? ...

how can we override method in child class without using "virtual" in parent class

This is a interview question. So is it possible to override a method without virtual specified in parent method? ...

Hiding derive class method?

Can we hide the derived class public method so that it is not accessible in Main() function in C#. We can't change the accessors of the derived class method. public class A { public void Add() { } } public class B : A { public void Multiply() { } } In main() method in C# B b = new B(); b.m...

Implementing Addition in Inheriting Classes with Generics.

With the structure.. abstract class Unit { int Id; } class Measure : Unit { int Current; int Baseline; } class Weight : Unit { int Minimum; int Maximum; int Current; } I basically want to add an "Add" method for adding, say, two Measures together, or adding two Weights together. But it needs to be in the Unit base class. So ba...

How to put two condition in lambda expression

I have two Repeater Control var list = from i in DA.obm_view_studentLists where i.FranchiseID == FranchiseID && i.ExamDate == DateTime.Parse(this.pallavi.DropDownSelectedValue) select i; I want to get result in 1 go from database. this._approvedStudentList.DataSource = list.Select(e => e.ApprovedByOBM == true); this._pendingStudentL...

What does it mean if a method call starts with two colons?

A coworker routinely writes something like this: ::someObject->someMethod(anAttribute, anotherAttribute); someObject is a global variable. Those two colons seem strange to me. The code compiles and runs just fine without them. The coworker claims that those colons make someObject explicitly global and thus prevent confusion with a po...

Does this language have its niche | future?

I am working on a new language, targeted for web development, embeding into applications, distributed applications, high-reliability software (but this is for distant future). Also, it's target to reduce development expenses in long term - more time to write safer code and less support later. And finally, it enforces many things that re...