I have a friend who wrote code for a large array with 1,048,576 maximum elements. Everything runs fine when complied using ./make but but when using just ./ we get a segmentation fault. It's obviously not too crucial of a prob to solve. Nonetheless, I am very curious about it. if anyone has seen this or has any Ideas as why...
I have searched high and low for an answer to why query results returned in this format and how to convert to a list.
data = cursor.fetchall()
When I print data, it results in:
(('car',), ('boat',), ('plane',), ('truck',))
I want to have the results in a list as ["car", "boat", "plane", "truck"]
Why is it necessary to remove and then re-add a user to a SQL Server database after restoring it from a file?
If I don't do this, I get a "User login failed" when trying to access the database using this username from apps.
I have a web application that uses login and sessions (cookies). Why is it that sometimes, when the iPhone is going slow with the 3G network (super super slow), the iphone doesn't see the cookies?
Cookies don't work when the iPhone network is slow!!!
Why do I never see the prototype property in JavaScript code I edit, from books and documentation I've read, it seems to be a cornerstone of the language.
Possible Duplicate:
GOTO still considered harmful?
I have read articles that advise on refraining from using the goto operator frequently, but never told why. I have googled this for ever and can't really find anything.
Why does many sites (youtube is good example) generate string of random number and letter instead of using for example the row id?
usually its something likes this
bla?v=wli4l73Chc0
instead of like
bla?id=83934
Is it just to keep it short if you have many rows? Or is there other good things about this? Because i can imagine: bla?id=23934234234
dont look so nice
Thanks and cheers
Hi
I've used the "Reduce XAP size by using Application library caching" setting. I see that some dlls are now excluded from the .xap file but some aren't, specifically
System.Reactive.dll
System.Windows.Controls.DataVisualization.Toolkit.dll
System.Windows.Controls.Theming.Toolkit.dll
System.Windows.Controls.Toolkit.dll
Any idea why this is the case?
thanks
In Objective-C, I've seen, for example:
UIPickerView *tweetPicker
and
UIPickerView* tweetPicker
What does the asterisk mean (I know, the first part is a dupe...) and why does it go on different parts of the deceleration in different contexts?
I was wondering if anyone knew why linq to entities always seems to generate left outer joins. I would understand it on an optional relationship but it doesn't make good sense when the relationship is mandatory.
Does anyone have any idea how to make it generate inner joins instead?
I have a struct like this, with an explicit conversion to float:
struct TwFix32
{
public static explicit operator float(TwFix32 x) { ... }
}
I can convert a TwFix32 to int with a single explicit cast: (int)fix32
But to convert it to decimal, I have to use two casts: (decimal)(float)fix32
There is no implicit conversion from float to either int or decimal. Why does the compiler let me omit the intermediate cast to float when I'm going to int, but not when I'm going to decimal?
I'm new to Python, and I know I must be missing something pretty simple, but why doesn't this very, very simple code work?
class myClass:
pass
testObject = myClass
print testObject.__class__
I get the following error:
AttributeError: class myClass has no attribute '__class__'
Doesn't every object in Python have a __class__ attribute?
Questions:
What are raw types in Java, and whydo I often hear that they shouldn't be used in new code?
What is the alternative if we can't use raw types, and how is it better?
Similar questions
Should Java Raw Types be Deprecated?
If I understand it correctly this means
extern void foo();
that the function foo is declared in another translation unit.
1) Why not just #include the header in which this function is declared?
2) How does the linker know where to look for function at linking time?
I have a static method [Method1] in my class, which calls another method [Method2] in the same class and is not a static method. But this is a no-no. I get this error:
An object reference is required for
the non-static field, method, or
property "ClassName.MethodName()"
Can someone please briefly describe why? including other things that might be related to this.
It's always seemed a little at odds with the principles of Java that the Java Servlet Spec (2.5 version here) includes a set of magic attributes containing info about included resources, namely:
javax.servlet.include.request_uri
javax.servlet.include.context_path
javax.servlet.include.servlet_path
javax.servlet.include.path_info
javax.servlet.include.query_string
It's not even specifically pointed out in the API documentation, only in the spec where it is a must for correct implementation.
This approach feels very wrong, an exposed implementation detail that clients will use and depend on. Why is this information exposed in this way?
Let's assume that I have files a.cpp b.cpp and file c.h. Both of the cpp files include the c.h file. The header file contains a bunch of const int definitions and when I compile them I get no errors and yet I can access those const as if they were global variables. So the question, why don't I get any compilation errors if I have multiple const definitions as well as these const int's having global-like scope?
Hi,
I have set break points on my attached properties SetXXX and GetXXX static methods. In Xaml, I have assigned values to the attached property. However, I was expecting the Set or Get static methods to be called but they are not. The attached property works as expected and if I call SetXXX and GetXXX methods in code, then it works are expected.
Why are the methods not called when set from Xaml?
JD.
When I rename a table column in Designer mode in SQL Server Management Studio 2008 (both R2 and non-R2) and generate a change script it looks like this:
EXECUTE sp_rename N'table.column', N'Tmp_columnNew', 'COLUMN'
GO
EXECUTE sp_rename N'table.Tmp_columnNew', N'columnNew', 'COLUMN'
GO
What for temporary column name is used? Why don't rename at once?
I have the following code
class Transcription(object):
WORD = 0
PHONE = 1
STATE = 2
def __init__(self):
self.transcriptions = []
def align_transcription(self,model,target=Transcription.PHONE):
pass
The important part here is that I would like to have a class member as default value for a variable. This however gives the following error:
NameError: name 'Transcription' is not defined
Why is this not possible and what is the right (pythonic) way to do something like this.