Search Results

Search found 12599 results on 504 pages for 'language'.

Page 14/504 | < Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >

  • Writing a mini-language with haskell, trouble with "while" statements and blocks { }

    - by Nibirue
    EDIT: problem partially solved, skip to the bottom for update. I'm writing a small language using haskell, and I've made a lot of progress, but I am having trouble implementing statements that use blocks, like "{ ... }". I've implemented support for If statements like so in my parser file: stmt = skip +++ ifstmt +++ assignment +++ whilestmt ifstmt = symbol "if" >> parens expr >>= \c -> stmt >>= \t -> symbol "else" >> stmt >>= \e -> return $ If c t e whilestmt = symbol "while" >> parens expr >>= \c -> symbol "\n" >> symbol "{" >> stmt >>= \t -> symbol "}" >> return $ While c t expr = composite +++ atomic And in the Syntax file: class PP a where pp :: Int -> a -> String instance PP Stmt where pp ind (If c t e) = indent ind ++ "if (" ++ show c ++ ") \n" ++ pp (ind + 2) t ++ indent ind ++ "else\n" ++ pp (ind + 2) e pp ind (While c t) = indent ind ++ "while (" ++ show c ++") \n" ++ "{" ++ pp (ind + 2) t ++ "}" ++ indent ind Something is wrong with the while statement, and I don't understand what. The logic seems correct, but when I run the code I get the following error: EDIT: Fixed the first problem based on the first reply, now it is not recognizing my while statment which I assume comes from this: exec :: Env -> Stmt -> Env exec env (If c t e) = exec env ( if eval env c == BoolLit True then t else e ) exec env (While c t) = exec env ( if eval env c == BoolLit True then t ) The file being read from looks like this: x = 1; c = 0; if (x < 2) c = c + 1; else ; -- SEPARATE FILES FOR EACH x = 1; c = 1; while (x < 10) { c = c * x; x = x + 1; } c I've tried to understand the error report but nothing I've tried solves the problem.

    Read the article

  • Are There Any Other Web Programming Languages That Can Be Used Without A Framework Aside From PHP?

    - by Ygam
    Python needs a framework, so does Java (for the web). I don't know much about Ruby or Coldfusion. But is there another language out there for the web that can stand alone as it is without a need for a framework or without strict adherence to a design pattern (MVC and the likes) aside from PHP? BTW, the statement that Python and Java needs a framework to work with the web came purely from my readings on articles and books; I might be mistaken.

    Read the article

  • Yii urlManager language in URL

    - by TaMeR
    I am trying to add a language to the url with following syntax: http://www.example.com/en/site/page/view/about What I have so far works with short urls like: http://www.example.com/en/site/contact but not with long once as in my first example Here is what I have so far: /config/main.php 'urlManager'=>array( 'class'=>'application.components.MyCUrlManager', 'urlFormat'=>'path', 'showScriptName'=>false, 'rules'=>array( '<language:\w+>/<controller:\w+>/<id:\d+>'=>'<controller>/view', '<language:\w+>/<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>', '<language:\w+>/<controller:\w+>/<action:\w+>'=>'<controller>/<action>', ), ), <?php // components/MyCUrlManager.php class MyCUrlManager extends CUrlManager { public function createUrl($route,$params=array(),$ampersand='&') { if(isset($_POST['_lang'])){ Yii::app()->language = $_POST['_lang']; }elseif (!isset($route['language']) && $controller != 'srbac'){ $route['language']=Yii::app()->language; }else{ Yii::app()->language = $route['language']; } return parent::createUrl($route, $params, $ampersand); } } ?> class Controller extends CController: { /// ..... function init() { parent::init(); if (isset($_POST['_lang'])) { Yii::app()->setLanguage($_POST['_lang']); Yii::app()->session['_lang'] = Yii::app()->language; }elseif (isset(Yii::app()->session['_lang'])) { Yii::app()->setLanguage(Yii::app()->session['_lang']); } } } class LangBox extends CWidget { public function run() { $currentLang = Yii::app()->language; require_once 'Zend/Locale.php'; $locale = new Zend_Locale(); //$siteLanguages = $this->getLang(); $siteLanguages = array('en','de','tr'); foreach($siteLanguages as $value){ $list[$value] = $locale->getTranslation($value, 'Language', $value); } asort($list); $this->render('langBox', array('currentLang' => $currentLang, 'list'=>$list)); } }

    Read the article

  • ASP-style tags for Perl web development?

    - by Alex R
    I feel like I'm traveling 10 years back in time by asking this, but... Are there any modules, patches, or any "new" version of Perl (released in the last 10 years) to enable writing web-oriented Perl scripts using ASP-style tags? e.g. from ASP/JSP some html <% some code %> more HTML e.g. from PHP some html <? some code ?> more HTML Please don't worry about "why" I'm asking this... It's related to programming language research.

    Read the article

  • Design a GUI browser to view a tree

    - by iamrohitbanga
    I have a large tree. I want to be able to visualize it using a GUI tool. I want the ability to pan and zoom the tree image so that i can focus on part of the tree. Is there an existing tool to achieve this? If not i would like to write a small tool for myself to be able to do this. what is the simplest way of doing this? what computer language should i use? the image should look something like http://upload.wikimedia.org/wikipedia/commons/d/df/Binary_tree.png I should be able to zoom and pan the image.

    Read the article

  • Interesting or unique types encountered?

    - by user318904
    What is the most strange or unique type you have seen in a programming language? I was thinking the other day about a "random variable", ie whenever it is evaluated it yields a random value from some domain. It would require some runtime trickery. Also I bet there can be some interesting mapping of regular expressions into a type system. It does not necessarily have to be a built in or primitive type, but some random class that implements a domain specific type won't really be interesting just unique.

    Read the article

  • Add Keyboard Input Language to Ubuntu

    - by Matthew Guay
    Want to type in multiple languages in Ubuntu?  Here we’ll show you how you can easily add and switch between multiple keyboard layouts in Ubuntu. Add a Keyboard Language To add a keyboard language, open the System menu, select Preferences, and then select Keyboard. In the Keyboard Preferences dialog, select the Layouts tab, and click Add.   You can select a country and then choose an language and keyboard variant.  Note that some countries, such as the United States, may show several languages.  Once you’ve made your selection, you can preview it on the sample keyboard displayed below the menu. Alternately, on the second tab, select a language and then choose a variant.  Click Add when you’ve made your selection. Now you’ll notice that there are two languages listed in the Keyboard Preferences, and they’re both ready to use immediately.  You can add more if you wish, or close the dialog. Switch Between Languages When you have multiple input languages installed, you’ll notice a new icon in your system tray on the top right.  It will show the abbreviation of the country and/or language name that is currently selected.  Click the icon to change the language. Right-click the dialog to view available languages (listed under Groups), open the Keyboard Preferences dialog again, or show the current layout. If you select Show Current Layout you’ll see a window with the keyboard preview we saw previously when setting the keyboard layout.  You can even print this layout preview out to help you remember a layout if you wish. Change Keyboard Shortcuts to Switch Languages By default, you can switch input languages in Ubuntu from the keyboard by pressing both Alt keys together.  Many users are already used to the default Alt+Switch combination to switch input languages in Windows, and we can add that in Ubuntu.  Open the keyboard preferences dialog, select the Layout tab, and click Options. Click the plus sign beside Key(s) to change layout, and select Alt+Shift.  Click Close, and you can now use this familiar shortcut to switch input languages. The layout options dialog offers many more neat keyboard shortcuts and options.  One especially neat option was the option to use a keyboard led to show when we’re using the alternate keyboard layout.  We selected the ScrollLock light since it’s hardly used today, and now it lights up when we’re using our other input language.   Conclusion Whether you regularly type in multiple languages or only need to enter an occasional character from an alternate keyboard layout, Ubuntu’s keyboard settings make it easy to make your keyboard work the way you want.  And since you can even preview and print a keyboard layout, you can even remember an alternate keyboard’s layout if it’s not printed on your keyboard. Windows users, you’re not left behind, either.  Check out our tutorial on how to Add keyboard languages to XP, Vista, and Windows 7. Similar Articles Productive Geek Tips Add keyboard languages to XP, Vista, and Windows 7Assign a Hotkey to Open a Terminal Window in UbuntuWhat is ctfmon.exe And Why Is It Running?Keyboard Shortcuts for VMware WorkstationInput Director Controls Multiple Windows Machines with One Keyboard and Mouse TouchFreeze Alternative in AutoHotkey The Icy Undertow Desktop Windows Home Server – Backup to LAN The Clear & Clean Desktop Use This Bookmarklet to Easily Get Albums Use AutoHotkey to Assign a Hotkey to a Specific Window Latest Software Reviews Tinyhacker Random Tips VMware Workstation 7 Acronis Online Backup DVDFab 6 Revo Uninstaller Pro MELTUP – "The Beginning Of US Currency Crisis And Hyperinflation" Enable or Disable the Task Manager Using TaskMgrED Explorer++ is a Worthy Windows Explorer Alternative Error Goblin Explains Windows Error Codes Twelve must-have Google Chrome plugins Cool Looking Skins for Windows Media Player 12

    Read the article

  • Learning to implement dynamically typed language compiler

    - by TriArc
    I'm interested in learning how to create a compiler for a dynamically typed language. Most compiler books, college courses and articles/tutorials I've come across are specifically for statically typed languages. I've thought of a few ways to do it, but I'd like to know how it's usually done. I know type inferencing is a pretty common strategy, but what about others? Where can I find out more about how to create a dynamically typed language? Edit 1: I meant dynamically typed. Sorry about the confusion. I've written toy compilers for statically typed languages and written some interpreters for dynamically typed languages. Now, I'm interested in learning more about creating compilers for a dynamically typed language. I'm specifically experimenting with LLVM and since I need to specify the type of every method and argument, I'm thinking of ways to implement a dynamically typed language on something like LLVM.

    Read the article

  • Game-oriented programming language features/objectives/paradigm?

    - by Klaim
    What are the features and language objectives (general problems to solves) or paradigms that a fictive programming language targetted at games (any kind of game) would require? For example, obviously we would have at least Performance (in speed and memory) (because a lot of games simply require that), but it have a price in the languages we currently use. Expressivity might be a common feature that is required for all languages. I guess some concepts from not-usually-used-for-games paradigms, like actor-based languages, or language-based message passing, might be useful too. So I ask you what would be ideal for games. (maybe one day someone will take those answers and build a language over it? :D ) Please set 1 feature/objective/paradigm per answer. Note: maybe that question don't make sense to you. In this case please explain why in an answer. It's a good thing to have answers to this question that might pop in your head sometimes.

    Read the article

  • Python as a first language?

    - by user64085
    I have just started working in Information Security World. I want to learn the Python language for creating my own automated tool for Fuzzing, SQL-Injection etc. My question is I don't know much about C language (only basic knowledge) but I want to learn directly Python Language so is it good? I have seen there is lots of difference between Python and C (obviously) and for Information Security field Python = GOD so I want to know learning Python need any experience on C language? If not so can I start learning Python directly?

    Read the article

  • Learning the GO programming language and its prospects [closed]

    - by SHOUBHIK BOSE
    Possible Duplicate: What are the chances of Google's Go becoming a mainstream language? Recently I've started experimenting with The GO programming language by Google. Its a programmer-friendly language having the simplicity of Python. I was wondering whether companies other than Google would also start using Go for development, and if they do , what would be the prospects of being a Go programmer?

    Read the article

  • Looking for new language and new technology [closed]

    - by Basim
    back when Microsoft relased .Net in 2002 or whatever, when I look at that time I say to myself what I if I picked one of Microsoft language in that time and still work on it, of course I will be professional by now. I am looking for a new language that is going up and will be big thing in the next 5-10 years, so in that time i can see the big picture and I know that I'm one of the few people who started from the beginning with X programming language or technology. My interest is web development.

    Read the article

  • How should I name the language data files?

    - by Ron
    Recently I decided to add some translations to my program. I wonder how I should name the language files? in the culture's name of the language (example: english = en, french = fr, italian = it, etc...) in the name of the language [in english] (example: english = english, french = french, italian = italian, etc..) I know you'll choose the second way because you dont have to detect which filename it is because both have the same name. But the problem is this - I show the name of the languages in its langauge (example: english = english, french = française, italian = italiano, etc..) so I still need to detect which filename it is. The main question is which way I should choose? the name of the language in english or the culture name? and why?... Thanks!

    Read the article

  • Programming Language, Turing Completeness and Turing Machine

    - by Amumu
    A programming language is said to be Turing Completeness if it can successfully simulate a universal TM. Let's take functional programming language for example. In functional programming, function has highest priority over anything. You can pass functions around like any primitives or objects. This is called first class function. In functional programming, your function does not produce side effect i.e. output strings onto screen, change the state of variables outside of its scope. Each function has a copy of its own objects if the objects are passed from the outside, and the copied objects are returned once the function finishes its job. Each function written purely in functional style is completely independent to anything outside of it. Thus, the complexity of the overall system is reduced. This is referred as referential transparency. In functional programming, each function can have its local variables kept its values even after the function exits. This is done by the garbage collector. The value can be reused the next time the function is called again. This is called memoization. A function usually should solve only one thing. It should model only one algorithm to answer a problem. Do you think that a function in a functional language with above properties simulate a Turing Machines? Functions (= algorithms = Turing Machines) are able to be passed around as input and returned as output. TM also accepts and simulate other TMs Memoization models the set of states of a Turing Machine. The memorized variables can be used to determine states of a TM (i.e. which lines to execute, what behavior should it take in a give state ...). Also, you can use memoization to simulate your internal tape storage. In language like C/C++, when a function exits, you lose all of its internal data (unless you store it elsewhere outside of its scope). The set of symbols are the set of all strings in a programming language, which is the higher level and human-readable version of machine code (opcode) Start state is the beginning of the function. However, with memoization, start state can be determined by memoization or if you want, switch/if-else statement in imperative programming language. But then, you can't Final accepting state when the function returns a value, or rejects if an exception happens. Thus, the function (= algorithm = TM) is decidable. Otherwise, it's undecidable. I'm not sure about this. What do you think? Is my thinking true on all of this? The reason I bring function in functional programming because I think it's closer to the idea of TM. What experience with other programming languages do you have which make you feel the idea of TM and the ideas of Computer Science in general? Can you specify how you think?

    Read the article

  • Easiest modern programming language [closed]

    - by Goward Gerald
    What programming language is easiest nowadays, yet demanded in market? By easiest I mean least skill cap (and by skill cap I mean knowing all the frameworks and all the language abilities and constructions. Sure It doesnt mean you need to know 100% of EVERYTHING, but what language lets me get closer to this the most? Please don't suggest me basic, delphi or some other dead/half-dead/useless technologies.

    Read the article

  • Why do old programming languages continue to be revised?

    - by SunAvatar
    This question is not, "Why do people still use old programming languages?" I understand that quite well. In fact the two programming languages I know best are C and Scheme, both of which date back to the 70s. Recently I was reading about the changes in C99 and C11 versus C89 (which seems to still be the most-used version of C in practice and the version I learned from K&R). Looking around, it seems like every programming language in heavy use gets a new specification at least once per decade or so. Even Fortran is still getting new revisions, despite the fact that most people using it are still using FORTRAN 77. Contrast this with the approach of, say, the typesetting system TeX. In 1989, with the release of TeX 3.0, Donald Knuth declared that TeX was feature-complete and future releases would contain only bug fixes. Even beyond this, he has stated that upon his death, "all remaining bugs will become features" and absolutely no further updates will be made. Others are free to fork TeX and have done so, but the resulting systems are renamed to indicate that they are different from the official TeX. This is not because Knuth thinks TeX is perfect, but because he understands the value of a stable, predictable system that will do the same thing in fifty years that it does now. Why do most programming language designers not follow the same principle? Of course, when a language is relatively new, it makes sense that it will go through a period of rapid change before settling down. And no one can really object to minor changes that don't do much more than codify existing pseudo-standards or correct unintended readings. But when a language still seems to need improvement after ten or twenty years, why not just fork it or start over, rather than try to change what is already in use? If some people really want to do object-oriented programming in Fortran, why not create "Objective Fortran" for that purpose, and leave Fortran itself alone? I suppose one could say that, regardless of future revisions, C89 is already a standard and nothing stops people from continuing to use it. This is sort of true, but connotations do have consequences. GCC will, in pedantic mode, warn about syntax that is either deprecated or has a subtly different meaning in C99, which means C89 programmers can't just totally ignore the new standard. So there must be some benefit in C99 that is sufficient to impose this overhead on everyone who uses the language. This is a real question, not an invitation to argue. Obviously I do have an opinion on this, but at the moment I'm just trying to understand why this isn't just how things are done already. I suppose the question is: What are the (real or perceived) advantages of updating a language standard, as opposed to creating a new language based on the old?

    Read the article

  • What language has the best/most library bindings?

    - by Rook
    A library binding allows a programming language to use a library written in another language. Most commonly you want to access a C library like libcurl from a language like PHP or Python. Not all bindings are created equally, for instance the libcurl binding for Python was abandoned almost 3 years ago and their sf.net bug tracker is overrun with unsolved problems. PHP on the other hand has very good libcurl bindings that are actively maintained. So here is my question: What language has the best and/or the most bindings?

    Read the article

  • SQL language drawbacks, The Third Manifesto

    - by David Portabella
    Sometime ago I read about SQL language drawbacks (the basic language specification, not vendor specific), and one of the drawbacks was that the language does not allow to create a set of tuples that don't come from a table. For instance, SELECT firstName, lastName from people; this creates a set of tuples coming from the table people. Now, if I don't have this table people, and I want to return a constant, I'd need something like this to return a set of two tuples (this would not require to have a table): SELECT VALUES('james', 'dean'), ('tom', 'cruisse'); Why I would need that? Because of the same reasons that we can define constants (not only basic types, but objects and arrays also) in any advanced programming language. Workarounds, Yes, I could create a temporal table, fill the data, and SELECT from that table. This is a hack, to overcome the drawbacks of the poor SQL language. I think that I read about this somewhere in "The Third Manifesto", but I don't find the paragraph/example talking about this concrete drawback anymore. Do you know a reference about it?

    Read the article

  • Why is verbosity bad for a programming language?

    - by frowing
    I have seen many people around complaining about verbosity in programming languages. I find that, within some bounds, the more verbose a programming language is, the better it is to understand. I think that verbosity also reinforces writing clearer APIs for that particular language. The only disadvantage I can think of is that it makes you type more, but I mean, most people use IDEs that do all that work for you. so, What are possible downsides to a verbose programming language?

    Read the article

  • Language Agnostic Basic Programming Question

    - by Rachel
    This is very basic question from programming point of view but as I am in learning phase, I thought I would better ask this question rather than having a misunderstanding or narrow knowledge about the topic. So do excuse me if somehow I mess it up. Question: Let's say I have class A,B,C and D now class A has some piece of code which I need to have in class B,C and D so I am extending class A in class B, class C, and class D Now how can I access the function of class A in other classes, do I need to create an object of class A and than access the function of class A or as am extending A in other classes than I can internally call the function using this parameter. If possible I would really appreciate if someone can explain this concept with code sample explaining how the logic flows. Note Example in Java, PHP and .Net would be appreciated.

    Read the article

  • details on the following Natural Language Processing terms ?

    - by wefwgeweg
    Named Entity Extraction (extract ppl, cities, organizations) Content Tagging (extract topic tags by scanning doc) Structured Data Extraction Topic Categorization (taxonomy classification by scanning doc....bayesian ) Text extraction (HTML page cleaning) are there libraries that i can use to do any of the above functions of NLP ? dont really feel like forking out cash to AlchemyAPI

    Read the article

  • Natural Language parsing of an appointment?

    - by Mike Hugo
    I'm looking for a Java library to help parse user entered text that represents an 'appointment' for a calendar application. For instance: Lunch with Mike at 11:30 on Tuesday or 5pm Happy hour on Friday I've found some promising leads like https://jchronic.dev.java.net/ and http://www.datejs.com/ which can parse dates - but I also need to be able to extract the title of the event like "Lunch with Mike". If such an API doesn't exist, I'm also interested in any thoughts on how best to approach the problem from a coding perspective.

    Read the article

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