In every technical publication, and on this site too, people are always comparing OO languages to Smalltalk. My experience is in Java: is Smalltalk so important that I should study it?
Hey Everyone!
I just want to get valuable suggestions from your side that which language should I go for. I have learned C, C++ and Java upto GRADUATION level. Now i want to be professional in any language. Which one should I go for. is it okay to start with VB or any suggestions from your side.
Thank you !
Hello
I am trying to make a list of things which can be difficult/surprising to someone who is changing language from PHP to Python.
so far i have rather short list:
forget require / include, learn import (this was most difficult to me - to understand package - module - class - object hierarchy and its mapping to filesystem)
you can't just upload file on server to have webpage (-mod_python, wsgi etc)
learn the python way for use variable class names (new $class() vs import + getattr)
/ operator in python 2.x and all float-related horrors
those were difficult to me, it takes few days before mind adapts a new paradigm
after i found that there is few other areas which could be challenging for someone with (too) many years of php:
everything is an object
you have to live with exceptions
array vs list, set, dictionary, tuple ...
learn (effective) list comprehensions
learn generators
any other ideas / personal experiences ?
The company I work for now uses a set naming convention for their C# variables such as iSomeName for int, sSomeName for string, aSomeName for arrays, bSomeName for boolean, dSomeName for datetime and so on. My previous employer did not use the i, s, a, b and d prefixes and just named the variables a good understandable name. My impression is that these prefixes lost favor a while ago and from what I read it is not the current trend. It seems fine to me either way as long as the variable is descriptive enough to understand what it is doing but I was wondering what the now-a-day accepted practice is for naming variables?
<?php
echo (2884284 >> 16), '<br>'; // = 44
echo ((2884284 >> 16) & 0xFFFF), '<br>'; // 44
from the above i got 44
so how can i retrive from 44 to 2884284 ???
I know that the Apple community – including Mac and iPhone developers – mainly use Objective-C for their development language. But it seems that not many people use Objective-C outside of the Apple community, such as in the Windows or Linux worlds.
What are the possible reasons that Objective-C is not particularly popular outside of the Apple community?
In the case of an IM client. I have made 2 separate threads to handle sending packets (by std io) and receiving packets. The question is how to make these 2 threads run simultaneously so that I can keep prompting for input while at the same time be ready to receive packets at any time?
I have already tried setting a timer but the data is always lost receiving.
The book of CLR via C# has this line at page 76.
When you install the .NET Framework, tow copies of Microsoft's assembly files are actuall installed. One set is installed into the compiler/CLR directory, and another set is installed into GAC subdirectory
I could find the GAC at C:\Windows\Microsoft.NET\assembly, but I couldn't find the compiler/CLR thing.
What's the physical directory name of compiler/CLR? I mean, where is it?
Why there are two GAC in assembly directory? I find GAC_32 and GAC_MSIL.
Every time i pass some parameters to a JavasScript or jQuery functon, i use some random letters. What are the correct letters for the corresponding variable types?
function(o){} for example is for a object. But what are the other letters? Do someone have a list of those?
somebody knows what does this error mean?
Usage: tcsh [ -bcdefilmnqstvVxX ] [ argument ... ].
I receive this error after I enter in my script this row
#! /bin/tcsh -f
I started off with C in school, went to Java and now I primarily use the P's(Php, Perl, Python) so my exposure to the lower level languages have all but disappeared. I would like to get back into it but I can never justify using C over Perl or Python. What real-world apps are being built with these languages? Any suggestions if I want to dive back in, what can I do with C/C++ that I can't easily do with Perl/Python?
I'm a little bit confused, can somebody please explain the main difference between those types of containers:
map
list
set
array
thanks in advanca(I'm asking about C++)
Hi All,
I have a data card, as soon as i insert the data card, i am getting the events by using wm_device_change event.
But I also want to get event, when my data connect actually connects to out side world.
I mean to say, as soon as we click on connect/disconnect button of data card,i want to get the event.
exactly speaking wanted to know, when connection is established and disconnected.
data card is vodaphone data card and i am trying to browse using that data card. what ever is the SDK, somewhere the OS should get the event of connection and disconnection to network is there any way to access that event which OS is getting. as i can see in notificaiton the changes of vodaphone connection and LAN connection
data card is a USB device having SIM within it, and can be used to access internet through GPRS.
can i know how to do this in win32 c/c++ programe.
with regards
Vinayaka Karjigi
hi all,
in the case of an IM client.
i have made 2 separate threads to handle sending packets (by std io) and receiving packets.
the question is how to make these 2 threads run simultaneously so that i can keep prompting for input while at the same time be ready to receive packets at any time?
i have already tried setting a timer but the data is always lost receiving.
I'm totally confused which one to use and when, first thing I do when something goes wrong in code with a slash is replace the one with other so my test cases double with one for / and one for \ .Help me to get the logic behind slashes.
I'm reading an article about different evaluation strategies (I linked article in wiki, but I'm reading another one not in English). And it says that unlike to call-by-name and call-by-need strategies, call-by-value strategy is not Turing complete.
Can anybody explain, please, why is it so? If it's possible, add an example pls.
i have known that winpcap library enabled a person to obtain advanced information about installed devices...
given all the networking devices found in the computer, how will i know which one of this has an internet connection?!
thanks:)
You can share your code or other's code. Here's a snippet from an array function in Kohana:
public static function rotate($source_array, $keep_keys = TRUE)
{
$new_array = array();
foreach ($source_array as $key => $value)
{
$value = ($keep_keys === TRUE) ? $value : array_values($value);
foreach ($value as $k => $v)
{
$new_array[$k][$key] = $v;
}
}
return $new_array;
}
It was helpful when I was uploading multiple images using multiple file upload forms. It turned this array
array('images' => array(
'name' => array(
0 => 'img1',
1 => 'img0',
2 =>'img2'
),
'error' => array(
0 => '',
1 => '',
2 => ''
into :
array('images' => array(
0 => array(
'name' => 'img1'
'error' => ''
),//rest goes here
How about you? What 20 or less lines of code did you find useful?
I'm guessing that there must be a better functional way of expressing the following:
def foo(i: Any) : Int
if (foo(a) < foo(b)) a else b
So in this example f == foo and p == _ < _. There's bound to be some masterful cleverness in scalaz for this! I can see that using BooleanW I can write:
p(f(a), f(b)).option(a).getOrElse(b)
But I was sure that I would be able to write some code which only referred to a and b once. If this exists it must be on some combination of Function1W and something else but scalaz is a bit of a mystery to me!
EDIT: I guess what I'm asking here is not "how do I write this?" but "What is the correct name and signature for such a function and does it have anything to do with FP stuff I do not yet understand like Kleisli, Comonad etc?"
I'm currently working on a project Euler problem (www.projecteuler.net) for fun but have hit a stumbling block. One of the problem provides a 20x20 grid of numbers and asks for the greatest product of 4 numbers on a straight line. This line can be either horizontal, vertical, or diagonal.
Using a procedural language I'd have no problem solving this, but part of my motivation for doing these problems in the first place is to gain more experience and learn more Haskell.
As of right now I'm reading in the grid and converting it to a list of list of ints, eg -- [[Int]]. This makes the horizontal multiplication trivial, and by transposing this grid the vertical also becomes trivial.
The diagonal is what is giving me trouble. I've thought of a few ways where I could use explicit array slicing or indexing, to get a solution, but it seems overly complicated and hackey. I believe there is probably an elegant, functional solution here, and I'd love to hear what others can come up with.
cut -d" " -f2 ${2} | $callsTo
hello, can somebody please explain can I pipe the result of cut to variable callsTo, and how will it be stored, as the string or list?
I have this snippet of the code in my header:
class A {
private:
int player;
public:
A(int initPlayer = 0);
A(const A&);
A& operator=(const A&);
~A();
void foo() const;
friend int operator==(const A& i, const A& member) const;
};
implementation of the operator==
int operator==(const A& i, const A& member) const{
if(i.player == member.player){
return 1;
}
return 0;
}
and I need casting for this part of my code:
A *pa1 = new A(a2);
assert(i == *pa1);
i - is some int, which my function receives
I receive an error non-member function, How can I fix it? thanks in advance
Hi,
what the syntax is in Action Mailer Basics rails guide ?
class UserMailer < ActionMailer::Base
def welcome_email(user)
recipients user.email
from "My Awesome Site Notifications <[email protected]>"
subject "Welcome to My Awesome Site"
sent_on Time.now
body {:user => user, :url => "http://example.com/login"}
end
end
How should i understand the construction, like
from "Some text for this field"
Is it an assignment the value to a variable, called "from" ?