Questions

Write to UTF-8 file in Python

I'm really confused with the `codecs.open function`. When I do: ``` file = codecs.open("temp", "w", "utf-8") file.write(codecs.BOM_UTF8) file.close() ``` It gives me the error > UnicodeDecodeError...

What is a wrapper class?

What is a wrapper class? How are such classes useful?

20 May at 17:42

How to ignore deprecation warnings in Python

I keep getting this : ``` DeprecationWarning: integer argument expected, got float ``` How do I make this message go away? Is there a way to avoid warnings in Python?

10 Aug at 23:31

How do you force a makefile to rebuild a target?

I have a makefile that builds and then calls another makefile. Since this makefile calls more makefiles that does the work it doesn't really change. Thus it keeps thinking the project is built and up ...

18 Mar at 19:19

Make Git automatically remove trailing white space before committing

I'm using Git with my team and would like to remove white space changes from my diffs, logs, merges, etc. I'm assuming that the easiest way to do this would be for Git to automatically remove trailing...

17 Apr at 12:43

How can I disable a button in a jQuery dialog from a function?

I have a jQuery dialog that requires the user to enter certain information. In this form, I have a "continue" button. I would like this "continue" button to only be enabled once all the fields have co...

8 Feb at 00:49

How to make child process die after parent exits?

Suppose I have a process which spawns exactly one child process. Now when the parent process exits for whatever reason (normally or abnormally, by kill, ^C, assert failure or anything else) I want the...

23 May at 12:3

Bring a window to the front in WPF

How can I bring my WPF application to the front of the desktop? So far I've tried: ``` SwitchToThisWindow(new WindowInteropHelper(Application.Current.MainWindow).Handle, true); SetWindowPos(new Wind...

6 Dec at 18:11

Exception thrown inside catch block - will it be caught again?

This may seem like a programming 101 question and I had thought I knew the answer but now find myself needing to double check. In this piece of code below, will the exception thrown in the first catch...

7 Aug at 02:30

How do I update Ruby Gems from behind a Proxy (ISA-NTLM)

The firewall I'm behind is running Microsoft ISA server in NTLM-only mode. Hash anyone have success getting their Ruby gems to install/update via Ruby SSPI gem or other method? ... or am I just being...

29 Jan at 18:13

Make a VStack fill the width of the screen in SwiftUI

Given this code: ``` import SwiftUI struct ContentView: View { var body: some View { VStack(alignment: .leading) { Text("Title") .font(.title) Text("Content") .line...

18 Apr at 07:39

Space between Column's children in Flutter

I have a `Column` widget with two `TextField` widgets as children and I want to have some space between both of them. I already tried `mainAxisAlignment: MainAxisAlignment.spaceAround`, but the resul...

3 Jan at 03:57

Difference between HttpModule and HttpClientModule

Which one to use to build a mock web service to test the Angular 4 app?

Error:Execution failed for task ':app:compileDebugKotlin'. > Compilation error. See log for more details

``` Error:Execution failed for task ':app:compileDebugKotlin'. > Compilation error. See log for more details ``` build:gradle(Module:app) ``` buildscript { repositories { maven { ...

Automatically hard wrap lines at column in VSCode

How can I automatically hard wrap lines in VSCode? By that I mean if a line reaches a specified column, automatically insert a newline at the word boundary closest to that column without going over. V...

30 Mar at 15:29

How to list files in windows using command prompt (cmd). I've tried using ' ls ' as in Linux but it shows an error?

When I tried to use list `ls` on a Windows command prompt, the system doesn't recognize it. I already added `C:\Windows\System32` in the path.

22 Jun at 21:5

Running a single test file

Is there a way to run `ng test` for a single file instead of for the entire test suite? Ideally, I'd like to get the quickest possible feedback loop when I'm editing a file, but `karma` executes the ...

Visual Studio Code cannot detect installed Git

Visual Studio Code reports "It look like git is not installed on your system." when I try to switch to the git view. I know I have git installed and used by other Git clients. I guess if I reinstall G...

17 Dec at 01:55

How to remove/ignore :hover css style on touch devices

I want to ignore all `:hover` CSS declarations if a user visits our website via touch device. Because the `:hover` CSS does not make sense, and it can even be disturbing if a tablet triggers it on cli...

1 Dec at 20:8

Android Facebook integration with invalid key hash

In one of my apps I need to get data from Facebook... I am doing this: I have created . It logs in successfully, but after logging out, I log in, and then it gives me: ![Screenshot of invalid key ha...

19 Nov at 16:29

Date query with ISODate in mongodb doesn't seem to work

I don't seem to be able to get even the most basic date query to work in MongoDB. With a document that looks something like this: ``` { "_id" : "foobar/201310", "ap" : "foobar", "dt" : I...

28 Feb at 17:55

Use URI builder in Android or create URL with variables

I'm developing an Android app. I need to build a URI for my app to make an API request. Unless there's another way to put a variable in a URI, this is the easiest way I've found. I found that you need...

21 Sep at 18:14

Change all files and folders permissions of a directory to 644/755

How would I change all files to 644 and all folders to 755 using `chmod` from the `linux` command prompt? (Terminal)

2 Feb at 19:5

Make function wait until element exists

I'm trying to add a canvas over another canvas – how can I make this function wait to start until the first canvas is created? ``` function PaintObject(brush) { this.started = false; // get...

16 Feb at 03:49

Change Schema Name Of Table In SQL

I want to change schema name of table `Employees` in Database. In the current table `Employees` database schema name is `dbo` I want to change it to `exe`. How can I do it ? Example: FROM ``` dbo...

20 Aug at 15:29