Search Results

Search found 90 results on 4 pages for 'sublime'.

Page 3/4 | < Previous Page | 1 2 3 4  | Next Page >

  • Is there a snippets program that allows for tab entry of variables across the mac?

    - by Jeremy Smith
    I love Sublime Text editor and the ability to create code snippets like so: <snippet> <content><![CDATA[\$("${1:selector}").${2:method}]]></content> <tabTrigger>jq</tabTrigger> </snippet> This allows me to type jq[tab] and then have it expand to $("selector").method where I am able to tab through the string 'selector' and 'method' in order to change them. But what I'd really like to do is use this same snippet when working in Chrome Dev Tools, so I was looking for a mac snippets program that could support this. However, the three programs that I looked at (Keyboard Maestro, Snippets, CodeBox) don't support the ability to tab through to highlight predetermined strings and change them. Does anyone know of an app that will do this?

    Read the article

  • Beyond Syntax Highlighting - What other code representations are possible today?

    - by Mathieu Hélie
    Despite GUI applications having been around for 30ish years, software is still written as lines of text instructions, for various valid reasons. But we've also found that manipulating these text instructions is mind-blowingly difficult unless we apply a layer of coloring on different words to represent their syntax, thus allowing us to quickly parse through these text files without having to read the whole words. But besides the Sublime Text minimap feature, I've yet to see any innovation in visual representation of code since colors came around on CRT monitors. I can think of one obviously essential representation that modern graphics technology allows: visual hierarchies for nested structures. If we make nested text slightly smaller than its outer context, and zoom on it when the cursor is focused on the line, then we will be able to browse huge files of nested statements very quickly. This becomes even more essential as languages based on closures and anonymous functions become filled with deep statements. Has anyone attempted to implement this in a text editor? Do you know of any otherwise useful improvements in representing code text graphically?

    Read the article

  • Free Typescript editor with definition based code completion feature

    - by NagyI
    I know that a plugin for Visual Studio exists. However i can't afford VS so i'm looking for a free alternative which can be used to code TypeScript and aware of the .d.ts definition files and can do code completion based on them. I know that Sublime Text and VIM can do syntax highlighting with the correct language definition file. However the biggest advantage of Typescript for me is that ability to give code assistance while coding. Are you aware of any editor which can do this? I'm interested even if it's in an experimental state.

    Read the article

  • Why should I learn vi/vim/emacs? [on hold]

    - by Tom Busby
    I hear all the flame wars about vi/vim and emacs and which is better etc but honestly, I just use sublime. When I have to edit from the CLI I use nano (it's simpler to use). I'm wondering if I'm missing something. Should I put the time/effort into learning one of those text-editors thoroughly, and if so... why? What is it about these two editors that evokes so much adoration and devotion? Why would I want to use any of them over my nice, multi-caret, GUI text editor?

    Read the article

  • What IDE(s) or editor(s) do companies like Google, Apple, IBM, etc. use?

    - by Pius
    Even though I have quite some experience in using various tools, I still can't make up my mind whether I prefer using IDE or a simple editor for code editing. Most IDEs I have experienced are written in Java (like Eclipse) which makes them slow and bulky. What's good about them is that it provides lots of tools. On the other hand editors are usually VERY fast. They can also be extended to become more similar to IDEs but usually I don't do that. However, there is Sublime Text 2 which has some basic code completion built-in. My question would be whether most Enterprise companies like Google, Apple, IBM and etc (except Microsoft because they have AMAZING IDE which, I assume, is used by MS developers) force their workers to use IDEs and whether using plain editor with external tools is considered being not professional? P.S. Not talking about cases like Android development where working without IDE barely possible.

    Read the article

  • Where can I find a library that parses source code and is able to extract the scope of where your cursor is currently in the code?

    - by Anthony
    In SublimeText(2), when you press [ctrl + shift + p] (mac osx) you are shown a scope of where your caret/cursor is in the source code at the given moment e.g.: entity.name.tag.inline.any.html meta.tag.inline.any.html text.html.basic I am curious about what library or script is used to parse the document/file and create that scope string. A sidenote: Typing view.syntax_name(view.sel()[0].b) into Sublime's console will output the scope as well.

    Read the article

  • How to format given string using regex?

    - by icoolninja
    So I have defined variables in such a way in my file: public static final String hello_world = "hello world" public static final String awesome_world = "awesome world" public static final String bye_world= "bye world" I have many declarations like that. Is it possible to format them as(All '=' in a line): public static final String hello_world = "hello world" public static final String awesome_world = "awesome world" public static final String bye_world = "bye world" I can't even think of a way to do it. Any kind of help is appreciated. P.S If it matters, I use sublime text 2.

    Read the article

  • 24+ Coda Alternatives for Windows and Linux

    - by Matt
    Coda plays an important role in designing layout on Mac. There are numerous coda alternatives for windows and Linux too. It is not possible to describe each and everyone so some of the coda alternatives, which work on both windows and Linux platforms, are discussed below. EditPlus $35.00 Good thing about EditPlus is that it highlights URLs and email addresses, activating them when you ‘crtl + double-click’. It also has a built in browser for previewing HTML, and FTP and SFTP support. Also supports Macros and RegEx find and replace. UltraEdit $49.99 It is another good coda alternative for windows and Linux. It is the best suited editor for text, HTML and HEX. It also plays an advanced PHP, Perl, Java and JavaScript editor for programmers. It supports disk-based 64-bit or standard file handling on 32-bit Windows platforms or window 2000 and later versions. HippoEdit $39.95 HippoEDIT has the best autocomplete it gives pop a ‘tooltip’ above your cursor as you type, suggesting words you’ve already typed. It does syntax highlighting for over 2 dozen language. Sublime Text $59.00 Sublime Text awesome ‘zoomed out’ view of the file lets you focus on the area you want. It lets you open a local file when you right-click on its link, and there are a few automation features, so this would make a solid choice of a text editor. Textpad $24.70 TextPad is simple editor with nifty features such as column select, drag-and-drop text between files, and hyperlink support. It also supports large files. Aptana Free Aptana Studio is one of the best editors working on both windows and Linux. It is a complete web development setting that has a nice blend of powerful authoring tools with a collection of online hosting and collaboration services. It is quite helpful as it support for PHP, CSS, FTP, and more. SciTE Free It is a SCIntilla based Text Editor. It has gradually developed as a generally useful editor. It provides for building and running programs. It is best to be used for jobs with simple configurations. SciTE is currently available for Intel Win32 and Linux compatible operating systems with GTK+. It has been run on Windows XP and on Fedora 8 and Ubuntu 7.10 with GTK+ 2.12 E Text Editor $34.96 E Text Editor is a new text editor for Windows, which also works on Linux as well. It has powerful editing features and also some unique abilities. It makes text manipulation quite fast and easy, and makes user focus on his writing as it automatically does all the manual work. It can be extend it in any language. It supports Text Mate bundles, thus allows the user to tap into a huge and active community. Editra Free Editra is an upcoming editor, with some fantastic features such as user profiles, auto-completion, session saving, and syntax highlighing for 60+ languages. Plugins can extend the feature set, offering an integrated python console, FTP client, file browser, and calculator, among others. PSPad Free PSPad is a good Template for writing CSS, as it an internal web browser, and a macro recorder to the table. It also supports hex editing, and some degree of code compiling. JEdit Free It is a mature programmer’s text editor and has taken a good deal of time to be developed as it is today. It is better than many costlier development tools due to its features and simplicity of use. It has been released as free software with full source code, provided under the terms of the GPL 2.0. Which also adds to its attractiveness. NEdit Free It is a multi-purpose text editor for the X Window System, which also works on Linux. It combines a standard, easy to use, graphical user interface with the full functionality and stability required by users who edit text for long period a day. It also provides for thorough support for development in various languages. It also facilitates the use of text processors, and other tools at the same time. It can be used productively by anyone who needs to edit text. It is quite a user-friendly tool. Its salient features include syntax highlighting with built in pattern, auto indent, tab emulation, block indentation adjustment etc. As of version 5.1, NEdit may be freely distributed under the terms of the GNU General Public License. MadEdit Free Mad Edit is an Open-Source and Cross-Platform Text/Hex Editor. It is written in C++ and wxWidgets. MadEdit can edit files in Text/Column/Hex modes. It also supports many useful functions, such as Syntax Highlighting, Word Wrap, Encoding for UTF8/16/32,and others. It also supports word count, which makes it quite a useful text editor for both windows and Linux. It has been recently modified on 10/09/2010. KompoZer Free Kompozer is a complete web authoring system that has a combination of web file management and easy-to-use WYSIWYG web page editing. KompoZer has been designed to be completely and extensively easy to use. It is thus an ideal tool for non-technical computer users who want to create an attractive, professional-looking web site without knowing HTML or web coding. It is based on the NVU source code. Vim Free Vim or “Vi IMproved” is an advanced text editor. Its salient features are syntax highlighting, word completion and it also has a huge amount of contributed content. Vim has several “modes” on offer for editing, which adds to the efficiency in editing. Thus it becomes a non-user-friendly application but it is also strength for its users. The normal mode binds alphanumeric keys to task-oriented commands. The visual mode highlights text. More tools for search & replace, defining functions, etc. are offered through command line mode. Vim comes with complete help. NotePad ++ Free One of the the best free text editor for Windows out there; with support for simple things—like syntax highlighting and folding—all the way up to FTP, Notepad++ should tick most of the boxes Notepad2 Free Notepad2 is also based on the Scintilla editing engine, but it’s much simpler than Notepad++. It bills itself as being fast, light-weight, and Notepad-like. Crimson Editor Free Crimson Editor has the ability to edit remote files, using a built-in FTP client; there’s also a spell checker. TotalEdit Free TotalEdit allows file comparison, RegEx search and replace, and has multiple options for file backup / versioning. For cleanup, it offers (X)HTML and XML customizable formatting, and a spell checker. In-Type Free ConTEXT Free SourceEdit Free SourceEdit includes features such as clipboard history, syntax highlighting and autocompletion for a decent set of languages. A hex editor and FTP client. RJ TextED Free RJ TextED supports integration with TopStyle Lite. Provides HTML validation and formatting. It includes an FTP client, a file browser, and a code browser, as well as a character map and support for email. GEDIT Free It is one of the best coda alternatives for windows and Linux. It has syntax highlighting and is best suitable for programming. It has many attractive features such as full support for UTF-8, undo/redo, and clipboard support, search and replace, configurable syntax highlighting for various languages and many more supportive features. It is extensible with plug ins. Other important coda alternatives for windows and Linux are Redcar, Bluefish Editor, NVU, Ruby Mine, Slick Edit, Geany, Editra, txt2html and CSSED. There are many more. Its up to user to decide which one suits best to his requirements. Related posts:10 Useful Text Editor For Developer Applications to Install & Run Windows on Linux Open Source WYSIWYG Text Editors

    Read the article

  • Mac friendly file sharing from VirtualBox

    - by kitsched
    I have set up Ruby on Rails on Ubuntu into a VirtualBox instance on my PC, I enabled Samba and I'm connecting to it via the home network from my Mac. All is fine except that I have some issues deleting some files from inside applications e.g. in Sublime Text 2 when I right click a file in the browser and select delete nothing happens (same in my Git client). To be able to delete files I have to navigate to the folder in Finder (which leaves those nasty .DS_Store files scattered all around) or issue the delete command from the terminal (inconvenient). If you're asking why I'm using VirtualBox for Rails instead of doing the development directly on the Mac it's because the ease of portability. So my question is: are there any network sharing options which I could use to make the Linux instance play nicer with my Mac?

    Read the article

  • My Mac is slow but don't know what's slowing it down

    - by duality_
    My Mac (Macbook Pro) is sometimes slow doing basic tasks, like browsing the web or something like that. If I open Activity Monitor, I have (maybe) one program that is about 10 % CPU, others are below 1 %. My CPU usage is not full. I still have more than 2 GB of free memory (out of 5 GB). There is no heavy I/O activity like copying files. My open programs are Google Chrome (6 tabs, none of which are in some way (flash, many DOM objects, Javascript) have IMO, except maybe Gmail), Activity Monitor, Finder, Sublime Text 2 (text editor) and iTerm (terminal). What is causing the slowdown? "Slow" being: taking time to write these characters (I press the keyboard keys but there is a delay before I see them on the screen), changing tabs or programs, etc.

    Read the article

  • raspberry pi for web programming/development

    - by Mark Dee
    I'm into web development and my machine (AMD Phenom II, 8G RAM) is running Ubuntu 13.04. I love my current setup but I kinda miss some of Windows software like MSOffice or Adobe suites, and running on Virtualbox doesn't feel as snappy for me.... So I'm thinking of buying a new cheap machine where I would install Linux and do my development work there and have my current machine run Windows. I just found this thing called Raspberry pi which is really cheap and requires 12v only (I think) which makes it good for downloading stuff overnight. So, does it make sense to buy Raspberry pi, make it my primary dev machine, Windows being the secondary (for Adobe and browser testing of course)? Basically, I want to know if Raspberry pi meets the following requirements: It should run ArchLinux Sublime Text 3 python ruby nginx nodejs Deluge or Transmission (well, maybe just those, no need for videos and music players)

    Read the article

  • How to select File menu in Mac, just like Alt + F in Windows?

    - by pal4life
    I have a Macbook Air with Mac OSX 10.8.2 . I have been wondering how do I select the File Menu which I am so used to doing in Windows using Alt + F, so that I do not have to click on the File menu each time I need to do something. I googled and checked out a bunch of articles as well. This wikipedia article suggests http://en.wikipedia.org/wiki/Table_of_keyboard_shortcuts CTRL +F2 then F. I tried this in Sublime Text and did not work for me. Any clues? Thanks.

    Read the article

  • how to change the default open-with program to a program on the second disk

    - by Scott????
    I have a 250GB HDD for my system and a 60GB SSD using a SATA port. I installed most of my applications on the SSD. There's a strange thing though. I can not change the default open-with program to a program which is on the SSD. I think it may be caused by permission so I gave my user a 'full control' permission on the security tab in disk properties. But changing permissions is not work. After I choose an application (I've tried Notepad++, Sublime, 7Zip, etc.), nothing is added in the below window: Also, if I install 7Zip on my machine, the right click menu items can not be added.

    Read the article

  • All terminal commands (like ls, cd, edit, open) are returning errors on my Mac

    - by park
    From what I can tell from reading other questions/answers is that my .bash_profile file may be corrupt. If I type echo $PATH in terminal the result is: /usr/local/git/bin From what I've read, that's not what the result is supposed to be. But I also can't get any of the commands (like edit or subl, for Sublime Text 2) to open the .bash_profile file to edit it. I was able to open the file in TextEdit using "cmd-shift-.", and here's what's in the file: [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" PATH=$PATH:~/bin export PATH export PATH=/usr/local/git/bin But the file is LOCKED, so I can't edit it there either. I'm very new to programming and in the middle of trying to install everything on my Mac to go through a Ruby on Rails tutorial. I can't even check my version of ruby, since even ruby -v returns -bash: ruby: command not found Any help would be greatly appreciated. Thanks.

    Read the article

  • Force Windows to cache executables without running them?

    - by Josh Einstein
    Is there a way to force Windows to pre-load certain EXE/DLL binaries into its prefetch/superfetch cache as if they had been executed? I have a particular application that loads pretty slowly on first run but if it's "warm" (recently executed) it starts pretty quickly. I'd like to prime the cache early in the background before the application is needed. But since it shows a UI, I'm looking for a way to do this silently. So simply launching the application it isn't ideal. Thanks you in advance. Prompted by David's suggestion in the comments, I wrote a PowerShell script to memory map the files, seek to the end, and close them. I haven't done any controlled tests yet and it could just be my imagination, but Sublime Text (the application in question) appeared to load much more quickly this time around and I haven't used it for several hours.

    Read the article

  • Encoding in Scene Builder

    - by Agafonova Victoria
    I generate an FXML file with Scene Builder. I need it to contain some cirillic text. When i edit this file with Scene Builder i can see normal cirillic letters (screen 1) After compileing and running my program with this FXML file, i'll see not cirillic letters, but some artefacts (screen 2) But, as you can see on the screen 3, its xml file encoding is UTF-8. Also, you can see there that it is saved in ANSI. I've tried to open it with other editors (default eclipse and sublime text 2) and they shoen wrong encoding either. (screen 4 and screen 5) At first i've tried to convert it from ansi to utf-8 (with notepad++). After that eclipse and sublime text 2 started display cirillic letters as they must be. But. Scene builder gave an error, when i've tried to open this file with it: Error loading file C:\eclipse\workspace\equification\src\main\java\ru\igs\ava\equification\test.fxml. C:\eclipse\workspace\equification\src\main\java\ru\igs\ava\equification\test.fxml:1: ParseError at [row,col]:[1,1] Message: Content is not allowed in prolog. And java compiler gave me an error: ??? 08, 2012 8:11:03 PM javafx.fxml.FXMLLoader logException SEVERE: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[1,1] Message: Content is not allowed in prolog. /C:/eclipse/workspace/equification/target/classes/ru/igs/ava/equification/test.fxml:1 at javafx.fxml.FXMLLoader.load(Unknown Source) at javafx.fxml.FXMLLoader.load(Unknown Source) at javafx.fxml.FXMLLoader.load(Unknown Source) at javafx.fxml.FXMLLoader.load(Unknown Source) at javafx.fxml.FXMLLoader.load(Unknown Source) at javafx.fxml.FXMLLoader.load(Unknown Source) at ru.igs.ava.equification.EquificationFX.start(EquificationFX.java:22) at com.sun.javafx.application.LauncherImpl$5.run(Unknown Source) at com.sun.javafx.application.PlatformImpl$4.run(Unknown Source) at com.sun.javafx.application.PlatformImpl$3.run(Unknown Source) at com.sun.glass.ui.win.WinApplication._runLoop(Native Method) at com.sun.glass.ui.win.WinApplication.access$100(Unknown Source) at com.sun.glass.ui.win.WinApplication$2$1.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Exception in Application start method Exception in thread "main" java.lang.RuntimeException: Exception in Application start method at com.sun.javafx.application.LauncherImpl.launchApplication1(Unknown Source) at com.sun.javafx.application.LauncherImpl.access$000(Unknown Source) at com.sun.javafx.application.LauncherImpl$1.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: javafx.fxml.LoadException: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[1,1] Message: Content is not allowed in prolog. at javafx.fxml.FXMLLoader.load(Unknown Source) at javafx.fxml.FXMLLoader.load(Unknown Source) at javafx.fxml.FXMLLoader.load(Unknown Source) at javafx.fxml.FXMLLoader.load(Unknown Source) at javafx.fxml.FXMLLoader.load(Unknown Source) at javafx.fxml.FXMLLoader.load(Unknown Source) at ru.igs.ava.equification.EquificationFX.start(EquificationFX.java:22) at com.sun.javafx.application.LauncherImpl$5.run(Unknown Source) at com.sun.javafx.application.PlatformImpl$4.run(Unknown Source) at com.sun.javafx.application.PlatformImpl$3.run(Unknown Source) at com.sun.glass.ui.win.WinApplication._runLoop(Native Method) at com.sun.glass.ui.win.WinApplication.access$100(Unknown Source) at com.sun.glass.ui.win.WinApplication$2$1.run(Unknown Source) ... 1 more Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[1,1] Message: Content is not allowed in prolog. at com.sun.org.apache.xerces.internal.impl.XMLStreamReaderImpl.next(Unknown Source) at javax.xml.stream.util.StreamReaderDelegate.next(Unknown Source) ... 14 more So, i've converted it back to ANSI. And, having this file in ANSI, changed its "artefacted" text to cirillic letters manually. Now i can see normal text when i run my program, but when i open this fixed file via Scene Builder, Scene Builder shows me some "artefacted" text (screen 7). So, how can i fix this situation?

    Read the article

  • Getting Started with TypeScript – Classes, Static Types and Interfaces

    - by dwahlin
    I had the opportunity to speak on different JavaScript topics at DevConnections in Las Vegas this fall and heard a lot of interesting comments about JavaScript as I talked with people. The most frequent comment I heard from people was, “I guess it’s time to start learning JavaScript”. Yep – if you don’t already know JavaScript then it’s time to learn it. As HTML5 becomes more and more popular the amount of JavaScript code written will definitely increase. After all, many of the HTML5 features available in browsers have little to do with “tags” and more to do with JavaScript (web workers, web sockets, canvas, local storage, etc.). As the amount of JavaScript code being used in applications increases, it’s more important than ever to structure the code in a way that’s maintainable and easy to debug. While JavaScript patterns can certainly be used (check out my previous posts on the subject or my course on Pluralsight.com), several alternatives have come onto the scene such as CoffeeScript, Dart and TypeScript. In this post I’ll describe some of the features TypeScript offers and the benefits that they can potentially offer enterprise-scale JavaScript applications. It’s important to note that while TypeScript has several great features, it’s definitely not for everyone or every project especially given how new it is. The goal of this post isn’t to convince you to use TypeScript instead of standard JavaScript….I’m a big fan of JavaScript. Instead, I’ll present several TypeScript features and let you make the decision as to whether TypeScript is a good fit for your applications. TypeScript Overview Here’s the official definition of TypeScript from the http://typescriptlang.org site: “TypeScript is a language for application-scale JavaScript development. TypeScript is a typed superset of JavaScript that compiles to plain JavaScript. Any browser. Any host. Any OS. Open Source.” TypeScript was created by Anders Hejlsberg (the creator of the C# language) and his team at Microsoft. To sum it up, TypeScript is a new language that can be compiled to JavaScript much like alternatives such as CoffeeScript or Dart. It isn’t a stand-alone language that’s completely separate from JavaScript’s roots though. It’s a superset of JavaScript which means that standard JavaScript code can be placed in a TypeScript file (a file with a .ts extension) and used directly. That’s a very important point/feature of the language since it means you can use existing code and frameworks with TypeScript without having to do major code conversions to make it all work. Once a TypeScript file is saved it can be compiled to JavaScript using TypeScript’s tsc.exe compiler tool or by using a variety of editors/tools. TypeScript offers several key features. First, it provides built-in type support meaning that you define variables and function parameters as being “string”, “number”, “bool”, and more to avoid incorrect types being assigned to variables or passed to functions. Second, TypeScript provides a way to write modular code by directly supporting class and module definitions and it even provides support for custom interfaces that can be used to drive consistency. Finally, TypeScript integrates with several different tools such as Visual Studio, Sublime Text, Emacs, and Vi to provide syntax highlighting, code help, build support, and more depending on the editor. Find out more about editor support at http://www.typescriptlang.org/#Download. TypeScript can also be used with existing JavaScript frameworks such as Node.js, jQuery, and others and even catch type issues and provide enhanced code help. Special “declaration” files that have a d.ts extension are available for Node.js, jQuery, and other libraries out-of-the-box. Visit http://typescript.codeplex.com/SourceControl/changeset/view/fe3bc0bfce1f#samples%2fjquery%2fjquery.d.ts for an example of a jQuery TypeScript declaration file that can be used with tools such as Visual Studio 2012 to provide additional code help and ensure that a string isn’t passed to a parameter that expects a number. Although declaration files certainly aren’t required, TypeScript’s support for declaration files makes it easier to catch issues upfront while working with existing libraries such as jQuery. In the future I expect TypeScript declaration files will be released for different HTML5 APIs such as canvas, local storage, and others as well as some of the more popular JavaScript libraries and frameworks. Getting Started with TypeScript To get started learning TypeScript visit the TypeScript Playground available at http://www.typescriptlang.org. Using the playground editor you can experiment with TypeScript code, get code help as you type, and see the JavaScript that TypeScript generates once it’s compiled. Here’s an example of the TypeScript playground in action:   One of the first things that may stand out to you about the code shown above is that classes can be defined in TypeScript. This makes it easy to group related variables and functions into a container which helps tremendously with re-use and maintainability especially in enterprise-scale JavaScript applications. While you can certainly simulate classes using JavaScript patterns (note that ECMAScript 6 will support classes directly), TypeScript makes it quite easy especially if you come from an object-oriented programming background. An example of the Greeter class shown in the TypeScript Playground is shown next: class Greeter { greeting: string; constructor (message: string) { this.greeting = message; } greet() { return "Hello, " + this.greeting; } } Looking through the code you’ll notice that static types can be defined on variables and parameters such as greeting: string, that constructors can be defined, and that functions can be defined such as greet(). The ability to define static types is a key feature of TypeScript (and where its name comes from) that can help identify bugs upfront before even running the code. Many types are supported including primitive types like string, number, bool, undefined, and null as well as object literals and more complex types such as HTMLInputElement (for an <input> tag). Custom types can be defined as well. The JavaScript output by compiling the TypeScript Greeter class (using an editor like Visual Studio, Sublime Text, or the tsc.exe compiler) is shown next: var Greeter = (function () { function Greeter(message) { this.greeting = message; } Greeter.prototype.greet = function () { return "Hello, " + this.greeting; }; return Greeter; })(); Notice that the code is using JavaScript prototyping and closures to simulate a Greeter class in JavaScript. The body of the code is wrapped with a self-invoking function to take the variables and functions out of the global JavaScript scope. This is important feature that helps avoid naming collisions between variables and functions. In cases where you’d like to wrap a class in a naming container (similar to a namespace in C# or a package in Java) you can use TypeScript’s module keyword. The following code shows an example of wrapping an AcmeCorp module around the Greeter class. In order to create a new instance of Greeter the module name must now be used. This can help avoid naming collisions that may occur with the Greeter class.   module AcmeCorp { export class Greeter { greeting: string; constructor (message: string) { this.greeting = message; } greet() { return "Hello, " + this.greeting; } } } var greeter = new AcmeCorp.Greeter("world"); In addition to being able to define custom classes and modules in TypeScript, you can also take advantage of inheritance by using TypeScript’s extends keyword. The following code shows an example of using inheritance to define two report objects:   class Report { name: string; constructor (name: string) { this.name = name; } print() { alert("Report: " + this.name); } } class FinanceReport extends Report { constructor (name: string) { super(name); } print() { alert("Finance Report: " + this.name); } getLineItems() { alert("5 line items"); } } var report = new FinanceReport("Month's Sales"); report.print(); report.getLineItems();   In this example a base Report class is defined that has a variable (name), a constructor that accepts a name parameter of type string, and a function named print(). The FinanceReport class inherits from Report by using TypeScript’s extends keyword. As a result, it automatically has access to the print() function in the base class. In this example the FinanceReport overrides the base class’s print() method and adds its own. The FinanceReport class also forwards the name value it receives in the constructor to the base class using the super() call. TypeScript also supports the creation of custom interfaces when you need to provide consistency across a set of objects. The following code shows an example of an interface named Thing (from the TypeScript samples) and a class named Plane that implements the interface to drive consistency across the app. Notice that the Plane class includes intersect and normal as a result of implementing the interface.   interface Thing { intersect: (ray: Ray) => Intersection; normal: (pos: Vector) => Vector; surface: Surface; } class Plane implements Thing { normal: (pos: Vector) =>Vector; intersect: (ray: Ray) =>Intersection; constructor (norm: Vector, offset: number, public surface: Surface) { this.normal = function (pos: Vector) { return norm; } this.intersect = function (ray: Ray): Intersection { var denom = Vector.dot(norm, ray.dir); if (denom > 0) { return null; } else { var dist = (Vector.dot(norm, ray.start) + offset) / (-denom); return { thing: this, ray: ray, dist: dist }; } } } }   At first glance it doesn’t appear that the surface member is implemented in Plane but it’s actually included automatically due to the public surface: Surface parameter in the constructor. Adding public varName: Type to a constructor automatically adds a typed variable into the class without having to explicitly write the code as with normal and intersect. TypeScript has additional language features but defining static types and creating classes, modules, and interfaces are some of the key features it offers. So is TypeScript right for you and your applications? That’s a not a question that I or anyone else can answer for you. You’ll need to give it a spin to see what you think. In future posts I’ll discuss additional details about TypeScript and how it can be used with enterprise-scale JavaScript applications. In the meantime, I’m in the process of working with John Papa on a new Typescript course for Pluralsight that we hope to have out in December of 2012.

    Read the article

  • How to better integrate a unix development environment into Windows

    - by SKenz
    I'm mostly a Windows user but I do most of my development (essentially web development) using unix tools and software. I've been going back and forth between using a dedicated lubuntu virtual machine on Virtualbox and using some tools directly in windows (msgit, python, django), but none of these approaches is entirely satisfactory. I'd like to hear of ways other devs use to better integrate a unix workflow into windows. For instance tighter integration between a linux and vm and windows. The vagrant demo showed how a VM could work off of a windows project folder and I found that nice. I'd like to hear of other tools and tips that would help mimic the workflow one can find on OS X (of course I understand that it cannot be as tightly integrated on Windows as it doesn't have the same unix underpinnings). PS: I have tried cygwin as well EDIT for clarifications about What I find lacking (thanks to axblount for pointing that out) : unix tools like msys et al do not work as well as their native unic counterparts. Many scripts, installers require further configuration or do not work at all. For instance getting virtualenvwrapper to work is not very straightforward. virtualbox: ideally I would like to use windows software (photoshop, sublime text 2) seamlessly with linux. I mostly use a FTP client atm to move over files edited on the windows side which is a tedious process.

    Read the article

  • Trying to move away from PHP/Yii: RoR, Python/Django or ASP.NET MVC? Your opinions please [closed]

    - by Örs
    I have a CS degree and I've been working as a web developer (front & backend) for about 2 years now. I've been working with PHP mostly because it was easy to pick up and find a job, but I've grown to dislike the language and want to try something new, and possibly get a better paying job. That last point is especially important because in my area (Romania/Eastern Europe) PHP jobs are mostly for people fresh out of college/high school, hence the pay is rather low. I've been working with the Yii framework which, if I understand correctly, borrows a lot from Ruby on Rails (convention over configuration, MVC, Active Record, scaffolding). Other than PHP I only know curly-brace languages (C/C++/Java) and bash so Python/Ruby might be a bit challenging. On the other hand I've been using Linux (with vim and recently Sublime Text 2) for almost 4 years now so Windows and a lack of a terminal would have its downsides as well. I'm leaning towards Python/Ruby because of my *nix bias (plus both look like fun), but I've heard great things about ASP.NET MVC as well. Any suggestions? PS: I think there are more jobs in ASP.NET around here, but that's not necessarily a plus, because there are a lot of CS graduates as well. tl;dr: Romanian PHP/Yii developer trying to move to Python/Django or Ruby/Rails or C#/ASP.NET MVC. Suggestions?

    Read the article

  • Is it worth replacing mouse by standalone trackpad for heavy code-editing? [on hold]

    - by heltonbiker
    I recently got more interested in improving my tools, workspace and worflow. The first sting came with a sore finger due to a crappy keyboard, and then after some research I fell in love with the "mechanical keyboard is what you need" doctrine, bought one (cherry MX Brown if you're curious), and am very happy with the results. Currently I am replacing my previous text editor (Geany) with Sublime Text 3, and am also very happy and feeling much more powerful and professional :) Well, but while I re-read all the ancient debates about VIM vs whatever-else, the following excerpt from a blog post got me thinking again about the mouse vs keyboard, and the "moving around from the very home row" (in VIM) versus gesturing away with the tiny and unstable mouse cursor: Reaching for a mouse may indeed slow you down, but developers are commonly on machines where the trackpad is a micro-hand movement away. Most novice programmers can click on a character on screen faster than an expert Vimmer can type 20jFp; or LkEEE or /word or any other nasty way Vimmers have to use. The point of a mouse is to make arbitrary on screen jumps efficient, and it’s very good at doing that. Don’t you ever think you can beat a mouse. Well, although there is some bitterness in this statement, it makes a lot of sense, and EVEN MORE if you consider your direct input to be a TRACKPAD conveniently placed in front of your spacebar (which oddly is where I like to put my mouse, rotated 90° ccw, due to a serious tendonitis in my right shoulder, already healed, but you knod...). So, the question is: Has anyone replaced mouse by a standalone trackpad, to work in code editing in a desktop machine (that is, with a sandalone keyboard)? Was it worth the change?

    Read the article

  • Is C# development effectively inseparable from the IDE you use?

    - by Ghopper21
    I'm a Python programmer learning C# who is trying to stop worrying and just love C# for what it is, rather than constantly comparing it back to Python. I'm really get caught up on one point: the lack of explicitness about where things are defined, as detailed in this Stack Overflow question. In short: in C#, using foo doesn't tell you what names from foo are being made available, which is analogous to from foo import * in Python -- a form that is discouraged within Python coding culture for being implicit rather than the more explicit approach of from foo import bar. I was rather struck by the Stack Overflow answers to this point from C# programmers, which was that in practice this lack of explicitness doesn't really matter because in your IDE (presumably Visual Studio) you can just hover over a name and be told by the system where the name is coming from. E.g.: Now, in theory I realise this means when you're looking with a text editor, you can't tell where the types come from in C#... but in practice, I don't find that to be a problem. How often are you actually looking at code and can't use Visual Studio? This is revelatory to me. Many Python programmers prefer a text editor approach to coding, using something like Sublime Text 2 or vim, where it's all about the code, plus command line tools and direct access and manipulation of folders and files. The idea of being dependent on an IDE to understand code at such a basic level seems anathema. It seems C# culture is radically different on this point. And I wonder if I just need to accept and embrace that as part of my learning of C#. Which leads me to my question here: is C# development effectively inseparable from the IDE you use?

    Read the article

  • Display glitches running ATI propietary driver under Ubuntu 12.10

    - by crystallero
    I have a lot of problems with the Ati propietary driver (fglrx). I have an iMac (mid 2011) with a Radeon HD 6900M [1002:6720]. I did not have any problem under Ubuntu 12.04, but since I updated to 12.10, I get some annoying graphic corruption. The worst one is that sometimes the screen does not update with the new information. It happens a lot when I change between tabs in Chrome or Sublime Text. It usually gets updated when I scroll the page. Sometimes, when I type, I have to wait a little bit to view the new characters. And I get trails when I move windows too (like a part of the window). After a while, the trail disappears. I tried to install fglrx, fglrx-updates and the new beta driver downloaded from Ati (12.11 Beta 11/16/2012), with no luck. It happens the same with all of them. I tried to mess with Compiz config, but it didn't fix anything. The open source driver does not suffer this problem, but I need the performance of the propietary driver . Do you have any clue? Thanks.

    Read the article

  • Problems with ATI propietary driver in Ubuntu 12.10, window trail and screen does not update

    - by crystallero
    I have problems with the Ati propietary driver (fglrx). I have an iMac (mid 2011) with a Radeon HD 6900M [1002:6720]. I did not have any problem under Ubuntu 12.04, but since I updated to 12.10, I get some annoying graphic corruption. The worst one is that sometimes the screen does not update with the new information. It happens a lot when I change between tabs in Chrome or Sublime Text. It usually gets updated when I scroll the page. Sometimes, when I type, I have to wait a little bit to view the new characters. And I get trails when I move windows too (like a part of the window). After a while, the trail disappears. I tried to install fglrx, fglrx-updates and the new beta driver downloaded from Ati (12.11 Beta 11/16/2012), with no luck. It happens the same with all of them. I tried to mess with Compiz config, but it didn't fix anything. The open source driver does not suffer this problem, but I need the performance of the propietary driver . Do you have clue? Thanks.

    Read the article

  • QtWebKit problems playing HTML5 video

    - by oskar
    I have a simple Qt application that launches a window with a QWebView. I tried several sites using the video tag with h.264, and it either can't play the video at all (as in youtube or sublime video), or it renders the video poorly, with black lines covering parts of it, like when viewing the video here. Is this a known issue with QtWebKit, or have I neglected to do something that would make it work better? My code is below. #include <QtGui/QApplication> #include <QWebView> int main(int argc, char *argv[]) { QApplication a(argc, argv); QWebView *view = new QWebView(); view->load(QUrl("http://webkit.org/blog/140/html5-media-support/")); view->show(); return a.exec(); }

    Read the article

  • How can I have HTML tab expansion in ST2 w/ Emmet inside Handlebars templates(emberjs)?

    - by Zuko
    Okay, so I'm using Sublime Text 2 with Emmet. But "Tab" expansion of HTML snippets doesn't work inside a script because of the scope. Example: In HTML, I can type "h1" and then hit tab, and it will generate "" When using Ember.js, and more specifically Handlebars, it doesn't work. <script type="text/x-handlebars"> h1 </script> Pressing tab after that "h1" doesn't expand it because it's inside a script; Emmet turns this off. I can press Ctrl+E, which is the "expand anywhere" hotkey, and that works just fine. However, that is uncomfortable and prone to missing and hitting things like Ctrl+S or Ctrl+D which have undesired effects. So, how can I change this? I tweeted at the developer, and got a reply, https://twitter.com/chikuyonok/status/398708331969540096 But couldn't understand what to do.

    Read the article

< Previous Page | 1 2 3 4  | Next Page >