Search Results

Search found 18568 results on 743 pages for 'url shortener'.

Page 187/743 | < Previous Page | 183 184 185 186 187 188 189 190 191 192 193 194  | Next Page >

  • Download Remote File

    - by Abs
    Hello all, I have a function that will be passed in a link. The link is to a remote image. I thought I could just use the extension of the file in the URL to determine the type of image but some URLs won't have extensions in the URL. They probably just push headers to the browser and therefore I do not have an extension to parse from the URL. How can I test if the URL has an extension and if not then read the headers to determine the file type? Am I over complicating things here? Is there an easier way to do this? I am making use of Codeigniter maybe there is something already built in to do this? All I really want to do is download an image from a URL with the correct extension. This is what I have so far. function get_image($image_link){ $remoteFile = $image_link; $ext = ''; //some URLs might not have an extension $file = fopen($remoteFile, "r"); if (!$file) { return false; }else{ $line = ''; while (!feof ($file)) { $line .= fgets ($file, 4096); } $file_name = time().$ext; file_put_contents($file_name, $line); } fclose($file); } Thanks all for any help

    Read the article

  • jQuery/Ajax IE7 - Long requests fail

    - by iQ
    Hi guys, I have a problem with IE7 regarding an ajax call that is made by jQuery.load function. Basically the request works in cases where the URL string is not too long, but as soon as the URL gets very large it fails. Doing some debugging on the Ajax call I found this error: URL: <blanked out security reasons but it's very long> Content Type: Headers size (bytes): 0 Data size (bytes): 0 Total size (bytes): 0 Transferred data size (bytes): 0 Cached data: No Error result: 0x800c0005 Error constant: INET_E_RESOURCE_NOT_FOUND Error description: The server or proxy was not found Extended error result: 0x7a Extended error description: The data area passed to a system call is too small. As you can see, it looks like nothing is being sent. Now this only happens on IE7 but not other browsers, with IE8 there is a small delay but still works. The same request works fine when the URL string is relatively small. Now I need this working on IE7 for compatibility reasons and I cannot find workarounds for this so any help is greatly appreciated. The actual ajax call is like this: $("ID").load("url?lotsofparams",callbac func(){}); "lotsofparams" can vary, sometimes being small or very large. It's when the string is very large that I get the above error for IE7 only.

    Read the article

  • ASP menu is not showing

    - by LauzPT
    My web application menu isn't showing in any browser I use to test. I looked around and checked out if it wasn't the z-index bug mentioned here, that seems to have caused some trouble to many people. I'm wondering if I'm doing something wrong: <asp:Menu ID="Menu1" runat="server" DataSourceID="SiteMapDataSource1" Orientation="Horizontal" /> </asp:Menu> I've got this as my SiteMap: <?xml version="1.0" encoding="utf-8" ?> <siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" > <siteMapNode title="Pagina"> <siteMapNode url="Default.aspx" title="Home" description="Página Inicial" /> <siteMapNode url="Generos.aspx" title="Géneros" description="Géneros" /> <siteMapNode url="Artistas.aspx" title="Artistas" description="Artistas" /> <siteMapNode url="Musicas.aspx" title="Musicas" description="Músicas" /> <siteMapNode title="Admin" roles="Administrador"> <siteMapNode url="Admin/Musicas.aspx" title="Musicas"/> </siteMapNode> </siteMapNode> </siteMap> Any suggestions about what might be wrong? TIA

    Read the article

  • Finding all CLASSPATH resources matching a pattern

    - by binil
    I want to read a bunch of text files, by loading them as resources using the context classloader. URL url = Thread.currentThread() .getContextClassloader() .getResource("folder/foo.txt"); Is there some way to get a list of resources whose names match a given pattern? For eg: URL[] matchingUrls = someLibrary.getMatchingResources("folder/*.txt"); Libraries like Spring can scan the classpath to find classes with a given annotation, so I am wondering if there something similar to load a bunch of resources.

    Read the article

  • Issue Displaying/Hiding Views (Obj-C iPhone Programming)

    - by roswell
    All right all, So I've got a UITableView that is inited in applicationDidFinishLaunching like so: [self showForumList]; Said method does this: -(void)showForumList { ForumList *fl = [ForumList alloc]; [fl initWithNibName:@"ForumList" bundle:[NSBundle mainBundle]]; self.ForumList = fl; [window addSubview:[self.ForumList view]]; [fl release]; }where self.ForumList is previously defined in the interface as ForumList *ForumList;, etc. Now, in ForumList (itself an extension of UITableViewController obviously), I've got didSelectRowAtIndexPath: -- within it I have the following code: Forum *f = [Forum alloc]; NSArray *forums = [f getForumList]; NSDictionary *selectedForum = [forums objectAtIndex:[indexPath row]]; NSString *Url = [selectedForum objectForKey:@"url"]; NSString *Username = [selectedForum objectForKey:@"username"]; NSString *Password = [selectedForum objectForKey:@"password"]; NSLog(@"Identified press on forum %@ (%@/%@)", Url, Username, Password); [self.globalDelegate showForumListFromForumUsingUrl:Url username:Username password:Password]; [self.globalDelegate closeForumList]; NSLog(@"ForumListFromForum init"); Both of the NSLog calls in this function are executed and perform as they should. Now, here is where the issue starts. self.globalDelegate is defined as AppDelegate *globalDelegate; in the Interface specification in my header file. However, [self.globalDelegate showForumListFromForumUsingUrl:username:password] and and [self.globalDelegate closeForumList] are never actually called. They look like so: -(void)closeForumList { NSLog(@"Hiding forum list"); [[self.ForumList view] removeFromSuperview]; } -(void)showForumListFromForumUsingUrl:(NSString *)Url username:(NSString *)Username password:(NSString *)Password { NSLog(@"Showing forum list from forum"); ForumListFromForum *fl = [ForumListFromForum alloc]; [fl initWithNibName:@"ForumListFromForum" bundle:[NSBundle mainBundle]]; [fl initFromForumWithUrl:Url username:Username password:Password]; self.ForumListFromForum = fl; [window addSubview:[self.ForumListFromForum view]]; [fl release]; } The app does not respond to my press and neither of these NSLog calls are made. Any idea where I've gone wrong?

    Read the article

  • Faster Javascript text replace

    - by Stacey
    Given the following javascript (jquery) $("#username").keyup(function () { selected.username = $("#username").val(); var url = selected.protocol + (selected.prepend == true ? selected.username : selected.url) + "/" + (selected.prepend == true ? selected.url : selected.username); $("#identifier").val(url); }); This code basically reads a textbox (username), and when it is typed into, it reconstructs the url that is being displayed in another textbox (identifier). This works fine - there are no problems with its functionality. However it feels 'slow' and 'sluggish'. Is there a cleaner/faster way to accomplish this task? Here is the HTML as requested. <fieldset class="identifier delta"> <form action="/authenticate/openid" method="post" target="_top" > <input type="text" class="openid" id="identifier" name="identifier" readonly="readonly" /> <input type='text' id='username' name='username' class="left" style='display: none;'/> <input type="submit" value="Login" style="height: 32px; padding-top: 1px; margin-right: 0px;" class="login right" /> </form> </fieldset> The identifier textbox just has a value set based on the hyperlink anchor of a button.

    Read the article

  • Extract and replace named group regex

    - by user557670
    I was able to extract href value of anchors in an html string. Now, what I want to achieve is extract the href value and replace this value with a new GUID. I need to return both the replaced html string and list of extracted href value and it's corresponding GUID. Thanks in advance. My existing code is like: Dim sPattern As String = "<a[^>]*href\s*=\s*((\""(?<URL>[^\""]*)\"")|(\'(?<URL>[^\']*)\')|(?<URL>[^\s]* ))" Dim matches As MatchCollection = Regex.Matches(html, sPattern, RegexOptions.IgnoreCase Or RegexOptions.IgnorePatternWhitespace) If Not IsNothing(matches) AndAlso matches.Count > 0 Then Dim urls As List(Of String) = New List(Of String) For Each m As Match In matches urls.Add(m.Groups("URL").Value) Next End If Sample HTML string: <html><body><a title="http://www.google.com" href="http://www.google.com">http://www.google.com</a><br /><a href="http://www.yahoo.com">http://www.yahoo.com</a><br /><a title="http://www.apple.com" href="http://www.apple.com">Apple</a></body></html>

    Read the article

  • get a different file name

    - by Power-Mosfet
    Hi, How do i get a different file name on a webserver by requesting the url. for example "file" click url link and get "file.bin" the "file" is located on a webserver by requesting the url, user can download "file.bin" instead of "file" something like (file + .bin)

    Read the article

  • Anything wrong with my cURL code (http status of 0)?

    - by Ilya
    Consistently getting a status of 0 even though if I copy and paste the url sent into my browser, I get a json object right back <?php $mainUrl = "https://api.xxxx.com/?"; $co = "xxxxx"; $pa = "xxxx"; $par = "xxxx"; $part= "xxxx"; $partn = "xxxx"; $us= "xxx"; $fields_string; $fields = array( 'co'=>urlencode($co), 'pa'=>urlencode($pa), 'par'=>urlencode($par), 'part'=>urlencode($part), 'partn'=>urlencode($partn), 'us'=>urlencode($us) ); foreach($fields as $key=>$value) { $fields_string .= $key . '=' . $value . '&' ;} $fields_string = rtrim($fields_string, "&"); $fields_string = "?" . $fields_string; $url = "https://api.xxxxx.com/" . $fields_string; $request = $url; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT_TIMEOUT,'3'); $content = trim(curl_exec($ch)); $http_status = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); print $url; print $http_status; print $content; ?>

    Read the article

  • How do I call this function in CodeIgniter controller?

    - by Jason Shultz
    I've got this code, but I'm not sure I make it work: /** * Function: youtube data grabber * * @description : * @param $ : video code, url type (embed/url) * @return : data array * @author : Mamun. * @last -modified-by: Mamun. */ if (! function_exists('youtube_data_grabber')) { function youtube_data_grabber($video_code, $link_type = "embed") { if ($video_code != '') { if ($link_type == "embed") { $splited_data = explode("=",$video_code); $video_unique_code = substr(strrchr($splited_data[4],"/"),1,-strlen(strrchr($splited_data[4],"&"))); } else if ($link_type == "url") { $splited_data = explode("=",$video_code); $video_unique_code = substr($splited_data[1],0,-strlen(strrchr($splited_data[1],"&"))); } else { return; } // set feed URL $feedURL = 'http://gdata.youtube.com/feeds/api/videos/'.$video_unique_code; // read feed into SimpleXML object $sxml = simplexml_load_file($feedURL); return $sxml; } } } // End Youtube Function I'm not sure how to activate it is what I'm trying to say. I placed it in the controller and it's within a function for one of my pages. I don't have any syntax errors. I just don't know how to wake it up and make it work. I thought I could just put youtube_data_grabber('http://www.youtube.com/watch?v=LAcrFym10ZI', 'url'); but that didn't work. I got the code from here: http://bit.ly/b7YnDt and I have the zend functionality working. I tested it earlier and had no errors. I'm just having trouble with this youtube part. Any ideas?

    Read the article

  • Submitting form in php file accessed by Ajax?

    - by dronnoc
    Hi people, I am trying to figure out how to submit a form in a page being accessed by Ajax? here are some code snippets to help demonstrate what i am trying to say. HTML BODY - THIS IS WHAT THE USER WILL SEE. <html> <head> <script language="javascript" src="linktoajaxfile.js"> </head> <body onLoad="gotoPage(0)"> <div id="fillThis"> </div> </body> </html> AJAX FILE var xmlhttp function gotoPage(phase) { xmlhttp=GetXmlHttpObject(); if (xmlhttp==null) { alert ("Your browser does not support AJAX!"); return; } var url="pageofstuffce.php"; url=url+"?stg="+phase; url=url+"&sid="+Math.random(); xmlhttp.onreadystatechange=stateChanged; xmlhttp.open("GET",url,true); xmlhttp.send(null); } function stateChanged() { if (xmlhttp.readyState==4) { document.getElementById("fillThis").innerHTML=xmlhttp.responseText; } } function GetXmlHttpObject() { if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari return new XMLHttpRequest(); } if (window.ActiveXObject) { // code for IE6, IE5 return new ActiveXObject("Microsoft.XMLHTTP"); } return null; } PAGE OF DATA <?php $stage = $_GET['stg']; if($stage == 0) { echo '<a onClick="gotoPage(1)">click me</a>'; } elseif($stage == 1) { <form> <input type="text" name="name"> <input type="submit" name="submit"> </form> } elseif(somehow can reach here) { show data from form. } ?> Can anyone perhaps help me get past the form and display the data in the same page? Also, i have looked around, and i don't think anything around has what i need... correct me if i'm wrong though :) Thanks in advance, and i hope i didn't put in too much detail :) Dronnoc EDIT Forgot to mention what I've tried; I have tried submitting the form to itself (same file) and that destroyed the ajax link, and opened the page. i have also tried just having the button move the page onto another step, but the $_POST variable is empty... i am at a loss, so does anyone else have any ideas?

    Read the article

  • Create select based on routing, how?

    - by huug
    I am trying to implement navigation like in Tree Based Navigation but based on url's defined in routes.rb (named routes, resources, ...). Is it possible to retreive a collection of all routes defined in routes.rb? So I can use it in a select like this: <%= f.collection_select :url, Route.all, :url, :name %> Tnx!

    Read the article

  • Google renforce la sécurité de ses services hébergés avec l'authentification basée sur les certificats pour Cloud Storage, Prediction API

    Google renforce la sécurité de ses services hébergés avec l'authentification basée sur les certificats pour Cloud Storage, Prediction API, URL Shortener Google a apporté une mise à jour à ses services Cloud pour les développeurs en renforçant la sécurité de ceux-ci. Les services hébergés de la firme pourront désormais communiquer avec des applications qui utilisent des comptes de service basés sur les certificatifs pour l'authentification. Ainsi, la requête d'une application Web au service Google Cloud Storage pourra par exemple être authentifiée par un certificat ou lieu d'une clé partagée. Les certificats de sécurité offrent une méthode d'authentification plus renforc...

    Read the article

  • Manipulating Directory Paths in Python

    - by G Ullman
    Basically I've got this current url and this other key that I want to merge into a new url, but there are three different cases. Suppose the current url is localhost:32401/A/B/foo if key is bar then I want to return localhost:32401/A/B/bar if key starts with a slash and is /A/bar then I want to return localhost:32401/A/bar finally if key is its own independent url then I just want to return that key = htt p://foo.com/bar - http://foo.com/bar I assume there is a way to do at least the first two cases without manipulating the strings manually, but nothing jumped out at me immediately in the os.path module.

    Read the article

  • Issue with loading background image using CSS

    - by Geethanga Amarasinghe
    Im using following CSS to set a background-image for my menu #menuContainer { background:url('../images/main-bg.png') repeat-x; } My CSS is inside ~/styles/site.css and my image is inside ~/images/main-bg.png The problem is this works perfectly in Chrome but it's not working in Firefox. But if change the URL to #menuContainer { background:url('images/main-bg.png') repeat-x; } It starts working in Firefox and in Chrome it doesn't work. Can anyone please help?

    Read the article

  • Downloading Large JSON File to local file using Java

    - by user1279675
    I'm attempting to download a JSON from the following URL - http://api.crunchbase.com/v/1/companies.js - to a local file. I'm using Java 1.7 and the following JSON Libraries - http://www.json.org/java/ - to attempt to make it work. Here's my code: public static void download(String address, String localFileName) { OutputStream out = null; URLConnection conn = null; InputStream in = null; try { URL url = new URL(address); out = new BufferedOutputStream( new FileOutputStream(localFileName)); conn = url.openConnection(); in = conn.getInputStream(); byte[] buffer = new byte[1024]; int numRead; long numWritten = 0; while ((numRead = in.read(buffer)) != -1) { out.write(buffer, 0, numRead); numWritten += numRead; System.out.println(buffer.length); System.out.println(" " + buffer.hashCode()); } System.out.println(localFileName + "\t" + numWritten); } catch (Exception exception) { exception.printStackTrace(); } finally { try { if (in != null) { in.close(); } if (out != null) { out.close(); } } catch (IOException ioe) { } } } When I run the code everything seems to work until midway through the loop the program seems to stop and not continue reading the JSON Object. Does anyone know why this would stop reading? How could I fix the issue?

    Read the article

  • is @font-face server dependant

    - by samquo
    Not sure if this has something to do the live host I'm working with, but I'm using @font-face in the following format, @font-face { font-family: 'UbuntuTitle'; src: url('Ubuntu-Title-webfont.eot'); src: local('?'), url('Ubuntu-Title-webfont.woff') format('woff'), url('Ubuntu-Title-webfont.ttf') format('truetype'), url('Ubuntu-Title-webfont.svg') format('svg'); font-weight: normal; font-style: normal; } I'm finding though that I can't save the document because of the strange character in () in local local('?') so I save it as UTF-8, but that changes the character to this local('☺'). Could that be the reason why it's not being picked up on the server? Any other possibilities?

    Read the article

  • How to handle single Ajax Error for Entire page using jquery

    - by Thiyagarajan
    In My page i am sending data to server side using 8 ajax call... I don't want to handle ajax error for each and every ajax call...... Single ajax error handle all the ajax error in entire page.... is their any inheritance is possible for the entire page.. function SendConfirmationEmail(ShipmentID, ChannelOrderReference) { var Url = '<%=Url.Action("SendShipmentEmail","Shipments") %>'; $.ajax({ cache: false, type: "POST", data: 'strOrderShipmentId=' + ShipmentID + '&channelOrderReference=' + ChannelOrderReference, url: Url, datatype: "HTML", success: function (data) { if (data == "1") { SucessErrorMessageDisplay('DivStatus', 'lblStatus', 'imgStatus', 0, 'Email is successfully sent for Order#' + ChannelOrderReference + ''); } if (data == "-2") { SucessErrorMessageDisplay('DivStatus', 'lblStatus', 'imgStatus', 0, 'Email Template is not Choosen for this Store'); } if (data == "-1") { SucessErrorMessageDisplay('DivStatus', 'lblStatus', 'imgStatus', 0, 'Problem in Sending Email for Order#' + ChannelOrderReference + ''); } if (data == "0") { SucessErrorMessageDisplay('DivStatus', 'lblStatus', 'imgStatus', 0, 'Connection Failed to Send Email for Order# ' + ChannelOrderReference + ''); } if (data == "-3") { SucessErrorMessageDisplay('DivStatus', 'lblStatus', 'imgStatus', 0, 'ShipTo Email Address is Not Given for Order# ' + ChannelOrderReference + ''); } // SucessErrorMessageDisplay('DivStatus', 'lblStatus', 'imgStatus', 0, 'Order# :' + ChannelOrderReference + ' is voided successfully'); }, error: function (xhr, ajaxOptions, thrownError) { if (xhr.status == 403) { window.location.href = '<%: Url.Action( "SessionExpire", "Home" ) %>'; } } }); }

    Read the article

  • Routing optional parameters with dashes in MVC

    - by Géza
    I've made an routing definition like this: routes.MapRoute("ProductSearch", "Search-{MainGroup}-{SubGroup}-{ItemType}", new { controller = "Product", action = "Search", MainGroup = "", SubGroup = "", ItemWebType = ""}); It is not working if the parameters are empty. Actually it resolves the url, so Url.Action method resolves the path "Search-12--" but the link is not working, so the GET of the page is not working With slashes it is working the Url.Action method makes "Search/12" "Search/{MainGroup}/{SubGroup}/{ItemType}" is it somehow possible to correct it?

    Read the article

  • Discard unprintable characters returned in server's XML response

    - by Penang
    While trying to use the Bing API to search, I am getting characters that are not printable and do not seem to hold any extra information. The goal is to save the XML (UTF-8) response as a text file to be parsed later. My code currently looks something like this: URL url = new URL(queryURL); BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream())); BufferedWriter out = new BufferedWriter(new FileWriter(query+"-"+saveResultAs)); String str = in.readLine(); out.write(str); in.close(); out.close(); When I send the contents of 'str' to console it looks something like this: and here's a what the newly created local XML file looks like: What should I be doing to convert the UTF-8 text so that str does not have the extra characters?

    Read the article

  • Delete duplicate rows, do not preserve one row

    - by Radley
    I need a query that goes through each entry in a database, checks if a single value is duplicated elsewhere in the database, and if it is - deletes both entries (or all, if more than two). Problem is the entries are URLs, up to 255 characters, with no way of identifying the row. Some existing answers on Stackoverflow do not work for me due to performance limitations, or they use uniqueid which obviously won't work when dealing with a string. Long Version: I have two databases containing URLs (and only URLs). One database has around 3,000 urls and the other around 1,000. However, a large majority of the 1,000 urls were taken from the 3,000 url database. I need to merge the 1,000 into the 3,000 as new entries only. For this, I made a third database with combined URLs from both tables, about 4,000 entries. I need to find all duplicate entries in this database and delete them (Both of them, without leaving either). I have followed the query of a few examples on this site, but whenever I try to delete both entries it ends up deleting all the entries, or giving sql errors. Alternatively: I have two databases, each containing the separate database. I need to check each row from one database against the other to find any that aren't duplicates, and then add those to a third database. Edit: I've got my own PHP solution which is pretty hacky, but works. I cannot answer my own question for 8 hours because I'm new, so here it is for now: I went with a PHP script to accomplish this, as I'm more familiar with PHP than MySQL. This generates a simple list of urls that only exist in the target database, but not both. If you have more than 7,000 entries to parse this may take awhile, and you will need to copy/paste the results into a text file or expand the script to store them back into a database. I'm just doing it manually to save time. Note: Uses MeekroDB <pre> <?php require('meekrodb.2.1.class.php'); DB::$user = 'root'; DB::$password = ''; DB::$dbName = 'testdb'; $all = DB::query('SELECT * FROM old_urls LIMIT 7000'); foreach($all as $row) { $test = DB::query('SELECT url FROM new_urls WHERE url=%s', $row['url']); if (!is_array($test)) { echo $row['url'] . "\n"; }else{ if (count($test) == 0) { echo $row['url'] . "\n"; } } } ?> </pre>

    Read the article

  • How to prevent the symbol "&" from being replaced by "&amp;

    - by tonsils
    Hi, Hoping someone could pls let me know how to prevent the symbol "&" from being replaced by "&amp;" within my URL, specifically within javascript? Just to expand on requirement, I am getting my url from an oracle database table, which I then use within Oracle Application Express, to set the src attribute of an iframe to this url. FYI, the url stored in the Oracle table is actually stored correctly, i.e. http://mydomain.com/xml/getInfo?s=pvalue1&f=mydir/Summary.xml what appears in my use when trying to pass over into iframe src using javascript is: http://mydomain.com/xml/getInfo?s=pvalue1&amp;f=mydir/Summary.xml which basically returns a page cannot be found Hope this clarified further my issue. Thanks.

    Read the article

  • how to save Audiorecorded file to another location? i m trying but i got exception...

    - by rakesh-bhatt99
    NSString recordFile = [NSTemporaryDirectory() stringByAppendingPathComponent: (NSString)inRecordFile]; NSArray *docPaths=NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask,YES); NSString docDir=[[docPaths objectAtIndex:0]stringByAppendingPathComponent: (NSString)inRecordFile]; url = CFURLCreateWithString(kCFAllocatorDefault, (CFStringRef)docPaths, NULL); // create the audio file XThrowIfError(AudioFileCreateWithURL(url, kAudioFileCAFType, &mRecordFormat, kAudioFileFlags_EraseFile, &mRecordFile), "AudioFileCreateWithURL failed"); CFRelease(url);

    Read the article

  • Jquery .load and inner jquery .append

    - by speekeazy
    Hello, Ive just started using jquery for the .load ajax functionality. When i load an external page to a specific div it loads fine. inside the external page there is an .append that .appends javascript to the head. This works on the initial load but when i use .load to load it this portion is not showing. //This is the .load for the div function loadContent(elementSelector, sourceUrl) { url = ""+sourceUrl+""; $(""+elementSelector+"").load(url); alert(url); } //This is the append in the other page that is embedded in a js var cUrl = "http://intensedebate.com/js/genericCommentWrapper2.php?acct="+idcomments_acct+"&postid="+idcomments_post_id+"&title="+idcomments_post_title+"&url="+idcomments_post_url; alert(cUrl); commentScript.type = "text/javascript"; commentScript.src = cUrl; $('head').append(commentScript);

    Read the article

  • Ensuring uniqueness on a varchar greater than 255 in MYSQL/InnoDB

    - by Vijay Boyapati
    I have a table which contains HTML entries for news pages. When I initially designed it I used URL as the primary key. I've learned the error of my ways because left-joining is super slow. So I want to redesign the table with an integer (id) primary key, but still keep the rows unique based on the URL. The problem is that I've found URLs longer than 255 characters, and MySQL isn't letting my create a key on the URL. I'm using an InnoDB/UTF8 table. From what I understand it's using multiple bytes per character with a limit of 766 bytes for the key (in InnoDB). I would really love suggestions on an elegant way of keeping the rows unique based on URL, while using an integer primary key. Thanks!

    Read the article

< Previous Page | 183 184 185 186 187 188 189 190 191 192 193 194  | Next Page >