Search Results

Search found 1685 results on 68 pages for 'mr noob'.

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

  • Designing exceptions for conversion failures

    - by Mr.C64
    Suppose there are some methods to convert from "X" to "Y" and vice versa; the conversion may fail in some cases, and exceptions are used to signal conversion errors in those cases. Which would be the best option for defining exception classes in this context? A single XYConversionException class, with an attribute (e.g. an enum) specifying the direction of the conversion (e.g. ConversionFromXToY, ConversionFromYToX). A XYConversionException class, with two derived classes ConversionFromXToYException and ConversionFromYToXException. ConversionFromXToYException and ConversionFromYToXException classes without a common base class.

    Read the article

  • Referencing external javascript vs. hosting my own copy

    - by Mr. Jefferson
    Say I have a web app that uses jQuery. Is it better practice to host the necessary javascript files on my own servers along with my website files, or to reference them on jQuery's CDN (example: http://code.jquery.com/jquery-1.7.1.min.js)? I can see pros for both sides: If it's on my servers, that's one less external dependency; if jQuery went down or changed their hosting structure or something like that, then my app breaks. But I feel like that won't happen often; there must be lots of small-time sites doing this, and the jQuery team will want to avoid breaking them. If it's on my servers, that's one less external reference that someone could call a security issue If it's referenced externally, then I don't have to worry about the bandwidth to serve the files (though I know it's not that much). If it's referenced externally and I'm deploying this web site to lots of servers that need to have their own copies of all the files, then it's one less file I have to remember to copy/update.

    Read the article

  • Why do i keep forgetting things? [closed]

    - by Mr.Anubis
    I am currently learning many things at the same time in C++ and coded many data structures and algorithms and some small applications. When I suddenly try to remember something that I coded many months ago, my mind completely goes blank. It's like I'll have to re-learn the whole thing. For example, recently I was thinking to refactor my BST data structure, when I realized that I don't even remember how I coded it or how does it works internally. Does this happen with many others? Or is it me only? How do I overcome this problem?

    Read the article

  • What is the best method to start understanding BIG project source code? [closed]

    - by Mr.32
    Possible Duplicate: How do you dive into large code bases? Sometimes before developing new products we need to understand some existing products or existing source code. Sometimes to write another small module of that big project we need to understand that big source code. In our case we need to study and understand a project with lots of files and folders. What is the easiest and most comfortable way to do it ? (especially for C and C++ and under Linux)

    Read the article

  • Typewriter Sounds

    - by Mr. Typing Sounds
    Since I switched to Ubuntu 12.04 I'd only missed one thing. A program which could launch typewriter sounds while typing. For instance, in Windows I used this: http://www.colorpilot.com/soundpilot.html for a long time. I learned then that this writing program: http://gottcode.org/focuswriter/ had the sounds but only for the program itself. However, sometimes I'm writing an email, writing on the web or doing more complex writing tasks in LibreOffice - all places where these long missed typing sounds don't apply. Does any of you know of any plans in the community of the sound bit - typing sounds - as an independent program or applet to be fetched in the Ubuntu Software Center soon? The Rhythm Of Creative Writing would really be helped then! ;-)

    Read the article

  • Set up Trendnet TEW-638APB Access point on Ubuntu 14.04

    - by Mr. Smileys
    I have a computer running Ubuntu 14.04, it has 2 Ethernet ports. I would like to set up this computer so that the internet comes in on one of the ports and is then shared through the other port with the Trendnet wireless access point that my other devices would connect to and use the internet. I have looked online for information on setting this up but have not been able to find anything. If someone could point me to a guide that would help me or just tell me how to do this in an answer I would really appreciate it. please help me to solve this problem

    Read the article

  • Alternatives to type casting in your domain

    - by Mr Happy
    In my Domain I have an entity Activity which has a list of ITasks. Each implementation of this task has it's own properties beside the implementation of ITask itself. Now each operation of the Activity entity (e.g. Execute()) only needs to loop over this list and call an ITask method (e.g. ExecuteTask()). Where I'm having trouble is when a specific tasks' properties need to be updated. How do I get an instance of that task? The options I see are: Get the Activity by Id and cast the task I need. This'll either sprinkle my code with: Tasks.OfType<SpecificTask>().Single(t => t.Id == taskId) or Tasks.Single(t => t.Id == taskId) as SpecificTask Make each task unique in the whole system (make each task an entity), and create a new repository for each ITask implementation I don't like either option, the first because I don't like casting: I'm using NHibernate and I'm sure this'll come back and bite me when I start using Lazy Loading (NHibernate currently uses proxies to implement this). I don't like the second option because there are/will be dozens of different kind of tasks. Which would mean I'd have to create as many repositories. Am I missing a third option here? Or are any of my objections to the two options not justified? How have you solved this problem in the past?

    Read the article

  • How to make creating viewmodels at runtime less painfull

    - by Mr Happy
    I apologize for the long question, it reads a bit as a rant, but I promise it's not! I've summarized my question(s) below In the MVC world, things are straightforward. The Model has state, the View shows the Model, and the Controller does stuff to/with the Model (basically), a controller has no state. To do stuff the Controller has some dependencies on web services, repository, the lot. When you instantiate a controller you care about supplying those dependencies, nothing else. When you execute an action (method on Controller), you use those dependencies to retrieve or update the Model or calling some other domain service. If there's any context, say like some user wants to see the details of a particular item, you pass the Id of that item as parameter to the Action. Nowhere in the Controller is there any reference to any state. So far so good. Enter MVVM. I love WPF, I love data binding. I love frameworks that make data binding to ViewModels even easier (using Caliburn Micro a.t.m.). I feel things are less straightforward in this world though. Let's do the exercise again: the Model has state, the View shows the ViewModel, and the ViewModel does stuff to/with the Model (basically), a ViewModel does have state! (to clarify; maybe it delegates all the properties to one or more Models, but that means it must have a reference to the model one way or another, which is state in itself) To do stuff the ViewModel has some dependencies on web services, repository, the lot. When you instantiate a ViewModel you care about supplying those dependencies, but also the state. And this, ladies and gentlemen, annoys me to no end. Whenever you need to instantiate a ProductDetailsViewModel from the ProductSearchViewModel (from which you called the ProductSearchWebService which in turn returned IEnumerable<ProductDTO>, everybody still with me?), you can do one of these things: call new ProductDetailsViewModel(productDTO, _shoppingCartWebService /* dependcy */);, this is bad, imagine 3 more dependencies, this means the ProductSearchViewModel needs to take on those dependencies as well. Also changing the constructor is painfull. call _myInjectedProductDetailsViewModelFactory.Create().Initialize(productDTO);, the factory is just a Func, they are easily generated by most IoC frameworks. I think this is bad because Init methods are a leaky abstraction. You also can't use the readonly keyword for fields that are set in the Init method. I'm sure there are a few more reasons. call _myInjectedProductDetailsViewModelAbstractFactory.Create(productDTO); So... this is the pattern (abstract factory) that is usually recommended for this type of problem. I though it was genious since it satisfies my craving for static typing, until I actually started using it. The amount of boilerplate code is I think too much (you know, apart from the ridiculous variable names I get use). For each ViewModel that needs runtime parameters you'll get two extra files (factory interface and implementation), and you need to type the non-runtime dependencies like 4 extra times. And each time the dependencies change, you get to change it in the factory as well. It feels like I don't even use an DI container anymore. (I think Castle Windsor has some kind of solution for this [with it's own drawbacks, correct me if I'm wrong]). do something with anonymous types or dictionary. I like my static typing. So, yeah. Mixing state and behavior in this way creates a problem which don't exist at all in MVC. And I feel like there currently isn't a really adequate solution for this problem. Now I'd like to observe some things: People actually use MVVM. So they either don't care about all of the above, or they have some brilliant other solution. I haven't found an indepth example of MVVM with WPF. For example, the NDDD-sample project immensely helped me understand some DDD concepts. I'd really like it if someone could point me in the direction of something similar for MVVM/WPF. Maybe I'm doing MVVM all wrong and I should turn my design upside down. Maybe I shouldn't have this problem at all. Well I know other people have asked the same question so I think I'm not the only one. To summarize Am I correct to conclude that having the ViewModel being an integration point for both state and behavior is the reason for some difficulties with the MVVM pattern as a whole? Is using the abstract factory pattern the only/best way to instantiate a ViewModel in a statically typed way? Is there something like an in depth reference implementation available? Is having a lot of ViewModels with both state/behavior a design smell?

    Read the article

  • Is it viable to make a port from a C++ application to Java through LLVM

    - by Javier Mr
    how viable is it to port a C++ application to Java bytecode using LLVM (I guess LLJVM)? The thing is that we currently have a process written in C++ but a new client has made mandatory to been able to run the program in a multiplatform way, using the Java Virtual Machine with obviously no native code (no JNI). The idea is to be able to take the generated jar and copy then to different systems (Linux, Win, 32 bits - 64 bits) and it should just work. Looking around looks like it is possible to compile C++ to LLVM IR code and then that code to java bytecode. There is no need of the generated code to be readable. I have test a bit with similar things using emscripten, this takes C++ code and compile it to JavaScript. The result is valid JS but totally unreadable (looks like assambler). Does anybody done a port of an application from C++ to Java bytecode using this tecnique? What problems could we face? Is a valid approach for production code? Note: I am aware that currently we have some non standard C++ and close source libraries, we are looking to removing this non standard code and all close source libraries and use Free Libre Open Source Software, so lets suppose all code is standard C++ code with all code available at compile time. Note: It is not an option to write portable C++ code and then compile it to the desired target platform, the compiled program must be mltiplatform thus the use of JVM (right now we are not looking in similar solutions but Python or other language base, but i would also like to heard about it)

    Read the article

  • How to choose between using a Domain Event, or letting the application layer orchestrate everything

    - by Mr Happy
    I'm setting my first steps into domain driven design, bought the blue book and all, and I find myself seeing three ways to implement a certain solution. For the record: I'm not using CQRS or Event Sourcing. Let's say a user request comes into the application service layer. The business logic for that request is (for whatever reason) separated into a method on an entity, and a method on a domain service. How should I go about calling those methods? The options I have gathered so far are: Let the application service call both methods Use method injection/double dispatch to inject the domain service into the entity, letting the entity do it's thing and then let it call the method of the domain service (or the other way around, letting the domain service call the method on the entity) Raise a domain event in the entity method, a handler of which calls the domain service. (The kind of domain events I'm talking about are: http://www.udidahan.com/2009/06/14/domain-events-salvation/) I think these are all viable, but I'm unable to choose between them. I've been thinking about this a long time and I've come to a point where I no longer see the semantic differences between the three. Do you know of some guidelines when to use what?

    Read the article

  • Installer doesn't recognise windows 7 install

    - by SirWaffleRaptor
    I will start off saying I searched a bit for this problem with little success. You see, I am an utmost noob when it comes to Ubuntu and Linux based OS (hence why I want to install it and discover it) and the thread I found were too specific for me to do anything with. Therefore, if you find a thread that is noob-friendly and answers my question, please link it below or please try to answer as simply as possible :) The problem: I want to install Ubuntu 12.04 LTS 64 bit alongside Windows 7 on my main hard drive (to get the choice which one to start when booting). Pop the CD in, reboot and get to the installer screen. I know I'm supposed to have 3 options, but I'm only given the option to erase my hard drive or "do something else". Therefore, my question is: how do I make Ubuntu recognise Windows 7, so it may install alongside it?

    Read the article

  • Ruby install jcode

    - by sanpell
    I'm trying to get 'jcode' for ruby, but I type "gem install jcode" and it says nothing exists? Does anyone know why? I'm trying to manipulate UTF-8 encoded strings. Sorry for the noob questoin as I'm a ruby noob :o

    Read the article

  • stock management of assemblys and its sub parts

    - by The Disintegrator
    I have to track the stock of individual parts and kits (assembly) and can't find a satisfactory way of doing this. Sample bogus and hyper simplified database: Table prod: prodID 1 prodName Flux capacitor prodCost 900 prodPrice 1350 (900*1.5) prodStock 3 - prodID 2 prodName Mr Fusion prodCost 300 prodPrice 600 (300*2) prodStock 2 - prodID 3 prodName Time travel kit prodCost 1650 (1350+300) prodPrice 2145 (1650*1.3) prodStock 2 Table rels relID 1 relSrc 1 (Flux capacitor) relType 4 (is a subpart of) relDst 3 (Time travel kit) - relID 2 relSrc 2 (Mr Fusion) relType 4 (is a subpart of) relDst 3 (Time travel kit) prodPrice: it's calculated based on the cost but not in a linear way. In this example for costs of 500 or less, the markup is a 200%. For costs of 500-1000 the markup is 150%. For costs of 1000+ the markup is 130% That's why the time travel kit is much cheaper than the individual parts prodStock: here is my problem. I can sell kits or the individual parts, So the stock of the kits is virtual. The problem when I buy: Some providers sell me the Time Travel kit as a whole (with one barcode) and some sells me the individual parts (with a different barcode) So when I load the stock I don't know how to impute it. The problem when I sell: If I only sell kits, calculate the stock would be easy: "I have 3 Flux capacitors and 2 Mr Fusions, so I have 2 Time travel kits and a Flux Capacitor" But I can sell Kits or individual parts. I have to track the stock of the individual parts and the possible kits at the same time (and I have to compensate for the sell price) Probably this is really simple, but I can't see a simple solution. Resuming: I have to find a way of tracking the stock and the database/program is the one who has to do it (I cant ask the clerk to correct the stock) I'm using php+MySql. But this is more a logical problem than a programing one

    Read the article

  • Stock management of assemblies and its sub parts

    - by The Disintegrator
    I have to track the stock of individual parts and kits (assemblies) and can't find a satisfactory way of doing this. Sample bogus and hyper simplified database: Table prod: prodID 1 prodName Flux capacitor prodCost 900 prodPrice 1350 (900*1.5) prodStock 3 - prodID 2 prodName Mr Fusion prodCost 300 prodPrice 600 (300*2) prodStock 2 - prodID 3 prodName Time travel kit prodCost 1650 (1350+300) prodPrice 2145 (1650*1.3) prodStock 2 Table rels relID 1 relSrc 1 (Flux capacitor) relType 4 (is a subpart of) relDst 3 (Time travel kit) - relID 2 relSrc 2 (Mr Fusion) relType 4 (is a subpart of) relDst 3 (Time travel kit) prodPrice: it's calculated based on the cost but not in a linear way. In this example for costs of 500 or less, the markup is a 200%. For costs of 500-1000 the markup is 150%. For costs of 1000+ the markup is 130% That's why the time travel kit is much cheaper than the individual parts prodStock: here is my problem. I can sell kits or the individual parts, So the stock of the kits is virtual. The problem when I buy: Some providers sell me the Time Travel kit as a whole (with one barcode) and some sells me the individual parts (with a different barcode) So when I load the stock I don't know how to impute it. The problem when I sell: If I only sell kits, calculate the stock would be easy: "I have 3 Flux capacitors and 2 Mr Fusions, so I have 2 Time travel kits and a Flux Capacitor" But I can sell Kits or individual parts. So, I have to track the stock of the individual parts and the possible kits at the same time (and I have to compensate for the sell price) Probably this is really simple, but I can't see a simple solution. Resuming: I have to find a way of tracking the stock and the database/program is the one who has to do it (I cant ask the clerk to correct the stock) I'm using php+MySql. But this is more a logical problem than a programing one

    Read the article

  • A jscript variable in a Query

    - by lerac
    Maybe a very simple question. How can I put in this code <Query> <Where> <Eq> <FieldRef Name="Judge_x0020_1" /> <Value Type="Text">mr. R. Sanches</Value> </Eq> </Where> </script> </Query> A variable from jscript in the area of the code where mr. R. Sanches is written. So my jScript contains a dynamic text variable I want to replace mr. R. Sanches with. See where it says THE JAVESCRIPT VAR underneath here: <Query> <Where> <Eq> <FieldRef Name="Judge_x0020_1" /> <Value Type="Text">THE JAVASCRIPT VAR</Value> </Eq> </Where> </script> </Query>

    Read the article

  • Stock management of assemblies and its sub parts (relations)

    - by The Disintegrator
    I have to track the stock of individual parts and kits (assemblies) and can't find a satisfactory way of doing this. Sample bogus and hyper simplified database: Table prod: prodID 1 prodName Flux capacitor prodCost 900 prodPrice 1350 (900*1.5) prodStock 3 - prodID 2 prodName Mr Fusion prodCost 300 prodPrice 600 (300*2) prodStock 2 - prodID 3 prodName Time travel kit prodCost 1650 (1350+300) prodPrice 2145 (1650*1.3) prodStock 2 Table rels relID 1 relSrc 1 (Flux capacitor) relType 4 (is a subpart of) relDst 3 (Time travel kit) - relID 2 relSrc 2 (Mr Fusion) relType 4 (is a subpart of) relDst 3 (Time travel kit) prodPrice: it's calculated based on the cost but not in a linear way. In this example for costs of 500 or less, the markup is a 200%. For costs of 500-1000 the markup is 150%. For costs of 1000+ the markup is 130% That's why the time travel kit is much cheaper than the individual parts prodStock: here is my problem. I can sell kits or the individual parts, So the stock of the kits is virtual. The problem when I buy: Some providers sell me the Time Travel kit as a whole (with one barcode) and some sells me the individual parts (with a different barcode) So when I load the stock I don't know how to impute it. The problem when I sell: If I only sell kits, calculate the stock would be easy: "I have 3 Flux capacitors and 2 Mr Fusions, so I have 2 Time travel kits and a Flux Capacitor" But I can sell Kits or individual parts. So, I have to track the stock of the individual parts and the possible kits at the same time (and I have to compensate for the sell price) Probably this is really simple, but I can't see a simple solution. Resuming: I have to find a way of tracking the stock and the database/program is the one who has to do it (I cant ask the clerk to correct the stock) I'm using php+MySql. But this is more a logical problem than a programing one

    Read the article

  • How to identify ideas and concepts in a given text

    - by Nick
    I'm working on a project at the moment where it would be really useful to be able to detect when a certain topic/idea is mentioned in a body of text. For instance, if the text contained: Maybe if you tell me a little more about who Mr Balzac is, that would help. It would also be useful if I could have a description of his appearance, or even better a photograph? It'd be great to be able to detect that the person has asked for a photograph of Mr Balzac. I could take a really naïve approach and just look for the word "photo" or "photograph", but this would obviously be no good if they wrote something like: Please, never send me a photo of Mr Balzac. Does anyone know where to start with this? Is it even possible? I've looked into things like nltk, but I've yet to find an example of someone doing something similar and am still not entirely sure what this kind of analysis is called. Any help that can get me off the ground would be great. Thanks!

    Read the article

  • constructor function's object literal returns toString() method but no other method

    - by JohnMerlino
    I'm very confused with javascript methods defined in objects and the "this" keyword. In the below example, the toString() method is invoked when Mammal object instantiated: function Mammal(name){ this.name=name; this.toString = function(){ return '[Mammal "'+this.name+'"]'; } } var someAnimal = new Mammal('Mr. Biggles'); alert('someAnimal is '+someAnimal); Despite the fact that the toString() method is not invoked on the object someAnimal like this: alert('someAnimal is '+someAnimal.toString()); It still returns 'someAnimal is [Mammal "Mr. Biggles"]' . That doesn't make sense to me because the toString() function is not being called anywhere. Then to add even more confusion, if I change the toString() method to a method I make up such as random(): function Mammal(name){ this.name=name; this.random = function(){ return Math.floor(Math.random() * 15); } } var someAnimal = new Mammal('Mr. Biggles'); alert(someAnimal); It completely ignores the random method (despite the fact that it is defined the same way was the toString() method was) and returns: [object object] Another issue I'm having trouble understanding with inheritance is the value of "this". For example, in the below example function person(w,h){ width.width = w; width.height = h; } function man(w,h,s) { person.call(this, w, h); this.sex = s; } "this" keyword is being send to the person object clearly. However, does "this" refer to the subclass (man) or the super class (person) when the person object receives it? Thanks for clearing up any of the confusion I have with inheritance and object literals in javascript.

    Read the article

  • A good machine learning technique to weed out good URLs from bad

    - by git-noob
    Hi, I have an application that needs to discriminate between good HTTP GET requests and bad. For example: http://somesite.com?passes=dodgy+parameter # BAD http://anothersite.com?passes=a+good+parameter # GOOD My system can make a binary decision about whether or not a URL is good or bad - but ideally I would like it to predict whether or not a previously unseen URL is good or bad. http://some-new-site.com?passes=a+really+dodgy+parameter # BAD I feel the need for a support vector machine (SVM) ... but I need to learn machine learning. Some questions: 1) Is an SVM appropriate for this task? 2) Can I train it with the raw URLs? - without explicitly specifying 'features' 3) How many URLs will I need for it to be good at predictions? 4) What kind of SVM kernel should I use? 5) After I train it, how do I keep it up to date? 6) How do I test unseen URLs again the SVM to decide whether it's good or bad? I

    Read the article

  • Asp.Net MVC 2 - Iterate Through Form Values In Model Binder

    - by Noob
    I have a list of items in my form which are named like this... <input type="text" id="ListItem1"> <input type="text" id="ListItem2"> <input type="text" id="ListItem3"> I want to create a custom model binder which converts these in to model with this structure... public class MyModel { public IEnumerable<MyModelItem> Items {get; set;} } public class MyModelItem { public int Id { get; set; } public string Value { get; set; } } So each ListItem should be converted to a MyModelItem with id equal to the number at the end of the input id and value set to the value on the input field. In ASP.Net MVC 1.0 I could iterate over the bindingContext.ValueProvider.Keys collection and check for key.StartsWith("ListItem") to find all input items in this format. The new IValueProvider interface in ASP.Net MVC 2 does not have a keys collection and I cannot iterate over that interface. How can I access these values which I only know the prefix for at design time in ASP.Net MVC 2?

    Read the article

  • Date prompt in BO

    - by Noob
    I have a webi report that accepts a date input. I need to receive data from the user in the format "dd-Mmm-YYYY"; however the calendar control that BO presents to the user for date selection is always shown in M/DD/YYYY HH:MM:SS AM/PM. Is there any way to control this behaviour?

    Read the article

  • Executing javascript during redirect without changing original referrer

    - by git-noob
    I need to test whether or not a click-through is valid by using some javascript client-side tests (e.g., browser window dimensions). However, I would like the original click referrer to remain the same. Is there a way I can do a redirect, execute some javascript, capture the browser details and then continue the click-through while keeping the original referrer value the same?

    Read the article

  • C++ stringstream, string, and char* conversion confusion

    - by Graphics Noob
    My question can be boiled down to, where does the string returned from stringstream.str().c_str() live in memory, and why can't it be assigned to a const char*? This code example will explain it better than I can #include <string> #include <sstream> #include <iostream> using namespace std; int main() { stringstream ss("this is a string\n"); string str(ss.str()); const char* cstr1 = str.c_str(); const char* cstr2 = ss.str().c_str(); cout << cstr1 // Prints correctly << cstr2; // ERROR, prints out garbage system("PAUSE"); return 0; } The assumption that stringstream.str().c_str() could be assigned to a const char* led to a bug that took me a while to track down. For bonus points, can anyone explain why replacing the cout statement with cout << cstr // Prints correctly << ss.str().c_str() // Prints correctly << cstr2; // Prints correctly (???) prints the strings correctly? I'm compiling in Visual Studio 2008.

    Read the article

  • SPWeb.Webs, Site vs SubSite

    - by noob.spt
    Hi, I have a very basic question here. I am confused between SPSite. SiteCollection and SPWeb. So my understanding is (or what I could research on this) that, http://My_server TOP Level SIte or SPWEbApplication http://My_server/My_site Site Collection or SPSite Now a site under SPSite that will be referenced through SPWeb. So what are we getting when using SPWeb.Webs. What is a Subsite? Please let me know if I need to rephrase the question or more info is needed. Thanks. SPWeb mySite = SPContext.Current.Web; SPWebCollection sites = mySite.Webs; foreach (SPWeb subSite in sites) { Response.Write(SPEncode.HtmlEncode(subSite.Title) + "<BR>"); }

    Read the article

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