Search Results

Search found 3022 results on 121 pages for 'loose typing'.

Page 76/121 | < Previous Page | 72 73 74 75 76 77 78 79 80 81 82 83  | Next Page >

  • What makes a bad programming language bad?

    - by sub
    We have all seen things like the typing system of JavaScript (There is a funny post including a truth table somewhere around here). I consider this one of the main things that makes a programming language bad. Other things that spring to mind: Bad Error messages (Either obfuscated so you can't figure out whats wrong, not existing or simply too long and red) The language wasn't planned and just grew uncontrolled in all directions (PHP?) The language encourages bad programm(er/ing) habits such as: Global variables everywhere, bad variable names Inconsistent naming conventions inside the language I can't come up with any more at the moment and would be very happy to read what you think about this. What shouldn't be missing in a language created to be as bad (from the perspectives of the programmer, the company that hires to programmer, the team leader and the customer) as possible? (I ask this because I'm designing a bad, experimental language at the moment)

    Read the article

  • Visual Studio autoclean?

    - by kubal5003
    Hello, I have a solution with multiple projects - executable, library, and others(unimportant right now). Library contains EF entity classes and executable uses them. When I'm working on some code from the executable then every entity that I use is marked as an error and compiler says that I should check usings and references. Reference in the executable project is set to library project(not the dll itself). When I build the library project then everything gets back to normal, but when I start typing then it happens again. I could live with it, but intelli sense isn't working and that is quite a disadvantage. Any ideas?

    Read the article

  • How to limit traffic using multicast over localhost

    - by Shane Holloway
    I'm using multicast UDP over localhost to implement a loose collection of cooperative programs running on a single machine. The following code works well on Mac OSX, Windows and linux. The flaw is that the code will receive UDP packets outside of the localhost network as well. For example, sendSock.sendto(pkt, ('192.168.0.25', 1600)) is received by my test machine when sent from another box on my network. import platform, time, socket, select addr = ("239.255.2.9", 1600) sendSock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP) sendSock.setsockopt(socket.IPPROTO_IP, socket.IP_MULTICAST_TTL, 24) sendSock.setsockopt(socket.IPPROTO_IP, socket.IP_MULTICAST_IF, socket.inet_aton("127.0.0.1")) recvSock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP) recvSock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, True) if hasattr(socket, 'SO_REUSEPORT'): recvSock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT, True) recvSock.bind(("0.0.0.0", addr[1])) status = recvSock.setsockopt(socket.IPPROTO_IP, socket.IP_ADD_MEMBERSHIP, socket.inet_aton(addr[0]) + socket.inet_aton("127.0.0.1")); while 1: pkt = "Hello host: {1} time: {0}".format(time.ctime(), platform.node()) print "SEND to: {0} data: {1}".format(addr, pkt) r = sendSock.sendto(pkt, addr) while select.select([recvSock], [], [], 0)[0]: data, fromAddr = recvSock.recvfrom(1024) print "RECV from: {0} data: {1}".format(fromAddr, data) time.sleep(2) I've attempted to recvSock.bind(("127.0.0.1", addr[1])), but that prevents the socket from receiving any multicast traffic. Is there a proper way to configure recvSock to only accept multicast packets from the 127/24 network, or do I need to test the address of each received packet?

    Read the article

  • Why is Standard Input is not displayed as I type in Mac OS X Terminal application?

    - by BryanWheelock
    I'm confused by some behavior of my Mac OS X Terminal and my Django manage.py shell and pdb. When I start a new terminal, the Standard Input is displayed as I type. However, if there is an error, suddenly Standard Input does not appear on the screen. This error continues until I shut down that terminal window. The Input is still being captured as I can see the Standard Output. E.g. in pdb.set_trace() I can 'l' to display where I'm at in the code. However, the 'l' will not be displayed, just an empty prompt. This makes it hard to debug because I can't determine what I'm typing in. What could be going wrong and what can I do to fix it?

    Read the article

  • Frustrated with Objective-c code...

    - by Moshe
    Well, I've started with iPod/iPhone programming using Head First iPhone Development (O'reilly) and I'm typing code out of the book. There are two problems, one is programming related and the other is not. I don't understand the format of objective-c methods. I'm getting an few errors now, based on source code from the book. Which leads me to my next issue. Some of the code is buggy. I think so because I couldn't get the code to run without modifying it. The book has some typos in the text since it's a first edition and whatnot, but could my "fixing" the code have to do with it? So... Where can I learn more about objective-c methods and how they work in terms of structure and where the return type and arguments go? For those with the book, I'm in the middle of the InstaTweet app towards the beginning. Thanks.

    Read the article

  • IRb: how to start an interactive ruby session with pre-loaded classes

    - by Shyam
    Hi, As I am going through my journey by adopting the Ruby language, I spend a lot of time inside IRb. It's just fantastic! But, as I am not very aware of it's capabilities, and still a nuby with Ruby, I would like to know the following: How can I 'flush' the session, without restarting IRb (or is this not possible). How can I configure IRb to load a bunch of source files "hello.rb" and "hello_objects.rb", i.e. at startup? I am heavily working in these and it would be nice to know a short hand to load these classes, without manually typing 'load' for each again. Thank you for your answers, comments and feedback!

    Read the article

  • Custom Logic and Proxy Classes in ADO.NET Data Services

    - by rasx
    I've just read "Injecting Custom Logic in ADO.NET Data Services" and my next question is, How do you get your [WebGet] method to show up in the client-side proxy classes? Sure, I can call this directly (RESTfully) with, say, WebClient but I thought the strong typing features in ADO.NET Data Services would "hide" this from me auto-magically. So here we have: public class MyService : DataService<MyDataSource> { // This method is called only once to initialize service-wide policies. public static void InitializeService(IDataServiceConfiguration config) { config.SetEntitySetAccessRule("Customers", EntitySetRights.AllRead); config.SetServiceOperationAccessRule("CustomersInCity", ServiceOperationRights.All); } [WebGet] public IQueryable<MyDataSource.Customers> CustomersInCity(string city) { return from c in this.CurrentDataSource.Customers where c.City == city select c; } } How can I get CustomersInCity() to show up in my client-side class defintions?

    Read the article

  • DateTime Property not firing PropertyChanged event when changed

    - by Brent
    I'm working on a WPF MVVM application and I've got a TextBox on my view that is bound to a DateTime property on the ViewModel. Seems simple enough, but when I clear the text in the TextBox, the property never changes. In fact, it never even fires until I begin typing "4/1..." and then it fires. What can I do to fix this? Obviously I could bind the TextBox to a string property and then update the real property in the setter, but that's a bit of a hack. There's got to be a better way... ViewModel private DateTime _startDate; public DateTime StartDate { get { return _startDate; } set { _startDate = value; OnPropertyChanged("StartDate"); } } View <TextBox Text="{Binding Path=StartDate, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=true}"/>

    Read the article

  • problem with Chrome form handling: input onfocus="this.select()"

    - by binaryorganic
    I'm using the following HTML code to autoselect some text in a form field when a user clicks on the field: input onfocus="this.select()" type="text" value="Search" This works fine in Firefox and Internet Explorer (the purpose being to use the default text to describe the field to the user, but highlight it so that on click they can just start typing), but I'm having trouble getting it to work in Chrome. When I click the form field in Chrome the text is highlighted for just a split second and then the cursor jumps to the end of the default text and the highlighting goes away. Any ideas on how to get this working in Chrome as well?

    Read the article

  • Set focus and carret position in textarea according to mouse position, as if user had clicked

    - by JeanHuguesRobert
    Once a page with a textarea is loaded, I want some textarea to have the focus immediatly if the mouse cursor is inside that textarea. This is the easy part because a onmousehover handler can set the focus. Now, how to I also set the position of the caret? I would like the caret to be where it would be if the user had clicked using the mouse to set the focus/caret. The basic use case is : User clicks on a link and waits (mouse barely moves) A page is delivered, it contains a big textarea only, full of text User types using keyboard Characters are inserted right below the mouse cursor Today the user has to wait until the caret is visible (at the top left of the textarea) and then click to move the caret before typing. Thanks!

    Read the article

  • VS2010 + Resharper 5 performance issues

    - by Jeremy Roberts
    I have been using VS2010 with Resharper 5 for several weeks and am having a performance issue. Sometimes when typing, the cursor will lag and the keystrokes won't show instantaneously. Also, scrolling will lag at times. There is a forum thread started and JetBrains has been responding. Several people (including myself) have added their voice and uploaded some performance profiles. If anyone here has has this issue, I would encourage you to visit the thread and let JetBrains know about it. Has anyone had this problem and have a suggestion to restore performance?

    Read the article

  • embedded php in html to include header (top part of page) into the page

    - by Andy
    Hi there, I'm trying to put the top of my page (which is all html) in a seperate file so I only need to change things once like the menu bar etc. So I googled some and found a solution on this website as well, but it doesn't work and I don't know why. So I have a page like article.html and on the top I have this: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html lang="en"> <head> <?php include("/pages/header.php"); ?> <!-- rest of the html code --> In the header.php I have the html that should be on the top of each page and it starts with: <?php /** * @author name * website header */ ?> <!-- html code --> So what's wrong with this. When I open the page article.html and right click on it to view the source, I can see the php from above calling the header.php file. Thanks!

    Read the article

  • VS 2008 SP1 text editor flickering over remote desktop connection

    - by AltairDusk
    I am connecting from a Windows 7 x64 machine to my dev machine running Windows XP SP3 using the built in remote desktop client. For most apps it works fine with no problems, for Visual Studio whenever I am typing the entire text editor keeps redrawing. I stumbled across this question: http://stackoverflow.com/questions/873849/vs-2008-sp1-over-remote-desktop-constant-repainting and I have tried all of the suggestions in it to no effect, including resetting all VS settings back to default then disabling the suggested settings. Has anyone found a reliable solution to this? I feel like I'm going insane with the screen constantly refreshing when I'm working from home. Some additional information: Remote Desktop is set to run at 1680x1050, 15bit color, Low-speed broadband for the experience setting with all but Visual styles and Persistent bitmap caching unchecked. Visual Studio 2008 Team System is running on the dev machine with Service Pack 1 and Power Commands installed.

    Read the article

  • Cut and paste out of/ into text fields in a separate window doesn't work

    - by Brian Postow
    I have a Macintosh Mozilla plugin which puts up a separate window for login information. It seems to work fine, it gets keyboard events like typing and hitting return to hit the default button. HOWEVER, it doesn't seem to get cut and paste events. When I hit Cmd-v, the edit menu flashes, but nothing happnes. Is this a problem with my responder chain? Do I have to specially tell Mozilla that I want these events? or am I likely to have some other problem that I haven't even thought of? thanks.

    Read the article

  • In git, how can I get the diff between two dates?

    - by Weidenrinde
    Basically, I am looking for something equivalent to cvs diff -D"1 day ago" -D"2010-02-29 11:11". While collecting more and more information, I found a solution. I paste it here, for others that might have similar problems. Things I have tried: In git, how can I get the diff between all the commits that occured between two dates? was ansered here with: git whatchanged --since="1 day ago" -p But this gives a diff for each commit, even if there are multiple commits in one file. I know that "date" is a bit of a loose concept in git, I thought there must be some way to do this. git diff 'master@{1 day ago}..master gives some warning warning: Log for 'master' only goes back to Tue, 16 Mar 2010 14:17:32 +0100. and does not show old diffs. git format-patch --since=yesterday --stdout does not give anything. revs=$(git log --pretty="format:%H" --since="1 day ago");git diff $(echo "$revs"|tail -n1) $(echo "$revs"|head -n1) works somehow, but seems complicated and does not restrict to the current branch. git diff $(git rev-list -n1 --before="1 day ago" master) seems to work and a default way to do similar things, although more complicated than I thought. Funnily, git-cvsserver does not support "cvs diff -D" (without that it is documented somewhere).

    Read the article

  • PHP (A few questions) OO, refactoring, eclipse

    - by jax
    I am using PHP in eclipse. It works ok, I can connect to my remote site, there is colour coding of code elements and some code hints. I realise this may be too long to answer all questions, if you have a good answer for one part, answering just that is ok. Firstly General Coding I have found that it is easy to loose track of included files and their variables. For example if there was a database $cursor it is difficult to remember or even know that it was declared in the included file (this becomes much worse the more files you include). How are people dealing with this? How are people documenting their code - in particular the required GET and POST data? Secondly OO Development: Should I be going full OO in my development. Currently I have a functions library which I can include and have separated each "task" into a separate file. It is a bit nasty but it works. If I go OO how do I structure the directories in PHP, java uses packages - what about php? How should I name my files, should I use all lower case with _ for spaces "hello_world.php"? Should I name classes with Uppercase like Java "HelloWorld.php"? Is there a different naming convention for Classes and regular function files? Thirdly Refactoring I must say this is a real pain. If I change the name of a variable in one place I have to go through whole document and each file that included this file and change the name their too. Of course, errors everywhere is what results. How are people dealing with this problem? In Java if you change the name in one place it changes everywhere. Are there any plugins to improve php refactoring? I am using the official PHP version of Eclipse from their website. thanks

    Read the article

  • Adding help button for each window

    - by Miraaj
    Hi all, I have found that user can associate help with his application using Help Viewer. Users typically launch Help Viewer by choosing the application help item from the Help menu, or by typing a query in the Spotlight For Help text field in the Help menu. I have some different requirement: I want to associate component specific help to my application, means that there will be a small '?' marked icon at bottom left corner of a window and when user clicks it, appropriate help page will open. This case is similar to 'print' panels where there is a small '?' icon. Can anyone suggest me some way to accomplish it, if it is possible? Thanks, Miraaj

    Read the article

  • Delphi - Populate an imagelist with icons at runtime 'destroys' transparency

    - by ben
    Hi again, I've spended hours for this (simple) one and don't find a solution :/ I'm using D7 and the TImageList. The ImageList is assigned to a toolbar. When I populate the ImageList at designtime, the icons (with partial transparency) are looking fine. But I need to populate it at runtime, and when I do this the icons are looking pretty shitty - complete loose of the partial transparency. I just tried to load the icons from a .res file - with the same result. I've tried third party image lists also without success. I have no clue what I could do :/ Thanks 2 all ;) edit: To be honest I dont know exactly whats going on. Alpha blending is the correkt term... Here are 2 screenies: Icon added at designtime: Icon added at runtime: Your comment that alpha blending is not supported just brought the solution: I've edited the image in an editor and removed the "alpha blended" pixels - and now it looks fine. But its still strange that the icons look other when added at runtime instead of designtime. If you (or somebody else ;) can explain it, I would be happy ;) thanks for you support!

    Read the article

  • Supporting multiple versions without separate builds in JavaME

    - by Casebash
    I want to be able to support multiple versions of Java ME without having to have multiple builds. I already know how to detect the profile/configuration/supported JSRs. My problem is that knowing whether the JSR is supported at run time doesn't allow me to use all the features. For if I call a function added in a later version anywhere in the code - even a location that will never be run, then this will be a compilation error due to static typing. Is there any way round this?

    Read the article

  • What's the best way to check that environment variables are set in Unix shellscript

    - by AndrewR
    I've got a few Unix shell scripts where I need to check that certain environment variables are set before I start doing stuff, so I do this sort of thing: if [ -z "$STATE" ]; then echo "Need to set STATE" exit 1 fi if [ -z "$DEST" ]; then echo "Need to set DEST" exit 1 fi which is a lot of typing. Is there a more elegant idiom for checking that a set of environment variables is set? EDIT: I should mention that these variables have no meaningful default value - the script should error out if any are unset.

    Read the article

  • Best ways to collaborate with small number of people

    - by Mark Szymanski
    Hi, I am collaborating with someone on a project and currently use Skype for collaboration. I like it because we can be on a call to say things that are hard to say by typing out. We can share our screens so we can help with code writing. And we can use the text chat to copy-paste code between each other. We also use Subversion for version control. I just wanted to know what other people used for collaborating with others so I could see whats out there to use. Thanks!

    Read the article

  • Useful Eclipse Java Code Templates

    - by Jon
    You can create various Java code templates in Eclipse via the Window->Preferences->Java -> Editor -> Templates e.g. sysout is expanded to: System.out.println(${word_selection}${});${cursor} You can activate this by typing sysout followed by CTRL+SPACE What useful Java code templates do you currently use? Include the name and description of it and why it's awesome. There's an open bounty on this for an original/novel use of a template rather than a built-in existing feature. Create Log4J logger Get swt color from display Syncexec - Eclipse Framework Singleton Pattern/Enum Singleton Generation Readfile Const Traceout Format String Comment Code Review String format Try Finally Lock Message Format i18n and log Equalsbuilder Hashcodebuilder Spring Object Injection Create FileOutputStream

    Read the article

  • Programatic re-evalutation of MVVM command's "can execute" state

    - by dzs
    Hello! I'm writing a WPF application using the MVVM pattern, based on the following article: WPF Apps With The Model-View-ViewModel Design Pattern I have two buttons on my View with the buttons' "Command" property bound (with data binding) to a given instance of the RelayCommand class (see "Figure 3 The RelayCommand Class" from the article above). The RelayCommand class has support for checking whether the given command can be executed. WPF automatically disables buttons whose command cannot be executed. Each of my commands (in the ViewModel class) start a background operation, and the command cannot be executed again until the background operation is finished. The RelayCommand instances have information whether the background operation is still working or it is finished. My problem is the following: after pressing the any of the buttons, the buttons automaticaly go disabled (which is OK) because the background operation started and the command cannot be executed until it is finished, but after the operation had finished, the buttons don't go enabled automatically because their command's "can be executed" predicate is not automatically reevaluated. The reevaluation can be manually triggered by having the application loose and regain focus (by pressing ALT+TAB). After doing this trick, the buttons get enabled once again. How can I programatically reevaluate the buttons' command's "can execute" state?

    Read the article

  • Entity Framework - Foreign key constraints not added for inherited entity

    - by Tri Q
    Hello, It appears to me that a strange phenomenon is occurring with inherited entities (TPT) in EF4. I have three entities. 1. Asset 2. Property 3. Activity Property is a derived-type of Asset. Property has many activities (many-to-many) When modeling this in my EDMX, everything seems fine until I try to insert a new Property into the database. If the property does not contain any Activity, it works, but all hell breaks loose when I add some new activities to the new Property. As it turns out after 2 days of crawling the web and fiddling around, I noticed that in the EF store (SSDL) some of the constraints between entities were not picked up during the update process. Property_Activity table which links properties and activities show only one constraint FK_Property_Activity_Activity but FK_Property_Activity_Property was missing. I knew this is an Entity Framework anomoly because when I switched the relationship in the database to: Asset <-- Asset_Activity <-- Activity After an update, all foreign key constraints are picked up and the save is successful, with or without activities in the new property. Is this intended or a bug in EF? How do I get around this problem? Should I abandon inheritance altogether?

    Read the article

  • how to keep a nativewindow on top

    - by Freddy Rios
    I need to keep a NativeWindow I am creating on top of the main window of the application. Currently I am using alwaysInFront = true, which is not limited to the windows in the application. I can successfully synchronize the minimize/restore/move/resize actions, so the top window behaves appropriately in those cases. Even though using this option has the drawback that if I alt-tab to other application the window goes on top of the other application. Because of the above I am trying to get it to work without using the alwaysInFront. I have tried using orderInFrontOf and orderToFront, which gets it in place but when I click an area in the main window the top one becomes hidden i.e. air makes it the top one. I have tried capturing activate/deactivate events but it only happens on the first click, so on the second click the top window becomes hidden again. I also tried making the top window active when the main one becomes active, but that causes the main one to loose focus and I can't click on anything. Ps. I am doing this to improve the behavior of a HTMLOverlay I am using - see http://stackoverflow.com/questions/1044927/flex-air-htmlloader-blank-pop-up-window-when-flash-content-is-loaded/1077738#1077738

    Read the article

< Previous Page | 72 73 74 75 76 77 78 79 80 81 82 83  | Next Page >