Python Finding Prime Factors
Two part question: 1. Trying to determine the largest prime factor of 600851475143, I found this program online that seems to work. The problem is, I'm having a hard time figuring out how it works ex...
How to generate an openSSL key using a passphrase from the command line?
First - what happens if I don't give a passphrase? Is some sort of pseudo random phrase used? I'm just looking for something "good enough" to keep casual hackers at bay. Second - how do I generate a ...
- Modified
- 15 Feb at 09:32
Sorting data based on second column of a file
I have a file of 2 columns and `n` number of rows. column1 contains `names` and column2 `age`. I want to sort the content of this file in ascending order based on the `age` (in second column). The res...
Getting a list of associative array keys
I have an associative array in JavaScript: ``` var dictionary = { "cats": [1,2,3,4,5], "dogs": [6,7,8,9,10] }; ``` How do I get this dictionary's keys? I.e., I want ``` var keys = ["cats", "d...
- Modified
- 15 Jul at 00:39
Confirm deletion using Bootstrap 3 modal box
I need to confirm deletion using Bootstrap 3 modal box (YES/NO). How can I create this? HTML code: ``` <form action="blah" method="POST"> <button class='btn' type="submit" name="remove_levels" v...
- Modified
- 19 Feb at 19:58
Show loading image while $.ajax is performed
I am just wondering how to show an image that indicates that the async request is running. I use the following code to perform a async request: ``` $.ajax({ url: uri, cache: false, success: fun...
- Modified
- 28 Oct at 19:3
How to import JsonConvert in C# application?
I created a C# library project. The project has this line in one class: ``` JsonConvert.SerializeObject(objectList); ``` I'm getting error saying > the name JsonConvert doesn't exist in the curr...
How to style readonly attribute with CSS?
I'm currently using readonly="readonly" to disable fields. I'm now trying to style the attribute using CSS. I've tried using ``` input[readonly] { /* styling info here */ } ``` but it is not workin...
- Modified
- 8 Apr at 19:56
How can I see what has changed in a file before committing to git?
I've noticed that while working on one or two tickets, if I step away, I'm not sure what I worked on, what changed, etcetera. Is there a way to see the changes made for a given file before git add an...
- Modified
- 16 Dec at 01:4
Favicon not showing up in Google Chrome
I have a favicon icon which isn't showing up in Chrome (I'm not sure about other browsers as I only use Chrome) but the strange thing is if I type the path to the icon in the URL bar it shows up! Why...
- Modified
- 28 May at 13:43
How to generate .env file for laravel?
From the [documentation](http://laravel.com/docs/master#install-composer) I see it's possible to create a laravel project via laravel installer: ``` $laravel new blog ``` or via composer: ``` $com...
- Modified
- 28 Apr at 09:36
java.lang.IllegalStateException: Cannot (forward | sendRedirect | create session) after response has been committed
This method throws > java.lang.IllegalStateException: Cannot forward after response has been committed and I am unable to spot the problem. Any help? ``` int noOfRows = Integer.parseInt(request.ge...
- Modified
- 30 Jan at 08:45
How can I export the schema of a database in PostgreSQL?
My computer broke down but fortunately I backed up the folder C:\Program Files\PostgreSQL. Now I'm working in a new computer and I would like to import the previous Postgres databases that are store...
- Modified
- 4 Dec at 16:34
How to use responsive background image in css3 in bootstrap
I dont want to use html tag. This is my css. I am using bootstrap 3.0. ``` background:url('images/ip-box.png')no-repeat; background-size:100%; height: 140px; display:block; padding:0 !important; mar...
- Modified
- 4 Sep at 11:43
Convert JS date time to MySQL datetime
Does anyone know how to convert JS dateTime to MySQL datetime? Also is there a way to add a specific number of minutes to JS datetime and then pass it to MySQL datetime?
- Modified
- 26 Feb at 20:44
How to place and center text in an SVG rectangle
I have the following rectangle: ``` <rect x="0px" y="0px" width="60px" height="20px"/> ``` I would like to center the word "Fiction" inside of it. For other rectangles, does SVG word wrap to stay wit...
PHP Create and Save a txt file to root directory
I am trying to create and save a file to the root directory of my site, but I don't know where its creating the file as I cannot see any. And, I need the file to be overwritten every time, if possible...
- Modified
- 27 Aug at 00:39
Best Regular Expression for Email Validation in C#
I have seen a multitude of regular expressions for different programming languages that all purport to validate email addresses. I have seen many comments saying that the expressions in question do n...
- Modified
- 23 Apr at 11:17
Append an object to a list in R in amortized constant time, O(1)?
If I have some R list `mylist`, you can append an item `obj` to it like so: ``` mylist[[length(mylist)+1]] <- obj ``` But surely there is some more compact way. When I was new at R, I tried writi...
- Modified
- 28 Apr at 18:22
RestClientException: Could not extract response. no suitable HttpMessageConverter found
Using the curl command: ``` curl -u 591bf65f50057469f10b5fd9:0cf17f9b03d056ds0e11e48497e506a2 https://backend.tdk.com/api/devicetypes/59147fd79e93s12e61499ffe/messages ``` I am getting a JSON respo...
- Modified
- 22 Jan at 13:2
Is it possible to specify a different ssh port when using rsync?
I have been attempting the following command: ``` rsync -rvz --progress --remove-sent-files ./dir user@host:2222/path ``` SSH is running on port 2222, but rsync still tries to use port 22 and the...
Detect Safari browser
How to detect Safari browser using JavaScript? I have tried code below and it detects not only Safari but also Chrome browser. ``` function IsSafari() { var is_safari = navigator.userAgent.toLower...
- Modified
- 10 Dec at 21:12
How to hide output of subprocess
I'm using eSpeak on Ubuntu and have a Python 2.7 script that prints and speaks a message: ``` import subprocess text = 'Hello World.' print text subprocess.call(['espeak', text]) ``` eSpeak produce...
- Modified
- 25 Sep at 18:20
How to convert date format to DD-MM-YYYY in C#
How to convert date format to DD-MM-YYYY in C#? I am only looking for DD-MM-YYYY format not anything else.
- Modified
- 27 Feb at 20:58
Is there any difference between a GUID and a UUID?
I see these two acronyms being thrown around and I was wondering if there are any differences between a GUID and a UUID?