Questions

"X does not name a type" error in C++

I have two classes declared as below: ``` class User { public: MyMessageBox dataMsgBox; }; class MyMessageBox { public: void sendMessage(Message *msg, User *recvr); Message receiveMessage(); ...

13 Mar at 18:26

How to check type of variable in Java?

How can I check to make sure my variable is an int, array, double, etc...? Edit: For example, how can I check that a variable is an array? Is there some function to do this?

22 Oct at 04:51

How to convert String object to Boolean Object?

How to convert `String` object to `Boolean` object?

26 Sep at 05:46

Why am I getting AttributeError: Object has no attribute?

I have a class MyThread. In that, I have a method sample. I am trying to run it from within the same object context. Please have a look at the code: ``` class myThread (threading.Thread): def __in...

How can I use an ES6 import in Node.js?

I'm trying to get the hang of ES6 imports in Node.js and am trying to use the syntax provided in this example: ### Cheatsheet Link I'm looking through [the support table](http://node.green/), but I...

12 Oct at 19:39

Pandas create empty DataFrame with only column names

I have a dynamic DataFrame which works fine, but when there are no data to be added into the DataFrame I get an error. And therefore I need a solution to create an empty DataFrame with only the column...

28 Jan at 21:56

How to use 'cp' command to exclude a specific directory?

I want to copy all files in a directory except some files in a specific sub-directory. I have noticed that `cp` command didn't have the `--exclude` option. So, how can I achieve this?

13 Jan at 00:0

Java code for getting current time

I am searching code in `java` for fetching or synchronizing my local PC system time into my application.

13 Dec at 20:44

How do I update Anaconda?

I have Anaconda installed on my computer and I'd like to update it. In Navigator I can see that there are several individual packages that can be updated, but also an `anaconda` package that sometime...

19 Jul at 17:55

Write to .txt file?

How can I write a little piece of text into a `.txt` file? I've been Googling for over 3-4 hours, but can't find out how to do it. `fwrite();` has so many arguments, and I don't know how to use it. Wh...

29 Apr at 11:24

Redirecting to URL in Flask

I'm trying to do the equivalent of `Response.redirect` as in C# - i.e.: redirect to a specific URL - how do I go about this? Here is my code: ``` import os from flask import Flask app = Flask(__name_...

29 Dec at 00:50

CSS text-overflow: ellipsis; not working?

I don't know why this simple CSS isn't working... ``` .app a { height: 18px; width: 140px; padding: 0; overflow: hidden; position: relative; margin: 0 5px 0 5px; text-align: center; t...

7 Jan at 21:26

Pseudo-terminal will not be allocated because stdin is not a terminal

I am trying to write a shell script that creates some directories on a remote server and then uses scp to copy files from my local machine onto the remote. Here's what I have so far: ``` ssh -t user@...

14 Dec at 15:27

Your branch is ahead of 'origin/master' by 3 commits

I am getting the following when running `git status` ``` Your branch is ahead of 'origin/master' by 3 commits. ``` I have read on some other post the way to fix this is run `git pull --rebase` but ...

30 Oct at 02:43

How to deal with floating point number precision in JavaScript?

I have the following dummy test script: ``` function test() { var x = 0.1 * 0.2; document.write(x); } test(); ``` This will print the result `0.020000000000000004` while it should just print `...

18 Jul at 21:35

Initialize a byte array to a certain value, other than the default null?

I'm busy rewriting an old project that was done in C++, to C#. My task is to rewrite the program so that it functions as close to the original as possible. During a bunch of file-handling the previ...

23 Jul at 13:34

How to reload/refresh jQuery dataTable?

I am trying to implement functionality whereby clicking a button on the screen will cause my [jQuery dataTable](http://datatables.net) to refresh (as the server-side data source may have changed since...

3 Jun at 03:37

How do I get the color from a hexadecimal color code using .NET?

How can I get a color from a hexadecimal color code (e.g. `#FFDFD991`)? I am reading a file and am getting a hexadecimal color code. I need to create the corresponding `System.Windows.Media.Color` in...

22 Sep at 06:18

How to Select a substring in Oracle SQL up to a specific character?

Say I have a table column that has results like: ``` ABC_blahblahblah DEFGH_moreblahblahblah IJKLMNOP_moremoremoremore ``` I would like to be able to write a query that selects this column from sai...

29 May at 16:10

Parse string to date with moment.js

I want to parse the following string with moment.js and output day month year (14 march 2014) I have been reading the docs but without success [http://momentjs.com/docs/#/parsing/now/](http://momentj...

4 Mar at 22:42

React Hook Warnings for async function in useEffect: useEffect function must return a cleanup function or nothing

I was trying the `useEffect` example something like below: ``` useEffect(async () => { try { const response = await fetch(`https://www.reddit.com/r/${subreddit}.json`); const json ...

30 Sep at 23:5

How can I upload files to a server using JSP/Servlet?

How can I upload files to server using JSP/Servlet? I tried this: ``` <form action="upload" method="post"> <input type="text" name="description" /> <input type="file" name="file" /> <input...

error: request for member '..' in '..' which is of non-class type

I have a class with two constructors, one that takes no arguments and one that takes one argument. Creating objects using the constructor that takes one argument works as expected. However, if I crea...

24 Jun at 05:42

add an element to int [] array in java

Want to add or append elements to existing array ``` int[] series = {4,2}; ``` now i want to update the series dynamically with new values i send.. like if i send 3 update series as `int[] series...

9 Apr at 10:38

Add leading zeroes to number in Java?

Is there a better way of getting this result? This function fails if num has more digits than digits, and I feel like it should be in the library somewhere (like Integer.toString(x,"%3d") or something...

1 Apr at 04:59