How can I scale the content of an iframe?
How can I scale the content of an iframe (in my example it is an HTML page, and is not a popup) in a page of my web site? For example, I want to display the content that appears in the iframe at 80% ...
Difference between two dates in Python
I have two different dates and I want to know the difference in days between them. The format of the date is YYYY-MM-DD. I have a function that can ADD or SUBTRACT a given number to a date: ``` def ...
How to customize a Spinner in Android
I want to add a custom height to the dropdown of a `Spinner`, say 30dp, and I want to hide the dividers of the dropdown list of `Spinner`. So far I tried to implement following style to the `Spinner`...
- Modified
- 22 Jun at 20:29
Multiple Inheritance in C#
Since multiple inheritance is bad (it makes the source more complicated) C# does not provide such a pattern directly. But sometimes it would be helpful to have this ability. For instance I'm able to i...
- Modified
- 20 Jun at 09:12
How can I determine the direction of a jQuery scroll event?
I'm looking for something to this effect: ``` $(window).scroll(function(event){ if (/* magic code*/ ){ // upscroll code } else { // downscroll code } }); ``` Any ideas?
- Modified
- 3 Feb at 05:33
Testing whether a value is odd or even
I decided to create simple and function with a very simple algorithm: ``` function isEven(n) { n = Number(n); return n === 0 || !!(n && !(n%2)); } function isOdd(n) { return isEven(Number(n)...
- Modified
- 13 Aug at 09:7
Get line number while using grep
I am using grep recursive to search files for a string, and all the matched files and the lines containing that string are print on the terminal. But is it possible to get the line numbers of those li...
How do I restart a service on a remote machine in Windows?
Sometimes while debugging, I need to restart a service on a remote machine. Currently, I'm doing this via Remote Desktop. How can it be done from the command line on my local machine?
- Modified
- 9 Oct at 15:32
"Failed to install the following Android SDK packages as some licences have not been accepted" error
I am getting this error in jitpack, I've tried everything on the internet. Below is my error ``` Failed to install the following Android SDK packages as some licences have not been accepted. pl...
- Modified
- 15 May at 12:0
SSL Error: unable to get local issuer certificate
I'm having trouble configuring SSL on a Debian 6.0 32bit server. I'm relatively new with SSL so please bear with me. I'm including as much information as I can. ### Configuration The server is r...
- Modified
- 23 May at 11:54
origin 'http://localhost:4200' has been blocked by CORS policy in Angular7
I want to use of [http://5.160.2.148:8091/api/trainTicketing/city/findAll](http://5.160.2.148:8091/api/trainTicketing/city/findAll) rest for get cities in my angular project. I used version 7.2.15 of ...
- Modified
- 27 May at 15:1
How to embed a SWF file in an HTML page?
How do you embed a SWF file in an HTML page?
Is it possible to focus on a <div> using JavaScript focus() function?
Is it possible to focus on a `<div>` using JavaScript `focus()` function? I have a `<div>` tag ``` <div id="tries">You have 3 tries left</div> ``` I am trying to focus on the above `<div>` using :...
- Modified
- 23 Jul at 15:43
Remove part of string in Java
I want to remove a part of string from one character, that is: Source string: ``` manchester united (with nice players) ``` Target string: ``` manchester united ```
Sending a mail from a linux shell script
I want to send an email from a Linux Shell script. What is the standard command to do this and do I need to set up any special server names?
How do I decode a base64 encoded string?
I am trying to "decode" this following Base64 string: > OBFZDTcPCxlCKhdXCQ0kMQhKPh9uIgYIAQxALBtZAwUeOzcdcUEeW0dMO1kbPElWCV1ISFFKZ0kdWFlLAURPZhEFQVseXVtPOUUICVhMAzcfZ14AVEdIVVgfAUIBWVpOUlAeaUVMXFlKIy9...
How can I use a for each loop on an array?
I have an array of Strings: ``` Dim sArray(4) as String ``` I am going through each String in the array: ``` for each element in sarray do_something(element) next element ``` `do_something` ta...
How can I obfuscate (protect) JavaScript?
I want to make a JavaScript application that's not open source, and thus I wish to learn how to can obfuscate my JS code? Is this possible?
- Modified
- 16 May at 12:57
How to set a timer in android
What is the proper way to set a timer in android in order to kick off a task (a function that I create which does not change the UI)? Use this the Java way: [http://docs.oracle.com/javase/1.5.0/docs/...
- Modified
- 16 Nov at 16:28
Format of the initialization string does not conform to specification starting at index 0
I have an ASP.NET application which runs fine on my local development machine. When I run this application online, it shows the following error: > Format of the initialization string does not conform ...
- Modified
- 3 Sep at 21:7
Tomcat Server Error - Port 8080 already in use
I received the following error while attempting to execute a Servlet program in Eclipse Mars EE. > 'Starting Tomcat v8.0 Sever at localhost' has encountered a problem.Port 8080 required by Tomcat v8...
Is there a way to get version from package.json in nodejs code?
Is there a way to get the version set in `package.json` in a nodejs app? I would want something like this ``` var port = process.env.PORT || 3000 app.listen port console.log "Express server listening...
- Modified
- 1 Jul at 15:46
How to check String in response body with mockMvc
I have simple integration test ``` @Test public void shouldReturnErrorMessageToAdminWhenCreatingUserWithUsedUserName() throws Exception { mockMvc.perform(post("/api/users").header("Authorization...
- Modified
- 20 Dec at 13:38
ReactJS: Maximum update depth exceeded error
I am trying to toggle the state of a component in ReactJS but I get an error stating: > Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillU...
- Modified
- 19 Jul at 09:12
Forbidden You don't have permission to access / on this server
All I wanted to do today was to write a redirect rule to a subfolder, e.g.: You enter the URL: and you get redirected to Such a simple wish. I tried to find a solution on the internet. The internet...
- Modified
- 2 Jul at 12:39