How to write to a file, using the logging Python module?
How can I use the [logging](https://docs.python.org/3.7/library/logging.html#module-logging) module in Python to write to a file? Every time I try to use it, it just prints out the message.
jQuery: Check if div with certain class name exists
Using jQuery I'm programmatically generating a bunch of `div`'s like this: ``` <div class="mydivclass" id="myid1">Some Text1</div> <div class="mydivclass" id="myid2">Some Text2</div> ``` Somewhere ...
- Modified
- 15 Mar at 11:59
How can I print multiple things on the same line, one at a time?
I want to run a script, which basically shows an output like this: ``` Installing XXX... [DONE] ``` Currently, I print `Installing XXX...` first and then I print `[DONE]`. How can I ins...
- Modified
- 3 Jan at 01:16
How to detect internet speed in JavaScript?
How can I create a JavaScript page that will detect the user’s internet speed and show it on the page? Something like .
- Modified
- 22 Apr at 05:30
How to use DbContext.Database.SqlQuery<TElement>(sql, params) with stored procedure? EF Code First CTP5
I have a stored procedure that has three parameters and I've been trying to use the following to return the results: ``` context.Database.SqlQuery<myEntityType>("mySpName", param1, param2, param3); `...
- Modified
- 29 Jan at 13:50
Javascript - get array of dates between 2 dates
``` var range = getDates(new Date(), new Date().addDays(7)); ``` I'd like "range" to be an array of date objects, one for each day between the two dates. The trick is that it should handle month an...
- Modified
- 5 Mar at 19:27
Any way to limit border length?
Is there any way to limit the length of a border. I have a `<div>` that has a bottom border, but I want to add a border on the left of the `<div>` that only stretches half of the way up. Is there an...
- Modified
- 19 Nov at 16:32
Safest way to convert float to integer in python?
Python's math module contain handy functions like `floor` & `ceil`. These functions take a floating point number and return the nearest integer below or above it. However these functions return the an...
- Modified
- 5 Aug at 18:21
PostgreSQL naming conventions
Where can I find a detailed manual about PostgreSQL naming conventions? (table names vs. camel case, sequences, primary keys, constraints, indexes, etc...)
- Modified
- 15 Jun at 19:48
How can I create download link in HTML?
I have a basic idea of HTML. I want to create the download link in my sample website, but I don't have idea of how to create it. How do I make a link to download a file rather than visit it?
Best way to check for nullable bool in a condition expression (if ...)
I was wondering what was the most clean and understandable syntax for doing condition checks on nullable bools. Is the following good or bad coding style? Is there a way to express the condition bet...
- Modified
- 20 Apr at 09:26
Read a variable in bash with a default value
I need to read a value from the terminal in a bash script. I would like to be able to provide a default value that the user can change. ``` # Please enter your name: Ricardo^ ``` In this script th...
What is AF_INET, and why do I need it?
I'm getting started on socket programming, and I keep seeing this `AF_INET`. Yet, I've never seen anything else used in its place. My lecturers are not that helpful and just say "You just need it". ...
- Modified
- 13 Jul at 07:24
Count the occurrences of DISTINCT values
I am trying to find a MySQL query that will find DISTINCT values in a particular field, count the number of occurrences of that value and then order the results by the count. example db ``` id ...
Display a view from another controller in ASP.NET MVC
Is it possible to display a view from another controller? Say for example I have a `CategoriesController` and a `Category/NotFound.aspx` view. While in the `CategoriesController`, I can easly return ...
- Modified
- 31 Dec at 15:3
What does Visual Studio mean by normalize inconsistent line endings?
Visual Studio occasionally tells me: > The line endings in the following files are not consistent. Do you want to normalize the line endings? It then gives me a drop down with different standards or...
- Modified
- 14 Jun at 06:57
Ball to Ball Collision - Detection and Handling
With the help of the Stack Overflow community I've written a pretty basic-but fun physics simulator. ![alt text](https://i.stack.imgur.com/EeqSP.png) You click and drag the mouse to launch a ball. It...
- Modified
- 27 Jul at 14:3
How do you make an element "flash" in jQuery
I'm brand new to jQuery and have some experience using Prototype. In Prototype, there is a method to "flash" an element — ie. briefly highlight it in another color and have it fade back to normal so t...
How to get the current user in ASP.NET MVC
In a forms model, I used to get the current logged-in user by: ``` Page.CurrentUser ``` How do I get the current user inside a controller class in ASP.NET MVC?
- Modified
- 11 Jan at 18:41
Render partial from different folder (not shared)
How can I have a view render a partial (user control) from a different folder? With preview 3 I used to call RenderUserControl with the complete path, but whith upgrading to preview 5 this is not poss...
- Modified
- 16 Oct at 12:52
Databinding an enum property to a ComboBox in WPF
As an example take the following code: ``` public enum ExampleEnum { FooBar, BarFoo } public class ExampleClass : INotifyPropertyChanged { private ExampleEnum example; public ExampleEnum Ex...
Generic type conversion FROM string
I have a class that I want to use to store "properties" for another class. These properties simply have a name and a value. Ideally, what I would like is to be able to add properties, so that the "va...
- Modified
- 7 Sep at 19:16
componentDidMount equivalent on a React function/Hooks component?
Are there ways to simulate `componentDidMount` in React functional components via hooks?
- Modified
- 12 Dec at 10:55
Console.log statements output nothing at all in Jest
`console.log` statements output nothing at all in Jest. This was working for me yesterday, and all of sudden, it's not working today. I have made zero changes to my config and haven't installed any up...
- Modified
- 30 Jan at 18:29
Why would one use Task<T> over ValueTask<T> in C#?
As of C# 7.0 async methods can return ValueTask<T>. The explanation says that it should be used when we have a cached result or simulating async via synchronous code. However I still do not understand...
- Modified
- 24 Mar at 18:16