PHP: How to generate a random, unique, alphanumeric string?

PHP: How to generate a random, unique, alphanumeric string?

How would it be possible to generate a random, unique string using numbers and letters for use in a verify link? Like when you create an account on a website, and it sends you an email with a link, and you have to click that link in order t

How do I match any character across multiple lines in a regular expression?

How do I match any character across multiple lines in a regular expression?

For example, this regex(.*)will match:abcdeBut how do I get it to match across multiple lines?abcdefghij 1:It depends on the language, but there should be a modifier that you can add to the regex pattern. In PHP i

Get selected text from a drop-down list (select box) using jQuery

Get selected text from a drop-down list (select box) using jQuery

How can I get the selected text (not the selected value) from a drop-down list in jQuery? 1:$("#yourdropdownid option:selected").text(); 2:Try this:$("#myselect :selected").text();For an ASP.NET dropdown you can use the following sele

doGet and doPost in Servlets

doGet and doPost in Servlets

I've developed an HTML page that sends information to a Servlet. In the Servlet, I am using the methods doGet() and doPost():public void doGet(HttpServletRequest req, HttpServletResponse res)throws ServletException, IOException { Strin

C# webbrowser Ajax call

C# webbrowser Ajax call

I am using a webbrowser control embeded in C# WPF .NET4 app. Whenever I press manually the button in a form, the browser hangs on "Your request is being processed" message and nothing happens. If I do the same in full IE browser the page is

Font scaling based on width of container

Font scaling based on width of container

I'm having a hard time getting my head around font scaling.I currently have this site with a body font-size of 100%. 100% of what though? This seems to compute out at 16px. I was under the impression that 100% would somehow refer to the siz

onClick within Chrome Extension not working

onClick within Chrome Extension not working

This seems to be the easiest thing to do, but it's just not working. In a normal browser the .html and .js files works perfectly, but in the Chrome extension the onClick function is not performing what it's supposed to do..js file:function

One-liner to take some properties from object in ES 6

One-liner to take some properties from object in ES 6

How one can write a function, which takes only few attributes in most-compact way in ES6?I've came up with solution using destructuring + simplified object literal, but I don't like that list of fields is repeated in the code.Is there an ev

Run Command Prompt Commands

Run Command Prompt Commands

Is there any way to run command prompt commands from within a C# application? If so how would I do the following:copy /b Image1.jpg + Archive.rar Image2.jpgThis basically embeds an RAR file within JPG image. I was just wondering if there

How can I get jQuery to perform a synchronous, rather than asynchronous, Ajax request?

How can I get jQuery to perform a synchronous, rather than asynchronous, Ajax request?

I have a JavaScript widget which provides standard extension points. One of them is the beforecreate function. It should return false to prevent an item from being created. I've added an Ajax call into this function using jQuery:beforecreat

How to scroll the window automatically when mouse moves bottom of the page using jquery

How to scroll the window automatically when mouse moves bottom of the page using jquery

I have 50 divs,But in my window it shows only 25,I do drag and drop activity on these divs.So If i drag my first div near 25th div,It should scroll automatically to show the remaining divs.How do i do this in jquery? any idea?I am using Nes

JSON Parse File Path

JSON Parse File Path

I'm stuck trying to get the correct path to the local file. I have the following directories:Resources -> data -> file.json js -> folder -> script.js html -> folder -> file1.htmlI'm executing script.js fr

How do you access the $on, $emit, $broadcast methods with Controller as syntax?

How do you access the $on, $emit, $broadcast methods with Controller as syntax?

Using $scope it's easy to emit an event or watch for one.(function() { "use strict"; angular .module("app") .controller("Ctrl", [ "$scope", CtrlDefinition ]); function CtrlDefinition($scop

security error the operation is insecure in firefox document.stylesheets

security error the operation is insecure in firefox document.stylesheets

The following code throws an error in the Firefox Console at the line with the continue. SecurityError: The operation is insecure.if( !sheet.cssRules ) { continue; }However does not in Chrome and IE 11... Can someone explain the -why- of th

This application is modifying the autolayout engine from a background thread, which can lead to engi

This application is modifying the autolayout engine from a background thread, which can lead to engi

I am getting this error This application is modifying the autolayout engine from a background thread, which can lead to engine corruption and weird crashes.This will cause an exception in a future release. I don't know what is causing this

C# accessing property values dynamically by property name

C# accessing property values dynamically by property name

The problem I am trying to solve is how to write a method which takes in a property name as a string, and returns the value assigned to said property. My model class is declared similar to:public class Foo{ public int FooId public in

Can multiple directives for one element share an isolated scope?

Can multiple directives for one element share an isolated scope?

Two directives on the same element can not both have isolated scope, but can they both use the same scope isolated from their parent? And can they both use properties bound to the isolated scope?For example, if I have two directives on an

Hide HTML element by id

Hide HTML element by id

Hopefully there's a quick and dirty way to remove the "Ask Question" (or hide it) from a page where I can only add CSS and Javascript: Ask Question I can't hide the nav class because other pag

Three.js png texture - alpha renders as white instead as transparent

Three.js png texture - alpha renders as white instead as transparent

I'm creating a cube and I apply 6 different textures to each of it's faces. Each texture is a .png file and contains transparent parts. I'm also applying a color to the cube - I want to see that color trough png transparency.Problem: Transp

phantomJS - Pass Argument to the JS File

phantomJS - Pass Argument to the JS File

Right now I'm using the following command to run phantomJSexec('./phantomjs table.js',$op,$er);table.jsvar page = require('webpage').create();page.open('table.php', function () { page.render('table.png'); phantom.exit();});This serves

regular expression for no more than 2 repeated letters/digits

regular expression for no more than 2 repeated letters/digits

I have a requirement that need to handle the regex expression no more than 2 same letter/digit in xsl file-no space-does not support special chars.-support (a-z,A-Z,0-9), -require one of a-z,-require one of 0-9,-no more than 2 same letter/d

Programmatical click on -tag not working in Firefox

Programmatical click on -tag not working in Firefox

I have a problem with the click()-function from jquery. I create a -element with document.createElement('a') and want call the click()-function about this element. About this element i want to create a Excel-file and save this at the deskto

Accessing SCM (Git) variables on a Jenkins Pipeline job [duplicate]

Accessing SCM (Git) variables on a Jenkins Pipeline job [duplicate]

This question already has an answer here: Git Variables in Jenkins Workflow plugin 6 answers Here's my pipeline code:node ('master') { git url: "$GI

Convert string into jQuery object and select inner element

Convert string into jQuery object and select inner element

I wonder if there is a way to convert string into jQuery object and select inner elements without injecting the whole string into DOM and manipulate it in there. Thanks.If possible, please give me example of converting And select a1 from th

Setting the POST-body to a JSON object with jQuery

Setting the POST-body to a JSON object with jQuery

I'm trying to write a JSON-based web API in a Sinatra app. I want to POST a JSON object as the post body (with the proper content-type set) but I'm struggling.In Cocoa, I'd do something like[mutableHTTPRequest setHTTPBody:dataRepresentation