Search Results

Search found 712 results on 29 pages for 'casual coder'.

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

  • Converting OCaml to F#: F# equivelent of Pervasives at_exit

    - by Guy Coder
    I am converting the OCaml Format module to F# and tracked a problem back to a use of the OCaml Pervasives at_exit. val at_exit : (unit -> unit) -> unit Register the given function to be called at program termination time. The functions registered with at_exit will be called when the program executes exit, or terminates, either normally or because of an uncaught exception. The functions are called in "last in, first out" order: the function most recently added with at_exit is called first. In the process of conversion I commented out the line as the compiler did not flag it as being needed and I was not expecting an event in the code. I checked the FSharp.PowerPack.Compatibility.PervasivesModule for at_exit using VS Object Browser and found none. I did find how to run code "at_exit"? and How do I write an exit handler for an F# application? The OCaml line is at_exit print_flush with print_flush signature: val print_flush : (unit -> unit) Also in looking at the use of it during a debug session of the OCaml code, it looks like at_exit is called both at the end of initialization and at the end of each use of a call to the module. Any suggestions, hints on how to do this. This will be my first event in F#. EDIT Here is some of what I have learned about the Format module that should shed some light on the problem. The Format module is a library of functions for basic pretty printer commands of simple OCaml values such as int, bool, string. The format module has commands like print_string, but also some commands to say put the next line in a bounded box, think new set of left and right margins. So one could write: print_string "Hello" or open_box 0; print_string "<<"; open_box 0; print_string "p \/ q ==> r"; close_box(); print_string ">>"; close_box() The commands such as open_box and print_string are handled by a loop that interprets the commands and then decides wither to print on the current line or advance to the next line. The commands are held in a queue and there is a state record to hold mutable values such as left and right margin. The queue and state needs to be primed, which from debugging the test cases against working OCaml code appears to be done at the end of initialization of the module but before the first call is made to any function in the Format module. The queue and state is cleaned up and primed again for the next set of commands by the use of mechanisms for at_exit that recognize that the last matching frame for the initial call to the format modules has been removed thus triggering the call to at_exit which pushes out any remaining command in the queue and re-initializes the queue and state. So the sequencing of the calls to print_flush is critical and appears to be at more than what the OCaml documentation states.

    Read the article

  • Mix and match class in C++/MFC

    - by Coder
    I'm trying to re-factor a code base, and there is some common functionality among unrelated classes that I'd love to unite. I would like to add that functionality in common base class, but I'm not sure if it's clean and good approach. Say I have CMyWnd class and CMyDialogEx class, both different, so they cannot inherit from one base class. I want to add a button to both classes and add the message handlers to both classes as well. So I'd like to do something like this: CMyWnd : public CWnd, public COnOkBtnFunctionality, public COnCancelBtnFunctionality CMyDialogEx: public CWnd, public COnOkBtnFunctionality Where COnOkBtnFunctionality would define CButton m_buttonOk, and all the afx_msg functions it should have. And so on. Is this approach doable/good? Or are there better patterns I should resort to?

    Read the article

  • Was Visual Studio 2008 or 2010 written to use multi cores?

    - by Erx_VB.NExT.Coder
    basically i want to know if the visual studio IDE and/or compiler in 2010 was written to make use of a multi core environment (i understand we can target multi core environments in 08 and 10, but that is not my question). i am trying to decide on if i should get a higher clock dual core or a lower clock quad core, as i want to try and figure out which processor will give me the absolute best possible experience with Visual Studio 2010 (ide and background compiler). if they are running the most important section (background compiler and other ide tasks) in one core, then the core will get cut off quicker if running a quad core, esp if background compiler is the heaviest task, i would imagine this would b e difficult to seperate in more then one process, so even if it uses multi cores you might still be better off with going for a higher clock cpu if the majority of the processing is still bound to occur in one core (ie the most significant part of the VS environment). i am a vb programmer, they've made great performance improvements in beta 2, congrats, but i would love to be able to use VS seamlessly... anyone have any ideas? thanks, erx

    Read the article

  • Iframe not displaying content

    - by a coder
    This snippet was gathered from a random youtube video: <iframe class="youtube-player" src="http://www.youtube.com/embed/http://www.youtube.com/v/gnrvYsZWR1c?rel=0" title="YouTube video player" type="text/html" frameborder="0" height="390" width="480"></iframe> Again, a little easier to read: <iframe class="youtube-player" src="http://www.youtube.com/embed/http://www.youtube.com/v/gnrvYsZWR1c?rel=0" title="YouTube video player" type="text/html" frameborder="0" height="390" width="480" ></iframe> It is not displaying the embedded youtube in Firefox 15.0.1 on Windows or Linux. Is there a problem with how this snippet is constructed, or is Firefox simply not displaying iframe content?

    Read the article

  • PHP , What is the difference between fopen r+ and r ! does it matter if i used r+ when not intending

    - by Naughty.Coder
    when I use fopen function , why don't I use r+ always , even when I'm not going to write any thing ... is there a reason for separating writing/reading process from only reading .. like , the file is locked for reading when I use r+ , because i might write new data into it or something ... another question : in php manual a+ : Open for reading and writing; place the file pointer at the end of the file. If the file does not exist, attempt to create it. What is supposed to be read if you are at the end of the file ..(pointer at the end) !!? where to learn more about the filesystem thing .... it's confusing

    Read the article

  • ASP.Net - How do I allow users to enter html tags in textbox without runtime errors?

    - by Coder
    I have an input textbox on an asp.net page and when a user inputs any tags like break tags or bold an error occurs. I currently am using the following to encode the input: Server.HtmlEncode(mytextbox.Text) However this only encodes characters when they aren't phrased as an html tag, like if the input is "<<<" is there a way for me to allow the user to put the tags in without it leading to a runtime error? Thanks.

    Read the article

  • Break in Class Module vs. Break on Unhandled Errors (VB6 Error Trapping, Options Setting in IDE)

    - by Erx_VB.NExT.Coder
    Basically, I'm trying to understand the difference between the "Break in Class Module" and "Break on Unhandled Errors" that appear in the Visual Basic 6.0 IDE under the following path: Tools --> Options --> General --> Error Trapping The three options appear to be: Break on All Errors Break in Class Module Break on Unhandled Errors Now, apparently, according to MSDN, the second option (Break in Class Module) really just means "Break on Unhandled Errors in Class Modules". Also, this option appears to be set by default (ie: I think its set to this out of the box). What I am trying to figure out is, if I have the second option selected, do I get the third option (Break on Unhandled Errors) for free? In that, does it come included by default for all scenarios outside of the Class Module spectrum? To advise, I don't have any Class Modules in my currently active project. I have .bas modules though. Also, is it possible that by Class Mdules they may be referring to normal .bas Modules as well? (this is my second sub-question). Basically, I just want the setting to ensure there won't be any surprises once the exe is released. I want as many errors to display as possible while I am developing, and non to be displayed when in release mode. Normally, I have two types of On Error Resume Next on my forms where there isn't explicit error handling, they are as follows: On Error Resume Next ' REQUIRED On Error Resume Next ' NOT REQUIRED The required ones are things like, checking to see if an array has any length, if a call to its UBound errors out, that means it has no length, if it returns a value 0 or more, then it does have length (and therefore, exists). These types of Error Statements need to remain active even while I am developing. However, the NOT REQUIRED ones shouldn't remain active while I am developing, so I have them all commented out to ensure that I catch all the errors that exist. Once I am ready to release the exe, I do a CTRL+H to find all occurrences of: 'On Error Resume Next ' NOT REQUIRED (You may have noticed they are commented out)... And replace them with: On Error Resume Next ' NOT REQUIRED ... The uncommented version, so that in release mode, if there are any leftover errors, they do not show to users. For more on the description by MSDN on the three options (which I've read twice and still don't find adequate) you can visit the following link: http://webcache.googleusercontent.com/search?q=cache:yUQZZK2n2IYJ:support.microsoft.com/kb/129876&hl=en&lr=lang_en%7Clang_tr&gl=au&tbs=lr:lang_1en%7Clang_1tr&prmd=imvns&strip=1 I’m also interested in hearing your thoughts if you feel like volunteering them (and this would be my tentative/totally optional third sub-question, that being, your thoughts on fall-back error handling techniques). Just to summarize, the first two questions were, do we get option 3 included in all non-class scenarios if we choose option 2? And, is it possible that when they use the term "Class Module" they may be referring to .bas Modules as well? (Since a .bad Module is really just a class module that is pre-instantiated in the background during start-up). Thank you.

    Read the article

  • Disable the Go button in the Keyboard for a UITextfield in iphone app.

    - by coder net
    Hi, My app has a screen where keyboard is always visible. The main element of the screen is a UITextfield. For easy data entering, keyboard is always made visible. When the user finishes entering data and hits Go, the app performs a 4,5 seconds action which is done in the background thread in order to show UIActivityIndicatorView. My problem is that the Go button on the keyboard still shows as enabled since the logic is performed in the background. The user could potentially hit the Go again causing it to run again. I am not able to set editable/userinteraction properties to No because then the keyboard disappears. Is there anyway just to disable the Go button or freeze the keyboard until the background thread returns?

    Read the article

  • Is SQL Server 2008 R2 a full release of SQL Server?

    - by AaronBertrand
    This has come up in conversations more than once in the past little while - recently on twitter I made the casual comment that later this year, SQL Server 2008 will be "two versions old." Well, not everyone agrees that that is technically true. So, I thought I'd put something out there that isn't limited to 140 characters. There are certainly some valid arguments on both sides, but my opinion - based both on these facts and on my memory that Microsoft has marketed it as such - is that SQL Server...(read more)

    Read the article

  • 25 reasons to attend JavaOne 2012

    - by arungupta
    17th JavaOne is just around the corner, less than 3 weeks away! If you are still thinking about registering for the conference, here are my top 25 reasons to attend the conference: Biggest gathering of Java geeks in the world Latest and greatest content with 475 technical sessions/Birds of Feathers/Hands-on labs sessions (about 20% more from last year) Reduced number of keynotes to accommodate room for more technical content No product pitches, exclusive focus on technology (I can tell you that from my experience as a track lead) Sessions are divided in different in-depth technical tracks to focus on Java technology that most interests you Reruns of several popular sessions Experts and Practitioners-led HOLs and tutorials Rock star speakers, panelists, faculties, and instructors. Meet several Java Champions and JUG leaders from all around the world Engage with speakers and discuss with fellow developers in a casual setting with lots of networking space A complete conference dedicated for Java Embedded Extensive and fast-paced hands-on University Sessions on Sunday, learn while you are at the conference. You can register for Java University only or attend with the conference. Dukes Choice Awards recognize and celebrate the most innovative usage of the Java platform DEMOgrounds and Exhibition Hall provide extensive opportunities for networking and engagement with the biggest names in Java (dedicated hours on each day as well) Dedicated day for Java User Groups and Communities (GlassFish Community Event and NetBeans Community Day) Multiple registration packages to meet your needs Pay for 4 full conference passes and get a fifth one free Students and Bloggers get a free pass Geek Bike Ride with fellow speakers and attendees in a casual setting Greenest conference on the plane Enjoy different cuisines in the San Francisco city, take a trip to Alcatraz or Napa Valley or go running on the crooked street ;-) There are tons of tourist opportunities in/around San Francisco. Tons of parties during the conference, in the evening, late night, and early mornings. Don't forget Thirsty Bear Party! Pearl Jam and Kings of Leon at Appreciation Party Oracle Music Festival at Yerba Buena Gardens Grab the bragging rights "I have attended JavaOne"! Learn a new skill, build new connections, conceive a new idea and push the boundaries of Java in the most important educational and networking event of the year for Java developers and enthusiasts. With so much geekgasm going on during the 5 days of JavaOne, is there a reason for you to wait ? Register for the conference now! Grab your buttons, banners, and other collateral at JavaOne Toolkit. You can also send an email to [email protected]. And reach out to us using different social media channels ... As a 13 year veteran of the conference, I can tell this is some thing every Java developer must experience! I will be there, will you ?

    Read the article

  • How do I get into Facebook game development?

    - by Ben Zeigler
    I have some ideas that I think might make interesting games for a Facebook-like platform, in that they are social and casual. Does anyone have advice on how to get into Facebook development from a background in traditional C++ game development? Is there anything special that differentiates developing facebook games from developing other web-based games, such as API intricacies and so forth? To start with this will probably be hobbyist level instead of some sort of professional enterprise, anything I need to know about making indie-level facebook games?

    Read the article

  • Windows Phone 7 Apps ? Iphone Killer?

    It';s not that long since Microsoft revamped Windows with their Windows 7 and made casual users and reviewers rejoice over the stunning looks and functionality. Of course, not many people understood a... [Author: Huey Davis - Computers and Internet - June 12, 2010]

    Read the article

  • How to practice typing of programmer keys such as tilde, pipe and programmer quote?

    - by user7893
    It is nice that there are services such as TypeRacer where you can practice casual writing but I want to practice programmer keys, covers more numbers and keys not used by regular typist. There was some tutor with which I practiced some programmer keys and noticed that my speed dropped dramatically from 70-80 wpm to even about 15-30 wpm, it also trains different muscles. So how can I practice just programming keys with programming texts or just random code pieces?

    Read the article

  • Best virtualization solution for running Windows 7 as a guest?

    - by gkt.pro
    I depend upon Ubuntu for most of my work but I still need Windows 7 for some applications such as Office 2010 Casual Gaming Adobe CS4 and other windows softwares that are not available on Ubuntu yet. I checked Wine but as of now it provides no support for Office 2010 and most of my games and softwares. So, I decided to go for Virtualizing Windows 7 inside Ubuntu, but I am confused about which virtualization software should I use on Ubuntu for virtualization.

    Read the article

  • How can you store item data from a game?

    - by ThePlan
    When I look at games such as warcraft 3, or Diablo, or basically any games that contain items in them I notice that each item is unique. They all have different stats, different graphics, different names. I took a wild guess that they don't use XML, although I know I might be wrong, but I just figured they use something that isn't easily human-editable to prevent casual hacking. How is data such as item attributes stored in a game (2d or 3d, I suppose it works the same way in both)?

    Read the article

  • JQuery UI Autocomplete TextBox in ASP.NET C# with ArrayList

    - by Avishek Kumar
    hello, I am a asp.net coder looking forward to the "easiest tutorial on the planet" to understand how to make a JQuery Autocomplete in ASP.NET c# with ArrayList which not just me but every .net idiot can understand for once and forever as im tired of looking up so many tutorials which teach me nothing. Im referring to this http://jqueryui.com/demos/autocomplete/ library for autocomplete thing. Here is what exactly i want: 1ASP.NET text-box which has autocomplete added to it. 2It will fetch records from "search.aspx?q=searchtext" and get back maximum of 5 matching results in C# ArrayList Format 3Show those 5 matching autocomplete records below text-box as it does in the jquery UI demo page 4Keep doing the autocomplete work for every new Textvalue/changed value in Text-box Here is "what i don't want to see" in my help example: 1JSON, 2XML 3.ASMX, LINQ, Theories of Book and all weired stuff So let me see who actually knows the best code for helping me. I would be thankful to the best ASP.NET coder who helps me out.

    Read the article

  • PHP correct indentation?

    - by brainle55
    I'm a beginner PHP coder, recently I've been told I indent my code not correctly. They say this is wrong: if($something) { do_something(); } else { something_more(); and_more(); } While this is right? if($something) { do_something(); } else { something_more(); and_more(); } Really? I am willing to become opensource coder in nearest future so that's why I'm asking how to write code in a good way.

    Read the article

  • Why does my UITableView change from UITableViewStyleGrouped to UITableViewStylePlain

    - by casper
    My application has a view controller that extends UITableViewController. The initialization method looks like this: - (id)initWithCoder:(NSCoder*)coder { if (self = [super initWithCoder:coder]) { self.tableView = [[UITableView alloc] initWithFrame:self.tableView.frame style:UITableViewStyleGrouped]; } return self; } When the view is initially loaded, it's displayed as UITableViewStyleGrouped. However, if my app ever receives a low memory warning, the above view changes to UITableViewStylePlain. There is no associated xib file with the View/Controller. The viewDidUnload and didReceiveMemoryWarning methods are straightforward: - (void)didReceiveMemoryWarning { // Releases the view if it doesn't have a superview. [super didReceiveMemoryWarning]; // Release any cached data, images, etc that aren't in use. } - (void)viewDidUnload { // Release any retained subviews of the main view. // e.g. self.myOutlet = nil; } My question is, why does the table style change when I receive a memory warning?

    Read the article

  • Updates to NSDictionary attribute in CoreData not saving

    - by sfkaos
    I have created an Entity in CoreData that includes a Transformable attribute type implemented as an NSDictionary. The NSDictionary attribute only contains values of a custom class. The properties of the custom class are all of type NSString. The custom class complies with NSCoding implementing: -(void)encodeWithCoder:(NSCoder*)coder; -(id)initWithCoder:(NSCoder *)coder When saving the Entity for the first time all attributes including the Transformable (NSDictionary) type are properly saved in the DB. When the same Entity is fetched from the DB and updated (including the Transformable attribute) it seems to be updated properly. However, when the app is closed and then reopened fetching the Entity does not show the updated Transformable attribute-type though the rest of the attributes of type NSDate and NSString are up-to-date. The Transformable attribute is the original saved value not the updated value. Is this a problem with KVO or am I missing something else when trying to save an NSDictionary filled with a custom class to CoreData?

    Read the article

  • Following PHP coding of Wisdom

    - by justjoe
    i read some wisdom like this : Programmers are encouraged to be careful when using by-reference variables since they can negatively affect the readability and maintainability of the code. i make my own solution, such as give suffix such as _ref in every by-reference variables. so, if i have a variable named as $files_in_root, then i will add suffix and changes it name into $files_in_root_ref. As far my knowledge goes, this is a good solution. So, here come the question Is there any best-practice on choosing suffix for by-reference variable in PHP coder world ? Or do you have any ? In general, how do we sustain readability and maintainability on PHP project with more then 3000 line of code ? I hope PHP coder world has unwritten aggrement for first question, cause it will help spot a pattern on any source code.

    Read the article

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