FAQ Database Discussion Community


Checking, if optional parameter is provided in Dart

syntax,dart,syntax-error,questionmark
I'm new to Dart and just learning the basics. The Dart-Homepage shows following: It turns out that Dart does indeed have a way to ask if an optional parameter was provided when the method was called. Just use the question mark parameter syntax. Here is an example: void alignDingleArm(num axis,...

Serialdata communication between c# and arduino

c#,serial-port,arduino,questionmark
here is my problem. I use thise piece of code to send a string to my arduino with a serialport: Arduino.Open(); Arduino.WriteLine("1.5,3.7,2"); After that I receive it with my arduino like this: char buffer[12]; String inc; void setup() { Serial.begin(115200); } void loop() { if (Serial.available() >= 11) { for...

Does every exception have an required try-catch?

java,exception,try-catch,questionmark
A simple question and I can't find the answer for it. Is it required to every exception in Java to use a try-catch? Or is it only for the FileNotFoundException? A lot of exceptions (IndexOutOfBoundException, ArithmeticException, IlligalArgumentException, NullPointerException) are saying that they didn't need an Exception, but FileNotFoundException does)... and...

Swift: call methods of an optional variable

swift,optional,questionmark
So I know the difference between '!' and '?', I just want to know what is the best way to use them when calling a method of an optional variable var bar: Bar? = nil bar?.doSomething() // this will be valid, but wouldn't call doSomething bar!.doSomething() // Given error: EXC_BAD_INSTRUCTIONS...

XMLPullParser black diamond question marks with certain characters

android,xml,character-encoding,xmlpullparser,questionmark
I'm making an android app, that needs to fetch and parse XML. The class for that was made following the instructions from here http://www.tutorialspoint.com/android/android_rss_reader.htm and the fetcher method looks like this: public void fetchXML() { Thread thread = new Thread(new Runnable() { @Override public void run() { try { URL...

OSX C++ Xcode: Pasting long input into console gives upside down question marks

c++,import,cin,getline,questionmark
We've made a program that takes a long string of tab-delimited input pasted into the console window and splits it up into the correct variables. However, lately with some long strings of metadata, a bunch of upside down question marks have appeared - sometimes after what has been pasted in,...

Celery worker's log contains question marks (???) instead of correct unicode characters

python,logging,unicode,celery,questionmark
I'm using Celery 3.1.18 with Python 2.7.8 on CentOS 6.5. In a Celery task module, I have the following code: # someapp/tasks.py from celery import shared_task from celery.utils.log import get_task_logger logger = get_task_logger(__name__) @shared_task() def foo(): logger.info('Test output: %s', u"测试中") I use the initd script here to run a Celery...