Search Results

Search found 21461 results on 859 pages for 'click ahead'.

Page 12/859 | < Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >

  • Lazy Sequences that "Look Ahead" for Project Euler Problem 14

    - by ivar
    I'm trying to solve Project Euler Problem 14 in a lazy way. Unfortunately, I may be trying to do the impossible: create a lazy sequence that is both lazy, yet also somehow 'looks ahead' for values it hasn't computed yet. The non-lazy version I wrote to test correctness was: (defn chain-length [num] (loop [len 1 n num] (cond (= n 1) len (odd? n) (recur (inc len) (+ 1 (* 3 n))) true (recur (inc len) (/ n 2))))) Which works, but is really slow. Of course I could memoize that: (def memoized-chain (memoize (fn [n] (cond (= n 1) 1 (odd? n) (+ 1 (memoized-chain (+ 1 (* 3 n)))) true (+ 1 (memoized-chain (/ n 2))))))) However, what I really wanted to do was scratch my itch for understanding the limits of lazy sequences, and write a function like this: (def lazy-chain (letfn [(chain [n] (lazy-seq (cons (if (odd? n) (+ 1 (nth lazy-chain (dec (+ 1 (* 3 n))))) (+ 1 (nth lazy-chain (dec (/ n 2))))) (chain (+ n 1)))))] (chain 1))) Pulling elements from this will cause a stack overflow for n2, which is understandable if you think about why it needs to look 'into the future' at n=3 to know the value of the tenth element in the lazy list because (+ 1 (* 3 n)) = 10. Since lazy lists have much less overhead than memoization, I would like to know if this kind of thing is possible somehow via even more delayed evaluation or queuing?

    Read the article

  • Cannot right click with synaptics touchpad

    - by fluteflute
    I have a Sony VAIO E14. The touchpad detects all clicks as Left clicks. In Windows 7, pressing on the right side of the touchpad is recognised as a right click. How can I enable right clicking? greg@greg-SVE14A1C5E:~$ xinput ? Virtual core pointer id=2 [master pointer (3)] ? ? Virtual core XTEST pointer id=4 [slave pointer (2)] ? ? SynPS/2 Synaptics TouchPad id=11 [slave pointer (2)] ... greg@greg-SVE14A1C5E:~$ grep "TouchPad: buttons:" /var/log/Xorg.0.log [ 23.112] (--) synaptics: SynPS/2 Synaptics TouchPad: buttons: left double triple

    Read the article

  • Ubuntu 11.04:Add right click menu as "Compress as ZIP"

    - by Ananthavel Sundararajan
    Step 1: I wanted to Add a menu as "Compress as ZIP" on right click. I know i can use change default compress format as "ZIP" using gconf-editor. But I wanted to add a new Menu Item for Compressing as ZIP without opening any other option dialog. Step 2: I wanted to Compress a file as ZIP and Rename it as a "epub". Please let me know is it possible to zip&rename by adding single menu Item? Im using Ubuntu 11.04 and Installed "Nautilus-Action-Configurations", but unsuccessful. N.B. I have read this Ask Ubuntu Q&A; I dont want to open a new window to choose me the format. It should be straight away saved as ZIP.

    Read the article

  • Uncheck Radio Button on Double Click

    - by Rajneesh Verma
    Hi, Recently I got one requirement that i have to uncheck radio button list when a user double click it (Try to uncheck). I did this using JAVA Script. Below is the code. Designer: 1: < head runat ="server" > 2: < title > :Radio Button List Demo: </ title > 3: < script language ="javascript" type ="text/javascript" > 1:   2: //Global variable to store selectedvalue 3: var lastchecked = "" ; 4:   5: function rblSelectedValue...(read more)

    Read the article

  • Huge difference between Facebook Ad Click figures and Apache log requests

    - by Gearóid
    We're running a facebook ad campaign for our business but there seems to be a huge discrepancy between the number of clicks registered and the number of requests made with "facebook.com" in the HTTP referrer. The difference can be anything between 40-80 clicks/requests. I understand why the Google Analytics would be off and I understand that the figures shouldnt be exactly the same but surely if 100 people click the ad then I should be seeing at least 90 requests for the homepage with facebook.com as the referrer? Can anybody provide any insight into why this may be happening?

    Read the article

  • Is AGS outdated for Point & Click Adventures?

    - by Aidan Moore
    Is Adventure Game Studio (AGS) outdated? I am working on a Point and Click Adventure game being coded on the AGS engine, and just recently, the question of 'is this outdated?' has come up. I'll admit, AGS is a rather old, and kind of went out of style with the P&C genre itself, but I have not found anything quite like it that specializes in this specific format of games. So my big question is not only 'is this outdated?' but also 'Is there a better alternative?'

    Read the article

  • Stacked Launcher Item Double Click Behaviour on Alt-tab

    - by Brandon Bertelsen
    Let's say that you have multiple firefox windows open. What you see happen is an additional arrow points to it's icon in the launcher. However, if you double click the icon, it displays all of the windows in a spread out fashion, similar to the behaviour from pushing Super + W, but only for that program group. Is it possible to make this window spreading behaviour occur with alt-tab? PS: No idea what tags I should use, or if the language (jargon) in the title or question is appropriate.

    Read the article

  • Java still dont recognize horizontal scroll (right click) 14.04

    - by user289280
    I am totally trackpoint fan, I use it all the time and have disablet my touchpad. Due to my study I work a lot with MATLAB, but MATLAB uses Java, and horizontal scroll does not be recognized by java as I already reat in many other threats(well it recognizes as right click :S ). There seems to be no solution for that and disable horizontal scroll in matlab is no solution for me at all. Does anybody know about a fix for that or somehow to enable horizontal scroll java. This really drives me crazy. HELP! I have Ubuntu 14.04 with java version: java version "1.7.0_55" OpenJDK Runtime Environment (IcedTea 2.4.7) (7u55-2.4.7-1ubuntu1) OpenJDK 64-Bit Server VM (build 24.51-b03, mixed mode) Thank you in advance!

    Read the article

  • Where is the Accessibility mouse click lock?

    - by user10133
    I've been a user of Linux on the desktop off and on again over the years. I very nearly switched my primary computer to Ubuntu prior to the release of Windows 7. There were a few, but significant issues at the time that prevented wholesale adoption, mostly tethering with my phone and lousy VPN Client. One key component I could count on was the Accessibility features. I have recently installed Ubuntu 10.10 and am considering giving it another try, but it appears Ubuntu has taken a leap backwards in that it no longer has a click lock feature for the mouse. Basically I need the ability to press and hold the left button to trigger a locking of the button so I can move the mouse by way of a trackpoint with my prosthesis. I absolutely require this feature and it is a deal breaker if it won't work. I've tried the Dwell keys but this is a chaotic control at best. I've never been able to manage a drag of any kind.

    Read the article

  • Left-click button inconsistently clicks in Lubuntu

    - by thebaer
    Just recently installed Lubuntu 12.10 on my Samsung N130 netbook, and left-clicking only works every once in a while. Here is the output from synclient, if it helps. Before changing MaxTapTime to 0, tapping to click worked fine. Clicking with hardware button worked fine on previous versions of Ubuntu before switching to Lubuntu on same computer. Parameter settings: LeftEdge = 1775 RightEdge = 5503 TopEdge = 1652 BottomEdge = 4662 FingerLow = 25 FingerHigh = 30 FingerPress = 256 MaxTapTime = 0 MaxTapMove = 245 MaxDoubleTapTime = 180 SingleTapTimeout = 180 ClickTime = 100 FastTaps = 0 EmulateMidButtonTime = 75 EmulateTwoFingerMinZ = 282 EmulateTwoFingerMinW = 7 VertScrollDelta = 111 HorizScrollDelta = 111 VertEdgeScroll = 0 HorizEdgeScroll = 0 CornerCoasting = 0 VertTwoFingerScroll = 1 HorizTwoFingerScroll = 0 MinSpeed = 1 MaxSpeed = 1.75 AccelFactor = 0.0359131 TrackstickSpeed = 40 EdgeMotionMinZ = 30 EdgeMotionMaxZ = 160 EdgeMotionMinSpeed = 1 EdgeMotionMaxSpeed = 445 EdgeMotionUseAlways = 0 TouchpadOff = 0 LockedDrags = 0 LockedDragTimeout = 5000 RTCornerButton = 2 RBCornerButton = 3 LTCornerButton = 0 LBCornerButton = 0 TapButton1 = 1 TapButton2 = 3 TapButton3 = 0 ClickFinger1 = 1 ClickFinger2 = 1 ClickFinger3 = 0 CircularScrolling = 0 CircScrollDelta = 0.1 CircScrollTrigger = 0 CircularPad = 0 PalmDetect = 0 PalmMinWidth = 10 PalmMinZ = 200 CoastingSpeed = 20 CoastingFriction = 50 PressureMotionMinZ = 30 PressureMotionMaxZ = 160 PressureMotionMinFactor = 1 PressureMotionMaxFactor = 1 ResolutionDetect = 1 GrabEventDevice = 1 TapAndDragGesture = 1 AreaLeftEdge = 0 AreaRightEdge = 0 AreaTopEdge = 0 AreaBottomEdge = 0 HorizHysteresis = 27 VertHysteresis = 27 ClickPad = 0

    Read the article

  • How to remove options from right click menu?

    - by Someone Like You
    There was this question, which suggest the use of Nautilus actions So i installed that. I try to open it but it does not open. I'm not asking you to fix it since Ask Ubuntu is not a bug tracker. All bug reports here will be closed as off-topic Fair enough, and i don't have time to report bugs, anyway Nautilus actions doesn't seem to care about the bug, it was reported before no actions were taken. Thus I don't seem to care about Nautilus actions. My question is simple: I want to know is there any alternative to Nautilus actions, or even better, how to add/remove options from the right click menu manually (without using any other software).

    Read the article

  • Is the tap-to-click issue solved

    - by AWE
    I'm just an average Joe when it comes to computing (maybe less then the average Joe) but I hate tap-to-click. In system and settings there is no touchpad tab? Is it true that this has been fixed? I'm using Dell inspiron N5110 xinput list: ? Virtual core pointer id=2 [master pointer (3)] ? ? Virtual core XTEST pointer id=4 [slave pointer (2)] ? ? PS/2 Generic Mouse id=13 [slave pointer (2)] This is really strange because Dell is one of the top manufacturers in laptops and Ubuntu one of the top distros in Linux and Canonical claims that they are working closely with Dell.

    Read the article

  • Best database setup for one click games

    - by ewizard
    I am building a one click game website/mobile app, and I am debating between using MySQL and MongoDB for the backend. The way I have been exploring it is with a NodeJS/Express/Angular/Passport/MongoDB stack - I have also implemented Socket.io. I have gotten to the point where I am sending data from the flash game to the server (NodeJS). The only data that needs to be sent is basic user information, the players score at the end of each game, and some x,y positions for each players game (for anti-cheating). It seems like MySQL would work fine, but as I am already using MongoDB - are there any major drawbacks to continuing to work with MongoDB on this project?

    Read the article

  • Detecting right-click on XAML GridView control item

    - by mbrit
    Leaving aside why you would ever want to do this in a touch-centric world, here's how you tell if the right-mouse button has been clicked on a GridView in XAML/WinRT/Metro-style. You have to retrieve a point relative to the UI element you're in, and then query its properties. void itemGridView_PointerPressed(object sender, PointerRoutedEventArgs e) { if (e.GetCurrentPoint(this).Properties.IsRightButtonPressed) { this.BottomAppBar.IsOpen = true; } } (The reason why you might want to do this can be explained by looking at any of the built-in Win8 apps. You can right-click any of the items on any list to bring up a context-sensitive AppBar.)

    Read the article

  • Point and click synonym replacement in text area with Javascript

    - by SilentD
    I am trying to create a site that will allow you to type a sentence or passage of text, then click on words to bring up a list of synonyms (from an online API) and possibly authorized abbreviations from a list that I provide, then once clicked on it would replace that word with the word that was clicked on. It would function kind of like After the Deadline or a Javascript based spell checker. Are there any libraries set up to make something like this easy, or what kind of Javascript do I need to be looking at? Are there any tutorials or examples for this kind of thing? I am aware that the source code for After the Deadline is available, but I only need a small portion of their technology, not all of the actual grammar and spelling check technology.

    Read the article

  • HTML5 point and click adventure game code structure with CreateJS

    - by user1612686
    I'm a programming beginner. I made a tiny one scene point and click adventure game to try to understand simple game logic and came up with this: CreateJS features prototypes for creating bitmap images, sprites and sounds objects. I create them and define their properties in a corresponding function (for example images(); spritesheets(), sounds()...). I then create functions for each animation sequence and "game level" functions, which handle user interactions and play the according animations and sounds for a certain event (when the level is complete, the current level function calls the next level function). And I end up with quite the mess. What would be the "standard (if something like that exists)" OOP approach to structure simple game data and interactions like that? I thought about making game.images, game.sprites, game.sounds objects, which contain all the game data with its properties using CreateJS constructors. game.spriteAnimations and game.tweenAnimations objects for sprite animations and tweens and a game.levelN object, which communicates with a game.interaction object, processing user interaction. Does this make any sense? How do you structure your simple game code? Thanks in advance!

    Read the article

  • converting a mouse click to a ray

    - by Will
    I have a perspective projection. When the user clicks on the screen, I want to compute the ray between the near and far planes that projects from the mouse point, so I can do some ray intersection code with my world. I am using my own matrix and vector and ray classes and they all work as expected. However, when I try and convert the ray to world coordinates my far always ends up as 0,0,0 and so my ray goes from the mouse click to the centre of the object space, rather than through it. (The x and y coordinates of near and far are identical, they differ only in the z coordinates where they are negatives of each other) GLint vp[4]; glGetIntegerv(GL_VIEWPORT,vp); matrix_t mv, p; glGetFloatv(GL_MODELVIEW_MATRIX,mv.f); glGetFloatv(GL_PROJECTION_MATRIX,p.f); const matrix_t inv = (mv*p).inverse(); const float unit_x = (2.0f*((float)(x-vp[0])/(vp[2]-vp[0])))-1.0f, unit_y = 1.0f-(2.0f*((float)(y-vp[1])/(vp[3]-vp[1]))); const vec_t near(vec_t(unit_x,unit_y,-1)*inv); const vec_t far(vec_t(unit_x,unit_y,1)*inv); ray = ray_t(near,far-near); What have I got wrong? (How do you unproject the mouse-point?)

    Read the article

  • Last click counts link cookies

    - by user3636031
    I want to fix so my only the last click gets the cookie, here is my script: <script type="text/javascript"> document.write('<scr' + 'ipt type="text/javascript" src="' + document.location.protocol + '//sc.tradetracker.net/public/tradetracker/tracking/?e=dedupe&amp;t=js"></scr' + 'ipt>'); </script> <script type="text/javascript"> // The pixels. var _oPixels = { tradetracker: '<img id="tt" />', tradedoubler: '<img id="td" />', zanox: '<img id="zx" />', awin: '<img id="aw" />' }; // Run the dedupe. _ttDedupe( 'conversion', 'network' ); </script> <noscript> <img id="tt" /> <img id="td" /> <img id="zx" /> <img id="aw" /> </noscript> How can I get this right? Thanks!

    Read the article

  • LibreOffice hangs everytime I click into it

    - by Freddy
    I've searched askubuntu for a solution but couldn't find anything helpful for me. I installed the latest version of ubuntu (13.10; 64-bit) yesterday (so I'm relatively new and unexperienced about it) and some programs as well. Today I wanted to try the LibreOffice package which comes with ubuntu by default. So I first started LO Impress, it showed me the default slide where it says something like "Add your title/text here" (I don't know exactly, I'm using my system in German). As soon as i clicked on this text, my entire system didn't react, I couldn't even click the stuff in the upper right corner (where the date, shutdown functions etc. are), nor the items on the launcher bar on the left. After 10 seconds or so, everything seemed to work properly again. But when I clicked into the LO Impress again, the same procedure as described happened again (cmpletely stuck for about 10 sec). Anybody got a solution for this? If you need more information, just tell me. Thanks in advance!

    Read the article

  • double-click does not open the default program

    - by Chang
    I installed Ubuntu 12.04, with texlive-full and texworks. When I double-click a .tex file in Nautilus, it pops up a Do you want to run "xxxxxxxx.tex", or display it contents? "xxxxxxxx.tex" is an executable text file. Run in Terminal Display Cancel Run If I choose Display, it opens texworks. How can I make it open without seeing the above conversation window? By the way, is .tex file indeed an executable file? ADDED Just for the case, my ~/.local/share/applications/mimeapps.list file looks like the following: [Default Applications] text/html=google-chrome.desktop x-scheme-handler/http=google-chrome.desktop x-scheme-handler/https=google-chrome.desktop x-scheme-handler/about=google-chrome.desktop x-scheme-handler/unknown=google-chrome.desktop text/x-tex=texworks.desktop x-scheme-handler/mailto=google-chrome.desktop [Added Associations] text/x-tex=texworks.desktop; text/x-bibtex=jabref.desktop;gedit.desktop; I observe texworks are both up and down. Should I remove one? ADDED This does not happen with all .tex files. In fact, I am currently using Ubuntu 12.04 under Virtual Box with Windows 7 host. I have my Dropbox account synced with the Windows 7 host, and I access files in Dropbox in Ubuntu through Virtual Box's shared folder functionality. (I didn't install Dropbox client in Ubuntu.) Files in Dropbox are owned by root with group vboxsf. My personal account is in the group vboxsf. It seems that I have to uncheck the option for "executable", but I have all my .tex files in the Dropbox shared folder. Would there be any workaround?

    Read the article

  • Prevent Click Fraud in Advertisement system with PHP and Javascript

    - by CodeDevelopr
    I would like to build an Advertising project with PHP, MySQL, and Javascript. I am talking about something like... Google Adsense BuySellAds.com Any other advertising platform My question is mainly, what do I need to look out for to prevent people cheating the system and any other issues I may encounter? My design concept. An Advertisement is a record in the Database, when a page is loaded, using Javascript, it calls my server which in turn will use a PHP script to query the Database and get a random Advertisement. (It may do kore like get an ad based on demographics or other criteria as well) The PHP script will then return the Advertisement to the server/website that is calling it and show it on the page as an Image that will have a special tracking link. I will need to... Count all impressions (when the Advertisement is shown on the page) Count all clicks on the Advertisement link Count all Unique clicks on the Advertisement link My question is purely on the query and displaying of the Advertisement and nothing to do with the administration side. If there is ever money involved with my Advertisement buying/selling of adspace, then the stats need to be accurate and make sure people can't easily cheat the system. Is tracking IP address really the only way to try to prevent click fraud? I am hoping someone with some experience can clarify I am on the right track? As well as give me any advice, tips, or anything else I should know about doing something like this?

    Read the article

  • How do I disable touchpad tap to click?

    - by AWE
    You've heard this a million times but the "tap to click" is a pain in the behind and I want to disable it. There is no touchpad in gpointing-device-settings and neither in mouse and touchpad in system settings. I've tried some commands in terminal but it's all crap. Dconf-editor doesn't react. How about solving this once and for all? xinput list: ? Virtual core pointer id=2 [master pointer (3)] ? ? Virtual core XTEST pointer id=4 [slave pointer (2)] ? ? PS/2 Generic Mouse id=13 [slave pointer (2)] ? Virtual core keyboard id=3 [master keyboard (2)] ? Virtual core XTEST keyboard id=5 [slave keyboard (3)] ? Power Button id=6 [slave keyboard (3)] ? Video Bus id=7 [slave keyboard (3)] ? Video Bus id=8 [slave keyboard (3)] ? Power Button id=9 [slave keyboard (3)] ? Sleep Button id=10 [slave keyboard (3)] ? Laptop_Integrated_Webcam_HD id=11 [slave keyboard (3)] ? AT Translated Set 2 keyboard id=12 [slave keyboard (3)] ? Dell WMI hotkeys id=14 [slave keyboard (3)]

    Read the article

  • Xna, after mouse click cpu usage goes 100%

    - by kosnkov
    Hi i have following code and it is enough just if i click on blue window then cpu goes to 100% for like at least one minute even with my i7 4 cores. I just check even with empty project and is the same !!! public class Game1 : Microsoft.Xna.Framework.Game { GraphicsDeviceManager graphics; SpriteBatch spriteBatch; private Texture2D cursorTex; private Vector2 cursorPos; GraphicsDevice device; float xPosition; float yPosition; public Game1() { graphics = new GraphicsDeviceManager(this); Content.RootDirectory = "Content"; } protected override void Initialize() { Viewport vp = GraphicsDevice.Viewport; xPosition = vp.X + (vp.Width / 2); yPosition = vp.Y + (vp.Height / 2); device = graphics.GraphicsDevice; base.Initialize(); } protected override void LoadContent() { spriteBatch = new SpriteBatch(GraphicsDevice); cursorTex = Content.Load<Texture2D>("strzalka"); } protected override void UnloadContent() { // TODO: Unload any non ContentManager content here } protected override void Update(GameTime gameTime) { // Allows the game to exit if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed) this.Exit(); base.Update(gameTime); } protected override void Draw(GameTime gameTime) { GraphicsDevice.Clear(Color.CornflowerBlue); spriteBatch.Begin(); spriteBatch.Draw(cursorTex, cursorPos, Color.White); spriteBatch.End(); base.Draw(gameTime); } }

    Read the article

  • Parse text file on click - and then display

    - by John R
    I am thinking of a methodology for rapid retrieval of code snippets. I imagine an HTML table with a setup like this: one two ... ten one oneTwo() oneTen() two twoOne() twoTen() ... ten tenOne() tenTwo() When a user clicks a function in this HTML table, a snippet of code is shown in another div tag or perhaps a popup window (I'm open to different solutions). I want to maintain only one PHP file named utitlities.php that contains a class called 'util'. This file & class will hold all the functions referenced in the above table (it is also used on various projects and is functional code). A key idea is that I do not want to update the HTML documentation everytime I write/update a new function in utilities.php. I should be able to click a function in the table and have PHP open the utilities file, parse out the apropriate function and display it in an HTML window. Questions: 1) I will be coding this in PHP and JavaScript but am wondering if similar scripts are available (for all or part) so I don't reinvent the wheel. 2) Quick & easy Ajax suggestions appreciated too (probably will use jquery, but am rusty). 3) Methodology for parsing out the functions from the utilities.php file (I'm not to good with regex).

    Read the article

  • Parse text file on click and display

    - by John R
    I am thinking of a methodology for rapid retrieval of code snippets. I imagine an HTML table with a setup like this: one two ... ten one oneTwo() oneTen() two twoOne() twoTen() ... ten tenOne() tenTwo() When a user clicks a function in this HTML table, a snippet of code is shown in another div tag or perhaps a popup window (I'm open to different solutions). I want to maintain only one PHP file named utitlities.php that contains a class called 'util'. This file & class will hold all the functions referenced in the above table (it is also used on various projects and is functional code). A key idea is that I do not want to update the HTML documentation everytime I write/update a new function in utilities.php. I should be able to click a function in the table and have PHP open the utilities file, parse out the apropriate function and display it in an HTML window. Questions: 1) I will be coding this in PHP and JavaScript but am wondering if similar scripts are available (for all or part) so I don't reinvent the wheel. 2) Quick & easy Ajax suggestions appreciated too (probably will use jquery, but am rusty). 3) Methodology for parsing out the functions from the utilities.php file (I'm not to good with regex).

    Read the article

< Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >