Search Results

Search found 713 results on 29 pages for 'barry brown'.

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

  • Internet and Intellisense bad for your memory?

    - by Barry Jones
    Having programmed for a while now I have noticed that I am becoming more and more reliant on the internet and intellisense to do my job. But I was wondering how much that has effected my knowledge over the past year or so. But does this matter? For example I am more likely now to remember that when I need to program against objects I have no knowledge about, I will go to the System.Reflection namespace and a quick look down the list will provide me with enough detail to get going again. But if you was to ask me which classes etc are required I would struggle to name them all. This problem of remembering seems to manifest itself more when going for interviews when people seem to focus more on the minute detail of obscure areas of the .NET framework and not on the wide and varied knowledge and experience of the applicant. Anyway I digress. Does anyone else think that maybe its time to turn of the intellisense and try and find better ways to learn, then quick fixes and work arounds of the internet?

    Read the article

  • Dynamically adding radio buttons using JQUERY and then hooking up the jquery change event to the gen

    - by Barry
    i am adding collection of radio buttons to my page using jquery below $(document).ready(function() { $("#Search").click(function() { var keyword = $('#keyWord').val(); var EntityType = $("#lstEntityTypes :selected").text(); var postData = { type: EntityType, keyWord: keyword }; // alert(postData.VehicleType); $.post('/EntityLink/GetJsonEntitySearchResults', postData, function(GRdata) { var grid = '<table><tr><td>ID</td><td>Name</td><td></td>'; for (var i = 0; i < GRdata.length; i++) { grid += '<tr><td>'; grid += GRdata[i].ID; grid += '</td><td>'; grid += GRdata[i].EntityName; grid += '</td><td>'; grid += '<input type="radio" name="EntitiesRadio" value="' + GRdata[i].ID + '" />'; grid += '</td></tr>'; } grid += '</table>'; alert(grid); $("#EntitySearchResults").html(grid); $("EntitiesRadio").change(function() { alert($("EntitiesRadio :checked").val()); $("EntityID").val($("EntitiesRadio :checked").val()); alert($("EntityID").val()); $("EntityName").val($("#lstEntityTypes :selected").text()); }); }); }); // }); so when page loads there is not EntitiesRadio name range, so i tried to register the entitiesRadio change function inside the same search click method but it isnt registering. how do i get the change event to fire to update my hidden inputs

    Read the article

  • Using inheritance and polymorphism to solve a common game problem

    - by Barry Brown
    I have two classes; let's call them Ogre and Wizard. (All fields are public to make the example easier to type in.) public class Ogre { int weight; int height; int axeLength; } public class Wizard { int age; int IQ; int height; } In each class I can create a method called, say, battle() that will determine who will win if an Ogre meets and Ogre or a Wizard meets a Wizard. Here's an example. If an Ogre meets an Ogre, the heavier one wins. But if the weight is the same, the one with the longer axe wins. public Ogre battle(Ogre o) { if (this.height > o.height) return this; else if (this.height < o.height) return o; else if (this.axeLength > o.axeLength) return this; else if (this.axeLength < o.axeLength) return o; else return this; // default case } We can make a similar method for Wizards. But what if a Wizard meets an Ogre? We could of course make a method for that, comparing, say, just the heights. public Wizard battle(Ogre o) { if (this.height > o.height) return this; else if (this.height < o.height) return o; else return this; } And we'd make a similar one for Ogres that meet Wizard. But things get out of hand if we have to add more character types to the program. This is where I get stuck. One obvious solution is to create a Character class with the common traits. Ogre and Wizard inherit from the Character and extend it to include the other traits that define each one. public class Character { int height; public Character battle(Character c) { if (this.height > c.height) return this; else if (this.height < c.height) return c; else return this; } } Is there a better way to organize the classes? I've looked at the strategy pattern and the mediator pattern, but I'm not sure how either of them (if any) could help here. My goal is to reach some kind of common battle method, so that if an Ogre meets an Ogre it uses the Ogre-vs-Ogre battle, but if an Ogre meets a Wizard, it uses a more generic one. Further, what if the characters that meet share no common traits? How can we decide who wins a battle?

    Read the article

  • Using Regex to remove Carriage Returns in a CSV file in Notepad++

    - by Barry
    I have a CSV file I need to clean up. This is a one-time thing so I'd like to do it in Notepad++ if possible. The CSV file has two fields, one of which is wrapped in quotes. I'd like to remove any Carriage Returns from within the quoted field. I was trying to use this pattern but can't get it quite right... (.*)\"(.*)\n(.*)\"(.*) Also correct me if I am wrong, but I presume the "replace with" value would be something along the lines of: \1\2\3\4 Thanks in advance. I'm also open to alternate solutions such as a quick and dirty PERL script.

    Read the article

  • What's the recommended implementation for hashing OLE Variants?

    - by Barry Kelly
    OLE Variants, as used by older versions of Visual Basic and pervasively in COM Automation, can store lots of different types: basic types like integers and floats, more complicated types like strings and arrays, and all the way up to IDispatch implementations and pointers in the form of ByRef variants. Variants are also weakly typed: they convert the value to another type without warning depending on which operator you apply and what the current types are of the values passed to the operator. For example, comparing two variants, one containing the integer 1 and another containing the string "1", for equality will return True. So assuming that I'm working with variants at the underlying data level (e.g. VARIANT in C++ or TVarData in Delphi - i.e. the big union of different possible values), how should I hash variants consistently so that they obey the right rules? Rules: Variants that hash unequally should compare as unequal, both in sorting and direct equality Variants that compare as equal for both sorting and direct equality should hash as equal It's OK if I have to use different sorting and direct comparison rules in order to make the hashing fit. The way I'm currently working is I'm normalizing the variants to strings (if they fit), and treating them as strings, otherwise I'm working with the variant data as if it was an opaque blob, and hashing and comparing its raw bytes. That has some limitations, of course: numbers 1..10 sort as [1, 10, 2, ... 9] etc. This is mildly annoying, but it is consistent and it is very little work. However, I do wonder if there is an accepted practice for this problem.

    Read the article

  • Why can't decimal numbers be represented exactly in binary?

    - by Barry Brown
    There have been several questions posted to SO about floating-point representation. For example, the decimal number 0.1 doesn't have an exact binary representation, so it's dangerous to use the == operator to compare it to another floating-point number. I understand the principles behind floating-point representation. What I don't understand is why, from a mathematical perspective, are the numbers to the right of the decimal point any more "special" that the ones to the left? For example, the number 61.0 has an exact binary representation because the integral portion of any number is always exact. But the number 6.10 is not exact. All I did was move the decimal one place and suddenly I've gone from Exactopia to Inexactville. Mathematically, there should be no intrinsic difference between the two numbers -- they're just numbers. By contrast, if I move the decimal one place in the other direction to produce the number 610, I'm still in Exactopia. I can keep going in that direction (6100, 610000000, 610000000000000) and they're still exact, exact, exact. But as soon as the decimal crosses some threshold, the numbers are no longer exact. What's going on? Edit: to clarify, I want to stay away from discussion about industry-standard representations, such as IEEE, and stick with what I believe is the mathematically "pure" way. In base 10, the positional values are: ... 1000 100 10 1 1/10 1/100 ... In binary, they would be: ... 8 4 2 1 1/2 1/4 1/8 ... There are also no arbitrary limits placed on these numbers. The positions increase indefinitely to the left and to the right.

    Read the article

  • Converting C source to C++

    - by Barry Kelly
    How would you go about converting a reasonably large (300K), fairly mature C codebase to C++? The kind of C I have in mind is split into files roughly corresponding to modules (i.e. less granular than a typical OO class-based decomposition), using internal linkage in lieu private functions and data, and external linkage for public functions and data. Global variables are used extensively for communication between the modules. There is a very extensive integration test suite available, but no unit (i.e. module) level tests. I have in mind a general strategy: Compile everything in C++'s C subset and get that working. Convert modules into huge classes, so that all the cross-references are scoped by a class name, but leaving all functions and data as static members, and get that working. Convert huge classes into instances with appropriate constructors and initialized cross-references; replace static member accesses with indirect accesses as appropriate; and get that working. Now, approach the project as an ill-factored OO application, and write unit tests where dependencies are tractable, and decompose into separate classes where they are not; the goal here would be to move from one working program to another at each transformation. Obviously, this would be quite a bit of work. Are there any case studies / war stories out there on this kind of translation? Alternative strategies? Other useful advice? Note 1: the program is a compiler, and probably millions of other programs rely on its behaviour not changing, so wholesale rewriting is pretty much not an option. Note 2: the source is nearly 20 years old, and has perhaps 30% code churn (lines modified + added / previous total lines) per year. It is heavily maintained and extended, in other words. Thus, one of the goals would be to increase mantainability. [For the sake of the question, assume that translation into C++ is mandatory, and that leaving it in C is not an option. The point of adding this condition is to weed out the "leave it in C" answers.]

    Read the article

  • linq to sql string property from non-null column with default

    - by Barry Fandango
    I have a LINQ to SQL class "VoucherRecord" based on a simple table. One property "Note" is a string that represents an nvarchar(255) column, which is non-nullable and has a default value of empty string (''). If I instantiate a VoucherRecord the initial value of the Note property is null. If I add it using a DataContext's InsertOnSubmit method, I get a SQL error message: Cannot insert the value NULL into column 'Note', table 'foo.bar.tblVoucher'; column does not allow nulls. INSERT fails. Why isn't the database default kicking in? What sort of query could bypass the default anyway? How do I view the generated sql for this action? Thanks for your help!

    Read the article

  • Strange issues with view switcher after object animator animations

    - by Barry Irvine
    I have two LinearLayout views that contain a number of edit texts and checkboxes for entering user information (name, email address etc). When a validation fails on one of these fields a gone textview is displayed showing the validation error. I have enclosed the two layouts within a ViewSwitcher and I animate between the two views using the ObjectAnimator class. (Since the code needs to support older versions of Android I am actually using the nineoldandroids backwards compatibility library for this). The bulk of the work is performed in my switchToChild method. If I flip the views more than twice then I start to run into strange errors. Firstly although the correct child view of the view animator is displayed it seems that the other view has focus and I can click on the views beneath the current one. I resolved this issue by adding a viewSwitcher.bringChildToFront at the end of the first animation. When I do this however and perform a validation on the 2nd view the "gone" view that I have now set to visible is not displayed (as if the linearlayout is never being re-measured). Here is a subset of the XML file: <ScrollView android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_below="@+id/TitleBar" android:scrollbarAlwaysDrawVerticalTrack="true" android:scrollbarStyle="outsideOverlay" android:scrollbars="vertical" > <ViewSwitcher android:id="@+id/switcher" android:layout_width="fill_parent" android:layout_height="wrap_content" > <LinearLayout android:id="@+id/page_1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="vertical" > <!-- Lots of subviews here --> <LinearLayout android:id="@+id/page_2" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="vertical" > And this is the main method for flipping between the views: private void switchToChild(final int child) { final ViewSwitcher viewSwitcher = (ViewSwitcher) findViewById(R.id.switcher); if (viewSwitcher.getDisplayedChild() != child) { final Interpolator accelerator = new AccelerateInterpolator(); final Interpolator decelerator = new DecelerateInterpolator(); final View visibleView; final View invisibleView; switch (child) { case 0: visibleView = findViewById(R.id.page_2); invisibleView = findViewById(R.id.page_1); findViewById(R.id.next).setVisibility(View.VISIBLE); findViewById(R.id.back).setVisibility(View.GONE); break; case 1: default: visibleView = findViewById(R.id.page_1); invisibleView = findViewById(R.id.page_2); findViewById(R.id.back).setVisibility(View.VISIBLE); findViewById(R.id.next).setVisibility(View.GONE); break; } final ObjectAnimator visToInvis = ObjectAnimator.ofFloat(visibleView, "rotationY", 0f, 90f).setDuration(250); visToInvis.setInterpolator(accelerator); final ObjectAnimator invisToVis = ObjectAnimator.ofFloat(invisibleView, "rotationY", -90f, 0f).setDuration(250); invisToVis.setInterpolator(decelerator); visToInvis.addListener(new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator anim) { viewSwitcher.showNext(); invisToVis.start(); viewSwitcher.bringChildToFront(invisibleView); // If I don't do this the old view can have focus } }); visToInvis.start(); } } Does anyone have any ideas? This is really confusing me!

    Read the article

  • How can I help fellow students struggling in programming classes?

    - by David Barry
    I'm a computer science student finishing up my second semester of programming classes. I've enjoyed them quite a bit, and learned a lot, but it seems other students are struggling with the concepts and assignments more than I am. When an assignment is due, the inevitable group email comes out the day or two before with people needing some help either with a specific part of the problem, or sometimes people just seem to have a hard time knowing where to start. I'd really like to be able to help out, but I have a hard time thinking of the right way to give them help without giving them the answer. When I'm having trouble understanding a concept, a code snippet can go along way to helping me, but at the same time if it makes a lot of sense, it can be difficult to think of another way to go about it. Plus the Academic Integrity section of each assignment is always looming overhead warning against sharing code with others. I've tried using pseudo code to help give others an idea on program flow, leaving them to figure out how to implement certain aspects of it, but I didn't get too much feedback and don't know how much it actually helped them out, or if it just confused them further. So I'm basically looking to see if anyone has experience with this, or good ways that I can help out other students to nudge them in the right direction or help them think about the problem in the right way.

    Read the article

  • Fade in list of images, once all are loaded.

    - by Nathan Barry
    I have a group of images in this format: <ul id="photo-list"> <li><img src="" /></li> <li><img src="" /></li> <li><img src="" /></li> </ul> My goal is that once all the images have finished loading, then #photo-list will fade in. Also I would like to display a loading animation before the images are loaded. Any help is appreciated!

    Read the article

  • jquery not working in internet explorer using mvc

    - by Barry
    i have a group of radio buttons that are generated on the fly from the db into a partial control then rendered on the page as html and they all have the same name now in firefox and chrome the following code works fine $(".FlightSelectedRadio").live('click', function() { alert("after flight select"); $("#ToisGarantueedBid").attr("disabled", false); }); however in ie it doesnt work on the first select of a radio but only fires if u select something else ? any ideas wat the problem is ?

    Read the article

  • Powershell script required..

    - by barry
    this is the scenario. p1 |_f1 |_f2 p2 |_f1 |_f2 Can anyone please help me with a powershell script that copies the files shown above from the TFS to a temporary folder ??? where f1,f2,and so on are the subfolders..

    Read the article

  • Does DB2 OS/390 BLOB support .docx file

    - by Barry
    ASP.net app inserts .docx fileinto a row on DB2 OS/390 Blob table. A different VB.net app gets the DB2 OS/390 Blob data. When Microsoft Word tries to open the .docx file Microsoft Word pops up a message that the data is corrupted. Word will fix the data so the file can be viewed. I've seen some examples where .docx can be converted to .doc but they only talk about stripping out the text. Some of our .docx have pictures in them. Any ideas?

    Read the article

  • SQL Not Exists in this Query - is it possible

    - by jason barry
    This is my script - it simply looks for the image file associated to a person record. Now the error will display if there is NO .jpg evident when the query runs. Msg 4860, Level 16, State 1, Line 1 Cannot bulk load. The file "C:\Dev\ClientServices\Defence\RAN\Shore\Config\Photos\002054.2009469432270600.001.jpg" does not exist. Is there a way to write this query to 'IF not exists then set id_number = '002054.2009469432270427.001' - so it wil always display this photo for any records without a picture. ALTER procedure [dbo].[as_ngn_sp_REP_PH108_photo] (@PMKEYS nvarchar(50)) AS ---exec [as_ngn_sp_REP_PH108_photo] '8550733' SET NOCOUNT ON DECLARE @PATH AS NVARCHAR(255) DECLARE @ID_NUMBER NVARCHAR(27) DECLARE @SQL AS NVARCHAR(MAX) EXEC DB_GET_DB_SETTING'STAFF PICTURE FILE LOCATION', 0, @PATH OUTPUT IF RIGHT(@PATH,1) <> '\' SET @PATH = @PATH + '\' SELECT @ID_NUMBER = ID_NUMBER FROM aView_person WHERE EXTRA_CODE_1 = @PMKEYS SET @PATH = @PATH + @ID_NUMBER + '.jpg' SET @SQL = 'SELECT ''Picture1'' [Picture], BulkColumn FROM OPENROWSET(Bulk ''' + REPLACE(@PATH,'''','''''') + ''', SINGLE_BLOB) AS RAN' EXEC SP_EXECUTESQL @SQL

    Read the article

  • wso2 governance email templates

    - by Barry Allott
    We have gotten WSO2 governance registry to send e-mails successfully. Now we want to template the emails that are being sent out. There is a sample at : http://docs.wso2.org/wiki/display/Governance450/Notification+E-mail+Customization+Sample This allows you to alter the text coming through the event but is there an easier way that writing Java code? We cannot compile the sample anyway as the Maven compiler keeps looking up the references files and errors with checksum validation failed. Thanks

    Read the article

  • File upload control - Select file is lossed when 2nd control is initiatied

    - by Barry
    Our problem/question revolves around an upload control that loses the selected file (goes blank) when a postback control is used (in this case, the dropdown list posts). Any insight into what we are doing wrong or how we can fix this? Below is our code and a summary of the problem. Any help would be greatly appreciated. Thank you! <asp:updatepanel id="UpdatePanel1" runat="server"> <ContentTemplate> <div class="row"> <asp:DropDownList runat="server" AutoPostBack="true" ID="CategorySelection" OnSelectedIndexChanged="CategorySelection_IndexChanged" CssClass="drop-down-list" /> </div> <div id="SubCategory" class="row" runat="server" visible="false"> <asp:DropDownList runat="server" ID="SubCategorySelection" CssClass="drop-down-list" /> </div> <div class="row"> <asp:FileUpload runat="server" ID="FileUpload" CssClass="file-upload" /> </div> <div class="row"> <asp:Button ID="submit" runat="server" Text="Submit" CssClass="button" OnClick="submit_ButtonClick" /> </div> </ContentTemplate> <Triggers> <asp:PostBackTrigger ControlID="submit" /> </Triggers> </asp:updatepanel> In this form we have 2 DropDownList, 1 FileUpload and 1 submit button. Every time that the user selects one category, the subcategories are loaded (AutoPostBack=”true”). The primary user flow works fine: User selects one category, subcategory and selects a file to be uploaded (submitted). HOWEVER, if the user selects a file first, and then selects a category, the screen will do a partial refresh and the selected file will disappear (field goes blank). As a result, the user needs to select the file again. This causes an issue because the fact that the file is no longer selected can easily be overlooked. Seems straighforward --- but causing us a lot of grief. Any experts out there that can help? BIG thanks!

    Read the article

  • PHP and MySQL search with extra counts along the way

    - by Barry Connolly
    I am building a PHP and MySQL search as so SELECT * FROM Properties WHERE Locaion = 'Liverpool' I want to count how many of each property type there are and display them at the side of the page to use as filters (like Rightmove.co.uk). This is what I am have come up with but can't get it to work SELECT *, count(PropertyType = 'house') AS HouesTotal, count(PropertyType = 'Apartment') AS ApartmentTotal FROM Properties WHERE Location = 'Liverpool' Can anyone help?

    Read the article

  • Python metaclass to run a class method automatically on derived class

    - by Barry Steyn
    I want to automatically run a class method defined in a base class on any derived class during the creation of the class. For instance: class Base(object): @classmethod def runme(): print "I am being run" def __metclass__(cls,parents,attributes): clsObj = type(cls,parents,attributes) clsObj.runme() return clsObj class Derived(Base): pass: What happens here is that when Base is created, ''runme()'' will fire. But nothing happens when Derived is created. The question is: How can I make ''runme()'' also fire when creating Derived. This is what I have thought so far: If I explicitly set Derived's metclass to Base's, it will work. But I don't want that to happen. I basically want Derived to use the Base's metaclass without me having to explicitly set it so.

    Read the article

  • How to ignore an exception and continue processing a foreach loop?

    - by Barry Dysert
    I have a test program that is supposed to loop over all the files under C:. It dies when it hits the "Documents and Settings" folder. I'd like to ignore the error and keep looping over the remaining files. The problem is that the exception is thrown in the foreach, so putting a try/catch around the foreach will cause the loop to exit. And putting a try/catch after the foreach never fires (because the exception is thrown in the foreach). Is there any way to ignore the exception and continue processing the loop? Here's the code: static void Main(string[] args) { IEnumerable<string> files = Directory.EnumerateFiles(@"C:\", "*.*", SearchOption.AllDirectories); foreach (string file in files) // Exception occurs when evaluating "file" Console.WriteLine(file); }

    Read the article

  • Name resolution for the name <name> timed out after none of the configured DNS servers responded.

    - by Paul Brown
    Installed Windows 7 (previously ran XP and Vista with no problems) a couple of weeks ago and I'm at least once a day getting the above error show up in the event logs and losing all internet connection. The only current way to resolve it is to reboot my cable modem. My ISP have been running diagnostics on it and tell me there is no problem whatsoever. I've configured my router (and PC on occasion) to point at OpenDNS - still occurs. I've had the PC directly connected to the modem - still occurs. If I can give more info that might of use please ask thanks Update: After moaning at my ISP for a couple of weeks (VirginMedia) they agreed to send me out a new cable modem ... and I've not had the issue since.

    Read the article

  • With Ubuntu Linux (10+), how do I connect to remote to my machine from Windows

    - by Berlin Brown
    I tried to to remote into my Ubuntu machine. I enabled the setting on Ubuntu and that side seems to work. But I get a connection time out when I use RealVNC on the Windows box. I believe it is a firewall issue. I disabled the firewall for that application on Windows but I don't know how to check if the firewall is enabled on the windows machine. I am on a local network with a router. Ideally, I would want to block that remote control port at the Internet level/router level but "enable" that port on the Windows box and the Ubuntu box. How do I check those settings.

    Read the article

  • Validating SSL clients using a list of authorised certificates instead of a Certificate Authority

    - by Gavin Brown
    Is it possible to configure Apache (or any other SSL-aware server) to only accept connections from clients presenting a certificate from a pre-defined list? These certificates may be signed by any CA (and may be self-signed). A while back I tried to get client certificate validation working in the EPP system of the domain registry I work for. The EPP protocol spec mandates use of "mutual strong client-server authentication". In practice, this means that both the client and the server must validate the certificate of the other peer in the session. We created a private certificate authority and asked registrars to submit CSRs, which we then signed. This seemed to us to be the simplest solution, but many of our registrars objected: they were used to obtaining a client certificate from a CA, and submitting that certificate to the registry. So we had to scrap the system. I have been trying to find a way of implementing this system in our server, which is based on the mod_epp module for Apache.

    Read the article

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