Posts

Generatinge Unique Id on the fly Mysql + PHP -

I am trying to come up with a solution specifically to generate a unique ID on the fly. The area of ​​use can be an order, product or plan ID, where no security is involved. I do not like the idea of ​​generating random numbers and then DB should check its specificity and repeat the process, if it is not in this case where security is not a problem. Besides, I do not like to use auto-emoticon id because it looks very easy. My initial thought is that the combination of Auto Enerment ID + Timestamp has to convert the decimal value to hex, it seems like a random string and then finally prefixing and suffixing with 2 digit random strings. Generate function UID ($ num) {$ str = dechex (time () + intval ($ num)); $ Prefix = dashx (rand (1,15)); $ Suffix = decex (rand (1,15)); Return Strawper ($ suffix. $ Str. $ Prefix); } Where $ num is the auto_increment id returns such as E53D42A046 is the correct way to know what to do Is Collision Issues? Thank you for all the resp...

arrays - unable to show image from external hd php -

Image
I am new to programming and am now learning php. I have installed the xim and have written a bit code. I have some pictures on my external HD and I want to show some pictures. The problem is that I can get a list of the paths of my images with this code: echo " gt; body ; $ External DIR = "X: \ map \ maps \ more \" "$ total = count (array_diff (scanner ($ external diameter), array (". "," .. "))); $ Dirs = array_diff ( Scandor ($ External Dior), Array (".", "..")) Foreign Currency ($ dirs $$) {if (! Is_dir ($ external DIR. $ D)) {echo $ d "& lt; But if I want to show it as an image, then I can not show the image. I tried to do it in foreach: if (! Is_dir ($ external. $ D)) {$ file = $ outerhDir $ D; Echo 'img src = "'. $ External Direct $ d '' Gt; & Lt; Br> '; Echo '' & lt; Img src = '". $ External Diaries"' \\ '. $ D. "' Alt = ...

sql server - T-SQL code to add 7 days to a date -

If we recall the date of the ship, the details given below include 7 days on the date of shipment. For, 07/24/2014 did not send any vessel to the ship for any reason. The following query in shipments adds 7 days (as a result of 07/31/2014 ). The only problem is that the 'test ship' column adds seven days to shipment if we remember the date of shipment, only on Sunday the date. What do I mean for jobs that was the date of a scheduled ship of 07/24/2014 , and we miss the job navigations on that day, update the next scheduled ship next to the 'test ship' column Does 07/31/2014 only on Sunday. For example, the job J012345 is 07/24/2014 / 2014 . Then the 'Test Ship' column will update tomorrow's date.e 07/27/2014 (Sunday) instead of updating it on Friday 07/25/2014 Am I missing anything here? How do I get a 'test ship' to update on Sunday on Sunday? 'test ship' = case when J. Jobstats & lt; & Gt; 'S' and the...

java - Scanner.next returning path of file? -

मेरे पास एक स्कैनर है: m = नया स्कैनर (मान। Mazegen.replace ( "\\", "//") + "//maze.txt"); (मान। Mazegen.replace ("\", "//") + "//maze.txt" प्रिंट के रूप में C: // users // myusername // डेस्कटॉप) और जब मैं m.next () का उपयोग करता हूं तो यह C: //users//myusername//Desktop//maze.txt देता है। मुझे कोई जानकारी नहीं है की क्यों...? पूर्ण कोड: सार्वजनिक शून्य खुलाफ़ाइल () {try {if (Values.custom == true & amp; Values.customSolved == false) {m = नया स्कैनर (नई फ़ाइल (मान .MazeFile)); } Else if (Values.customSolved == true || Values.custom == false) {m = नया स्कैनर (मान। Mazegen.replace ("\\", "//") + "//Maze.txt") ; } और {एम = नया स्कैनर (मान.मज़ेज.रेले ("\\", "//") + "//Maze.txt"); }} पकड़ (FileNotFoundException ई) {System.out.println ("फ़ाइल नहीं मिली!"); } यदि (वैल्यूज कूफ्यूम == सत्य & amp; Values.customSolved == गलत) {m.nextLine (); }...

python - How to generate RequestToken URL for Google API -

"itemprop =" text "> I am writing Python 2.7 desktop applications which need to use Google Spreadsheets by using OAuth 2.0. I'va got a library for Google Spreadsheets for Python, which uses Python OAuth2.0 library. The flow for described desktop applications tells me that the first time I have to generate the RequestToken URL is that the user can use the application to get the authorization code. I have already created Client ID and Client Secret Developer Console. But I can not figure out what class / method I can use to generate RequestToken URL in Python. Should I somehow build myself or is there an API to do this? I have understood this from the document #! / Usr / bin / env oauth2client = OAuth2WebServerFlow (client_id = 'your_client_id' python import oauth2client.client import OAuth2WebServerFlow flow, client_secret = 'your_client_secret', scope = 'https: //spreadsheets.google.com/feeds', redirect_uri =' You need y...

android - How can I set eclipse to generate widgets in R class automatically? -

I'm new to Android I have a problem with my eclipse: Like the text view or button in the XML file R is not generated in the class even when I clear the project or create the project (There is no error in the xml file). The only way to make it in R class is to start the project Run the project and it will be generated immediately after running it. I saw in some instructions; When we create automatically under the Project tab, widgets created immediately after the composition but I do not have an eclipse. How can I fix this problem? Sorry for the lame question, I searched it and I could not find any answer. thanks please read your paint Doable image should not contain uppercase letters. Or you can remove ic_launcher and also check that your layout can not have uppercase letters. Then reboot the eclipse and clear it again. try. Thank you.

python - Scatter plot with arrows using matplotlib -

Image
I'm trying to create a scatter plot in matplotlib with an arrow coming out of the points to indicate the upper limit At the end I have done the following: arrow = u '$ \ u2193 $' ax.plot (x, y, linestyle = 'none', marker size = 20, marker = Arrow) Ax.plot (x, y, linestyle = 'none', markersize = 10, marker = 'o') However, I am not completely satisfied with the results - / P> to come to me Arrow is out of the middle of the point, then that point + arrow looks like a shape, is there any way to do this? Thank you! You can do this with Thiracer to create a plot filled with arrows For situation and direction takes data. But they will start at x, y instead of being centered (as you have been found in the plot) x = [4.07.0,4.5] y = [3.0,1.0,5.5] Ax = ([0,0,0] V = [1,1,1] fig, ax = subdivision () ax (x, y, u, v) ax.scatter (x, y, color = 'k') ax .axis ([0,10,0,10])