Search Results

Search found 3339 results on 134 pages for 'hash collision'.

Page 98/134 | < Previous Page | 94 95 96 97 98 99 100 101 102 103 104 105  | Next Page >

  • Trying to get a new user up on pfSense IPSec VPN; Config file import failed, now getting gateway err

    - by Chris
    Caveat: I am not a sysadmin, so please forgive the n00bness of the query. We have a new user and I'm trying to get them up on VPN. We use pfsense as an IPSEC endpoint. This person is using Shrewsoft for the client. I had created an entry in pfsense for them and then edited a previous user's config file. Shrewsoft didn't import the config file very well and I had to hand edit the information. Now we are getting gateway errors. One thing I've noticed is that there is a different between the values of the preshared key stored on the firewall and the psk stored in the config file. I assume it has something to do with a hash, but I've no idea if that's the case and whether that might be what's causing the problem. Any suggestions greatly appreciated! Tangentially, is there some software used to generate these config files?

    Read the article

  • Edit exim4 Message-ID for releasing blocked mail by Mailscanner

    - by F12
    Our sysadmin team edits the field Message-ID in exim4 header files (ending with -H) and substitues the first char after "<". e.g: 077I Message-ID: <[email protected] -- 077I Message-ID: <[email protected] I'd like to write a script to release the mails. I changed the part between "<" and "@" in the field Message-ID and substituted a hash value so the Message-ID looks like: 077I Message-ID: <[email protected] Now exim says "format error" in the log and the mail is not released. There was no change except for this one field. Why can't the ID be substituted like that? Does it need to be the exact same length? It's exim4 version 4.69-2ubuntu0.3.

    Read the article

  • How to edit the list of files to download in a .torrent file?

    - by Forbidden Overseer
    I have a torrent that contains many files in it, but I don't want to download all of them because I need only few files among them. I am not downloading from a torrent client, but I am actually using put.io service that converts torrents into direct downloads for me. I want to edit the .torrent file (or magnet link) in such a way that I get only those files which I need from the torrent. I tried by editing with text editors, but I am getting some crazy hash errors when I did that. I have seen people editing trackers in a torrent file (using online editors and other editors), but none of them edited the list of files in the torrent file. So, the question is: How to edit a .torrent file (and save it back as another .torrent file) such that when you run that torrent file, it only downloads only those files you need?

    Read the article

  • Mail being sent as root on Ubuntu 14.04

    - by Benjamin Allison
    I'm really struggling with this. I'm trying to set up this server to send mail using Gmail's SMTP. Google keeps bouncing the messages, saying that that Authentication is required: smtp.gmail.com[74.125.196.109]:25: 530-5.5.1 Authentication Required. Learn more at smtp.gmail.com[74.125.196.109]:25: 530 5.5.1 http://support.google.com/mail/bin/answer.py?answer=14257 But it seems my server is trying to send mail as [email protected]. I'm baffled. Here's what I've done so far: Updated mail.cf relayhost = [smtp.gmail.com]:587 smtp_sasl_auth_enable = yes smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd smtp_sasl_security_options = noanonymous smtp_tls_CAfile = /etc/postfix/cacert.pem smtp_use_tls = yes Created /etc/postfix/sasl_passwd: [smtp.gmail.com]:587 [email protected]:password Then did the following: sudo chmod 400 /etc/postfix/sasl_passwd sudo postmap /etc/postfix/sasl_passwd cat /etc/ssl/certs/Thawte_Premium_Server_CA.pem | sudo tee -a /etc/postfix/cacert.pem service postfix restart I can't for the life me get a mail message to send, or change the default mail user from [email protected] to [email protected] (FWIW, I'm using Google Apps, that's why it's not a .gmail address).

    Read the article

  • match patterns update output file uncomment when desired

    - by user2692634
    Need suggestion for following. Have two files myfile and responsefile. First file myfile.txt user=myname user_1=yourname group=mygroup group_1=yourgroup second file responsefile.txt #Please fill details user= #user_1= #user_2= #Please fill details group= #group_1= #group_2= Based on myfile.txt data update responsefile.txt as below and the file responsefile.txt is lenghty of about 604L, 16481C. Result output responsefile.txt #Please fill details user=myname user_1=yourname #user_2= #Please fill details group=mygroup group_1=yourgroup #group_2= If you observe myfile above, I want to match user= in responsefile, then update as user=myname, same applies for group=. Then match user_1= and group_1= which is hashed or commented in responsefile, update as user_1=yourname and group_1=yourgroup. Should not remove hash or uncomment for others in file. I tried this awk -F= 'NR==FNR{a[$1]=$0;next}$1 in a{$0=a[$1]}1' myfile.txt responsefile.txt Please suggest thanks in advance.

    Read the article

  • IP packet proxy solutions? Riverbed alternative

    - by Ruvan
    I have stumbled upon Riverbed.com's products which basically has the capability to hash chunks of IP data and subsequently store them to disk. I'm looking for an open source / cheaper alternative. WANProxy is the exact equivalent except that it only keeps data in-memory and can't store the data to disk which is a requirement for our solution. I'm basically looking for a proxy which not only looks at the files (filenames) but the data itself being transmitted at the packet level. Anyone? Thanks!

    Read the article

  • Move already (i.e. not new) completed files in rtorrent

    - by Skippy le Grand Gourou
    I've been using rtorrent for a while with a single directory. Now I figured out it was possible to use different directories and even to move completed downloads elsewhere, so according to the rtorrent wiki I edited my .rtorrent.rc as follow : # Download directory directory = /Medias/torrents/ # Watching directories schedule = watch_directory_1,5,60,"load_start=/path/to/dl/dir1/*.torrent,d.set_custom1=/path/to/done/dir1" schedule = watch_directory_2,5,60,"load_start=/path/to/dl/dir2/*.torrent,d.set_custom1=/path/to/done/dir2" # On completion, move the torrent to the directory from custom1. system.method.set_key = event.download.finished,move_complete,"d.set_directory=$d.get_custom1= ;execute=mv,-u,$d.get_base_path=,$d.get_custom1=" It seems to work for new torrents. However I have a bunch of completed files I have already downloaded before to split directories, and for them it does not work : if I delete their file in the session directory, rtorrent will check the hash but won't move them, and if I move them by myself rtorrent won't see them and will try to redownload them. So how can I tell rtorrent either to move them or that they are in another directory ? Thanks.

    Read the article

  • Find RARs with duplicate content

    - by Scott McClenning
    I need a utility to find RAR files that contain duplicate data (i.e. files within the RAR that hash the same, but could have different names). I can open the RARs and see the CRCs are the same, but I was hoping for a more automated process that would work in bulk (hundreds of files). Hashing the overall RAR won't help because the file contained within could have different names, or the archive could be compressed at different levels. If needed, a utility that would extract the contents of the RARs and then compare would work, but is not preferred. I would prefer a free utility for Windows, but a pay utility or a utility for Linux would be acceptable.

    Read the article

  • Network Password Recovery

    - by sneakyV
    I am trying to recover a password for my network. It's set up like this: a network of computers, and a central server which authenticates login-passwords entered, and is also a network share. Username looks like administrator@abc. I tried to recover the password hashes from the individual CPUs, they gave this : FAFEA8FAF0D8D61FAAD3B435B51404EE. This decodes to GAGCAU and a null hash after. This password does not work for logging in to the network. Is there a way to recover the password for the network share from a non-admin network account? Thanks in advance.

    Read the article

  • Curl, twitter oauth problem

    - by Darxval
    Does anyone see a problem with the following Curl call / how the Oauth request is built? (i am trying to get a correctly setup request so i can finish my app) So i am calling the following CURL call: C:\>curl -v -k --data-urlencode "status=Testing2" -H "Authorization: OAuth realm='', oauth_nonce=1276107867blah, oauth_timestamp=1276107867, oauth_consumer_key=yJDLH7BDdVi1OKIINSV7Q, oauth_signature_method=HMAC-SHA1, oauth_version=1.0, oauth_signature=NWU4MDdlNjk0OGIxYWQ1YTkyNmU5YjU1NGYyOTczMmU5ZDg5 YWNkNA==, staus=Testing2 " http://twitter.com/statuses/update.xml?status=Testing2 and i recieve this: * About to connect() to twitter.com port 80 (#0) * Trying 168.143.162.68... connected * Connected to twitter.com (168.143.162.68) port 80 (#0) > POST /statuses/update.xml?status=Testing2 HTTP/1.1 > User-Agent: curl/7.20.1 (i386-pc-win32) libcurl/7.20.1 OpenSSL/0.9.8n zlib/1.2.5 libidn/1.18 libssh2/1.2.5 > Host: twitter.com > Accept: */* > Authorization: OAuth realm='', oauth_nonce=1276106370blah, oauth_timestamp=1276106370, oauth_consumer_key=yJDLH7BDdVi1OKIINSV7Q, oauth_signature_method=HMAC-SHA1, oauth_version=1.0, oauth_signature=MjQzNDA1MGU4NGRmMWVjMzUwZmQ4YzE5NzMzY2I1ZDJlOTRkNmQ2Zg==, staus=Testing2 > Content-Length: 15 > Content-Type: application/x-www-form-urlencoded > < HTTP/1.1 401 Unauthorized < Date: Wed, 09 Jun 2010 18:00:22 GMT < Server: hi < Status: 401 Unauthorized < WWW-Authenticate: Basic realm="Twitter API" < X-Runtime: 0.00548 < Content-Type: application/xml; charset=utf-8 < Content-Length: 164 < Cache-Control: no-cache, max-age=1800 < Set-Cookie: k=209.234.229.21.1276106420885412; path=/; expires=Wed, 16-Jun-10 18:00:20 GMT; domain=.twitter.com < Set-Cookie: guest_id=127610642214871948; path=/; expires=Fri, 09 Jul 2010 18:00:22 GMT < Set-Cookie: _twitter_sess=BAh7CDoPY3JlYXRlZF9hdGwrCIm33h0pAToHaWQiJTkyMjllODE0NTdiYWE1%250AMWU1MzBmNjgwMTFiMDhkYjdlIgpmbGFzaElDOidBY3Rpb25Db250cm9sbGVy%250AOjpGbGFzaDo6Rmxhc2hIYXNoewAGOgpAdXNlZHsA--8ebb3c62d461d28f8fda7b8adab642af66969f7e; domain=.twitter.com; path=/ < Expires: Wed, 09 Jun 2010 18:30:20 GMT < Vary: Accept-Encoding < Connection: close < <?xml version="1.0" encoding="UTF-8"?> <hash> <request>/statuses/update.xml?status=Testing2</request> <error>Could not authenticate with OAuth.</error> </hash> * Closing connection #0 my Parameters are setup like so: var parameters = [encodeURIComponent("status="+status),encodeURIComponent("oauth_token="+ac_token),encodeURIComponent("oauth_consumer_key="+"yJDLH7BDdVi1OKIINSV7Q"),encodeURIComponent("oauth_nonce="+nonce,"oauth_signature_method=HMAC-SHA1"),encodeURIComponent("oauth_timestamp="+timestamp),encodeURIComponent("oauth_version=1.0")] var join = parameters.join("&"); var eparamjoin =encodeURIComponent(join); The key is like so: var key=con_secret+"&"+ac_secret; Signature base string is: var signaturebs = "POST&"+encodeURIComponent(url)+"&"+eparamjoin; giving this: POST&http%3A%2F%2Ftwitter.com%2Fstatuses%2Fupdate.xml&status%253DTesting2%26oauth_token%253D142715285-yi2ch324S3zfyKyJby6WDUZOhCsiQuKNUtc3nAGe%26oauth_consumer_key%253DyJDLH7BDdVi1OKIINSV7Q%26oauth_nonce%253D1276107867blah%26oauth_timestamp%253D1276107867%26oauth_version%253D1.0 and signature built like so: var hmac = Crypto.HMAC(Crypto.SHA1, signaturebs,key ); var signature=Base64.encode(hmac); making the signature: NWU4MDdlNjk0OGIxYWQ1YTkyNmU5YjU1NGYyOTczMmU5ZDg5YWNkNA== Any help would be appreciated thank you!

    Read the article

  • Merging dictionaries in C#

    - by orip
    What's the best way to merge 2 or more dictionaries (Dictionary<T1,T2>) in C#? (3.0 features like LINQ are fine). I'm thinking of a method signature along the lines of: public static Dictionary<TKey,TValue> Merge<TKey,TValue>(Dictionary<TKey,TValue>[] dictionaries); or public static Dictionary<TKey,TValue> Merge<TKey,TValue>(IEnumerable<Dictionary<TKey,TValue>> dictionaries); EDIT: Got a cool solution from JaredPar and Jon Skeet, but I was thinking of something that handles duplicate keys. In case of collision, it doesn't matter which value is saved to the dict as long as it's consistent.

    Read the article

  • How to decrypt a string in C# that was encrypted in Delphi

    - by Simon Linder
    Hi all, we have a project written in Delphi that we want to convert to C#. Problem is that we have some passwords and settings that are encrypted and written into the registry. When we need a specified password we get it from the registry and decrypt it so we can use it. For the conversion into C# we have to do it the same way so that the application can also be used by users that have the old version and want to upgrade it. Here is the code we use to encrypt/decrypt strings in Delphi: unit uCrypt; interface function EncryptString(strPlaintext, strPassword : String) : String; function DecryptString(strEncryptedText, strPassword : String) : String; implementation uses DCPcrypt2, DCPblockciphers, DCPdes, DCPmd5; const CRYPT_KEY = '1q2w3e4r5t6z7u8'; function EncryptString(strPlaintext) : String; var cipher : TDCP_3des; strEncryptedText : String; begin if strPlaintext <> '' then begin try cipher := TDCP_3des.Create(nil); try cipher.InitStr(CRYPT_KEY, TDCP_md5); strEncryptedText := cipher.EncryptString(strPlaintext); finally cipher.Free; end; except strEncryptedText := ''; end; end; Result := strEncryptedText; end; function DecryptString(strEncryptedText) : String; var cipher : TDCP_3des; strDecryptedText : String; begin if strEncryptedText <> '' then begin try cipher := TDCP_3des.Create(nil); try cipher.InitStr(CRYPT_KEY, TDCP_md5); strDecryptedText := cipher.DecryptString(strEncryptedText); finally cipher.Free; end; except strDecryptedText := ''; end; end; Result := strDecryptedText; end; end. So for example when we want to encrypt the string asdf1234 we get the result WcOb/iKo4g8=. We now want to decrypt that string in C#. Here is what we tried to do: public static void Main(string[] args) { string Encrypted = "WcOb/iKo4g8="; string Password = "1q2w3e4r5t6z7u8"; string DecryptedString = DecryptString(Encrypted, Password); } public static string DecryptString(string Message, string Passphrase) { byte[] Results; System.Text.UTF8Encoding UTF8 = new System.Text.UTF8Encoding(); // Step 1. We hash the passphrase using MD5 // We use the MD5 hash generator as the result is a 128 bit byte array // which is a valid length for the TripleDES encoder we use below MD5CryptoServiceProvider HashProvider = new MD5CryptoServiceProvider(); byte[] TDESKey = HashProvider.ComputeHash(UTF8.GetBytes(Passphrase)); // Step 2. Create a new TripleDESCryptoServiceProvider object TripleDESCryptoServiceProvider TDESAlgorithm = new TripleDESCryptoServiceProvider(); // Step 3. Setup the decoder TDESAlgorithm.Key = TDESKey; TDESAlgorithm.Mode = CipherMode.ECB; TDESAlgorithm.Padding = PaddingMode.None; // Step 4. Convert the input string to a byte[] byte[] DataToDecrypt = Convert.FromBase64String(Message); // Step 5. Attempt to decrypt the string try { ICryptoTransform Decryptor = TDESAlgorithm.CreateDecryptor(); Results = Decryptor.TransformFinalBlock(DataToDecrypt, 0, DataToDecrypt.Length); } finally { // Clear the TripleDes and Hashprovider services of any sensitive information TDESAlgorithm.Clear(); HashProvider.Clear(); } // Step 6. Return the decrypted string in UTF8 format return UTF8.GetString(Results); } Well the result differs from the expected result. After we call DecryptString() we expect to get asdf1234but we get something else. Does anyone have an idea of how to decrypt that correctly? Thanks in advance Simon

    Read the article

  • simple C++ hash_set example

    - by celil
    I am new to C++ and STL. I am stuck with the following simple example of a hash set storing custom data structures: #include <iostream> #include <ext/hash_set> using namespace std; using namespace __gnu_cxx; struct trip { int trip_id; int delta_n; int delta_secs; trip(int trip_id, int delta_n, int delta_secs){ this->trip_id = trip_id; this->delta_n = delta_n; this->delta_secs = delta_secs; } }; struct hash_trip { size_t operator()(const trip t) { hash<int> H; return H(t.trip_id); } }; struct eq_trip { bool operator()(const trip t1, const trip t2) { return (t1.trip_id==t2.trip_id) && (t1.delta_n==t2.delta_n) && (t1.delta_secs==t2.delta_secs); } }; int main() { hash_set<trip, hash_trip, eq_trip> trips; trip t = trip(3,2,-1); trip t1 = trip(3,2,0); trips.insert(t); } when I try to compile it, I get the following error message: /usr/include/c++/4.2.1/ext/hashtable.h: In member function ‘size_t __gnu_cxx::hashtable<_Val, _Key, _HashFcn, _ExtractKey, _EqualKey, _Alloc>::_M_bkt_num_key(const _Key&, size_t) const [with _Val = trip, _Key = trip, _HashFcn = hash_trip, _ExtractKey = std::_Identity<trip>, _EqualKey = eq_trip, _Alloc = std::allocator<trip>]’: /usr/include/c++/4.2.1/ext/hashtable.h:599: instantiated from ‘size_t __gnu_cxx::hashtable<_Val, _Key, _HashFcn, _ExtractKey, _EqualKey, _Alloc>::_M_bkt_num(const _Val&, size_t) const [with _Val = trip, _Key = trip, _HashFcn = hash_trip, _ExtractKey = std::_Identity<trip>, _EqualKey = eq_trip, _Alloc = std::allocator<trip>]’ /usr/include/c++/4.2.1/ext/hashtable.h:1006: instantiated from ‘void __gnu_cxx::hashtable<_Val, _Key, _HashFcn, _ExtractKey, _EqualKey, _Alloc>::resize(size_t) [with _Val = trip, _Key = trip, _HashFcn = hash_trip, _ExtractKey = std::_Identity<trip>, _EqualKey = eq_trip, _Alloc = std::allocator<trip>]’ /usr/include/c++/4.2.1/ext/hashtable.h:437: instantiated from ‘std::pair<__gnu_cxx::_Hashtable_iterator<_Val, _Key, _HashFcn, _ExtractKey, _EqualKey, _Alloc>, bool> __gnu_cxx::hashtable<_Val, _Key, _HashFcn, _ExtractKey, _EqualKey, _Alloc>::insert_unique(const _Val&) [with _Val = trip, _Key = trip, _HashFcn = hash_trip, _ExtractKey = std::_Identity<trip>, _EqualKey = eq_trip, _Alloc = std::allocator<trip>]’ /usr/include/c++/4.2.1/ext/hash_set:197: instantiated from ‘std::pair<typename __gnu_cxx::hashtable<_Value, _Value, _HashFcn, std::_Identity<_Value>, _EqualKey, _Alloc>::const_iterator, bool> __gnu_cxx::hash_set<_Value, _HashFcn, _EqualKey, _Alloc>::insert(const typename __gnu_cxx::hashtable<_Value, _Value, _HashFcn, std::_Identity<_Value>, _EqualKey, _Alloc>::value_type&) [with _Value = trip, _HashFcn = hash_trip, _EqualKey = eq_trip, _Alloc = std::allocator<trip>]’ try.cpp:45: instantiated from here /usr/include/c++/4.2.1/ext/hashtable.h:595: error: passing ‘const hash_trip’ as ‘this’ argument of ‘size_t hash_trip::operator()(trip)’ discards qualifiers What am I doing wrong?

    Read the article

  • How to investigate if opencl is possible for an algorithm

    - by Marnix
    I have a heavy-duty algorithm in C# that takes two large Bitmaps of about 10000x5000 and performs photo and ray collision operations on a 3D model to map photos on the 3D model. I would like to know if it is possible to convert such an algorithm to OpenCL to optimize parallel operations during the algorithm. But before asking you to go into the details of the algorithm, I would like to know how I can investigate if my algorithm is convertible to OpenCL. I am not experienced in OpenCL and I would like to know if it is worth it to get into it and learn how it works. Are there things I have to look for that will definitely not work on the graphics card? (for-loops, recursion) Update: My algorithm goes something like: foreach photo split the photo in 64x64 blocks foreach block cast a ray from the camera to the 3D model foreach triangle in 3D model perform raycheck

    Read the article

  • Can zlib.crc32 or zlib.adler32 be safely used to mask primary keys in URLs?

    - by David Eyk
    In Django Design Patterns, the author recommends using zlib.crc32 to mask primary keys in URLs. After some quick testing, I noticed that crc32 produces negative integers about half the time, which seems undesirable for use in a URL. zlib.adler32 does not appear to produce negatives, but is described as "weaker" than CRC. Is this method (either CRC or Adler-32) safe for usage in a URL as an alternate to a primary key? (i.e. is it collision-safe?) Is the "weaker" Adler-32 a satisfactory alternative for this task? How the heck do you reverse this?! That is, how do you determine the original primary key from the checksum?

    Read the article

  • Short unique id in php

    - by Antti
    I want to create a unique id but uniqid() is giving something like '492607b0ee414'. What i would like is something similar to what tinyurl gives: '64k8ra'. The shorter, the better. The only requirements are that it should not have an obvious order and that it should look prettier than a seemingly random sequence of numbers. Letters are preferred over numbers and ideally it would not be mixed case. As the number of entries will not be that many (up to 10000 or so) the risk of collision isn't a huge factor. Any suggestions appreciated.

    Read the article

  • MVC ActionLink omits action when action equals default route value

    - by rjygraham
    I have the following routes defined for my application: routes.MapRoute( "Referral", // Route name "{referralCode}", // URL with parameters new { controller = "Home", action = "Index" } // Parameter defaults ); routes.MapRoute( "Default", // Route name "{controller}/{action}", // URL with parameters new { controller = "Home", action = "Index" } // Parameter defaults ); And I'm trying to create an ActionLink to go on the Index action on my AdminController: @Html.ActionLink("admin", "Index", "Admin") However, when the view is executed the ActionLink renders as (Index action value is omitted): <a href="/Admin">admin</a> Normally this would be ok, but it's causing a collision with the "Referral" route. NOTE: If I instead use ActionLink to render a different action like "Default," the ActionLink renders correctly: <a href="/Admin/Default">admin</a> The fact that the "Default" action renders correctly leads me to believe the problem has to do with the default value specified for the route. Is there anyway to force ActionLink to render the "Index" action as well?

    Read the article

  • jQuery AJAX (google PageRank)

    - by RobertPitt
    Hey guys, I need a little help.. iv'e been developing a Jqery plug-in to get the page ranks of urls on a website using XHR, The problem is when requesting the rank from google servers the page is returned no content, but if i use an inspector and get the url that was requests and go to it via my browser the pageranks are shown. so it must be something with headers but its just got me puzzled. Heres some source code but i have removed several aspects that are not needed to review. pagerank.plugin.js ( $.fn.PageRank = function(callback) { var _library = new Object(); //Creat the system library _library.parseUrl = function(a) { var b = {}; var a = a || ''; /* * parse the url to extract its parts */ if (a = a.match(/((s?ftp|https?):\/\/){1}([^\/:]+)?(:([0-9]+))?([^\?#]+)?(\?([^#]+))?(#(.+))?/)) { b.scheme = a[2] ? a[2] : "http"; b.host = a[3] ? a[3] : null; b.port = a[5] ? a[5] : null; b.path = a[6] ? a[6] : null; b.args = a[8] ? a[8] : null; b.anchor = a[10] ? a[10] : null } return b } _library.ValidUrl = function(url) { var b = true; return b = url.host === undefined ? false : url.scheme != "http" && url.scheme != "https" ? false : url.host == "localhost" ? false : true } _library.toHex = function(a){ return (a < 16 ? "0" : "") + a.toString(16) } _library.hexEncodeU32 = function(a) { } _library.generateHash = function(a) { for (var b = 16909125, c = 0; c < a.length; c++) { } return _library.hexEncodeU32(b) } var CheckPageRank = function(domain,_call) { var hash = _library.generateHash(domain); $.ajax( { url: 'http://www.google.com/search?client=navclient-auto&ch=8'+hash+'&features=Rank&q=info:' + escape(domain), async: true, dataType: 'html', ifModified:true, contentType:'', type:'GET', beforeSend:function(xhr) { xhr.setRequestHeader('Referer','http://google.com/'); //Set Referer }, success: function(content,textS,xhr){ var d = xhr.responseText.substr(9, 2).replace(/\s$/, ""); if (d == "" || isNaN(d * 1)) d = "0"; _call(d); } }); } //Return the callback $(this).each(function(){ urlsegments = _library.parseUrl($(this).attr('href')) if(_library.ValidUrl(urlsegments)) { CheckPageRank(urlsegments.host,function(rank){ alert(rank) callback(rank); }); } }); return this; //Dont break any chain. } )(jQuery); Index.html (example) <html> <head> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"></script> <script type="text/javascript" src="pagerank.plugin.js"></script> <script type="text/javascript"> $(document).ready(function() { $('a').PageRank(function(pr){ alert(pr); }) }); </script> </head> <body> <a href="http://facebook.com">a</a> <a href="http://twitter.com">a</a> <div></div> </body> </html> i just cant understand why its doing this.

    Read the article

  • RuntimeException: Could not start Selenium session: Internal Server Error

    - by user79685
    I am trying to detect a midair collision problem (simultaneous editin) using selenium. So I start a selenium session A with following (Super Class) selenium = new MASSelenium(serverHost, serverPort, *iexplore, browserURL); selenium.start(); selenium.open("index.cgi"); then I try starting a different selenium session B pointing to a different browser from the superclass (Sub Class): selenium2 = new MASSelenium(getServerHost(), getServerPort(), *firefox, getBrowserURL()); selenium2.start(); selenium2.open("index.cgi"); It works fine on my local machine (behaves as expected) but then when i run this same test on a remote machine (using bamboo build tool), i get this exception: java.lang.RuntimeException: Could not start Selenium session: Internal Server Error at com.thoughtworks.selenium.DefaultSelenium.start(DefaultSelenium.java:89) at gov.baba.arc.mas.selenium.tests.SimultaneousEditingConflictDetected.setUp(SimultaneousEditingConflictDetected.java:78) Caused by: com.thoughtworks.selenium.SeleniumException: Internal Server Error at com.thoughtworks.selenium.HttpCommandProcessor.throwAssertionFailureExceptionOrError(HttpCommandProcessor.java:97) at com.thoughtworks.selenium.HttpCommandProcessor.getCommandResponseAsString(HttpCommandProcessor.java:168) at com.thoughtworks.selenium.HttpCommandProcessor.executeCommandOnServlet(HttpCommandProcessor.java:104) at com.thoughtworks.selenium.HttpCommandProcessor.doCommand(HttpCommandProcessor.java:86) Any idea why this is happening?

    Read the article

  • ^M characters when using Tramp (on Windows) to connect to Ubuntu Server

    - by jamting
    I've set up Tramp on Emacs on my Windows 7 box (64 bit). For this test, this is the only thing in my emacs-config: (setq tramp-default-method "plink") Then I connect to my Ubuntu Server 9.10 running in a VM on my local network. Connection goes fine, i can use dired to browse folders and open files. Yay! However, git status shows up as: Git:master^M An when i open speedbar all folders and files ends with ^M, ie: <+ conf/^M Does anyone know how to prevent this line-ending collision from occurring?

    Read the article

  • Timer with random seconds ¿How to update the random seconds?

    - by benLIVE
    I have a timer "tmr_sendCesta" which must be called each x seconds between 1 and 3 seconds. The problem is the timer "tmr_sendCesta" is called only one time, and the random seconds is never updated. I need to call the function "createCesta" each x seconds randomly. Any idea how to do it? function createCesta() cesta = display.newImageRect("cesta.png", 100, 55) cesta.x = -110 cesta.y = screenH - 110 cesta.name = "cesta" physics.addBody( cesta, physicsData:get("cestaSmall")) grupoCesta:insert(cesta) transition.to(cesta, {time = 4000, x = screenW + 110}) end function scene:enterScene( event ) local group = self.view physics.start() Runtime:addEventListener("touch", touchScreen) Runtime:addEventListener( "collision", onCollision ) tmr_sendCesta = timer.performWithDelay((math.random(1000, 3000), randomCesta, 0) end

    Read the article

  • Overriding Object.Equals() instance method in C#; now Code Analysis / FxCop warning CA2218: "should

    - by Chris W. Rea
    I've got a complex class in my C# project on which I want to be able to do equality tests. It is not a trivial class; it contains a variety of scalar properties as well as references to other objects and collections (e.g. IDictionary). For what it's worth, my class is sealed. To enable a performance optimization elsewhere in my system (an optimization that avoids a costly network round-trip), I need to be able to compare instances of these objects to each other for equality – other than the built-in reference equality – and so I'm overriding the Object.Equals() instance method. However, now that I've done that, Visual Studio 2008's Code Analysis a.k.a. FxCop, which I keep enabled by default, is raising the following warning: warning : CA2218 : Microsoft.Usage : Since 'MySuperDuperClass' redefines Equals, it should also redefine GetHashCode. I think I understand the rationale for this warning: If I am going to be using such objects as the key in a collection, the hash code is important. i.e. see this question. However, I am not going to be using these objects as the key in a collection. Ever. Feeling justified to suppress the warning, I looked up code CA2218 in the MSDN documentation to get the full name of the warning so I could apply a SuppressMessage attribute to my class as follows: [SuppressMessage("Microsoft.Naming", "CA2218:OverrideGetHashCodeOnOverridingEquals", Justification="This class is not to be used as key in a hashtable.")] However, while reading further, I noticed the following: How to Fix Violations To fix a violation of this rule, provide an implementation of GetHashCode. For a pair of objects of the same type, you must ensure that the implementation returns the same value if your implementation of Equals returns true for the pair. When to Suppress Warnings ----- Do not suppress a warning from this rule. [arrow & emphasis mine] So, I'd like to know: Why shouldn't I suppress this warning as I was planning to? Doesn't my case warrant suppression? I don't want to code up an implementation of GetHashCode() for this object that will never get called, since my object will never be the key in a collection. If I wanted to be pedantic, instead of suppressing, would it be more reasonable for me to override GetHashCode() with an implementation that throws a NotImplementedException? Update: I just looked this subject up again in Bill Wagner's good book Effective C#, and he states in "Item 10: Understand the Pitfalls of GetHashCode()": If you're defining a type that won't ever be used as the key in a container, this won't matter. Types that represent window controls, web page controls, or database connections are unlikely to be used as keys in a collection. In those cases, do nothing. All reference types will have a hash code that is correct, even if it is very inefficient. [...] In most types that you create, the best approach is to avoid the existence of GetHashCode() entirely. ... that's where I originally got this idea that I need not be concerned about GetHashCode() always.

    Read the article

  • Javascript and CSS Popups

    - by user183315
    Hi all, I've got a question about CSS based popup windows, like those generated by jQuery UI's dialog system, or Colorbox. If I use those (or something like them) to open a popup window to an HTML page and that page has Javascript in it, does the Javascript in the popup window run in its own context, or does it become part of the context of the Javascript in the parent window that opened it? I ask so that I can write the Javascript on both pages (parent and popup) so there is no namespace collision. Thanks in advance! Doug

    Read the article

  • Chipmunk Physics or Box2D for C++ 2D GameEngine ?

    - by Mr.Gando
    Hello, I'm developing what it's turning into a "cross-platform" 2D Game Engine, my initial platform target is iPhone OS, but could move on to Android or even some console like the PSP, or Nintendo DS, I want to keep my options open. My engine is developed in C++, and have been reading a lot about Box2D and Chipmunk but still I can't decide which one to use as my Physics Middleware. Chipmunk appears to have been made to be embedded easily, and Box2D seems to be widely used. Chipmunk is C , and Box2D is C++, but I've heard the API's of Box2D are much worse than chipmunk's API's. For now I will be using the engine shape creation and collision detection features for irregular polygons (not concave). I value: 1) Good API's 2) Easy to integrate. 3) Portability. And of course if you notice anything else, I would love to hear it. Which one do you think that would fit my needs better ?

    Read the article

  • Is writing to a socket an arbitrary limitation of the sendfile() syscall?

    - by Sufian
    Prelude sendfile() is an extremely useful syscall for two reasons: First, it's less code than a read()/write() (or recv()/send() if you prefer that jive) loop. Second, it's faster (less syscalls, implementation may copy between devices without buffer, etc...) than the aforementioned methods. Less code. More efficient. Awesome. In UNIX, everything is (mostly) a file. This is the ugly territory from the collision of platonic theory and real-world practice. I understand that sockets are fundamentally different than files residing on some device. I haven't dug through the sources of Linux/*BSD/Darwin/whatever OS implements sendfile() to know why this specific syscall is restricted to writing to sockets (specifically, streaming sockets). I just want to know... Question What is limiting sendfile() from allowing the destination file descriptor to be something besides a socket (like a disk file, or a pipe)?

    Read the article

< Previous Page | 94 95 96 97 98 99 100 101 102 103 104 105  | Next Page >