What's the best way to determine the location of the current PowerShell script?
Whenever I need to reference a common module or script, I like to use paths relative to the current script file. That way, my script can always find other scripts in the library. So, what is the best...
- Modified
- 21 Oct at 23:3
The request was aborted: Could not create SSL/TLS secure channel
We are unable to connect to an HTTPS server using `WebRequest` because of this error message: `The request was aborted: Could not create SSL/TLS secure channel.` We know that the server doesn't have a...
- Modified
- 17 Jul at 16:34
ValueError: invalid literal for int() with base 10: ''
I got this error from my code: ``` ValueError: invalid literal for int() with base 10: ''. ``` What does it mean? Why does it occur, and how can I fix it?
- Modified
- 14 Jan at 03:0
Scala vs. Groovy vs. Clojure
Can someone please explain the major differences between Scala, Groovy and Clojure. I know each of these compiles to run on the JVM but I'd like a simple comparison between them.
- Modified
- 22 Aug at 00:8
How to resolve git stash conflict without commit?
As [asked in this question](https://stackoverflow.com/q/7517124/11343), I also want to know how to resolve a conflicting `git stash pop` without adding all modifications to a commit (just like "git st...
Getting file size in Python?
Is there a built-in function for getting the size of a file object in bytes? I see some people do something like this: ``` def getSize(fileobject): fileobject.seek(0,2) # move the cursor to the e...
What is the point of "final class" in Java?
I am reading a book about Java and it says that you can declare the whole class as `final`. I cannot think of anything where I'd use this. I am just new to programming and I am wondering . If they d...
How to filter object array based on attributes?
I have the following JavaScript array of real estate home objects: ``` var json = { 'homes': [{ "home_id": "1", "price": "925", "sqft": "1100", "nu...
- Modified
- 21 Apr at 14:50
What is the python keyword "with" used for?
What is the python keyword "with" used for? Example from: [http://docs.python.org/tutorial/inputoutput.html](http://docs.python.org/tutorial/inputoutput.html) ``` >>> with open('/tmp/workfile', 'r')...
- Modified
- 2 Sep at 18:59
Func delegate with no return type
All of the Func delegates return a value. What are the .NET delegates that can be used with methods that return void?
Capturing multiple line output into a Bash variable
I've got a script 'myscript' that outputs the following: ``` abc def ghi ``` in another script, I call: ``` declare RESULT=$(./myscript) ``` and `$RESULT` gets the value ``` abc def ghi ``` I...
Difference between InvariantCulture and Ordinal string comparison
When comparing two strings in c# for equality, what is the difference between InvariantCulture and Ordinal comparison?
- Modified
- 8 Sep at 20:6
Find document with array that contains a specific value
If I have this schema... ``` person = { name : String, favoriteFoods : Array } ``` ... where the `favoriteFoods` array is populated with strings. How can I find all persons that have "sushi...
How can I get a value from a cell of a dataframe?
I have constructed a condition that extracts exactly one row from my data frame: ``` d2 = df[(df['l_ext']==l_ext) & (df['item']==item) & (df['wn']==wn) & (df['wd']==1)] ``` Now I would like to take a...
Creating a BLOB from a Base64 string in JavaScript
I have Base64-encoded binary data in a string: ``` const contentType = 'image/png'; const b64Data = 'iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHw...
- Modified
- 13 Apr at 14:0
How to convert a normal Git repository to a bare one?
How can I convert a 'normal' Git repository to a bare one? The main difference seems to be: - in the normal Git repository, you have a `.git` folder inside the repository containing all relevant dat...
- Modified
- 23 Feb at 09:49
Difference between DTO, VO, POJO, JavaBeans?
Have seen some similar questions: - [What is the difference between a JavaBean and a POJO?](https://stackoverflow.com/questions/1394265/what-is-the-difference-between-a-javabean-and-a-pojo)- [What is...
- Modified
- 23 May at 11:47
Removing Conda environment
I want to remove a certain environment created with conda. How can I achieve that? Let's say I have an active `testenv` environment. I tried, by following documentation, with: ``` $ conda env remove ...
How, in general, does Node.js handle 10,000 concurrent requests?
I understand that Node.js uses a single-thread and an event loop to process requests only processing one at a time (which is non-blocking). But still, how does that work, lets say 10,000 concurrent re...
- Modified
- 17 Jun at 11:5
Difference between map, applymap and apply methods in Pandas
Can you tell me when to use these vectorization methods with basic examples? I see that `map` is a `Series` method whereas the rest are `DataFrame` methods. I got confused about `apply` and `applyma...
- Modified
- 20 Jan at 17:7
Git and nasty "error: cannot lock existing info/refs fatal"
After cloning from remote git repository (at bettercodes) I made some changes, commited and tried to push: ``` git push origin master ``` Errors with: > error: cannot lock existing info/refs f...
- Modified
- 17 May at 00:18
Add a new item to a dictionary in Python
How do I add an item to an existing dictionary in Python? For example, given: ``` default_data = { 'item1': 1, 'item2': 2, } ``` I want to add a new item such that: ``` default_data = default...
- Modified
- 17 Jul at 06:54
How to extract numbers from a string in Python?
I would like to extract all the numbers contained in a string. Which is better suited for the purpose, regular expressions or the `isdigit()` method? Example: ``` line = "hello 12 hi 89" ``` Result: ...