programming-languages

difference between (int) and convert.toint32 in c#

半世苍凉 提交于 2020-01-24 17:42:05
问题 when i convert a object to int by (int)object then when the object value is 0 then he give me error that specific cast not valid. when i convert a object to int by convert.toint32(object) then he works and give me 0 means cast is valid. and i want to know that what is difference between both. 1. (int)object 2.convert.toint32(object) 回答1: There are many ways to convert to an int, a lot depends on what your source is. The biggest thing to keep in mind is error checking, none of the methods are

How do you measure the popularity of a programming language?

我的梦境 提交于 2020-01-24 08:23:19
问题 Following on from this question, I am interested in finding out how you could measure the popularity of any and all programming languages. As professional developers, we need to be aware of the trends in the software industry - what languages will employers be looking for in the coming few years, and we should be proficient in. Also, it can allow us to spot opportunities - perhaps there are opportunities for new developers to branch out into mainframe programming as older members of the

How do you measure the popularity of a programming language?

試著忘記壹切 提交于 2020-01-24 08:21:23
问题 Following on from this question, I am interested in finding out how you could measure the popularity of any and all programming languages. As professional developers, we need to be aware of the trends in the software industry - what languages will employers be looking for in the coming few years, and we should be proficient in. Also, it can allow us to spot opportunities - perhaps there are opportunities for new developers to branch out into mainframe programming as older members of the

Would you call it level or depth?

和自甴很熟 提交于 2020-01-24 02:59:06
问题 Which word would you pick to label the absolute stack level of an element—in other words its degree of nesting relative to the root/document element? Between level and depth which one would you choose and why? What is commonly used or preferred? Which one would you find less confusing in the absence of a meaningful context? I tried checking the XML specification without much success. 回答1: I call it Depth . As we know, XML is a Node based structure . We all know that in Data Structures we use

Is there a relationship between untyped/typed code quotations in F# and macro hygiene?

最后都变了- 提交于 2020-01-23 07:20:31
问题 I wonder if there is a relationship between untyped/typed code quotations in F# and the hygiene of macro systems. Do they solve the same issues in their respective languages or are they separate concerns? 回答1: Quotations are a form of meta-programming. They allow you to manipulate abstract syntax trees programmatically, which can be in turned spliced into code, and evaluated. Typed quotations embed the reified type of the AST in the host language's type system, so they ensure you cannot

Static allocation of huge amounts of memory inside the main function

南笙酒味 提交于 2020-01-21 12:24:12
问题 I have a program that has to declare a huge integer array of the size 1000000 in C (using GNU GCC compiler). I tried to declare the array in two different ways. The two possible codes are : #include <stdio.h> int arr[1000000]; int main() { return 0; } and #include <stdio.h> int main() { int arr[1000000]; return 0; } The latter version hangs during runtime. What could be the possible reason? Thanks a lot!!! 回答1: The second version allocates on the stack, the size of which may be limited on

Is there an “opposite” to the null coalescing operator? (…in any language?)

坚强是说给别人听的谎言 提交于 2020-01-19 04:43:07
问题 null coalescing translates roughly to return x, unless it is null, in which case return y I often need return null if x is null, otherwise return x.y I can use return x == null ? null : x.y; Not bad, but that null in the middle always bothers me -- it seems superfluous. I'd prefer something like return x :: x.y; , where what follows the :: is evaluated only if what precedes it is not null . I see this as almost an opposite to null coalescence, kind of mixed in with a terse, inline null-check,

Is there an “opposite” to the null coalescing operator? (…in any language?)

為{幸葍}努か 提交于 2020-01-19 04:43:05
问题 null coalescing translates roughly to return x, unless it is null, in which case return y I often need return null if x is null, otherwise return x.y I can use return x == null ? null : x.y; Not bad, but that null in the middle always bothers me -- it seems superfluous. I'd prefer something like return x :: x.y; , where what follows the :: is evaluated only if what precedes it is not null . I see this as almost an opposite to null coalescence, kind of mixed in with a terse, inline null-check,

Is divide by zero an error or an exception?

僤鯓⒐⒋嵵緔 提交于 2020-01-15 02:30:24
问题 Basically I want to know how do you differentiate an error from an exception. In some programming languages accessing a non existent file throws an error and in others its an exception. How do you know if some thing is an error or an exception? 回答1: Like anything else - you either test it or read the documentation. It can be an "Error" or an "Exception" based on the language. Eg. C: Crashes and gives a divide by zero error. Ruby: >> 6 / 0 ZeroDivisionError: divided by 0 from (irb):1:in `/'

SuperCollider not audible on headphone

南楼画角 提交于 2020-01-14 22:42:46
问题 I am just beginning to learn audio programming using supercollider. When I play a sound I am able to hear it on speakers but not headphone. I get the following message on starting server - booting 57110 localhost JackDriver: client name is 'SuperCollider' SC_AudioDriver: sample rate = 48000.000000, driver's block size = 1024 JackDriver: connected system:capture_1 to SuperCollider:in_1 JackDriver: connected system:capture_2 to SuperCollider:in_2 JackDriver: connected SuperCollider:out_1 to