How can I store my users' passwords safely?

How can I store my users' passwords safely?

How much more safe is this than plain MD5? I've just started looking into password security. I'm pretty new to PHP.$salt = 'csdnfgksdgojnmfnb';$password = md5($salt.$_POST['password']);$result = mysql_query("SELECT id FROM users

How to create a Custom Dialog box in android?

How to create a Custom Dialog box in android?

I want to create a custom dialog box like below I have tried the following things.I created a subclass of AlertDialog.Builder and used a custom Title and Custom Content View and used that but the result was not as expected.Another attempt w

window.close and self.close do not close the window in Chrome

window.close and self.close do not close the window in Chrome

The issue is that when I invoke window.close() or self.close() it doesn't close the window. Now there seems to be a belief that in Chrome you can't close by script any window that is not script created. That is patently false but regardless

Random shuffling of an array

Random shuffling of an array

I need to randomly shuffle the following Array:int[] solutionArray = {1, 2, 3, 4, 5, 6, 6, 5, 4, 3, 2, 1};Is there any function to do that? 1:Using Collections to shuffle an array of primitive types is a bit of an overkill...It is simple

What are POD types in C++?

What are POD types in C++?

I've come across this term POD-type a few times... what does it mean? 1:POD stands for Plain Old Data - that is, a class (whether defined with the keyword struct or the keyword class) without constructors, destructors and virtual member

Using i and j as variables in Matlab

Using i and j as variables in Matlab

i and j are very popular variable names (see e.g., this question and this one). For example, in loops:for i=1:10, % do something...endAs indices into matrix:mat( i, j ) = 4;Why shouldn't they be used as variable names in Matlab? 1:Be

How to find out which .c file contains the .c functions of R internals, on Windows?

How to find out which .c file contains the .c functions of R internals, on Windows?

I want to view the source code of R's match.call function. As it is an internal function, I downloaded the R source code, went to ./src/main/names.c and looked for match.call there. Thus, I found out that the corresponding .c function is ca

CSS using negative relative positioning issue

CSS using negative relative positioning issue

I have a header, mainbody and footer. Header and mainbody are properly styled. Now for footer I want to make it appear behind mainbody, so I used:z-index: -1;position: relative;top: -60px;This gives the desired result, but I get an extra sp

Does Content Security Policy block bookmarklets?

Does Content Security Policy block bookmarklets?

Does Mozillas CSP block to execute Javascript from a bookmark by default?Can it be configured to do so? 1:As of 2017, the answer is still a definitive "maybe" - just like when this answer was originally posted in 2011. The specification

Getting the fractional part of a float without using modf()

Getting the fractional part of a float without using modf()

I'm developing for a platform without a math library, so I need to build my own tools. My current way of getting the fraction is to convert the float to fixed point (multiply with (float)0xFFFF, cast to int), get only the lower part (mask w

c array - warning: format not a string literal

c array - warning: format not a string literal

I'm attempting to learn C and already I've run into an issue. I assume its trivial but I need to know it. I have written:#include #include int main() { char str_a[20]; strcpy(str_a, "Hello, world!\n"); printf(str_a);}Once I attempt

Animating max-height with CSS transitions

Animating max-height with CSS transitions

I want to create an expand/collapse animation that's powered only by classnames (javascript is used to toggle the classnames).I'm giving one class max-height: 4em; overflow: hidden; and the other max-height: 255em; (I also tried the value n

How are denormalized floats handled in C#?

How are denormalized floats handled in C#?

Just read this fascinating article about the 20x-200x slowdowns you can get on Intel CPUs with denormalized floats (floating point numbers very close to 0).There is an option with SSE to round these off to 0, restoring performance when such

Random chat with 2 users at a time (Socket.io)

Random chat with 2 users at a time (Socket.io)

I just started learning NodeJS and Socket.io... Until now I have this demo code, from official socket.io site:http://socket.io/demos/chat/I am able to get the unique client's ID of each user (socket) which connects, I am still trying to fig

Google Maps Api Directions

Google Maps Api Directions

Can i mark two points on the google maps in my application and then calculate the direction on the map as well as turn by turn navigation ? 1:No the Map Activity doesn't provide such a feature. You have to request it via the Google Maps

How to point a domain at a heroku application

How to point a domain at a heroku application

While I've done this on my VPS, I've never done this for a heroku application, and now I have to do it for a fairly large company so I really want a simple list of bullet-points in how to do this.I've read these instructions, and I'm still

What does LL mean? [closed]

What does LL mean? [closed]

Is LL defined anywhere in the standard (hard term to come by)?ideone accepts the codeint main(){ std::cout and prints84But what does it mean? 1:It is specified in Paragraph 2.14.2 of the C++11 Standard:2.14.2 Integer literals [...]

KeyEvent special Keys (like mute)

KeyEvent special Keys (like mute)

I'm currently trying to create a little remote-app for Android to control a MediaPlayer (like Rythmbox) on my PC.Most media-players understand the special keys on my keyboard (like "play/pause" or "next/previous"). My idea is that the Andro

Convert a string to number and back to string?

Convert a string to number and back to string?

I would like to know how I can convert a short ASCII string to a number (int, float, or numeric string). I saw a couple of posts here mentioned perfect hashes which seems like it might be what I need. However, I'm not quite understanding th

Best C# solution for multithreaded threadsafe read/write locking?

Best C# solution for multithreaded threadsafe read/write locking?

What is the safest (and shortest) way do lock read/write access to static members in a multithreaded environment in C#? Is it possible to do the threadsafe locking & unlocking on class level (so I don't keep repeating lock/unlock code every

Reading .evt/.evtx files directly [closed]

Reading .evt/.evtx files directly [closed]

Hello does anybody know how to read .evt /.evtx which are Windows Event log files to read not using provided api's , I want to read them using FILE I/O apis in C/C++.Or how to convert those files into .txt , I know splunk does this but not

Node js Mongodb Query NumberLong

Node js Mongodb Query NumberLong

I have a date field stored in mongo collection as NumberLongNode query on this collection for the date field {$gte: NumberLong("635186135151387725")} isnot pulling any records though the same works in mongoshell. I tried using require('mon

How to improve the speed of InnoDB writes per second of MySQL DB

How to improve the speed of InnoDB writes per second of MySQL DB

On my server, doing insert records into MySQL DB is very slow. Regarding the Server Status, InnoDB writes per second is around 20.I am not an expert, just graduated from university. I don't have much experience on it.How could I improve the

Create a sample login page using servlet and JSP? [duplicate]

Create a sample login page using servlet and JSP? [duplicate]

This question already has an answer here: Authentication filter and servlet for login 1 answer I developed a sample login page for validating username

linked list in C

linked list in C

I am creating a linked list as in the previous question I asked. I have found that the best way to develop the linked list is to have the head and tail in another structure. My products struct will be nested inside this structure. And I sho