Is it necessary to code RTOS in C language always? Why can't that be coded in java or some other technology..?? Is that because of the absence of pointer concept in java?
Why are Python exceptions named "Error" (e.g. ZeroDivisionError, NameError, TypeError etc)
and not "Exception" (e.g. ZeroDivisionException, NameException, TypeException etc).
I come from a Java background and started to learn Python recently, as such this is confusing because in java there is a distinction between error and exception.
Is there a difference in Python also or not? Can someone explain or point me to some documentation explaining it?
Thank you!
I realized today that I have blindly just followed this requirement for years without ever really asking why. Today, I ran across a NotSerializableException with a model object I created from scratch and I realized enough is enough.
I was told this was because of session replication between load-balanced servers, but I know I've seen other objects at session scope that do not implement Serializable. Is this the real reason?
code
<a href="#" style="width:50px;display:block">london paris itlay milan</a>
output
london paris itlay milan
Why it's not rendering like this
london
paris
itlay
milan
how to achieve output like this without changing in HTML?
I'm new to Scala... Here's the code:
def ack2(m: BigInt, n: BigInt): BigInt = {
val z = BigInt(0)
(m,n) match {
case (z,_) => n+1
case (_,z) => ack2(m-1,1) // Compiler says unreachable code on the paren of ack2(
case _ => ack2(m-1, ack2(m, n-1)) // Compiler says unreachable code on the paren of ack2(
}
}
I'm trying to understand that... why is it giving that error?
Why we need the new in the select statement on one of them?
var runs = from sampleDataTable in db.SampleData
from sampleInfoTable in db.SampleInfo
where sampleDataTable.SampleInfo.SampleInfoId == sampleInfoTable.SampleInfoId
select new {sampleDataTable.Timestamp, sampleDataTable.SampleDataId, sampleInfoTable.Lane} ;
and
var runs2 = from sampleDataTable in db.SampleData
from sampleInfoTable in db.SampleInfo
where sampleDataTable.SampleInfo.SampleInfoId == sampleInfoTable.SampleInfoId
&& sampleDataTable.Timestamp == timestamp
select sampleInfoTable.Lane;
I have classes SearchToUser and getFilesToWord. GetFilesToWord must inherit SearchToUser fields. Extending works if an empty construction in SearchToUser-class, otherwise:
cannot find symbol
symbol : constructor SearchToUser()
location: class SearchToUser
public class GetFilesToWord extends SearchToUser{
^
1 error
make: *** [all] Error 1
I cannot understand why the empty constructor is required for extending.
Java allows identifier to start with or contain $ (dollar sign).
e.g int a$b;
But why # is not allowed in an identifier? What is the specific reason? Is # an operator or something in Java?
e.g int a#b;
Yesterday I read a question (now deleted) from a guy asking: "Why my avatar is now a pony?"
Today my avatar changed suddenly, and now I see a pony and a rainbow. but my gravatar still no changed.
What's happening?
Hi All,
I dont want to make this into a "which is better... MVC or WebForms" type of question. Im sure that has been asked a bunch of times here already.
My Question: If I am building a MVC web project, why should I not use an ASP.datagrid control on one of my "Views" .aspx pages?
In java adjectives ending in -able are interfaces Serializable, Comparable etc... So why is Throwable a class? Wouldn't exception handling be easier if Throwable were an interface?
Obviously, changing it now is out the question. But could it be made abstract? Wouldn't that avoid the bad practice of throw new Throwable();
I have several classes that do not really need any state. From the organizational point of view, I would like to put them into hierarchy.
But it seems I can't declare inheritance for static classes.
Something like that:
public static class Base
{
}
public static class Inherited : Base
{
}
will not work.
Why have the designers of the language closed that possibility?
I have to make a presentation at work to convince everyone why they should try coding in Python. So, I thought of taking a poll here...
What is it about Python (features, etc) over other languages that you love?
The reason I usually give is that in Python you forget about the complexities and frills of programming languages and can just focus on producing code that works... What do you think?
I have setup 1 project in VS2010 RC. A workflow console application that simply counts from 1 to 10000 and writes each number to console.
When I execute "F5" this application it takes minutes to finish, but when i execute this application with profiling it finishes in 3-5 seconds.
Does anyone know why?
In Internet Explorer 7, this code executes consistently in 47 ms:
function updateObjectValues() {
$('.objects').html(12345678); // ~500 DIVs
}
however, this code executes consistently in 157 ms:
function updateObjectValues() {
$('.objects').html('12345678'); // ~500 DIVs
}
Passing a number is over 3x faster than a string. Why are these results so dramatically different? And, is there any way to help the performance of the string?
I have a UIViewController and I'm noticing that I've done something to where the didReceiveMemoryWarning method is getting called every time I run it on an actual device.
I've run the project with Run Run With Performance Tool Object Allocations (and Leaks also). There are no leaks but I have no idea how to read or understand the "Object Allocations" data that is displayed.
So ...
How do I read this information and what is/are the best ways to figure out (and resolve) why this is happening?
Thanks
You might keep pondering over this question a million times in your head. When there are so many softwares available that can make the work easy, why to hire web programmer. There is a difference. Building a website on your own and seeking the help of professionals can create a major impact on your business.
Why are the runtime heap used for dynamic memory allocation in C-style languages and the data structure both called "the heap"? Is there some relation?
Just curious as to why Dictionary is not supported by XmlSerializer?
You can get around it easily enough by using DataContractSerializer and writing the object to a XmlTextWriter, but what are the characteristics of a Dictionary that makes it difficult for a XmlSerializer to deal with considering it's really an array of KeyValuePairs.
In fact, you can pass an IDictionary<TKey, TItem> to a method expecting an IEnumerable<KeyValuePairs<TKey, ITem>>.
Why would bitmap outperform vector?
My Flash is for a large Kiosk, with rich media requirements and must function accurately as a counter. I want to keep everything vector for scalability.
When I did a simple FPS test, I noticed my Bitmap version performed perfectly, and the all vector file was noticeably slower.
PLEASE EXPLAIN
• vector performance• what graphic standards I can apply• solutions for using vector
KIOSK TEST ANIMATION
RESULTS
• only text and bitmap perform well, not vector
• background and clouds OK, but more layers slow it down
Seems like every C# static analyzer wants to complain when it sees a public field. But why? Surely there are cases where a public (or internal) field is enough, and there is no point in having a property with its get_ and set_ methods? What if I know for sure that I won't be redefining the field or adding to it (side effects are bad, right?) - shouldn't a simple field suffice?
Why does the C# compiler not even complain with a warning on this code? :
if (this == null)
{
// ...
}
Obviously the condition will never be satisfied..
Is the proliferation of open source licenses just another example of programmers living NYI (Not Invented Here) syndrome? I know there are some big differences between some of the big licenses (e.g., GPL, Apache, BSD) but when you start looking to see many projects creating their own licenses. Why?
References:
http://en.wikipedia.org/wiki/Open_source_licenses
http://developer.kde.org/documentation/licensing/licenses_summary.html