Search Results

Search found 1856 results on 75 pages for 'hits lucky'.

Page 3/75 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • How can I track hits to areas of my web application?

    - by Tyson
    We have a growing web application, and we currently use Google Analytics and Chartbeat to track usage and engagement (although we're open to alternatives). Unfortunately, both are geared towards content-based sites where everything is about the URL. Our URLs contain object IDs, making them less useful independently, and causing us to grow beyond Google Analytics' 50,000 unique URLs per day. How can we track hits to areas of our web application, essentially ignoring parts of the URLs?

    Read the article

  • This Week In Geek History: Steve Jobs Demos the First Mac, Mythbusters Hits the Airwaves, and Dr. Strangelove Invades Popular Culture

    - by Jason Fitzpatrick
    It was quite a wild ride for this week in Geek History: Steve Jobs gave a demonstration of the first Macintosh computer, beloved geek show MythBusters took to the air, and iconic movie Dr. Strangelove appeared in theatres and our collective consciousness. Latest Features How-To Geek ETC How To Create Your Own Custom ASCII Art from Any Image How To Process Camera Raw Without Paying for Adobe Photoshop How Do You Block Annoying Text Message (SMS) Spam? How to Use and Master the Notoriously Difficult Pen Tool in Photoshop HTG Explains: What Are the Differences Between All Those Audio Formats? How To Use Layer Masks and Vector Masks to Remove Complex Backgrounds in Photoshop Bring Summer Back to Your Desktop with the LandscapeTheme for Chrome and Iron The Prospector – Home Dash Extension Creates a Whole New Browsing Experience in Firefox KinEmote Links Kinect to Windows Why Nobody Reads Web Site Privacy Policies [Infographic] Asian Temple in the Snow Wallpaper 10 Weird Gaming Records from the Guinness Book

    Read the article

  • Apache Lucene: Is Relevance Score Always Between 0 and 1?

    - by Eamorr
    Greetings, I have the following Apache Lucene snippet that's giving me some nice results: int numHits=100; int resultsPerPage=100; IndexSearcher searcher=new IndexSearcher(reader); TopScoreDocCollector collector=TopScoreDocCollector.create(numHits,true); Query q=parser.parse(queryString); searcher.search(q,collector); ScoreDoc[] hits=collector.topDocs(0*resultsPerPage,resultsPerPage).scoreDocs; Results r=new Results(); r.length=hits.length; for(int i=0;i<hits.length;i++){ Document doc=searcher.doc(hits[i].doc); double distanceKm=getGreatCircleDistance(lucene2double(doc.get("lat")), lucene2double(doc.get("lng")), Double.parseDouble(userLat), Double.parseDouble(userLng)); double newRelevance=((1/distanceKm)*Math.log(hits[i].score)/Math.log(2))*(0-1); System.out.println(hits[i].doc+"\t"+hits[i].score+"\t"+doc.get("content")+"\t"+"Km="+distanceKm+"\trlvnc="+String.valueOf(newRelevance)); } What I want to know, is hits[i].score always between 0 and 1? It seems that way, but I can't be sure. I've even checked the Lucene documentation (class ScoreDocs) to no avail. You'll see I'm calculating the log of the "newRelevance" value, which is based on hits[i].score. I need hits[i].score to be between 0 and 1, because if it is below zero, I'll get an error; above 1 and the sign will change from negative to positive. I hope some Lucene expert out there can offer me some insight. Many thanks,

    Read the article

  • Is there a way to keep track of javascript hits?

    - by user54197
    I am populating a table based on a javascript function. I want to limit the data entered to 2, afterwhich I hide the table. Is there a way to track how many hits the javascript code gets hit? function addNewRow() { $('#displayInjuryTable tr:last').after('<tr><td style="font-size:smaller;" class="name"></td><td style="font-size:smaller;" class="address"></td></tr>'); var $tr = $('#displayInjuryTable tr:last'); var propertyCondition = $('#txtInjuryAddress').val(); $tr.find('.name').text($('#txtInjuryName').val()); if (propertyCondition != "") { $tr.find('.address').text($('#txtInjuryAddress').val() + ', ' + $('#txtInjuryCity').val() + ' ' + $('#txtInjuryState').val() + ' ' + $('#txtInjuryZip').val()); }

    Read the article

  • Getting the username entered by the user after he hits submit on the login form, irrespective of whe

    - by simonr
    Duplicate of http://stackoverflow.com/questions/2803425 Hello, When a user enters his login information and hits submit, irrespective of whether the login credentials entered by the user were correct or not, i want my function to be called. In this function, i need the username entered by the user. I think i cannot use the login op of hook_user because its called only when the user has successfully logged in. So, how can i achieve the above functionality ? Some sample code would be really appreciated. Please help. Thank You.

    Read the article

  • My CPU hits 100°C... Help me!

    - by JamesT
    The safe limit for processors is typically 50°C or so, but I have found that my CPU likes to do up to 100°C. I have got these readings from SpeedFan 4.42. I have a Intel Quad Core unclocked. I am using the standard intel fan with heatsink that came with the prossesor My case is a Cooler Master and I have two fans installed on the case. I took the side off to see if that helped. It lowered the temp be 3C. I don't really want to blow the processor and I don't know how to cool it down.

    Read the article

  • What is the best way to optimize clearcase dynamic view performance on a linux client?

    - by gambit
    cleartool getcache -view -cview Lookup cache: 94% full, 6080 entries (307.0K), 308777 requests, 86% hits Readdir cache: 77% full, 4534 entries (1259.4K), 52233 requests, 91% hits Fstat cache: 89% full, 6188 entries (870.2K), 137811 requests, 100% hits Object cache: 100% full, 6188 entries (1146.9K), 290977 requests, 42% hits Total memory used for view caches: 3583.5Kbytes The current view server cache limits are: Lookup cache: 335520 bytes Readdir cache: 1677721 bytes Fstat cache: 1006560 bytes Object cache: 1174320 bytes Total cache size limit: 4194304 bytes Should I try to get my Object cache hit to be 100%? I have 2GB RAM.

    Read the article

  • Application Design: Single vs. Multiple Hits to the DB

    - by shyneman
    I'm building a service that performs a set of configured activities based on the type of request that it receives. Each activity involves going to the database and retrieving/updating some kind of information. The logic for each activity can be generalized and re-used across different request types. The activities may need to participate in a transaction for the duration of the servicing the request. One option, I'm considering is having each activity maintain its own access to DAL/database. This fully encapsulates the activity into a stand-alone re-usable piece, but hitting the database multiple times for one request doesn't seem like a viable option. I don't really know how to easily implement the concept of a transaction across the multiple activities here either. The second option is to encapsulate ALL the activities into one big activity and hit the database once. But this does not allow re-use and configuration of these activities for different requests. Does anyone have any suggestions and input about what should be the best way to approach my problem? Thanks for any help.

    Read the article

  • XNA - Pong Clone - Reflecting ball when it hits a wall?

    - by toleero
    Hi guys, I'm trying to make the ball bounce off of the top and bottom 'Walls' of my UI when creating a 2D Pong Clone. This is my Game.cs public void CheckBallPosition() { if (ball.Position.Y == 0 || ball.Position.Y >= graphics.PreferredBackBufferHeight) ball.Move(true); else ball.Move(false); if (ball.Position.X < 0 || ball.Position.X >= graphics.PreferredBackBufferWidth) ball.Reset(); } At the moment I'm using this in my Ball.cs public void Move(bool IsCollidingWithWall) { if (IsCollidingWithWall) { Vector2 normal = new Vector2(0, 1); Direction = Vector2.Reflect(Direction,normal); this.Position += Direction; Console.WriteLine("WALL COLLISION"); } else this.Position += Direction; } It works, but I'm using a manually typed Normal and I want to know how to calculate the normal of the top and bottom parts of the screen?

    Read the article

  • How to get colliding effect or bouncy when ball hits the track.

    - by Chandan Shetty SP
    I am using below formula to move the ball circular, where accelX and accelY are the values from accelerometer, it is working fine. But the problem in this code is mRadius (I fixed its value to 50), i need to change mRadius according to accelerometer values and also i need bouncing effect when it touches the track. Currently i am developing code by assuming only one ball is on the board. float degrees = -atan2(accelX, accelY) * 180 / 3.14159; int x = cCentrePoint.x + mRadius * cos(degreesToRadians(degrees)); int y = cCentrePoint.y + mRadius * sin(degreesToRadians(degrees)); Here is the snap of the game i want to develop: Updated: I am sending the updated code... mRadius = 5; mRange = NSMakeRange(0,60); -(void) updateBall: (UIAccelerationValue) accelX withY:(UIAccelerationValue)accelY { float degrees = -atan2(accelX, accelY) * 180 / 3.14159; int x = cCentrePoint.x + mRadius * cos(degreesToRadians(degrees)); int y = cCentrePoint.y + mRadius * sin(degreesToRadians(degrees)); //self.targetRect is rect of ball Object self.targetRect = CGRectMake(newX, newY, 8, 9); self.currentRect = self.targetRect; //http://books.google.co.in/books?id=WV9glgdrrrUC&pg=PA455#v=onepage&q=&f=false static NSDate *lastDrawTime; if(lastDrawTime!=nil) { NSTimeInterval secondsSinceLastDraw = -([lastDrawTime timeIntervalSinceNow]); ballXVelocity = ballXVelocity + (accelX * secondsSinceLastDraw) * [self isTouchedTrack:mRadius andRange:mRange]; ballYVelocity = ballYVelocity + -(accelY * secondsSinceLastDraw) * [self isTouchedTrack:mRadius andRange:mRange]; distXTravelled = distXTravelled + secondsSinceLastDraw * ballXVelocity * 50; distYTravelled = distYTravelled + secondsSinceLastDraw * ballYVelocity * 50; CGRect temp = self.targetRect; temp.origin.x += distXTravelled; temp.origin.y += distYTravelled; int radius = (temp.origin.x - cCentrePoint.x) / cos(degreesToRadians(degrees)); if( !NSLocationInRange(abs(radius),mRange)) { //Colided with the tracks...Need a better logic here ballXVelocity = -ballXVelocity; } else { // Need a better logic here self.targetRect = temp; } //NSLog(@"angle = %f",degrees); } [lastDrawTime release]; lastDrawTime = [ [NSDate alloc] init]; } In the above code i have initialized mRadius and mRange(indicate track) to some constant for testing, i am not getting the moving of the ball as i expected( bouncing effect when Collided with track ) with respect to accelerometer. Help me to recognize where i went wrong or send some code snippets or links which does the similar job. I am searching for better logic than my code, if you found share with me.

    Read the article

  • How to skip interstitial in a django view if a user hits the back button?

    - by Jose Boveda
    I have an application with an interstitial page to hold the user while an intensive operation runs in the background (takes anywhere from 30 secs to 1 minute). Once the operation is done, the user is redirected to the results page. Once on the result page, typical user behavior is to hit the 'back' button to perform the operation on a different input set. However, the back button takes them to the interstitial, not the original form. The desired behavior is to go back to the original form, skipping the interstitial entirely. I'd like this to be default behavior if the user goes to the interstitial page from anywhere but the original form. I thought I could create this by using the @never_cache function decorator in my view for the interstitial, and logic based on request.META['HTTP_REFERER'], however the page doesn't respect these. The browser's back button still trumps this behavior. Any ideas on how to solve this issue?

    Read the article

  • Application Code Redesign to reduce no. of Database Hits from Performance Perspective

    - by Rachel
    Scenario I want to parse a large CSV file and inserts data into the database, csv file has approximately 100K rows of data. Currently I am using fgetcsv to parse through the file row by row and insert data into Database and so right now I am hitting database for each line of data present in csv file so currently database hit count is 100K which is not good from performance point of view. Current Code: public function initiateInserts() { //Open Large CSV File(min 100K rows) for parsing. $this->fin = fopen($file,'r') or die('Cannot open file'); //Parsing Large CSV file to get data and initiate insertion into schema. while (($data=fgetcsv($this->fin,5000,";"))!==FALSE) { $query = "INSERT INTO dt_table (id, code, connectid, connectcode) VALUES (:id, :code, :connectid, :connectcode)"; $stmt = $this->prepare($query); // Then, for each line : bind the parameters $stmt->bindValue(':id', $data[0], PDO::PARAM_INT); $stmt->bindValue(':code', $data[1], PDO::PARAM_INT); $stmt->bindValue(':connectid', $data[2], PDO::PARAM_INT); $stmt->bindValue(':connectcode', $data[3], PDO::PARAM_INT); // Execute the statement $stmt->execute(); $this->checkForErrors($stmt); } } I am looking for a way wherein instead of hitting Database for every row of data, I can prepare the query and than hit it once and populate Database with the inserts. Any Suggestions !!! Note: This is the exact sample code that I am using but CSV file has more no. of field and not only id, code, connectid and connectcode but I wanted to make sure that I am able to explain the logic and so have used this sample code here. Thanks !!!

    Read the article

  • Pong Collision Help in C# w/ XNA

    - by Ramses Brown
    Edit: My goal is to have it function like this: Ball hits 1st Quarter = rebounds higher (aka Y++) Ball hits 2nd Quarter = rebounds higher (using random value) Ball hits 3rd Quarter = rebounds lower (using random value) Ball hits 4th Quarter = rebounds lower (aka Y--) I'm currently using Rectangle Collision for my collision detection, and it's worked. Now I wish to expand it. Instead of it simply detecting whether or not the paddle/ball intersect, I want to make it so that it can determine what section of the paddle gets hit. I wanted it in 4 parts, with each having a different reaction to impact. My first thought is to base it on the Ball's Y position compared to the Paddle's Y position. But since I want it in 4 parts, I don't know how to do that. So it's essentially be if (ball.Y > Paddle.Y) { PaddleSection1 == true; } Except modified so that instead of being top half/bottom half, it's 1st Quarter, etc.

    Read the article

  • bind event handler on keydown listen function JavaScript jQuery

    - by user1644123
    I am trying to bind a handler to an event. The event is a keydown function. The handler will listen for hit variables to produce one of two conditions. The 1st condition (odd number of hits) will perform 1 function, the 2nd (even number of hits) will perform another function. To elaborate, the 1st function will scroll to one element, the 2nd will scroll to another element. My syntax may be the wrong approach, but it works for the 1st condition, but not the 2nd. I think I have the conditional statement in the wrong place. How can I rewrite this to work as intended? Thank you kindly, in advance! $(document).keydown(function(e) { switch (e.which) { case 37: break; case 38: break; case 39: break; case 40: //bottom arrow key var hits = 0; if (hits % 2 !== 0) { $('#wrap').animate({ scrollTop: $("#scrollToHere").offset().top }, 2800); } else { $('#wrap').animate({ scrollTop: $("#scroll2ToHere").offset().top }, 2800); } hits++; return false; break; } })? *I moved "var hits = 0;" to the top, but it only works! But is there a way I can reset the whole thing after every two hits? I want to reset because when there is a bug and if I press a 3rd time it scrolls to the very top of the page, where there is no element to make it scroll to the top. Why would it scroll to the top of the page if I never scripted it to do so?? *

    Read the article

  • Apache APC (Windows) Can I optimize these APC settings more?

    - by ar099968
    I would like to optimize APC some more but I am not sure where I could do something. First here is the stats after 1 week of running with the current configuration: General Cache Information APC Version 3.1.9 PHP Version 5.4.4 APC Host XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX Server Software Apache Shared Memory 1 Segment(s) with 128.0 MBytes (IPC shared memory, Windows Slim RWLOCK (native) locking) Start Time 2014/06/08 05:00:00 Uptime 6 days, 11 hours and 55 minutes File Upload Support 1 Host Status Diagrams Memory Usage Free: 99.7 MBytes (77.9%) Used: 28.3 MBytes (22.1%) Hits & Misses Hits: 510818 (99.9%) Misses: 608 (0.1%) Detailed Memory Usage and Fragmentation Fragmentation: 0.60% (609.8 KBytes out of 99.7 MBytes in 83 fragments) File Cache Information Cached Files 693 ( 35.4 MBytes) Hits 5143359 Misses 1087 Request Rate (hits, misses) 13.24 cache requests/second Hit Rate 13.24 cache requests/second Miss Rate 0.00 cache requests/second Insert Rate 0.01 cache requests/second Cache full count 0 User Cache Information Cached Variables 0 ( 0.0 Bytes) Hits 0 Misses 0 Request Rate (hits, misses) 0.00 cache requests/second Hit Rate 0.00 cache requests/second Miss Rate 0.00 cache requests/second Insert Rate 0.00 cache requests/second Cache full count 0 Runtime Settings apc.cache_by_default 1 apc.canonicalize 1 apc.coredump_unmap 0 apc.enable_cli 0 apc.enabled 1 apc.file_md5 0 apc.file_update_protection 2 apc.filters -/apc.php$, -/apc_clean.php$, -.tpl.cache.php$, -.tpl.php$, -.string.cache.php$, -.string.php$ apc.gc_ttl 3600 apc.include_once_override 0 apc.lazy_classes 0 apc.lazy_functions 0 apc.max_file_size 2M apc.num_files_hint 7000 apc.preload_path apc.report_autofilter 0 apc.rfc1867 0 apc.rfc1867_freq 0 apc.rfc1867_name APC_UPLOAD_PROGRESS apc.rfc1867_prefix upload_ apc.rfc1867_ttl 3600 apc.serializer default apc.shm_segments 1 apc.shm_size 128M apc.shm_strings_buffer 4M apc.slam_defense 0 apc.stat 1 apc.stat_ctime 0 apc.ttl 7200 apc.use_request_time 1 apc.user_entries_hint 4096 apc.user_ttl 7200 apc.write_lock 1

    Read the article

  • C# 4: The Curious ConcurrentDictionary

    - by James Michael Hare
    In my previous post (here) I did a comparison of the new ConcurrentQueue versus the old standard of a System.Collections.Generic Queue with simple locking.  The results were exactly what I would have hoped, that the ConcurrentQueue was faster with multi-threading for most all situations.  In addition, concurrent collections have the added benefit that you can enumerate them even if they're being modified. So I set out to see what the improvements would be for the ConcurrentDictionary, would it have the same performance benefits as the ConcurrentQueue did?  Well, after running some tests and multiple tweaks and tunes, I have good and bad news. But first, let's look at the tests.  Obviously there's many things we can do with a dictionary.  One of the most notable uses, of course, in a multi-threaded environment is for a small, local in-memory cache.  So I set about to do a very simple simulation of a cache where I would create a test class that I'll just call an Accessor.  This accessor will attempt to look up a key in the dictionary, and if the key exists, it stops (i.e. a cache "hit").  However, if the lookup fails, it will then try to add the key and value to the dictionary (i.e. a cache "miss").  So here's the Accessor that will run the tests: 1: internal class Accessor 2: { 3: public int Hits { get; set; } 4: public int Misses { get; set; } 5: public Func<int, string> GetDelegate { get; set; } 6: public Action<int, string> AddDelegate { get; set; } 7: public int Iterations { get; set; } 8: public int MaxRange { get; set; } 9: public int Seed { get; set; } 10:  11: public void Access() 12: { 13: var randomGenerator = new Random(Seed); 14:  15: for (int i=0; i<Iterations; i++) 16: { 17: // give a wide spread so will have some duplicates and some unique 18: var target = randomGenerator.Next(1, MaxRange); 19:  20: // attempt to grab the item from the cache 21: var result = GetDelegate(target); 22:  23: // if the item doesn't exist, add it 24: if(result == null) 25: { 26: AddDelegate(target, target.ToString()); 27: Misses++; 28: } 29: else 30: { 31: Hits++; 32: } 33: } 34: } 35: } Note that so I could test different implementations, I defined a GetDelegate and AddDelegate that will call the appropriate dictionary methods to add or retrieve items in the cache using various techniques. So let's examine the three techniques I decided to test: Dictionary with mutex - Just your standard generic Dictionary with a simple lock construct on an internal object. Dictionary with ReaderWriterLockSlim - Same Dictionary, but now using a lock designed to let multiple readers access simultaneously and then locked when a writer needs access. ConcurrentDictionary - The new ConcurrentDictionary from System.Collections.Concurrent that is supposed to be optimized to allow multiple threads to access safely. So the approach to each of these is also fairly straight-forward.  Let's look at the GetDelegate and AddDelegate implementations for the Dictionary with mutex lock: 1: var addDelegate = (key,val) => 2: { 3: lock (_mutex) 4: { 5: _dictionary[key] = val; 6: } 7: }; 8: var getDelegate = (key) => 9: { 10: lock (_mutex) 11: { 12: string val; 13: return _dictionary.TryGetValue(key, out val) ? val : null; 14: } 15: }; Nothing new or fancy here, just your basic lock on a private object and then query/insert into the Dictionary. Now, for the Dictionary with ReadWriteLockSlim it's a little more complex: 1: var addDelegate = (key,val) => 2: { 3: _readerWriterLock.EnterWriteLock(); 4: _dictionary[key] = val; 5: _readerWriterLock.ExitWriteLock(); 6: }; 7: var getDelegate = (key) => 8: { 9: string val; 10: _readerWriterLock.EnterReadLock(); 11: if(!_dictionary.TryGetValue(key, out val)) 12: { 13: val = null; 14: } 15: _readerWriterLock.ExitReadLock(); 16: return val; 17: }; And finally, the ConcurrentDictionary, which since it does all it's own concurrency control, is remarkably elegant and simple: 1: var addDelegate = (key,val) => 2: { 3: _concurrentDictionary[key] = val; 4: }; 5: var getDelegate = (key) => 6: { 7: string s; 8: return _concurrentDictionary.TryGetValue(key, out s) ? s : null; 9: };                    Then, I set up a test harness that would simply ask the user for the number of concurrent Accessors to attempt to Access the cache (as specified in Accessor.Access() above) and then let them fly and see how long it took them all to complete.  Each of these tests was run with 10,000,000 cache accesses divided among the available Accessor instances.  All times are in milliseconds. 1: Dictionary with Mutex Locking 2: --------------------------------------------------- 3: Accessors Mostly Misses Mostly Hits 4: 1 7916 3285 5: 10 8293 3481 6: 100 8799 3532 7: 1000 8815 3584 8:  9:  10: Dictionary with ReaderWriterLockSlim Locking 11: --------------------------------------------------- 12: Accessors Mostly Misses Mostly Hits 13: 1 8445 3624 14: 10 11002 4119 15: 100 11076 3992 16: 1000 14794 4861 17:  18:  19: Concurrent Dictionary 20: --------------------------------------------------- 21: Accessors Mostly Misses Mostly Hits 22: 1 17443 3726 23: 10 14181 1897 24: 100 15141 1994 25: 1000 17209 2128 The first test I did across the board is the Mostly Misses category.  The mostly misses (more adds because data requested was not in the dictionary) shows an interesting trend.  In both cases the Dictionary with the simple mutex lock is much faster, and the ConcurrentDictionary is the slowest solution.  But this got me thinking, and a little research seemed to confirm it, maybe the ConcurrentDictionary is more optimized to concurrent "gets" than "adds".  So since the ratio of misses to hits were 2 to 1, I decided to reverse that and see the results. So I tweaked the data so that the number of keys were much smaller than the number of iterations to give me about a 2 to 1 ration of hits to misses (twice as likely to already find the item in the cache than to need to add it).  And yes, indeed here we see that the ConcurrentDictionary is indeed faster than the standard Dictionary here.  I have a strong feeling that as the ration of hits-to-misses gets higher and higher these number gets even better as well.  This makes sense since the ConcurrentDictionary is read-optimized. Also note that I tried the tests with capacity and concurrency hints on the ConcurrentDictionary but saw very little improvement, I think this is largely because on the 10,000,000 hit test it quickly ramped up to the correct capacity and concurrency and thus the impact was limited to the first few milliseconds of the run. So what does this tell us?  Well, as in all things, ConcurrentDictionary is not a panacea.  It won't solve all your woes and it shouldn't be the only Dictionary you ever use.  So when should we use each? Use System.Collections.Generic.Dictionary when: You need a single-threaded Dictionary (no locking needed). You need a multi-threaded Dictionary that is loaded only once at creation and never modified (no locking needed). You need a multi-threaded Dictionary to store items where writes are far more prevalent than reads (locking needed). And use System.Collections.Concurrent.ConcurrentDictionary when: You need a multi-threaded Dictionary where the writes are far more prevalent than reads. You need to be able to iterate over the collection without locking it even if its being modified. Both Dictionaries have their strong suits, I have a feeling this is just one where you need to know from design what you hope to use it for and make your decision based on that criteria.

    Read the article

  • SQL model optimization question

    - by supermogx
    I need to keep track of number of "hits" on a particular item in a DB. The thing is that the "hits" should stay unique with a user ID, so if a user hits the item 3 times, it should still count for a hit of 1. Also, I need to display the total number of hits for a particular item. Is there a better way than to store each hits for each items by each users in a separate table? Would keeping the user ID in a string separated by commas a better and efficient way?

    Read the article

  • How do I fix these LibreOffice unmet dependencies?

    - by Lucky
    The following packages have unmet dependencies: libreoffice: Depends: libreoffice-core (= 1:3.4.4-0ubuntu1) but 1:3.4.3-3ubuntu2 is to be installed Depends: libreoffice-base but it is not going to be installed Depends: libreoffice-report-builder-bin but it is not going to be installed Depends: ttf-dejavu but it is not going to be installed Depends: ttf-sil-gentium-basic but it is not going to be installed Depends: libreoffice-filter-mobiledev but it is not going to be installed Depends: libreoffice-java-common (>= 1:3.4.4~) but it is not going to be installed libreoffice-base-core : Depends: libreoffice-core (= 1:3.4.4-0ubuntu1) but 1:3.4.3-3ubuntu2 is to be installed libreoffice-calc : Depends: libreoffice-core (= 1:3.4.4-0ubuntu1) but 1:3.4.3-3ubuntu2 is to be installed libreoffice-draw : Depends: libreoffice-core (= 1:3.4.4-0ubuntu1) but 1:3.4.3-3ubuntu2 is to be installed libreoffice-gnome : Depends: libreoffice-core (= 1:3.4.4-0ubuntu1) but 1:3.4.3-3ubuntu2 is to be installed libreoffice-gtk : Depends: libreoffice-core (= 1:3.4.4-0ubuntu1) but 1:3.4.3-3ubuntu2 is to be installed libreoffice-impress : Depends: libreoffice-core (= 1:3.4.4-0ubuntu1) but 1:3.4.3-3ubuntu2 is to be installed libreoffice-math : Depends: libreoffice-core (= 1:3.4.4-0ubuntu1) but 1:3.4.3-3ubuntu2 is to be installed libreoffice-writer : Depends: libreoffice-core (= 1:3.4.4-0ubuntu1) but 1:3.4.3-3ubuntu2 is to be installed python-uno : Depends: libreoffice-core (= 1:3.4.4-0ubuntu1) but 1:3.4.3-3ubuntu2 is to be installed E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

    Read the article

  • Well-tested libraries for player ratings?

    - by Lucky
    It's common in games to implement some sort of numerical ranking system -- the ELO system is usually used in chess. I could implement this system naively using Wikipedia's descriptions, but I suspect that this would open up a whole box of problems that have already been solved: rating inflation, etc -- for instance, the ELO system has a K constant that's 'fudged' according to rating, duration, pairings, statistics, ... What are some libraries (I'm looking at Python, but anything is okay) that implements rating systems? It also doesn't have to be ELO.

    Read the article

  • How to detect bots programatically

    - by Tom
    we have a situation where we log visits and visitors on page hits and bots are clogging up our database. We can't use captcha or other techniques like that because this is before we even ask for human input, basically we are logging page hits and we would like to only log page hits by humans. Is there a list of known bot IP out there? Does checking known bot user-agents work?

    Read the article

  • Detecting collision between ball (circle) and brick(rectangle)?

    - by James Harrison
    Ok so this is for a small uni project. My lecturer provided me with a framework for a simple brickbreaker game. I am currently trying to overcome to problem of detecting a collision between the two game objects. One object is always the ball and the other objects can either be the bricks or the bat. public Collision hitBy( GameObject obj ) { //obj is the bat or the bricks //the current object is the ball // if ball hits top of object if(topX + width >= obj.topX && topX <= obj.topX + obj.width && topY + height >= obj.topY - 2 && topY + height <= obj.topY){ return Collision.HITY; } //if ball hits left hand side else if(topY + height >= obj.topY && topY <= obj.topY + obj.height && topX + width >= obj.topX -2 && topX + width <= obj.topX){ return Collision.HITX; } else return Collision.NO_HIT; } So far I have a method that is used to detect this collision. The the current obj is a ball and the obj passed into the method is the the bricks. At the moment I have only added statement to check for left and top collisions but do not want to continue as I have a few problems. The ball reacts perfectly if it hits the top of the bricks or bat but when it hits the ball often does not change directing. It seems that it is happening toward the top of the left hand edge but I cannot figure out why. I would like to know if there is another way of approaching this or if people know where I'm going wrong. Lastly the collision.HITX calls another method later on the changes the x direction likewise with y.

    Read the article

  • How to get unique numbers using randomint python?

    - by user2519572
    I am creating a 'Euromillions Lottery generator' just for fun and I keep getting the same numbers printing out. How can I make it so that I get random numbers and never get the same number popping up: from random import randint numbers = randint(1,50) stars = randint(1,11) print "Your lucky numbers are: ", numbers, numbers, numbers, numbers, numbers print "Your lucky stars are: " , stars, stars The output is just: >>> Your lucky numbers are: 41 41 41 41 41 >>> Your lucky stars are: 8 8 >>> Good bye! How can I fix this? Regards

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >