builtins.TypeError: must be str, not bytes
I've converted my scripts from Python 2.7 to 3.2, and I have a bug. ``` # -*- coding: utf-8 -*- import time from datetime import date from lxml import etree from collections import OrderedDict # Cr...
- Modified
- 7 Mar at 01:1
Page vs Window in WPF?
What is the difference between a Page and a Window in WPF when you are adding a new file in the Solution Explorer?
Change default text in input type="file"?
I want to change default text on button that is "`Choose File`" when we use `input="file"`. ![enter image description here](https://i.stack.imgur.com/rcdgH.png) How can I do this? Also as you can se...
- Modified
- 13 Nov at 18:20
Referencing a string in a string array resource with xml
I have preferences where you can enable/disable what items will show up on the menu. There are 17 items. I made a string array in values/arrays.xml with titles for each of these 17 items. I have pr...
- Modified
- 21 May at 14:36
Difference between Key, Primary Key, Unique Key and Index in MySQL
When should I use `KEY`, `PRIMARY KEY`, `UNIQUE KEY` and `INDEX`?
- Modified
- 17 Sep at 13:56
What does $_ mean in PowerShell?
I've seen the following a lot in PowerShell, but what does it do exactly? ``` $_ ```
- Modified
- 1 Feb at 19:54
Pass request headers in a jQuery AJAX GET call
I am trying to pass request headers in an AJAX GET using jQuery. In the following block, "data" automatically passes the values in the querystring. Is there a way to pass that data in the request head...
- Modified
- 19 Apr at 04:7
Volatile vs Static in Java
Is it correct to say that `static` means one copy of the value for all objects and `volatile` means one copy of the value for all threads? Anyway a `static` variable value is also going to be one va...
- Modified
- 10 Oct at 13:47
How can I trigger a JavaScript event click
I have a hyperlink in my page. I am trying to automate a number of clicks on the hyperlink for testing purposes. Is there any way you can simulate 50 clicks on the hyperlink using JavaScript? ``` <a ...
- Modified
- 20 Feb at 19:42
What are the differences between .so and .dylib on macOS?
.dylib is the dynamic library extension on macOS, but it's never been clear to me when I can't / shouldn't use a traditional unix .so shared object. Some of the questions I have: - - -
How to download a branch with git?
I have a project hosted on GitHub. I created a branch on one computer, then pushed my changes to GitHub with: ``` git push origin branch-name ``` Now I am on a different computer, and I want to do...
JavaScript: Is there a way to get Chrome to break on all errors?
I am looking for an equivalent in Chrome to the "break on all errors" functionality of Firebug. In the Scripts tab, Chrome has a "pause on all exceptions", but this is not quite the same as breaking o...
- Modified
- 9 Mar at 10:41
How do I reverse an int array in Java?
I am trying to reverse an int array in Java. This method does not reverse the array. ``` for(int i = 0; i < validData.length; i++) { int temp = validData[i]; validData[i] = validData[valid...
How to create module-wide variables in Python?
Is there a way to set up a global variable inside of a module? When I tried to do it the most obvious way as appears below, the Python interpreter said the variable `__DBNAME__` did not exist. ``` .....
Getting the class name from a static method in Java
How can one get the name of the class from a static method in that class. For example ``` public class MyClass { public static String getClassName() { String name = ????; // what goes her...
How to parse a string to an int in C++?
What's the C++ way of parsing a string (given as char *) into an int? Robust and clear error handling is a plus (instead of [returning zero](http://en.cppreference.com/w/cpp/string/byte/atoi)).
How do you loop through each line in a text file using a windows batch file?
I would like to know how to loop through each line in a text file using a Windows batch file and process each line of text in succession.
- Modified
- 24 Mar at 14:12
Tree data structure in C#
I was looking for a tree or graph data structure in C#, but I guess there isn't one provided. [An Extensive Examination of Data Structures Using C# 2.0](http://msdn.microsoft.com/en-us/library/ms37957...
- Modified
- 5 Dec at 17:22
How to validate an XML file against an XSD file?
I'm generating some xml files that needs to conform to an xsd file that was given to me. How should I verify they conform?
- Modified
- 9 Feb at 14:4
Multiple submit buttons in an HTML form
Let's say you create a wizard in an HTML form. One button goes back, and one goes forward. Since the button appears first in the markup when you press , it will use that button to submit the form. E...
- Modified
- 14 Jul at 14:18
SwiftUI text-alignment
Among the many properties of the `Text` view, I couldn't find any related to text alignment. I've seen in a demo that it automatically handles RTL, and when placing stuff using View's `body`, it alway...
How to show all columns' names on a large pandas dataframe?
I have a dataframe that consist of hundreds of columns, and I need to see all column names. What I did: ``` In[37]: data_all2.columns ``` The output is: ``` Out[37]: Index(['customer_id', 'incomi...
NSRange to Range<String.Index>
How can I convert `NSRange` to `Range<String.Index>` in Swift? I want to use the following `UITextFieldDelegate` method: ``` func textField(textField: UITextField!, shouldChangeCharactersIn...
Escape double quotes in a string
Double quotes can be escaped like this: ``` string test = @"He said to me, ""Hello World"". How are you?"; ``` But this involves adding character `"` to the string. Is there a C# function or other ...
- Modified
- 25 Jun at 12:30
Moving average or running mean
Is there a SciPy function or NumPy function or module for Python that calculates the running mean of a 1D array given a specific window?
- Modified
- 23 Feb at 11:17