Search Results

Search found 3195 results on 128 pages for 'tip and tricks'.

Page 101/128 | < Previous Page | 97 98 99 100 101 102 103 104 105 106 107 108  | Next Page >

  • Keyboard for programmers

    - by Robert Höglund
    I'm trying to improve my working environment and I'm still searching for that perfect keyboard that practically types bug-free code all by itself. At the moment I'm using a Logitech Wave for my Windows need and an Apple Wireless Keyboard (the one without a numeric keypad) when doing OS X stuff. I'm quite happy with the Logitech Wave but I would prefer one without all the extra multimedia buttons. What I like most about the Apple Wireless Keyboard is that it is very similar to the Macbook's keyboard which for me makes it easier to write code when on my Macbook. What kind of keyboard would you recommend for going all out writing code until your fingers bleed? I have remapped the Caps Lock key to Ctrl which after a while feels really good, until I have to sit at another computer or when someone at work is going to show me something on my computer. Are there other little keyboard tricks that you use to get a little bit more productive? I have looked into switching to Dvorak but I have decided it's not for me.

    Read the article

  • What are some methods to debug Javascript inside of a UIWebView?

    - by bpapa
    I'm trying to figure out why something with Javascript isn't working inside of a UIWebView. To my knowledge, there is no way to set a breakpoint inside of XCode for a js file. No problemo, I'll just go back to 2004 and use alert statemen-- oh wait they don't seem to work inside of a UIWebView either! The only thing I could think of is by exporting my HTML And JS files to my desktop and then just doing my debugging inside of Safari. And that works! But of course, the bug I'm fighting with in the UIWebView doesn't occur in Safari. Are there any other ways for debugging inside of a UIWebView, or any tricks that I can use akin to using the old-school alert method?

    Read the article

  • Why not allow mutation of the this binding?

    - by gnucom
    Hi Everyone, I'm building a interpreter/compiler for a school project (well now its turning into a hobby project) and an instructor warned me not to allow mutation of the 'this' binding (he said it was gross and made a huge deal about it) but I never learned why this is so... dangerous or bad. I'm very curious about why this is so bad. I figured this sort of feature could be useful in some way or another. I'm wondering if anyone familiar with building languages can tell me what sort of problems mutation on the 'this' binding can cause, and if they know of any cool or useful tricks that one could do if it actually was allowed. Do any languages that you're aware of allow mutation of 'this'? Thanks,

    Read the article

  • NetLogo 4.1 - implementation of a motorway ( Problem creating collision of cars )

    - by user206019
    Hi there, I am trying to create a simulation of motorway and the behaviour of the drivers in NetLogo. I have some questions that I m struggling to solve. Here is my code: globals [ selected-car ;; the currently selected car average-speed ;; average speed of all the cars look-ahead ] turtles-own [ speed ;; the current speed of the car speed-limit ;; the maximum speed of the car (different for all cars) lane ;; the current lane of the car target-lane ;; the desired lane of the car change? ;; true if the car wants to change lanes patience ;; the driver's current patience max-patience ;; the driver's maximum patience ] to setup ca import-drawing "my_road3.png" set-default-shape turtles "car" crt number_of_cars [ setup-cars ] end to setup-cars set color blue set size .9 set lane (random 3) set target-lane (lane + 1) setxy round random-xcor (lane + 1) set heading 90 set speed 0.1 + random 9.9 set speed-limit (((random 11) / 10) + 1) set change? false set max-patience ((random 50) + 10) set patience (max-patience - (random 10)) ;; make sure no two cars are on the same patch loop [ ifelse any? other turtles-here [ fd 1 ] [ stop ] ;if count turtles-here > 1 ; fd 0.1 ;if ; ;ifelse (any? turtles-on neighbors) or (count turtles-here > 1) ;[ ; ifelse (count turtles-here = 1) ; [ if any? turtles-on neighbors ; [ ; if distance min-one-of turtles-on neighbors [distance myself] > 0.9 ; [stop] ; ] ; ] ; [ fd 0.1 ] ;] ;[ stop ] ] end to go drive end to drive ;; first determine average speed of the cars set average-speed ((sum [speed] of turtles) / number_of_cars) ;set-current-plot "Car Speeds" ;set-current-plot-pen "average" ;plot average-speed ;set-current-plot-pen "max" ;plot (max [speed] of turtles) ;set-current-plot-pen "min" ;plot (abs (min [speed] of turtles) ) ;set-current-plot-pen "selected-car" ;plot ([speed] of selected-car) ask turtles [ ifelse (any? turtles-at 1 0) [ set speed ([speed] of (one-of (turtles-at 1 0))) decelerate ] [ ifelse (look-ahead = 2) [ ifelse (any? turtles-at 2 0) [ set speed ([speed] of (one-of turtles-at 2 0)) decelerate ] [ accelerate if count turtles-at 0 1 = 0 and ycor < 2.5 [lt 90 fd 1 rt 90] ] ] [accelerate if count turtles-at 0 1 = 0 and ycor < 2.5 [lt 90 fd 1 rt 90] ] ] if (speed < 0.01) [ set speed 0.01 ] if (speed > speed-limit) [ set speed speed-limit ] ifelse (change? = false) [ signal ] [ change-lanes ] ;; Control for making sure no one crashes. ifelse (any? turtles-at 1 0) and (xcor != min-pxcor - .5) [ set speed [speed] of (one-of turtles-at 1 0) ] [ ifelse ((any? turtles-at 2 0) and (speed > 1.0)) [ set speed ([speed] of (one-of turtles-at 2 0)) fd 1 ] [jump speed] ] ] tick end ;; increase speed of cars to accelerate ;; turtle procedure set speed (speed + (speed-up / 1000)) end ;; reduce speed of cars to decelerate ;; turtle procedure set speed (speed - (slow-down / 1000)) end to signal ifelse (any? turtles-at 1 0) [ if ([speed] of (one-of (turtles-at 1 0))) < (speed) [ set change? true ] ] [ set change? false ] end ;; undergoes search algorithms to change-lanes ;; turtle procedure show ycor ifelse (patience <= 0) [ ifelse (max-patience <= 1) [ set max-patience (random 10) + 1 ] [ set max-patience (max-patience - (random 5)) ] set patience max-patience ifelse (target-lane = 0) [ set target-lane 1 set lane 0 ] [ set target-lane 0 set lane 1 ] ] [ set patience (patience - 1) ] ifelse (target-lane = lane) [ ifelse (target-lane = 0) [ set target-lane 1 set change? false ] [ set target-lane 0 set change? false ] ] [ ifelse (target-lane = 1) [ ifelse (pycor = 2) [ set lane 1 set change? false ] [ ifelse (not any? turtles-at 0 1) [ set ycor (ycor + 1) ] [ ifelse (not any? turtles-at 1 0) [ set xcor (xcor + 1) ] [ decelerate if (speed <= 0) [ set speed 0.1 ] ] ] ] ] [ ifelse (pycor = -2) [ set lane 0 set change? false ] [ ifelse (not any? turtles-at 0 -1) [ set ycor (ycor - 1) ] [ ifelse (not any? turtles-at 1 0) [ set xcor (xcor + 1) ] [ decelerate if (speed <= 0) [ set speed 0.1 ] ] ] ] ] ] end I know its a bit messy because I am using code from other models from the library. I want to know how to create the collision of the cars. I can't think of any idea. As you notice my agent has almost the same size as the patch (I set it to 0.9 so that you can distinguish the space between 2 cars when they are set next to each other and I round the coordinates so that they are set to the centre of the patch). In my accelerate procedure I set my agent to turn left, move 1, turn right in a loop. I want to know if there's a command that lets me make the agent jump from one lane to the other (to the patch next to it on its left) without making it turn and move. And last, if you notice the code i created the car checks the patch that is next to it on the lane on its left and the patch in front of it and the back of it. So if the 3 patches on its left are empty then it can change lane. The fuzzy part is that when i run the setup and I press Go sometimes (not always) the car goes out of the 3 basic lanes. To understand this I have 7 lanes. The middle one which I don't use which is lane 0. Then there are 3 lanes on top of lane 0 and 3 below it. So the code I am using refers to the upper 3 lanes where I set the cars but for some reason some of the cars change lane and go to lane -3 then -2 and so forth. If someone can give me a tip I would really appreciate it. Thank you in advance. Tip: if you want to try this code in netlogo keep in mind that on interface tab I have 2 buttons one setup and one go as well as 3 sliders with names: number_of_cars , speed-up , slow-down.

    Read the article

  • Stop Picasa (Mac) from scanning my harddrive

    - by Bodyscanner
    I want to use Picasa desktop app instead of the tedious & clunky web interface to share a couple of photos. Every time I launch Picasa it proceeds to open an annoying pop-up/tool-tip which flicks through every file on my HD using <=95% of CPU. I don't want this so I click the X. It appears again. I try to drag it somewhere less annoying onscreen but it pings back. I look in prefs for an option to turn it off. I give up and quit app until a new build comes out, which I download and repeat the above. WTF?! I understand Google can't be as cool as Apple - iPhoto isn't perfect by any means but at least it looks nice and 'just works'. I want to launch Picasa, not have it go through everything, not have 1000's of random pics and HD cruft on display in the list, and then perhaps drag in a few photos and upload them. Any idea of if that is possible? </rant>

    Read the article

  • Running Windows Update inside Windowx XP Mode

    - by Noam Gal
    I am working on a Win 7 Ultimate machine, and was using XP for some development tasks (for compatibility checks). Everything worked like a charm on the XP, including updates. Two days ago I had to switch computer (mainly a new motherboard/cpu), and I had just stuck my old HD inside the newer case. Win 7 worked like a charm - installed all the new drivers, identified everything automatically, no sweat. The trouble started when I tried running my old XP mode - it won't launch, complaining about the cpu change. I figured it's not a big deal, and I deleted the VM, and re-ran XP mode. It told me it can't find it, and offered to create a new one, just what I wanted. I had finished setting up the new XP mode VM, and it seems to work just fine. Got it to use the host network adapter, so I can surf from "inside". But I can't get Windows Update to run. Whenever I click on the "Custom" button on the WU site, after a short while, I get the [Error number: 0x80072EFD] page. I tried several solution from around the web for it (clearing some cache and restarting the wuauserv, even a microsoft fix-it run), but still nothing seems to work. Anyone here has any new tip for me? Thanks.

    Read the article

  • Wpf: Tips for better performance

    - by viky
    I am working on a wpf application. In which I am working with a TreeView, each node represents different datatypes, these datatypes are having properties defined and using data template to show their properties. My application reads from xml and create tree accordingly. My problem is that when I load it, it is too slow, I want to know about the tricks that will help me to improve performance of my(any) wpf application. Edit: Please provide me some tips for better performance in wpf!! I am using wpf Profiler but it is not much helpful for me.

    Read the article

  • Reducing differences in xibs

    - by tewha
    I've been noticing superfluous changes in my xib files with Interface Builder 3.2.1. Here are a few of them: - <reference key="NSNextResponder"/> + <nil key="NSNextResponder"/> - <reference key="NSSuperview"/> - <array class="NSMutableArray" key="IBDocument.EditedObjectIDs"> - <integer value="6"/> - </array> + <array class="NSMutableArray" key="IBDocument.EditedObjectIDs"/> Can anyone tell me what these are, and are there any tricks for avoiding them? I'd prefer my checkins to only describe changes I intentionally made. Update: I wasn't clear in the original question, but these differences were caused by opening the file in Interface Builder and saving it without making a change.

    Read the article

  • Paging enormous tables on DB2

    - by grenade
    We have a view that, without constraints, will return 90 million rows and a reporting application that needs to display paged datasets of that view. We're using nhibernate and recently noticed that its paging mechanism looks like this: select * from (select rownumber() over() as rownum, this_.COL1 as COL1_20_0_, this_.COL2 as COL2_20_0_ FROM SomeSchema.SomeView this_ WHERE this_.COL1 = 'SomeValue') as tempresult where rownum between 10 and 20 The query brings the db server to its knees. I think what's happening is that the nested query is assigning a row number to every row satisfied by the where clause before selecting the subset (rows 10 - 20). Since the nested query will return a lot of rows, the mechanism is not very efficient. I've seen lots of tips and tricks for doing this efficiently on other SQL platforms but I'm struggling to find a DB2 solution. In fact an article on IBM's own site recommends the approach that nhibernate has taken. Is there a better way?

    Read the article

  • Redmon's Run As User not loading user's enviroment variables

    - by catfish
    I'm attempting to use Redmon http://www.winimage.com/misc/redmon/ to send print jobs to a custom C# application. Redmon "runs" (actually the Print Spooler) as SYSTEM but has an option to Run As User to allow your application to run under the user that printed the job. The problem is that it doesn't appear to load the user's environment. So calling functions like Path.GetTempPath() points to \windows\temp instead of the user's. Also when attempting to run Outlook 2007+ via MAPI calls (to add attachments) it reports form errors due to, I think, the temp folder location. Is there a way to "reload" a profile or atleast get your environment vars within the Impersonated application? The only ideas I've had so far is to rebuild the vars directly from the registry, but I want to avoid this since it's a hack around (avoiding implementation details and all that). Or making a stub program that Redmon calls which then properly Run As User with full profile the custom application. Any other items or tricks?

    Read the article

  • Using Subversion in Xcode

    - by Kevin L.
    It seems that all of the initial Google results for "using subversion with xcode" are actually just tutorials for installing and configuring svn and Xcode, as opposed to actually using the two (i.e. interacting with svn via Xcode's GUI). Is anyone aware of a good guide that teaches the tricks and pitfalls of working with svn via Xcode's GUI? Something that bridges the gap between the most excellent Version Control with Subversion book and the Xcode IDE (as in pure Xcode GUI without any terminal command use)? Edit: We all love our terminal commands, and we all love Eclipse but (and I mean this in the nicest possible way) neither is really the point of the question. I’d prefer to use svn via Xcode’s IDE instead of via terminal just as I prefer (well, for this case) to code in Xcode’s IDE instead of using vim and gcc. Apple engineers spent a good bit of time implementing that SCM menu in Xcode; someone has to have seen a usage guide somewhere.

    Read the article

  • Idiomatic way to do list/dict in Cython?

    - by ramanujan
    My problem: I've found that processing large data sets with raw C++ using the STL map and vector can often be considerably faster (and with lower memory footprint) than using Cython. I figure that part of this speed penalty is due to using Python lists and dicts, and that there might be some tricks to use less encumbered data structures in Cython. For example, this page (http://wiki.cython.org/tutorials/numpy) shows how to make numpy arrays very fast in Cython by predefining the size and types of the ND array. Question: Is there any way to do something similar with lists/dicts, e.g. by stating roughly how many elements or (key,value) pairs you expect to have in them? That is, is there an idiomatic way to convert lists/dicts to (fast) data structures in Cython? If not I guess I'll just have to write it in C++ and wrap in a Cython import.

    Read the article

  • Career Day in kindergarten: how to demonstrate programming in 20 minutes?

    - by Péter Török
    I was invited to the kindergarten group of my elder daughter to talk, and aswer the kids' questions, about my profession. There are 26 kids of age 4-6 in the group (plus 3 teachers who are fairly scared of anything related to programming and IT themselves, but bold enough to learn new tricks). I would have about 20-30 minutes, without projector or anything. (They have an old computer though, which by its look may be a 486, and I am not even sure if it's functioning.) My research turned up excellent earlier threads, with lots of good tips: How would you explain your job to a 5-year old? Career Day: how do I make “computer programmer” sound cool to 8 year olds? What things can I teach a group of children about programming in one day? My situation is different from each of the above though. So any advice on how to teach the kids (and their teachers) in a fun way about programming is appreciated.

    Read the article

  • Why can't we use a Translucent system bars with and ActionBar

    - by Waza_Be
    While updating my apps to Kitkat, I just wanted to give them a gorgeous look on KitKat using the Translucent property: Translucent system bars You can now make the system bars partially translucent with new themes, Theme.Holo.NoActionBar.TranslucentDecor and Theme.Holo.Light.NoActionBar.TranslucentDecor. By enabling translucent system bars, your layout will fill the area behind the system bars, so you must also enable [fitsSystemWindows][4] for the portion of your layout that should not be covered by the system bars. My only concern is that I would like to use an ActionBar which sounds the opposite of what Google wants (both theme have NoActionBar: Theme.Holo.NoActionBar.TranslucentDecor Theme.Holo.Light.NoActionBar.TranslucentDecor As I don't plan to use some hacks or tricks to make it work, I just wanted to know if there was some correct way to achieve this or if this would be against Google guidelines.

    Read the article

  • What Simple Changes Made the Biggest Improvements to Your Delphi Programs

    - by lkessler
    I have a Delphi 2009 program that handles a lot of data and needs to be as fast as possible and not use too much memory. What small simple changes have you made to your Delphi code that had the biggest impact on the performance of you program by noticeably reducing execution time or memory use? Thanks everyone for all your answers. Many great tips. For completeness, I'll post a few important articles on Delphi optimization that I found. Before you start optimizing Delphi code at About.com Speed and Size: Top 10 Tricks also at About.com Code Optimization Fundamentals and Delphi Optimization Guidelines at High Performance Delphi, relating to Delphi 7 but still very pertinent.

    Read the article

  • is it possible to achieve an image clipping/masking effect with html + css3?

    - by sa125
    Hi - I'm trying to place a nice border around an image that's 250x250, using only html and css. The markup is this: <div id="img-container"><img src="pic.jpg" border="0"/></div> And the css is: #img-container { height: 225px; width: 225px; padding: 3px; border: 1px solid black; z-index: 10; position: relative; overflow: hidden; border-radius: 10px; } #img-container img { z-index: 5; } Basically, I want the div container to clip the picture's edges that exceed its boundaries. This will achieve the rounded edges effect using the border-radius property (-moz-border-radius, -webkit-border-radius, etc) - if it actually works or could even be done. Looking for tips and tricks on this. Thanks. And, yes, I'm obviously not a web designer :)

    Read the article

  • Image 8-connectivity without excessive branching?

    - by shoosh
    I'm writing a low level image processing algorithm which needs to do alot of 8-connectivity checks for pixels. For every pixel I often need to check the pixels above it, below it and on its sides and diagonals. On the edges of the image there are special cases where there are only 5 or 3 neighbors instead of 8 neighbors for a pixels. The naive way to do it is for every access to check if the coordinates are in the right range and if not, return some default value. I'm looking for a way to avoid all these checks since they introduce a large overhead to the algorithm. Are there any tricks to avoid it altogether?

    Read the article

  • Parse error: syntax error, unexpected T_PUBLIC in ..... ?

    - by tonsils
    Hi, I am new to php and trying out this tutorial at : http://css-tricks.com/php-for-beginners-building-your-first-simple-cms/ Unfortunately I am getting the following error and can't seem to track down the reason: Parse error: syntax error, unexpected T_PUBLIC in ../simpleCMS.php on line 56 My code for simpleCMS.php is as is in the tutorial link above. FYI, my line 56 is the following line of code in simpleCMS.php public function display_admin() { Above this line is public function display_public() Can anyone possibly see what I could be doing wrong and again, my code is the same code from the tutorial website and have downloaded the files that came with it? Hoping someone can point me in the right direction. Furthermore, I am using Mac OS X MAMP to run my Apache/MySQL Server locally. My other question is, when I using the following command: mysql_connect($this->host,$this->username,$this->password) is my hostname 'localhost' alone or do I also have to include port alongside the localhost? Thanks again.

    Read the article

  • JPEG image with alpha channel on website

    - by mikez302
    I would like to make a JPEG image file with some pixels that are partially transparent or fully transparent, similar to a PNG file with an alpha channel. Is this possible? If so, how would I go about doing this? I would like to use the image on a website. If I try to do this, would it work in any or all of the popular browsers (IE 7+, Firefox, Safari)? Assuming it is possible, will it just work, or are there any tricks or hacks required to make it work?

    Read the article

  • How to build sqlite for Python 2.4?

    - by Verrtex
    I would like to use pysqlite interface between Python and sdlite database. I have already Python and SQLite on my computer. But I have troubles with installation of pysqlite. During the installation I get the following error message: error: command 'gcc' failed with exit status 1 As far as I understood the problems appears because version of my Python is 2.4.3 and SQLite is integrated in Python since 2.5. However, I also found out that it IS possible to build sqlite for Python 2.4 (using some tricks, probably). Does anybody know how to build sqlite for Python 2.4? As another option I could try to install higher version of Python. However I do not have root privileges. Does anybody know what will be the easiest way to solve the problem (build SQLite fro Python 2.4, or install newer version of Python)? I have to mention that I would not like to overwrite the old version version of Python. Thank you in advance.

    Read the article

  • Hidden features of CSS

    - by alex
    I have definitely picked up some useful tips in the hidden features style questions concerning PHP and XHTML. So here is one to cover CSS. While easy to pick up, it takes a little while to learn about everything, their default behaviors, properties etc Here are some to start the ball @charset "UTF-8"; /* set the character set. must be first line as Gumbo points out in comments */ .element { /* takes precedence over other stylings */ display: block !important; /* mozilla .... rounded corners with no images */ -moz-border-radius: 10px; /* webkit equivalent */ -webkit-border-radius: 10px } These are not so much hidden, but their use is not often widespread. What tips, tricks, rare features have you discovered with CSS?

    Read the article

  • Why are events and commands in MVVM so unsupported by WPF / Visual Studio?

    - by Edward Tanguay
    When creating an WPF application with the MVVM pattern, it seems I have to gather the necessary tools myself to even begin the most rudimentary event handling, e.g. AttachedBehaviors I get from here DelegateCommands I get from here Now I'm looking for some way to handle the ItemSelected event in a ComboBox and am getting suggestions of tricks and workarounds to do this (using a XAML trigger or have other elements bound to the selected item, etc.). Ok, I can go down this road, but it seems to be reinventing the wheel. It would be nice to just have an ItemSelected command that I can handle in my ViewModel. Am I missing some set of standard tools or is everyone doing MVVM with WPF basically building and putting together their own collection of tools just so they can do the simplest plumbing tasks with events and commands, things that take only a couple lines in code-behind with a Click="eventHandler"?

    Read the article

  • Learning Ruby on Rails

    - by Ethan Gunderson
    As it stands now I'm a Java and C# developer, but the more and more I look at Ruby on Rails, the more I really want to learn it. What have you found to be the best route to learn RoR? Would it be easier to develop on Windows, or should I just run a virtual machine with linux? Is there an ide that can match the robustness of Visual Studio? Any programs to develop that give a good overhead of what to do? Any good books? Seriously, any tips/tricks/rants would be awesome.

    Read the article

  • OpenVPN, install a TAP adapter

    - by GolezTrol
    When I try to connect to my work VPN using OpenVPN, the connection fails with the message: All TAP-Win32 adapters on this system are currently in use. Many sources suggest to look in Control Panel\Network and Internet\Network Connections an enable the TAP adapter, but when I look there, there is none. Now I've run addtap.bat which is provided with OpenVPN, but I still don't get to see any TAP adapter, and logging in in VPN still fails. The output of addtap.bat is C:\Windows\system32>"C:\Program Files (x86)\OpenVPN\bin\tapinstall.exe" install "C:\Program Files (x86)\OpenVPN\driver\OemWin2k.inf" tap0801 Device node created. Install is complete when drivers are updated... Updating drivers for tap0801 from C:\Program Files (x86)\OpenVPN\driver\OemWin2k .inf. Drivers updated successfully. I've Run As Administrator both the setup of OpenVPN and addtap.bat. I've run deltapall.bat to remove any (maybe hidden) adapters. It said it removed three of them, after which I ran addtap.bat again to try to create another one. I also run OpenVPN itself as administrator. What's wrong? Running Windows 7 Home Premium on a HP Pavilion dv7 4050ed. It has worked before, but I recently had to reinstall my laptop, for which I used the restore disks I created when I just got it. Everything else seems to work fine. == UPDATE == The TAP adapter is found in Device Manager, but apparently it is disabled because it is incompatible with Windows 7 64bit. I've deïnstalled OpenVPNGui, downloaded a version that should be 64bit compatible, and installed that. Still no cigar. Then I found a tip to install OpenVPN (version 9) after installing OpenVPNGui, because that installs OpenVPN version 8. Now I got a v9 TAP driver in Device Manager, but it still doesn't work and shows up in device manager with an exclamation mark, and not at all in my network devices.

    Read the article

  • onclick event from XML Nodes

    - by user256007
    My Documents are a mixture of XML and HTML Tags. where HTML tags are pulled from xhtml namespace and mine are from various namspaces. I wanna take user interaction events from XML Nodes of my Document. I First tried <do:landingTime xhtml:onclick="fnc">20:48:29.45</do:landingTime> with no Luck. But <xhtml:span onclick="fnc"> works. So is there any solution/tricks/hacks/backdoor to take events from my xml Nodes.

    Read the article

< Previous Page | 97 98 99 100 101 102 103 104 105 106 107 108  | Next Page >