Search Results

Search found 320 results on 13 pages for 'closure'.

Page 9/13 | < Previous Page | 5 6 7 8 9 10 11 12 13  | Next Page >

  • How to select the first ocurrence in the auto-completion menu by pressing Enter?

    - by janoChen
    Every time there's is a pop up menu. I select the first occurrence and press enter but nothing happens (the word is not completed with he selected occurrence). The only way is to press Tab until you reach the term for a second time. Is there a way of selecting the first occurrence pressing Enter (or other Vim hotkey)? My .vimrc: " SHORTCUTS nnoremap <F4> :set filetype=html<CR> nnoremap <F5> :set filetype=php<CR> nnoremap <F3> :TlistToggle<CR> " press space to turn off highlighting and clear any message already displayed. nnoremap <silent> <Space> :nohlsearch<Bar>:echo<CR> " set buffers commands nnoremap <silent> <M-F8> :BufExplorer<CR> nnoremap <silent> <F8> :bn<CR> nnoremap <silent> <S-F8> :bp<CR> " open NERDTree with start directory: D:\wamp\www nnoremap <F9> :NERDTree /home/alex/www<CR> " open MRU nnoremap <F10> :MRU<CR> " open current file (silently) nnoremap <silent> <F11> :let old_reg=@"<CR>:let @"=substitute(expand("%:p"), "/", "\\", "g")<CR>:silent!!cmd /cstart <C-R><C-R>"<CR><CR>:let @"=old_reg<CR> " open current file in localhost (default browser) nnoremap <F12> :! start "http://localhost" file:///"%:p""<CR> " open Vim's default Explorer nnoremap <silent> <F2> :Explore<CR> nnoremap <C-F2> :%s/\.html/.php/g<CR> " REMAPPING " map leader to , let mapleader = "," " remap ` to ' nnoremap ' ` nnoremap ` ' " remap increment numbers nnoremap <C-kPlus> <C-A> " COMPRESSION function Js_css_compress () let cwd = expand('<afile>:p:h') let nam = expand('<afile>:t:r') let ext = expand('<afile>:e') if -1 == match(nam, "[\._]src$") let minfname = nam.".min.".ext else let minfname = substitute(nam, "[\._]src$", "", "g").".".ext endif if ext == 'less' if executable('lessc') cal system( 'lessc '.cwd.'/'.nam.'.'.ext.' &') endif else if filewritable(cwd.'/'.minfname) if ext == 'js' && executable('closure-compiler') cal system( 'closure-compiler --js '.cwd.'/'.nam.'.'.ext.' > '.cwd.'/'.minfname.' &') elseif executable('yuicompressor') cal system( 'yuicompressor '.cwd.'/'.nam.'.'.ext.' > '.cwd.'/'.minfname.' &') endif endif endif endfunction autocmd FileWritePost,BufWritePost *.js :call Js_css_compress() autocmd FileWritePost,BufWritePost *.css :call Js_css_compress() autocmd FileWritePost,BufWritePost *.less :call Js_css_compress() " GUI " taglist right side let Tlist_Use_Right_Window = 1 " hide tool bar set guioptions-=T "remove scroll bars set guioptions+=LlRrb set guioptions-=LlRrb " set the initial size of window set lines=46 columns=180 " set default font set guifont=Monospace " set guifont=Monospace\ 10 " show line number set number " set default theme colorscheme molokai-2 " encoding set encoding=utf-8 setglobal fileencoding=utf-8 bomb set fileencodings=ucs-bom,utf-8,latin1 " SCSS syntax highlight au BufRead,BufNewFile *.scss set filetype=scss " LESS syntax highlight syntax on au BufNewFile,BufRead *.less set filetype=less " Haml syntax highlight "au! BufRead,BufNewFile *.haml "setfiletype haml " Sass syntax highlight "au! BufRead,BufNewFile *.sass "setfiletype sass " set filetype indent filetype indent on " for snipMate to work filetype plugin on " show breaks set showbreak=-----> " coding format set tabstop=4 set shiftwidth=4 set linespace=1 " CONFIG " set location of ctags let Tlist_Ctags_Cmd='D:\ctags58\ctags.exe' " keep the buffer around when left set hidden " enable matchit plugin source $VIMRUNTIME/macros/matchit.vim " folding set foldmethod=marker set foldmarker={,} let g:FoldMethod = 0 map <leader>ff :call ToggleFold()<cr> fun! ToggleFold() if g:FoldMethod == 0 exe 'set foldmethod=indent' let g:FoldMethod = 1 else exe 'set foldmethod=marker' let g:FoldMethod = 0 endif endfun " save and restore folds when a file is closed and re-opened "au BufWrite ?* mkview "au BufRead ?* silent loadview " auto-open NERDTree everytime Vim is invoked au VimEnter * NERDTree /home/alex/www " set omnicomplete autocmd FileType python set omnifunc=pythoncomplete#Complete autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS autocmd FileType html set omnifunc=htmlcomplete#CompleteTags autocmd FileType css set omnifunc=csscomplete#CompleteCSS autocmd FileType xml set omnifunc=xmlcomplete#CompleteTags autocmd FileType php set omnifunc=phpcomplete#CompletePHP autocmd FileType c set omnifunc=ccomplete#Complete " Remove trailing white-space once the file is saved au BufWritePre * silent g/\s\+$/s/// " Use CTRL-S for saving, also in Insert mode noremap <C-S> :update!<CR> vnoremap <C-S> <C-C>:update!<CR> inoremap <C-S> <C-O>:update!<CR> " DEFAULT set nocompatible source $VIMRUNTIME/vimrc_example.vim "source $VIMRUNTIME/mswin.vim "behave mswin " disable creation of swap files set noswapfile " no back ups wwhile editing set nowritebackup " disable creation of backups set nobackup " no file change pop up warning autocmd FileChangedShell * echohl WarningMsg | echo "File changed shell." | echohl None set diffexpr=MyDiff() function MyDiff() let opt = '-a --binary ' if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif let arg1 = v:fname_in if arg1 =~ ' ' | let arg1 = '"' . arg1 . '"' | endif let arg2 = v:fname_new if arg2 =~ ' ' | let arg2 = '"' . arg2 . '"' | endif let arg3 = v:fname_out if arg3 =~ ' ' | let arg3 = '"' . arg3 . '"' | endif let eq = '' if $VIMRUNTIME =~ ' ' if &sh =~ '\<cmd' let cmd = '""' . $VIMRUNTIME . '\diff"' let eq = '"' else let cmd = substitute($VIMRUNTIME, ' ', '" ', '') . '\diff"' endif else let cmd = $VIMRUNTIME . '\diff' endif silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3 . eq endfunction

    Read the article

  • wait after call command minecraft

    - by smeagogol
    I'm trying to create a batch file for a friend because he has some problems on minecraft. He needs to launch minecraft 80 times without closing java error... I have 2 batches, one with a while, and an other one executing java command for launching minecraft. ::Launcher.bat title Script Minecraft set tour=10 set tour2=tour :boucle set /a tour=tour-1 call "D:\thepath\Minecraft2.bat" if %tour%==0 goto suite goto boucle :suite wait javaw.exe :boucle2 set /a tour2=tour2-1 taskkill /F /IM "javaw.exe" if %tour2%==0 goto fin goto boucle2 :fin echo Appuyez sur une touche pour quitter... pause >nul and the other one ::Minecraft2.bat @echo off java -Xmx2048m -Xms1024m -cp "D:\thepath\Minecraft.exe" net.minecraft.LauncherFrame My problem is that when it calls the second batch, it's waiting for closure of the window but we must leave them opened ! If someone has already encountered this problem, I'd be grateful. Thanks PS: If my english is bad, it's because I'm french ;)

    Read the article

  • How can HAProxy improve availibility, or "how can I prevent my site from going down"? [closed]

    - by Joe Hopfgartner
    I am aware of what HAProxy does, but what if my HAproxy goes down? Or what if my DNS servers go down? Yes, dns is less the problem. However dns only solves to an IP and an IP is announced via BGP to be routed over some router. What if that router goes down? Of course if I have complicated application servers that are likely to fail HAProxy can significantly improve uptime. But my application isnt. In fact my application may very well just be delivering a small static html file via HTTP. Basically if any user anywhere types in MYDOMAIN.COM, I want the user to get SOMETHING on the screen other than a timeout or DNS resolution error. How can I do that? The point of entry is difficult. The so called "initial closure mechanism".

    Read the article

  • Prevent runaway threads and ultimately physical overheating and battery drain on Android [migrated]

    - by foampile
    I was wondering if there is a system monitor app that will raise (audible) alerts and offer app closure if it detects runaway threads on Android that cause physical overheating and battery drain. E.g., I just had to turn my phone off because there was a runaway thread that I think was constantly trying to refresh FB where there was very poor connection, so it was going in a virtually endless loop. But I get that with other apps too and not just Facebook. I'd like to actually shut apps down when they're detected. I am not kidding, I nearly burned my fingertips when I touched my phone -- it was on for only 2 hrs and the battery was almost dead. It is because 4G is very poor inside my office building and I checked Facebook walking between my vehicle and the building this AM. After that, the app kept trying to refresh continuously without success and overheating the phone.

    Read the article

  • CodePlex Daily Summary for Sunday, February 28, 2010

    CodePlex Daily Summary for Sunday, February 28, 2010New ProjectsESB Toolkit Extensions: ESB Extensions is a solution containing multiple .Net Projects and artifacts: Unit Tests, Itineraries, Business Rules, Binding Files, and C# Class ...Event-Based Components Binder: The Binder automatically connects output-pins to input-pins of Event-Based Components based on message type information and naming conventions. ...Haze Anti-Virus: Haze Anti-Virus is a anti virus written in C# and has features such a realtime process watching and a Process Blacklist, and is able to download Da...latex2mathml: A .NET 2.0 library written in C# which allows the conversion of LaTeX documents to XHTML+MathML format. A stand-alone converter is included. The li...Project Lyrebird: Project lyrebird is a attempt to create a all-purpose media player. It is designed to be simple, yet powerful. Its written in C#QueryToGrid Module for DotNetNuke®: This is a module that allows you to execute and display the results of T-SQL queries in DotNetNuke using your choice of AJAX grids.Reusable Library Demo: A demonstration of reusable abstractions for enterprise application developerSharePoint 2010 Conference Samples: This project contains source code from various SharePoint 2010 conferences where Scot Hillier presented.Silverlight Photo Blogger: Silverlight Photo Blogger gives you the tools you need to capture and blog about your travels in a rich and interactive web experience. Enjoy som...SMTP Test: Several times we are faced with applications that send email, the SMTP Tester principle objective is to test various possibilities of sendingSolution Tools - tools for Visual Studio solutions and projects: Solution Tools are a collection of tools that you can use with your Visual Studio Solutions and projects.New ReleasesAgile Poker Cards for Windows Mobile: Agile Poker Cards v1.1.0.0: Agile Poker Cards v1.1.0.0 Use this application to display poker cards in a planning session on a Windows Mobile device. Release notes Added new ...BuildTools - Toolset for automated builds: BuildTools 2.0 Feb 2010 Milestone: The Feb 2010 Milestone release is a complete rewrite of the old codebase in Visual Studio 2010 RC. It features MSBuild tasks for generating build v...Composure: NHibernate-Trunk-2010-02-25-VS2010.NET4 Alpha1: Recent NHibernate-Trunk conversion for Visual Studio 2010 Beta2 against .NET 4.0. Although all of the tests pass (other than the "Ignored"), this ...Employee Scheduler: Employee Scheduler 2.4: Extract the files to a directory and run Lab Hours.exe. Add an employee. Double click an employee to modify their times. Please contact me through ...ESB Toolkit Extensions: Tellago BizTalk ESB 2.0 Toolkit Extensions: Windows Installer file that installs Library on a BizTalk ESB 2.0 system. This Install automatically configures the esb.config to use the new compo...Haze Anti-Virus: Haze Anti-Virus Binary v1.0.3: This is the Compiled version of Haze Anti-Virus, please let me know about any bugs, thanks Please Note that Database updating is currently not avai...Haze Anti-Virus: Haze Anti-Virus Source v1.0.3: This is the source for Haze Anti-VirusHOG Project: HOG Visual Studio Template: This is Visual Studio HOG Template. Created by the great tool: Solution FactoryHOG Project: Template user guide: HOW TOiTuner - The iTunes Companion: iTuner 1.1.3711: Two new features are available: the Automated Librarian and Playlist Exporter. The iTuner Automated Librarian automatically cleans the iTunes libr...johanleino.codeplex.com: SilverlightMultiLevelNavigationExample: The source code for SilverlightMultiLevelNavigationExample (VS 2010)MDownloader: MDownloader-0.15.3.56128: Fixed filefactory provider implementation after site changes.MiniTwitter: 1.09: MiniTwitter 1.09 更新内容 変更 スクロール位置がトップ以外の時は自動更新や発言時に位置を保持するように変更 タブ毎にスクロール位置が変わらないように変更 URL に ? や ! が含まれている時は短縮 URL に変換するように変更NMock3: NMock3 - Beta 4, .NET 3.5: This release includes the most current version of the NMock2 project code from Source Forge. Please start providing feedback on the tutorials. The...QueryUnit: QueryUnitPOC v. 0.0.0.7: - This version fixes problems related to the fact that in previous releases you had to specify expected values using locale-specific formats. Now e...RapidWebDev - .NET Enterprise Software Development Infrastructure: RapidWebDev 1.51: This is a hot-fix version for 1.5 which is added a new restful web service for concrete data and fixed some major bugs. The change list is as follo...Rawr: Rawr 2.3.11: - Load from Armory code cleaned up. - Tiny Abomination in a Jar's proc how now been more accurately modeled. - You should now be able to reload...Resharper Settings Manager: RSM v1.2: Changes Added Default Settings File option. The selected settings file will be loaded automatically for solutions with no settings sharing. Added...Reusable Library Demo: Reusable Library Demo v1.0.0: A demonstration of reusable abstractions for enterprise application developerRounded Corners / DIV Container: MJC RoundedDiv 3.2: This is the first public release on Codeplex.com. Versions previous to 3.2 were created before this control was made available on Codeplex.com.SharePoint 2010 Conference Samples: Samples: Download the samples from the conferencesSharePoint Outlook Connector: Version 1.2.2.8: Saving email message as list item and attachments as attachment of the list item functionality has been addedSharePoint URL Ping Tool: Url Ping Tool Solution: A solution that contain one fram fature that will add a link under Site Administration section in the Site Settings page.SMTP Test: Fist SMTP Tester: First ReleaseSolution Tools - tools for Visual Studio solutions and projects: SolutionTools binary: Initial release of the tool. Turns out, this project was just a big waste of effort - use Project Linker instead!Solution Tools - tools for Visual Studio solutions and projects: SolutionTools source - don't use this tool: Initial release of the tool. Turns out, this project was just a big waste of effort - use Project Linker instead! Anyway, here's the source code...Spark View Engine: Spark v1.1 RC1: Overview This build is a preview of v1.1. Among other changes it provides support for ASP.NET MVC 2 RC2. Spark v1.1 release will be created soon ...Sprite Sheet Packer: 2.0 Release: I'm calling this a full new release because I can. Refactored all of the build logic to sspack.exe. This allows you to run this from the command l...SPSF SharePoint Software Factory: SPSF SharePoint Software Factory 2.4.3: New features: WSPBuilder support, Simple Application now with optional multilanguage support, Extending deployment skript for large deployments Fix...TortoiseHg: Beta for TortoiseHg 1.0 (0.9.31201): Beta for TortoiseHg 1.0 (0.9.31201) Please backup your user Mercurial.ini file and then uninstall any 0.9.X release before installing Use the x86...UI Compiler .NET - JavaScript compiler/minifier built on Google Closure Compiler: UI Compiler .NET 1.5 Beta: UI Compiler .NET does not include Java. To be able to run Google Closure Compiler locally you must make sure that Java 6 is installed. If Java 6 (o...VCC: Latest build, v2.1.30227.0: Automatic drop of latest buildVisual Studio DSite: File Encryption and Decryption (Visual Basic 2008): This program will create an encrypted copy of the file specified. Also decrypt the file specified. This program contains the source code but if yo...Visual Studio DSite: Visual C++ 2008 CLR Console Application Random Int: This source code includes an example of generating a random integer between the numbers 1-100.Weather Forecast Control: MJC MyWeather 2.2: This is the first public release on Codeplex.com. Versions previous to 2.2 were created before this control was made available on Codeplex.com.Most Popular ProjectsRawrWBFS ManagerAJAX Control ToolkitMicrosoft SQL Server Product Samples: DatabaseSilverlight ToolkitWindows Presentation Foundation (WPF)Microsoft SQL Server Community & SamplesASP.NETDotNetNuke® Community EditionBlogEngine.NETMost Active ProjectsDinnerNow.netRawrBlogEngine.NETMapWindow GISSLARToolkit - Silverlight Augmented Reality ToolkitCommon Context Adapterspatterns & practices – Enterprise LibrarySharpMap - Geospatial Application Framework for the CLRNB_Store - Free DotNetNuke Ecommerce Catalog ModuleRapid Entity Framework. (ORM). CTP 2

    Read the article

  • Organizing an entity system with external component managers?

    - by Gustav
    I'm designing a game engine for a top-down multiplayer 2D shooter game, which I want to be reasonably reuseable for other top-down shooter games. At the moment I'm thinking about how something like an entity system in it should be designed. First I thought about this: I have a class called EntityManager. It should implement a method called Update and another one called Draw. The reason for me separating Logic and Rendering is because then I can omit the Draw method if running a standalone server. EntityManager owns a list of objects of type BaseEntity. Each entity owns a list of components such as EntityModel (the drawable representation of an entity), EntityNetworkInterface, and EntityPhysicalBody. EntityManager also owns a list of component managers like EntityRenderManager, EntityNetworkManager and EntityPhysicsManager. Each component manager keeps references to the entity components. There are various reasons for moving this code out of the entity's own class and do it collectively instead. For example, I'm using an external physics library, Box2D, for the game. In Box2D, you first add the bodies and shapes to a world (owned by the EntityPhysicsManager in this case) and add collision callbacks (which would be dispatched to the entity object itself in my system). Then you run a function which simulates everything in the system. I find it hard to find a better solution to do this than doing it in an external component manager like this. Entity creation is done like this: EntityManager implements the method RegisterEntity(entityClass, factory) which registers how to create an entity if that class. It also implements the method CreateEntity(entityClass) which would return an object of type BaseEntity. Well now comes my problem: How would the reference to a component be registered to the component managers? I have no idea how I would reference the component managers from a factory/closure.

    Read the article

  • What does your Lisp workflow look like?

    - by Duncan Bayne
    I'm learning Lisp at the moment, coming from a language progression that is Locomotive BASIC - Z80 Assembler - Pascal - C - Perl - C# - Ruby. My approach is to simultaneously: write a simple web-scraper using SBCL, QuickLisp, closure-html, and drakma watch the SICP lectures I think this is working well; I'm developing good 'Lisp goggles', in that I can now read Lisp reasonably easily. I'm also getting a feel for how the Lisp ecosystem works, e.g. Quicklisp for dependencies. What I'm really missing, though, is a sense of how a seasoned Lisper actually works. When I'm coding for .NET, I have Visual Studio set up with ReSharper and VisualSVN. I write tests, I implement, I refactor, I commit. Then when I'm done enough of that to complete a story, I write some AUATs. Then I kick off a Release build on TeamCity to push the new functionality out to the customer for testing & hopefully approval. If it's an app that needs an installer, I use either WiX or InnoSetup, obviously building the installer through the CI system. So, my question is: as an experienced Lisper, what does your workflow look like? Do you work mostly in the REPL, or in the editor? How do you do unit tests? Continuous integration? Packaging & deployment? When you sit down at your desk, steaming mug of coffee to one side and a framed photo of John McCarthy to the other, what is it that you do? Currently, I feel like I am getting to grips with Lisp coding, but not Lisp development ...

    Read the article

  • [Kubuntu 14.04][Eclipse] (ADT) crashes at button OK from Project properties

    - by nouseforname
    Since i upgraded to kubuntu 14.04, my Eclipse crashes at different situations. Mostly i can "simulate" it when going to project properties and press ok. Then it always crashes. My system: DISTRIB_ID=Ubuntu DISTRIB_RELEASE=14.04 DISTRIB_CODENAME=trusty DISTRIB_DESCRIPTION="Ubuntu 14.04.1 LTS" My Java: java version "1.8.0_05" Java(TM) SE Runtime Environment (build 1.8.0_05-b13) Java HotSpot(TM) 64-Bit Server VM (build 25.5-b02, mixed mode) My ADT Version: Android Development Toolkit Version: 23.0.0.1245622 I already tried to add this in adt-bundle-linux-x86_64/eclipse/configuration/configuration.ini org.eclipse.swt.browser.DefaultType=mozilla -Dorg.eclipse.swt.browser.DefaultType=mozilla Error: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00007fe049eb1718, pid=5964, tid=140601811232512 # # JRE version: Java(TM) SE Runtime Environment (8.0_05-b13) (build 1.8.0_05-b13) # Java VM: Java HotSpot(TM) 64-Bit Server VM (25.5-b02 mixed mode linux-amd64 compressed oops) # Problematic frame: # C [libgobject-2.0.so.0+0x19718] g_object_get_qdata+0x18 # # Core dump written. Default location: /home/maddin/core or core.5964 # # An error report file with more information is saved as: # /home/maddin/hs_err_pid5964.log Compiled method (nm) 28866 4166 n 0 org.eclipse.swt.internal.gtk.OS::_g_object_get_qdata (native) total in heap [0x00007fe051da6790,0x00007fe051da6af0] = 864 relocation [0x00007fe051da68b0,0x00007fe051da68f8] = 72 main code [0x00007fe051da6900,0x00007fe051da6ae8] = 488 oops [0x00007fe051da6ae8,0x00007fe051da6af0] = 8 # # If you would like to submit a bug report, please visit: # http://bugreport.sun.com/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # Now, as soon as i change SystemSettings - Application Apperance - GTK - GTKn-Design to something else but "oxygen-gtk" this crash doesn't happen anymore. But the application appearance also is ugly. Beside that i get a lot of errors/warnings like that: (SWT:6148): GLib-GObject-CRITICAL **: g_closure_add_invalidate_notifier: assertion 'closure->n_inotifiers < CLOSURE_MAX_N_INOTIFIERS' failed or other GTK warnings from the particular design, not having theme-engine. Which actually doesn't cause any crahs it seems so far. So i have 3 options: accept crashes accept warnings (maybe the best choice) accept ugly design What can i do to solve this issue without changing the design settings?

    Read the article

  • What does your Lisp workflow look like?

    - by Duncan Bayne
    I'm learning Lisp at the moment, coming from a language progression that is Locomotive BASIC - Z80 Assembler - Pascal - C - Perl - C# - Ruby. My approach is to simultaneously: write a simple web-scraper using SBCL, QuickLisp, closure-html, and drakma watch the SICP lectures I think this is working well; I'm developing good 'Lisp goggles', in that I can now read Lisp reasonably easily. I'm also getting a feel for how the Lisp ecosystem works, e.g. Quicklisp for dependencies. What I'm really missing, though, is a sense of how a seasoned Lisper actually works. When I'm coding for .NET, I have Visual Studio set up with ReSharper and VisualSVN. I write tests, I implement, I refactor, I commit. Then when I'm done enough of that to complete a story, I write some AUATs. Then I kick off a Release build on TeamCity to push the new functionality out to the customer for testing & hopefully approval. If it's an app that needs an installer, I use either WiX or InnoSetup, obviously building the installer through the CI system. So, my question is: as an experienced Lisper, what does your workflow look like? Do you work mostly in the REPL, or in the editor? How do you do unit tests? Continuous integration? Packaging & deployment? When you sit down at your desk, steaming mug of coffee to one side and a framed photo of John McCarthy to the other, what is it that you do? Currently, I feel like I am getting to grips with Lisp coding, but not Lisp development ...

    Read the article

  • Make an object slide around an obstacle

    - by Isaiah
    I have path areas set up in a game I'm making for canvas/html5 and have got it working to keep the player within these areas. I have a function isOut(boundary, x, y) that returns true if the point is outside the boundary. What I do is check only the new position x/y separately with the corresponding old position x/y. Then if each one is out I assign them the past value from the frame before. The old positions are kept in a variable from a closure I made. like this: opos = [x,y];//old position npos = [x,y];//new position if(isOut(bound, npos[0], opos[1])){ npos[0] = opos[0]; //assign it the old x position } if(isOut(bound, opos[0], npos[1])){ npos[1] = opos[1]; //assign it the old y position } It looks nice and works good at certain angles, but if your boundary has diagonal regions it results in jittery motion. What's happening is the y pos exits the area while x doesn't and continues pushing the player to the side, once it has moved the player to the side a bit the player can move forward and then the y exits again and the whole process repeats. Anyone know how I may be able to achieve a smoother slide? I have access to the player's velocity vector, the angle, and the speed(when used with the angle). I can move the play with either angle/speed or x/yvelocities as I've built in backups to translate one to the other if either have been altered manually.

    Read the article

  • Dealing with the node.js callback pyramid

    - by thecoop
    I've just started using node, and one thing I've quickly noticed is how quickly callbacks can build up to a silly level of indentation: doStuff(arg1, arg2, function(err, result) { doMoreStuff(arg3, arg4, function(err, result) { doEvenMoreStuff(arg5, arg6, function(err, result) { omgHowDidIGetHere(); }); }); }); The official style guide says to put each callback in a separate function, but that seems overly restrictive on the use of closures, and making a single object declared in the top level available several layers down, as the object has to be passed through all the intermediate callbacks. Is it ok to use function scope to help here? Put all the callback functions that need access to a global-ish object inside a function that declares that object, so it goes into a closure? function topLevelFunction(globalishObject, callback) { function doMoreStuffImpl(err, result) { doMoreStuff(arg5, arg6, function(err, result) { callback(null, globalishObject); }); } doStuff(arg1, arg2, doMoreStuffImpl); } and so on for several more layers... Or are there frameworks etc to help reduce the levels of indentation without declaring a named function for every single callback? How do you deal with the callback pyramid?

    Read the article

  • Dealing with the node callback pyramid

    - by thecoop
    I've just started using node, and one thing I've quickly noticed is how quickly callbacks can build up to a silly level of indentation: doStuff(arg1, arg2, function(err, result) { doMoreStuff(arg3, arg4, function(err, result) { doEvenMoreStuff(arg5, arg6, function(err, result) { omgHowDidIGetHere(); }); }); }); The official style guide says to put each callback in a separate function, but that seems overly restrictive on the use of closures, and making a single object declared in the top level available several layers down, as the object has to be passed through all the intermediate callbacks. Is it ok to use function scope to help here? Put all the callback functions that need access to a global-ish object inside a function that declares that object, so it goes into a closure? function topLevelFunction(globalishObject, callback) { function doMoreStuffImpl(err, result) { doMoreStuff(arg5, arg6, function(err, result) { callback(null, globalishObject); }); } doStuff(arg1, arg2, doMoreStuffImpl); } and so on for several more layers... Or are there frameworks etc to help reduce the levels of indentation without declaring a named function for every single callback? How do you deal with the callback pyramid?

    Read the article

  • Best approach for tracking dependent state

    - by Pace
    Let's pretend I work on a project tracking application. The application is a database backed, server hosted, web application. In this application there are Projects which have many Activities which have many Tasks. A Task has two date fields an originalDueDate and a projectedDueDate. In addition, there are dynamic fields on the Activities and the Projects which indicate whether the Activity or Project is behind schedule based on the projected due dates of the child tasks and various other variables such as remaining buffer time, etc. There are a number of things that can cause the projectedDueDate to change. For example, an employee working on the project may (via a server request) enter in a shipping delay. Alternatively, a site may (via a server request) enter in an unexpected closure. When any of these things occur I need to not only update the projectedDueDate of the Task but also trigger the corresponding Project and Activity to update as well. What is the best way to do this? I've thought of the observer pattern but I don't keep a single copy of all these objects in memory. When a request comes in, I query the Task in from the database, at that point there is no associated Activity in memory that would be a listener. I could remove the ability to query for Tasks and force the application to query first by Project, then by Activity (in context of Project), then by task (in context of Activity) adding the observer relationships at each step but I'm not sure if that is the best way. I could setup a database event listening system so when a Task modified event is dispatched I have a handler which queries for the Activity at that point. I could simply setup a two-way relationship between Task and Activity so that the Task knows about the parent Activity and when the Task updates his state the Task grabs his parent and updates state. Right now I'm stuck considering all the options and am wondering if any single approach (doesn't have to be a listed approach) is jumping out at others as the best approach.

    Read the article

  • CodePlex Daily Summary for Sunday, December 09, 2012

    CodePlex Daily Summary for Sunday, December 09, 2012Popular ReleasesMedia Companion: MediaCompanion3.509b: mc_com movie cache unassigned fields bug fixes - votes, movie set & originaltitle were not getting set. No changes to main application from previous release.VidCoder: 1.4.10 Beta: Added progress percent to the title bar/task bar icon. Added MPLS information to Blu-ray titles. Fixed the following display issues in Windows 8: Uncentered text in textbox controls Disabled controls not having gray text making them hard to identify as disabled Drop-down menus having hard-to distinguish white on light-blue text Added more logging to proxy disconnect issues and increased timeout on initial call to help prevent timeouts. Fixed encoding window showing the built-in pre...WPF Application Framework (WAF): WPF Application Framework (WAF) 2.5.0.400: Version 2.5.0.400 (Release): This release contains the source code of the WPF Application Framework (WAF) and the sample applications. Requirements .NET Framework 4.0 (The package contains a solution file for Visual Studio 2010) The unit test projects require Visual Studio 2010 Professional Changelog Legend: [B] Breaking change; [O] Marked member as obsolete Update the documentation. InfoMan: Write the documentation. Other Downloads Downloads OverviewYnote Classic: Ynote Classic version 1.0: Ynote Classic is a text editor made by SS Corporation. It can help you write code by providing you with different codes for creation of html or batch files. You can also create C/C++ /Java files with SS Ynote Classic. Author of Ynote Classic is Samarjeet Singh. Ynote Classic is available with different themes and skins. It can also compile *.bat files into an executable file. It also has a calculator built within it. 1st version released of 6-12-12 by Samarjeet Singh. Please contact on http:...Http Explorer: httpExplorer-1.1: httpExplorer now has the ability to connect to http server via web proxies. The proxy may be explicitly specified by hostname or IP address. Or it may be specified via the Internet Options settings of Windows. You may also specify credentials to pass to the proxy if the proxy requires them. These credentials may be NTLM or basic authentication (clear text username and password).Bee OPOA Platform: Bee OPOA Demo V1.0.001: Initial version.Microsoft Ajax Minifier: Microsoft Ajax Minifier 4.78: Fix for issue #18924 - using -pretty option left in ///#DEBUG blocks. Fix for issue #18980 - bad += optimization caused bug in resulting code. Optimization has been removed pending further review.Selenium PowerShell eXtensions: SePSX 0.4.8: Beta 1: Selenium 2.26, IEDriver 2.26, ChromeDriver 23 Beta 2: Selenium 2.27, IEDriver 2.27, ChromeDriver 23 Beta 3: Selenium 2.27.1, IEDriver 2.27, ChromeDriver 23 This release brings to us several interesting features: ChromeOptions cmdletsThe New-SeChromeOptions, Add-SeChromeArgument, Add-SeChromeExtension and Set-SeChromeBinary cmdlets along with the revisited Start-SeChrome cmdlet give now the full spectrum of possibilities to run a web driver, namely the following seven ways: bare start...Periodic.Net: 0.8: Whats new for Periodic.Net 0.8: New Element Info Dialog New Website MenuItem Minor Bug Fix's, improvements and speed upsHydroDesktop - CUAHSI Hydrologic Information System Desktop Application: 1.5.11 Experimental Release: This is HydroDesktop 1.5.11 Experimental Release We are targeting for a 1.6 Stable Release in Fall 2012. This experimental version has been published for testing. New Features in 1.5 Time Series Data Import Improved performance of table, graph and edit views Support for online sample project packages (sharing data and analyses) More detailed display of time series metadata Improved extension manager (uninstall extensions, choose extension source) Improved attribute table editor (supports fil...Yahoo! UI Library: YUI Compressor for .Net: Version 2.2.0.0 - Epee: New : Web Optimization package! Cleaned up the nuget packages BugFix: minifying lots of files will now be faster because of a recent regression in some code. (We were instantiating something far too many times).DtPad - .NET Framework text editor: DtPad 2.9.0.40: http://dtpad.diariotraduttore.com/files/images/flag-eng.png English + A new built-in editor for the management of CSV files, including the edit of cells, deleting and adding new rows, replacement of delimiter character and much more (issue #1137) + The limit of rows allowed before the decommissioning of their side panel has been raised (new default: 1.000) (issue #1155, only partially solved) + Pressing CTRL+TAB now DtPad opens a screen that shows the list of opened tabs (issue #1143) + Note...AvalonDock: AvalonDock 2.0.1746: Welcome to the new release of AvalonDock 2.0 This release contains a lot (lot) of bug fixes and some great improvements: Views Caching: Content of Documents and Anchorables is no more recreated everytime user move it. Autohide pane opens really fast now. Two new themes Expression (Dark and Light) and Metro (both of them still in experimental stage). If you already use AD 2.0 or plan to integrate it in your future projects, I'm interested in your ideas for new features: http://avalondock...AcDown?????: AcDown????? v4.3.2: ??●AcDown??????????、??、??、???????。????,????,?????????????????????????。???????????Acfun、????(Bilibili)、??、??、YouTube、??、???、??????、SF????、????????????。 ●??????AcPlay?????,??????、????????????????。 ● AcDown??????????????????,????????????????????????????。 ● AcDown???????C#??,????.NET Framework 2.0??。?????"Acfun?????"。 ?? v4.3.2?? ?????????????????? ??Acfun??????? ??Bilibili?????? ??Bilibili???????????? ??Bilibili????????? ??????????????? ???? ??Bilibili??????? ????32??64? Windows XP/...ExtJS based ASP.NET 2.0 Controls: FineUI v3.2.2: ??FineUI ?? ExtJS ??? ASP.NET 2.0 ???。 FineUI??? ?? No JavaScript,No CSS,No UpdatePanel,No ViewState,No WebServices ???????。 ?????? IE 7.0、Firefox 3.6、Chrome 3.0、Opera 10.5、Safari 3.0+ ???? Apache License 2.0 (Apache) ???? ??:http://fineui.com/bbs/ ??:http://fineui.com/demo/ ??:http://fineui.com/doc/ ??:http://fineui.codeplex.com/ ???? +2012-12-03 v3.2.2 -?????????????,?????button/button_menu.aspx(????)。 +?Window????Plain??;?ToolbarPosition??Footer??;?????FooterBarAlign??。 -????win...Player Framework by Microsoft: Player Framework for Windows Phone 8: This is a brand new version of the Player Framework for Windows Phone, available exclusively for Windows Phone 8, and now based upon the Player Framework for Windows 8. While this new version is not backward compatible with Windows Phone 7 (get that http://smf.codeplex.com/releases/view/88970), it does offer the same great feature set plus dozens of new features such as advertising, localization support, and improved skinning. Click here for more information about what's new in the Windows P...SSH.NET Library: 2012.12.3: New feature(s): + SynchronizeDirectoriesQuest: Quest 5.3 Beta: New features in Quest 5.3 include: Grid-based map (sponsored by Phillip Zolla) Changable POV (sponsored by Phillip Zolla) Game log (sponsored by Phillip Zolla) Customisable object link colour (sponsored by Phillip Zolla) More room description options (by James Gregory) More mathematical functions now available to expressions Desktop Player uses the same UI as WebPlayer - this will make it much easier to implement customisation options New sorting functions: ObjectListSort(list,...Chinook Database: Chinook Database 1.4: Chinook Database 1.4 This is a sample database available in multiple formats: SQL scripts for multiple database vendors, embeded database files, and XML format. The Chinook data model is available here. ChinookDatabase1.4_CompleteVersion.zip is a complete package for all supported databases/data sources. There are also packages for each specific data source. Supported Database ServersDB2 EffiProz MySQL Oracle PostgreSQL SQL Server SQL Server Compact SQLite Issues Resolved293...RiP-Ripper & PG-Ripper: RiP-Ripper 2.9.34: changes FIXED: Thanks Function when "Download each post in it's own folder" is disabled FIXED: "PixHub.eu" linksNew ProjectsBaldur's Gate Party Gold Editor - WPF, Windows Forms MVP-VM sample: MVP-VM sample WPF, Windows Forms MVP-VM sampleEGRemote Studio: EGRemote Studio is a gateway application that enables communication between Eventghost and Google's push messaging service.Emptycanvas: Le projet emptycanvas est destiné aux créations de vidéos en images de synthèse ainsi qu'aux conceptions 3D sur ordinateur.eveCIMS - A Corporation Information and Management System for eve online: eveCIMS is a web application for managing a corporation in CCPs Spaceship Game EVE Online. Google Helper: Google HelperHongloumeng: ???RPG????Mobile Projects LFD: Projeto voltado a agrupar funções simples de plataformas moveis.Momra Transfers: This is transfers project for momraMuhammad Tarmizi bin Kamaruddin's simple free software (primary edition) (BETA): Muhammad Tarmizi bin Kamaruddin's simple free software (primary edition) (BETA)Nth Parameter Series: Silverlight Business application to use the concept of extending the double time series used extensivelly in the finance industry.OMR.EasyBackup: Example of easy real time file system backup project.SharePoint - Web Customization Inheritance: This project allows to inherit customizations of a site to is childrens, including master page, theme and logo. Tennis_HDU: TennisHDUTuto Direct3D 11 SDZ: Code source accompagnant le tutoriel disponible sur le Site du Zéro.Visual Studio 2010 Settings Swapper AddIn: Settings swapper makes it simple to have Visual Studio settings apply per file type. For example, maybe you want to have settings for a aspx MVC page be different from a C# file. The project was created in and tested with Visual Studio 2010 and written in C#.Weak Closure Pattern: The weak closures. Creation of the closure behavior that independent from a compiler.??MVC?????????: ??MVC ??????????,??????MVC3、Autofac、Lucene.net 3.0,??Npoi.net,Nhibernate、quartz.net???????,??????????????????????,????????,????

    Read the article

  • Is there a way to ‘join’ (block) in POSIX threads, without exiting the joinee?

    - by elliottcable
    I’m buried in multithreading / parallelism documents, trying to figure out how to implement a threading implementation in a programming language I’ve been designing. I’m trying to map a mental model to the pthreads.h library, but I’m having trouble with one thing: I need my interpreter instances to continue to exist after they complete interpretation of a routine (the language’s closure/function data type), because I want to later assign other routines to them for interpretation, thus saving me the thread and interpreter setup/teardown time. This would be fine, except that pthread_join(3) requires that I call pthread_exit(3) to ‘unblock’ the original thread. How can I block the original thread (when it needs the result of executing the routine), and then unblock it when interpretation of the child routine is complete?

    Read the article

  • Singleton by Jon Skeet clarification

    - by amutha
    public sealed class Singleton { Singleton() { } public static Singleton Instance { get { return Nested.instance; } } class Nested { // Explicit static constructor to tell C# compiler // not to mark type as beforefieldinit static Nested() { } internal static readonly Singleton instance = new Singleton(); } } I wish to implement Jon Skeet's Singleton pattern in my current application in C#. I have two doubts on the code 1) How is it possible to access the outer class inside nested class? I mean internal static readonly Singleton instance = new Singleton(); Is something called closure? 2) I did not get this comment // Explicit static constructor to tell C# compiler // not to mark type as beforefieldinit what does this comment suggest us?

    Read the article

  • Interval tree algorithm that supports merging of intervals with no overlap

    - by Dave Griffiths
    I'm looking for an interval tree algorithm similar to the red-black interval tree in CLR but that supports merging of intervals by default so that there are never any overlapping intervals. In other words if you had a tree containing two intervals [2,3] and [5,6] and you added the interval [4,4], the result would be a tree containing just one interval [2,6]. Thanks Update: the use case I'm considering is calculating transitive closure. Interval sets are used to store the successor sets because they have been found to be quite compact. But if you represent interval sets just as a linked list I have found that in some situations they can become quite large and hence so does the time required to find the insertion point. Hence my interest in interval trees. Also there may be quite a lot of merging one tree with another (i.e. a set OR operation) - if both trees are large then it may be better to create a new tree using inorder walks of both trees rather than repeated insertions of each interval.

    Read the article

  • Grails Shiro plugin : confirming my understanding

    - by bsreekanth
    I'm bit vague about how to start using the shiro plugin, after reading few documents. I decided against Nimble, as it comes with few tables and UI plugins. I setup shiro plugin with wildcard realm, with my own tables. I may use permission based (rather tan role based) access control as it scales well. Now, the steps for it. assign the permission string to the subject, and save it in the db check the permission through isPermitted, hasPermission (or relevant tags in GSP). Now, 1. when to use the accesscontrol through filter? 2. is there a closure injected into the controller where I can define the permission for the actions in it? 3. How do I create a typical access control scenario like only the creator of (something, a post etc) can delete it? thanks a lot.. Babu.

    Read the article

  • What is in scala-android.jar?

    - by synic
    I've been trying to experiment with developing Android applications with Scala. I've gotten to the point where I can get the app to compile, but there are no helper functions for things like: button.setOnClickListener( () => { text.setText("test") }) (I'm talking about the closure there) I see lots of references to scala-android.jar, and have this file in my project, but I'm not sure what it does, or how to use it. I get the feeling it has these helper conversion functions, but I'm not sure. Running jar -tvf scala-android.jar on the file gives me this: 401 Sun Jun 06 10:06:02 MDT 2010 scala/Function0$class.class 431 Sun Jun 06 10:06:02 MDT 2010 scala/Function0.class 572 Sun Jun 06 10:06:02 MDT 2010 scala/Function1.class 282 Sun Jun 06 10:06:02 MDT 2010 scala/ScalaObject$class.class 271 Sun Jun 06 10:06:02 MDT 2010 scala/ScalaObject.class 458 Sun Jun 06 10:06:02 MDT 2010 scala/runtime/BoxedUnit.class If this isn't what I'm looking for, is there a simple library that'll do conversions for this kind of stuff?

    Read the article

  • Is there an easy way to get a list of all successful captures from a regex pre-5.10?

    - by Chas. Owens
    I know the right way to do this if I have Perl 5.10 is to use named captures and values %+, but in Perl 5.8.9 and how can I get a list of successful captures? I have come up with two methods that are both just terrible: #you need to list each possible match my @captures = grep { defined } ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16); and #ew, I turned on symbolic references { no strict 'refs'; my @captures = map { defined $+[$_] ? $$_ : () } 1 .. $#+; } There is a third option I have found involving (?{}), but it requires global variables (because the closure happens at compile time) and takes the regex from reasonably clear to ungodly mess. The only alternative I have found is to capture the whole match and then use another set of regexes to get the values I want (actually I build the first regex out of the other regexes because there is no good reason to duplicate the logic).

    Read the article

  • Iterator blocks in Clojure?

    - by Checkers
    I am using clojure.contrib.sql to fetch some records from an SQLite database. (defn read-all-foo [] (with-connection *db* (with-query-results res ["select * from foo"] (into [] res)))) Now, I don't really want to realize the whole sequence before returning from the function (i.e. I want to keep it lazy), but if I return res directly or wrap it some kind of lazy wrapper (for example I want to make a certain map transformation on result sequence), SQL-related bindings will be reset and connection will be closed after I return, so realizing the sequence will throw an exception. How can I enclose the whole function in a closure and return a kind of iterator block (like yield in C# or Python)? Or is there another way to return a lazy sequence from this function?

    Read the article

  • Shortest way of attaching multiple DOM elements to one event handler using Jquery?

    - by Camsoft
    I need to attach a single event handler to multiple DOM elements using jQuery. I'm currently achieving this using jQuery's each() method. See below: $([elm1, elm2, elm3]).each(function() { this.click(eventHandler); }); I was wondering if there is a way to do this without using the each method and closure. I thought I would be able to do something like: $(elm1, elm2, elm3).click(eventHandler); This kind of statement works using Prototype.js but not in jQuery.The reason I ask the question is because after using both Prototype.js and jQuery I have found that jQuery requires simpler statements to achieve the same tasks in almost every area so I assume there must be a better way of doing this?

    Read the article

  • C# -Interview Question Anonymous Type

    - by Amutha
    Recently i was asked to prove the power of C# 3.0 in a single line( might be tricky) i wrote new int[] { 1, 2, 3 }.Union(new int[]{10,23,45}). ToList().ForEach(x => Console.WriteLine(x)); and explained you can have (i) anonymous array (ii) extension method (iii)lambda and closure all in a single line.I got spot offer. But..... The interviewer asked me how will you convert an anonymous type into know type :( I am 100% sure ,we can not do that.The interviewer replied there is 200% chance to do that if you have a small work around.I was clueless. As usual,I am waiting for your valuable reply(Is it possible?).

    Read the article

  • How to define enum in as3?

    - by Nava Carmon
    Is there a way to define an enum in AS3 in a way we do it in other languages? I can define constants with defined values like that: private const CONST_1:int = 0; private const CONST_2:int = 1; private const CONST_3:int = 2; and so on. If I want to insert some other constant between 3 these I need to move all values like that: private const CONST_1:int = 0; private const CONST_2:int = 1; private const CONST_2A:int = 2; private const CONST_3:int = 3; while in other language I would end up with only adding a new member to enum closure like that: enum { CONST_1 = 0, CONST_2, CONST_2A, CONST_3 } MyConstEnum; Does AS3 has something similar? Thanks

    Read the article

  • Java - JTable multiple instances

    - by Brian
    I have a JTable that gets data added to it from another JTable. Now I want to switch between JTables according to the day selected in a JComboBox. For example, if I choose Monday I add programs added to it then I select Tuesday from the JComboBox and a fresh JTable appears. If I go to Monday again the programs should still be there (until the program is closed). How do I create multiple JTables (the JTable remains the same) for the days and let the info remain there until program closure? Here is an example to show you what I mean:

    Read the article

< Previous Page | 5 6 7 8 9 10 11 12 13  | Next Page >