Search Results

Search found 19 results on 1 pages for 'user271619'.

Page 1/1 | 1 

  • Low Level Software and Devices

    - by user271619
    I'm looking at a new chapter in my career. I'm a web developer, but now I'm starting to play around with C, compilers, and things I didn't have to work with before. It's all very intriguing! As I'm getting more and more into the "lower level" arena, I'm wondering how devices (mice, printers, webcams, microphones, etc...) are controlled, managed, detected, or used in general with software. I ask because I'm really having a hard time finding straightforward documentation online describing or giving examples of how hardware interacts with software. Does someone know of decent sites that can get me started learning this?

    Read the article

  • Extract Certs from Apache

    - by user271619
    Recently I've had to uninstall a single Self-Signed SSL Certificate from one of my Apache boxes, specifically for an outside party. That's not really a problem for me, since it was easy. What confuses me is how they knew I had a self-signed certificate. The domain I provided them was not related to the domain with the self-signed certificate. Does this mean Apache publicizes the Virtual hosts in the httpd.conf file? I asked the outside party what software they used to extract information from my server, and they provided this GitHub link: https://gist.github.com/4ndrej/4547029 I figured I'd ask the community first, before I attempt installing the Java program.

    Read the article

  • jquery insertAfter or append question

    - by user271619
    I am playing around with validating form inputs. For now I'm simply having fun with displaying a message after the input. I'm using the after() method to display simple text, and when I purposely make a mistake in the box I display the message perfectly. However, if I purposely make a mistake again, it immediately adds the same message after the first error message. Is there a method that replaces the original? I didn't want to try to add some more code to look for that original error message, delete it, and then insert the same message again. I will if I have to, but I thought I'd ask first. Here's my code: <script language="javascript" type="text/javascript"> $(document).ready(function(){ $("form#testform").submit(function(){ if($("#fieldname1").val().length < 5){ $("#fieldone").after("<div>not enough characters</div>"); } });return false; }); </script> <form id="testform" method="post"> <table> <tr> <td style="width:100px;">Field One:</td> <td><input type="text" name="fieldname1" id="fieldname1" /></td> </tr> <tr> <td>&nbsp;</td> <td><input type="submit" name="Submit" value="Submit" /></td> </tr> </table> </form>

    Read the article

  • IE not detecting jquery change method for checkbox

    - by user271619
    The code below works in FF, Safari, Chrome. But IE is giving me issues. When a checkbox is checked, I cannot get IE to detect it. $("#checkbox_ID").change(function(){ if($('#'+$(this).attr("id")).is(':checked')){ var value = "1"; }else{ var value = "0"; } alert(value); return false; }); Simply, I'm not getting that alert popup, as expected. I've even tried it this way: $("#checkbox_ID").change(function(){ if( $('#'+$(this).attr("id")'+:checked').attr('checked',false)){ var value = "1"; }else{ var value = "0"; } alert(value); return false; }); Here's the simple checkbox input: Anyone know if IE requires a different jquery method? or is my code just off?

    Read the article

  • php adding images to another image, exact positioning

    - by user271619
    I have a cool snippet of code that works well, except one thing. The code will take an icon I want to add to an existing picture. I can position it where I want too! Which is exactly what I need to do. However, I'm stuck on one thing, concerning the placement. The code "starting position" (on the main image: navIcons.png) is from the Bottom Right. I have 2 variables: $move_left = 10; & $move_up = 8;. So, the means I can position the icon.png 10px left, and 8px up, from the bottom right corner. I really really want to start the positioning from the Top Left of the image, so I'm really moving the icon 10px right & 8px down, from the top left position of the main image. Can someone look at my code and see if I'm just missing something that inverts that starting position? function attachIcon($imgname) { $mark = imagecreatefrompng($imgname); imagesavealpha($mark, true); list($icon_width, $icon_height) = getimagesize($imgname); $img = imagecreatefrompng('images/sprites/navIcons.png'); imagesavealpha($img, true); $move_left = 10; $move_up = 9; list($mainpic_width, $mainpic_height) = getimagesize('images/sprites/navIcons.png'); imagecopy($img, $mark, $mainpic_width-$icon_width-$move_left, $mainpic_height-$icon_height-$move_up, 0, 0, $icon_width, $icon_height); imagepng($img); // display the image + positioned icon in the browser //imagepng($img,'newnavIcon.png'); // rewrite the image with icon attached. } header('Content-Type: image/png'); attachIcon('icon.png'); ? For those who are wondering why I'd even bother doing this. In a nutshell, I like to add 16x16 icons to 1 single image, while using css to display that individual icon. This does involve me downloading the image (sprite) and open photoshop, add the new icon (positioning it), and reuploading it to the server. Not a massive ordeal, but just having fun with php.

    Read the article

  • javascript/jquery input fields cleanup

    - by user271619
    I've created a few input fields, that I am cleaning up as the user types. So, I'm using a keystroke detection event, like .keyup() It's all working very well, but I do notice one thing that's rather annoying for the users. While the script is cleaning the data as they type, their cursor is being sent to the end of the input field. So, if you want to edit the middle of the value, you're cursor immediately goes to the end of the box. Does anyone know of a way to maintain the cursor's current position inside the input field? I'm not holding my breath, but I thought I'd ask. Here's the cleanup code I'm using: $(".pricing").keyup(function(){ // clean up anything non-numeric **var itemprice = $("#itemprice").val().replace(/[^0-9\.]+/g, '');** // return the cleaner value back to the input field **$("#itemprice").val(itemprice);** });

    Read the article

  • PHP, display image with Header()

    - by user271619
    I'm displaying images from outside my web root, like this: header('Content-type:image/png'); readfile($fullpath); The content-type: image/png is what confuses me. Someone else helped me out with this code, but I noticed that not all images are PNG. Many are jpg or gif. And still they are displayed successfully. does anyone know why?

    Read the article

  • Preload Images with javascript

    - by user271619
    Here is my preload script: <script type="text/javascript"> Image_1 = new Image(1,1); Image_1.src = "images/sprites.png"; </script> And it works fine. I can see in the headers the image loading. Here's my question. Even though I have preloaded sprites.png, I notice that when I go to a page on my site that simply displays that entire image, the headers tell me my browser is requesting the server to send the image again. I'm hoping to not sound too naive. But, why would the browser request the image when I preloaded it earlier? Are there other reasons the browser would need to re-request? Also, I put the dimensions as Image(1,1). Sometimes I don't know the dimensions, as that image gets updated from time to time. Maybe that's a reason?

    Read the article

  • PHP Unicode character questions

    - by user271619
    Here's a link I found, which even has a character I need to play with for other projects of mine. http://www.fileformat.info/info/unicode/char/2446/index.htm There is a box with the Title of: "Encodings" on that page. And I am wondering about some of the rows. I obviously need a course on this sort of thing, but I'm wondering what the difference is between "HTML Entity (decimal)" and "HTML Entity (hex)". The funny thing is, which confuses me, I throw those characters on a web page, and they display fine. But I haven't specified any UTF-8 encoding in the php page. <?php $string1 = '&#x2446;'; $string2 = '&#9286;'; echo $string1; echo '<br>'; echo $string2; ?> Does the browser know how to display both automatically? And to make it weirder, I can only see those characters on my Mac, in Firefox. But my windows box doesn't want to show them. I've tested it in chrome, and firefox. Do I need to tell the browsers to view them correctly? Or is it an operating system modification?

    Read the article

  • Text Obfuscation using base64_encode()

    - by user271619
    I'm playing around with encrypt/decrypt coding in php. Interesting stuff! However, I'm coming across some issues involving what text gets encrypted into. Here's 2 functions that encrypt and decrypt a string. It uses an Encryption Key, which I set as something obscure. I actually got this from a php book. I modified it slightly, but not to change it's main goal. I created a small example below that anyone can test. But, I notice that some characters show up as the "encrypted" string. Characters like "=" and "+". Sometimes I pass this encrypted string via the url. Which may not quite make it to my receiving scripts. I'm guessing the browser does something to the string if certain characters are seen. I'm really only guessing. is there another function I can use to ensure the browser doesn't touch the string? or does anyone know enough php bas64_encode() to disallow certain characters from being used? I'm really not going to expect the latter as a possibility. But, I'm sure there's a work-around. enjoy the code, whomever needs it! define('ENCRYPTION_KEY', "sjjx6a"); function encrypt($string) { $result = ''; for($i=0; $i<strlen($string); $i++) { $char = substr($string, $i, 1); $keychar = substr(ENCRYPTION_KEY, ($i % strlen(ENCRYPTION_KEY))-1, 1); $char = chr(ord($char)+ord($keychar)); $result.=$char; } return base64_encode($result)."/".rand(); } function decrypt($string){ $exploded = explode("/",$string); $string = $exploded[0]; $result = ''; $string = base64_decode($string); for($i=0; $i<strlen($string); $i++) { $char = substr($string, $i, 1); $keychar = substr(ENCRYPTION_KEY, ($i % strlen(ENCRYPTION_KEY))-1, 1); $char = chr(ord($char)-ord($keychar)); $result.=$char; } return $result; } echo $encrypted = encrypt("reaplussign.jpg"); echo "<br>"; echo decrypt($encrypted);

    Read the article

  • Access/Download server files, not in site root, with PHP

    - by user271619
    Usually I save documents (images, mpegs, excel, word docs, etc...) for my friends or family on my website's root, inside a directory called /files/ or something similar. Nothing too uncommon. But, I have been playing with user session control, and allowing users to upload files to the dedicated /files/ directory. (the file names are saved in a db, with that user's ID) But, that means other people could try to guess and locate other people's files. I do randomize the file names, upon upload. And I stop the apache from displaying the /files/ directory content. However, I'd like to start saving the files outside of the website's root. This way it can't be accessible via the browser. I don't have any code to show, but I didn't want to even start on this endeavor if it's not able to be accomplished. I did find this snippet that shows how to display an image, from outside your website root: $file = $_GET['file']; $fileDir = '/path/to/files/'; if (file_exists($fileDir . $file)) { // Note: You should probably do some more checks // on the filetype, size, etc. $contents = file_get_contents($fileDir . $file); // Note: You should probably implement some kind // of check on filetype header('Content-type: image/jpeg'); echo $contents; } ? Maybe I can use this for any file type, but has anyone heard of a better way to allow users (logged in) to access their files from online, but not letting other users has similar access?

    Read the article

  • php compare array keys, not values

    - by user271619
    I am successfully using the array_key_exists(), as described by php.net Example: <?php $search_array = array('first' => 1, 'second' => 4); if (array_key_exists('first', $search_array)) { echo "The 'first' element is in the array"; } ?> But, take out the values, and it doesn't work. <?php $search_array = array('first', 'second'); if (array_key_exists('first', $search_array)) { echo "The 'first' element is in the array"; } ?> Not sure how to only compare 2 arrays by their keys only.

    Read the article

  • Find order of data inside an array

    - by user271619
    I have a simple array of stuff: $array = array("apples","oranges","strawberries"); I am trying to find the order of the stuff inside the array. (sometimes the order changes, and so do the items) I'm expecting to get something like this: "apples" = 0, "oranges = 1, "strawberries = 2 The end result has something to do with database sorting. Something like this, inside a foreach loop: UPDATE tbl SET sortorder = $neworder WHERE fruit = '$fruitname' The $neworder variable would be populated with the new order, inside the array. While the $fruit variable comes from the item inside the array.

    Read the article

  • jquery live() method on custom functions

    - by user271619
    I have a custom event handler, or I suppose some call it a custom jquery function. My problem is I'm trying to apply the live() method to it. But I'm not too successful. Here's a simple custom jquery function: $.fn.myFunction = function() { return $(this).addClass('changed'); } And here I use it: $('.changePlease').myFunction(); Ok, simple enough. But how do I apply the live() method to it?? I actually have no idea if that's even possible. But I do use live() for other things, like: $(".changePlease").live("click",function(){ alert("hello"); }); Any thoughts on this?

    Read the article

  • php - create columns from mysql list

    - by user271619
    I have a long list generated from a simple mysql select query. Currently (shown in the code below) I am simply creating list of table rows with each record. So, nothing complicated. However, I want to divide it into more than one column, depending on the number of returned results. I've been wrapping my brain around how to count this in the php, and I'm not getting the results I need. <table> <? $query = mysql_query("SELECT * FROM `sometable`"); while($rows = mysql_fetch_array($query)){ ?> <tr> <td><?php echo $rows['someRecord']; ?></td> </tr> <? } ?> </table> Obviously there's one column generated. So if the records returned reach 10, then I want to create a new column. In other words, if the returned results are 12, I have 2 columns. If I have 22 results, I'll have 3 columns, and so on.

    Read the article

  • htaccess redirect conditions

    - by user271619
    I figured out how to redirect someone, if they happen across one particular filename: Redirect /index.php http://www.website.com/#myaccount As you can see, I'm pretty much redirecting that visitor to the same page, which doesn't work. It's an endless look, regardless of the slight/minuscule change. I want to force someone to see a part of the page, by adding the hash. (it's a little weird, I know) I'm guessing this may be a time to use regex in the htaccess file. But I thought I'd ask if there's a simpler way to do this from the htaccess file.

    Read the article

  • mysql inserts & updates optimized

    - by user271619
    This is an optimization question, mostly. I have many forms on my sites that do simple Inserts and Updates. (Nothing complicated) But, several of the form's input fields are not necessary and may be left empty. (again, nothing complicated) However, my SQL query will have all columns in the Statement. My question, is it best to optimize the Inserts/Update queries appropriately? And only apply the columns that are changed into the query? We all hear that we shouldn't use the "SELECT *" query, unless it's absolutely needed for displaying all columns. But what about Inserts & Updates? Hope this makes sense. I'm sure any amount of optimization is acceptable. But I never really hear about this, specifically, from anyone.

    Read the article

1