Search Results

Search found 23435 results on 938 pages for 'i give terrible advice'.

Page 34/938 | < Previous Page | 30 31 32 33 34 35 36 37 38 39 40 41  | Next Page >

  • Advice on a simple Windows Form

    - by Austin Hyde
    I have a VERY simple windows form that the user uses to manage "Stores". Each store has a name and number, and is kept in a corresponding DB table. The form has a listbox of stores, an add button that creates a new store, a delete button, and an edit button. Beside those I have text boxes for the name and number, and save/cancel buttons. When the user chooses a store from the list box, and clicks 'edit', the textboxes become populated and save/cancel become active. When the user clicks 'add', I create a new Store, add it to the listbox, activate the textboxes and save/cancel buttons, then commit it to the database when the user clicks 'save', or discards it when the user clicks 'cancel'. Right now, my event system looks like this (in psuedo-code. It's just shorter that way.) add->click: store = new Store() listbox.add(store) populateAndEdit(store) delete->click: store = listbox.selectedItem db.deleteOnSubmit(store) listbox.remove(store) db.submit() edit->click: populateAndEdit(listbox.selectedItem) save->click: parseAndSave(listbox.selectedItem) db.submit() disableTexts() cancel->click: disableTexts() The problem is in how I determine if we are inserting a new Store, or updating an existing one. The obvious solution to me would be to make it a "modal" process - that is, when I click edit, I go into edit mode, and the save button does things differently than if I were in add mode. I know I could make this more MVC-like, but I don't really think this simple form merits the added complexity. I'm not very experienced with winforms, so I'm not sure if I even have the right idea for how to tackle this. Is there a better way to do this? I would like to keep it simple, but usable.

    Read the article

  • Correct way to give users access to additional schemas in Oracle

    - by Jacob
    I have two users Bob and Alice in Oracle, both created by running the following commands as sysdba from sqlplus: create user $blah identified by $password; grant resource, connect, create view to $blah; I want Bob to have complete access to Alice's schema (that is, all tables), but I'm not sure what grant to run, and whether to run it as sysdba or as Alice. Happy to hear about any good pointers to reference material as well -- don't seem to be able to get a good answer to this from either the Internet or "Oracle Database 10g The Complete Reference", which is sitting on my desk.

    Read the article

  • DOM: how to import nodes and give them different namespace prefix

    - by thomasrutter
    I'm familiar with the DOMDocument::importNode method for importing a tree of nodes from some other document element. However, what I was wondering is if I can automatically change the namespace prefix on a tree of nodes as I import them, that is, specify a new prefix for all nodes of that namespace. Say the nodes, in their existing document, all have names like "name", "identity", and so on. When importing them into my new document they will be alongside other namespaces, so I'd like them to appear as "nicnames:name", "nicnames:identity" and so on. I'd like to be able to change this prefix programmatically so that in another context I may be able to import them as, for instance, "myprefix:name", "myprefix:identity" depending on the document they're imported into. Can anyone help me understand how to do this? Thanks

    Read the article

  • PHP Looping....need some advice

    - by Homer_J
    Hi all, I have the following code: $q1 = $_POST["q1"]; $q2 = $_POST["q2"]; $q3 = $_POST["q3"]; $q4 = $_POST["q4"]; $q5 = $_POST["q5"]; $q6 = $_POST["q6"]; $q7 = $_POST["q7"]; $q8 = $_POST["q8"]; At the moment, this is hard coded and I need to manually change it each time, I'd like to use variables instead so that it's not a manual process. Is it a case of using a loop, while or foreach? If I had the the information $q and q in an array would that help? Thanks, Homer.

    Read the article

  • PHP 'smart' search engine to search Mysql tables advice

    - by Anonymous12345
    I am creating a search engine for my php based website. I need to search a mysql table. Thing is, the search engine must be pretty 'smart', so that users can easily find their items (it's a classifieds website). I have currently set up a FULLTEXT search with this piece of code: MATCH (headline) AGAINST ($querystring) But this isn't enough... For instance, lets say the field headline contains something like Bmw 330ci. If I search for 330, I wont get any results. The ending ('ci') is just one of many endings in car models which must be taken into account when searching the table. Or what if the headline field is bmw330? Also no results, because it only matches full words. Or also, what if the headline is bmw 330, and I search for bmw 520, still with FULLTEXT I will get the bmw 330 as a result, even though I searched for bmw 520... Not good! How should I solve this problem?

    Read the article

  • Need Language/Career Path Advice

    - by Cain
    I am interested in getting a few Microsoft Certs and I am currently facing the option for .NET Framework app development language. My choices are C++, C#, and Visual Basic. I have some experience with Java and Visual Basic .NET but I honestly would like to know what the best would be for developing stand-alone applications in a workstation (local) environment. This is for my career and honestly, 90% of the developers are all experienced in the above three languages and I wanted to improve my chances of staying employed by learning/certifying myself on my own time.

    Read the article

  • Is it possible to give a python dict an initial capacity (and is it usefull)

    - by Peter Smit
    I am filling a python dict with around 10,000,000 items. My understanding of dict (or hashtables) is that when too much elements get in them, the need to resize, an operation that cost quite some time. Is there a way to say to a python dict that you will be storing at least n items in it, so that it can allocate memory from the start? Or will this optimization not do any good to my running speed? (And no, I have not checked that the slowness of my small script is because of this, I actually wouldn't now how to do that. This is however something I would do in Java, set the initial capacity of the HashSet right)

    Read the article

  • How to give a timeout to an FTP connection

    - by dierre
    The story behind: Old script written in ruby 1.8.6 that opens a connection to a ftp and download a configuration file. For a specific client with a windows ftp server the script just hangs. The log stops writing after it opens the connection to the ftp. It's an old script, it's in ruby and I'm not an expert on it. What I tried: So I tried this implementation of a timeout to check if an ftp connection hangs out with this code Timeout::timeout(5) { ftp = Net::FTP.new(host,pass,host) } The problem is that this isn't working. My guess is that the interpreter stops on opening the connection and the timeout doesn't kill the connection because the interpreter is stuck. Is it possible that that's the problem? Could you tell me if there is maybe an alternative solution or if I'm doing something wrong?

    Read the article

  • Give More Prominence To DIV or <P> That Is After Floating DIV

    - by Aahan Krish
    Consider this HTML: <div id="entry-content"> <div id="my-300px-ad">AD CODE HERE</div> <p><img src="file.jpg" alt="file" /></p> <p>SOME TEXT</p> <p>SOME MORE TEXT</p> </div> Now, consider that the div#my-300px-ad is floating right. Would it be possible for me to have the image in the next paragraph show up before the ad so that the TEXT in its following paragraphs can wrap around the ad? For example, like this: Why so...? The thing is, due to various reasons (including Google) I want to avoid placing an ad in BETWEEN the post's content. CSS only I am sure that something like this would be possible with some JavaScript code. But I am looking for a CSS-based solution only. (Cross-browser compatibility, = IE8) Please note that ONLY the CSS of div#my-300px-ad can be changed. Nothing else should be touched as this is not a static HTML page, besides they are articles. PS: It was hard to frame a one-line question for this. Please feel free to edit the question's title if it can be made more clear.

    Read the article

  • Give app.config another name after build?

    - by AndyC
    As you all know, when you build a project with an app.config file it gets copied to the bin directory and renamed $(targetFileName).config. Is it possible for it to be called something else? For example if my executable is called myApplication.exe, can I have the config file called settings.config as opposed to myApplication.exe.config? Cheers

    Read the article

  • Complex SQL design, help/advice needed

    - by eugeneK
    Hi, i have few questions for SQL gurus in here ... Briefly this is ads management system where user can define campaigns for different countries, categories, languages. I have few questions in mind so help me with what you can. Generally i'm using ASP.NET and i want to cache all result set of certain user once he asks for statistics for the first time, this way i will avoid large round-trips to server. any help is welcomed Click here for diagram with all details you need for my questions 1.Main issue of this application is to show to the user how many clicks/impressions were and how much money he spent on campaign. What is the easiest way to get this information for him? I will also include filtering by date, date ranges and few other params in this statistics table. 2.Other issue is what happens when user will try to edit campaign. Old campaign will die this means if user set 0.01$ as campaignPPU (pay-per-unit) and next day updates it to 0.05$ all will be reset to 0.05$. 3.If you could re-design some parts of table design so it would be more flexible and easier to modify, how would you do it? Thanks... sorry for so large job but it may interest some SQL guys in here

    Read the article

  • Dynamic editor upload into web page. Need advice

    - by Andrew Florko
    Hello everybody, I am writing intranet site for tracking employees science activities in organization. There lots of editable information on each personal page (science degree, publications & so on) so I upload editor per request (user clicks "edit" and modal dialog with html editor: set of textboxes/comboboxes/autocomplete features & validation logic appears). Editor is html layout that is wrapped with jquery dialog plugin + some logic, written as javascript functions that should be invoked from the callee page (onsubmit, validate, afterLoad editor events). There are also attributes (editor preferrable with and height) that are passed to callee page also. Currently I send these functions & attribute as ... function onsubmit() { }; function validate() { } var width = 640; var height = 800 ... code that is embedded into the request page. Function calls and editor markup wrap with jquery plugin completed in the callee page. It works, but I have some try { call editor event handler } catch { } stuff in callee page (because not every editor provides these functions) and some attributes (editor width & height for instance) that are loaded as variables declared in javascript. Please, suggest, is there a better approach to build & use custom editors for my situation. Thank you in advance!

    Read the article

  • please give me a solution

    - by user327832
    here is the code i have written so far but ended up giving me error import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; public class Main { public static void main(String[] args) throws Exception { File file = new File("c:\\filea.txt"); InputStream is = new FileInputStream(file); long length = file.length(); System.out.println (length); bytes[] bytes = new bytes[(int) length]; try { int offset = 0; int numRead = 0; while (numRead >= 0) { numRead = is.read(bytes); } } catch (IOException e) { System.out.println ("Could not completely read file " + file.getName()); } is.close(); Object[] see = new Object[(int) length]; see[1] = bytes; System.out.println ((String[])see[1]); } }

    Read the article

  • Advice on Mocking System Calls

    - by Robert S. Barnes
    I have a class which calls getaddrinfo for DNS look ups. During testing I want to simulate various error conditions involving this system call. What's the recommended method for mocking system calls like this? I'm using Boost.Test for my unit testing.

    Read the article

  • Can phper give me some code snippet to consume the .net wcf service

    - by Vincent
    Hi, I can successfully make a call to wcf from php without WCF message security enabled. I search the whole forum and cannot find any clue. I'd like to know how can I pass the credential ? My WCF service use the basichttpbinding on SSL with Message security enabled. Here is my code snippet to call my wcf from .NET ServiceReference1.TestClient sc = new TestClient(); sc.ClientCredentials.UserName.UserName = "[email protected]"; sc.ClientCredentials.UserName.Password = "ABC123"; Console.WriteLine(sc.GetProfiledSchemas(412));

    Read the article

  • Request for advice about class design, inheritance/aggregation

    - by Lasse V. Karlsen
    I have started writing my own WebDAV server class in .NET, and the first class I'm starting with is a WebDAVListener class, modelled after how the HttpListener class works. Since I don't want to reimplement the core http protocol handling, I will use HttpListener for all its worth, and thus I have a question. What would the suggested way be to handle this: Implement all the methods and properties found inside HttpListener, just changing the class types where it matters (ie. the GetContext + EndGetContext methods would return a different class for WebDAV contexts), and storing and using a HttpListener object internally Construct WebDAVListener by passing it a HttpListener class to use? Create a wrapper for HttpListener with an interface, and constrct WebDAVListener by passing it an object implementing this interface? If going the route of passing a HttpListener (disguised or otherwise) to the WebDAVListener, would you expose the underlying listener object through a property, or would you expect the program that used the class to keep a reference to the underlying HttpListener? Also, in this case, would you expose some of the methods of HttpListener through the WebDAVListener, like Start and Stop, or would you again expect the program that used it to keep the HttpListener reference around for all those things? My initial reaction tells me that I want a combination. For one thing, I would like my WebDAVListener class to look like a complete implementation, hiding the fact that there is a HttpListener object beneath it. On the other hand, I would like to build unit-tests without actually spinning up a networked server, so some kind of mocking ability would be nice to have as well, which suggests I would like the interface-wrapper way. One way I could solve this would be this: public WebDAVListener() : WebDAVListener(new HttpListenerWrapper()) { } public WebDAVListener(IHttpListenerWrapper listener) { } And then I would implement all the methods of HttpListener (at least all those that makes sense) in my own class, by mostly just chaining the call to the underlying HttpListener object. What do you think? Final question: If I go the way of the interface, assuming the interface maps 1-to-1 onto the HttpListener class, and written just to add support for mocking, is such an interface called a wrapper or an adapter?

    Read the article

  • Lightcore IoC is returning the same instance when it should give a new one

    - by Anthony
    I have the following code using the lightcore IoC container. But it fails with "NUnit.Framework.AssertionException: Contained objects are equal" which indicates that the objects that should be transient, are not. Is this a bug in lightcore, or am I doing it wrong? [Test] public void JellybeanDispenserHasNewInstanceEachTimeWithDefault() { var builder = new ContainerBuilder(); builder.Register<IJellybeanDispenser, VanillaJellybeanDispenser>(); builder.Register<SweetVendingMachine>().ControlledBy<TransientLifecycle>(); builder.Register<SweetShop>(); builder.DefaultControlledBy<TransientLifecycle>(); IContainer container = builder.Build(); SweetShop sweetShop = container.Resolve<SweetShop>(); SweetShop sweetShop2 = container.Resolve<SweetShop>(); Assert.IsFalse(ReferenceEquals(sweetShop, sweetShop2), "Root objects are equal"); Assert.IsFalse(ReferenceEquals(sweetShop.SweetVendingMachine, sweetShop2.SweetVendingMachine), "Contained objects are equal"); Assert.IsFalse(ReferenceEquals(sweetShop.SweetVendingMachine.JellybeanDispenser, sweetShop2.SweetVendingMachine.JellybeanDispenser), "services are equal"); } PS: I would tag this question with "lightcore", but suddenly my reputation isn't good enough to make a new tag. Huh.

    Read the article

  • C# ToDictionary can valueSelector give null?

    - by Trimack
    Hi, I want to make a dictionary out of list in a way, that the list becomes keys and values would be empty. I have following code Dictionary<XmlTest, int?> testBattery = new XmlTests().GetRandomTestBattery(id). ToDictionary(k => k, v => null); But I am getting the error "Cannot convert lambda expression to type System.Collections.Generic.IEqualityComparer' because it is not a delegate type" Any ideas how could I fix it? (I know I could iterate through and fill the dict one element at a time, but I simply want to use something more elegant)

    Read the article

  • Need an advice for unit testing using mock object

    - by Andree
    Hi there, I just recently read about "Mocking objects" for unit testing and currently I'm having a difficulties implementing this approach in my application. Please let me explain my problem. I have a User model class, which is dependent on 2 data sources (database and facebook web service). The controller class simply use this User model as an interface to access data and it doesn't care about where the data came from. Currently I never done any unit test to this User model because it is dependent on an external web service. But just a while ago, I read about object mocking and now I know that it is a common approach to unit test a class that depends on external resources (like in my case). Now I want to create a unit test for the User model, but then I encountered a design issue: In order for the User model to use a mocked Facebook SDK, I have to inject this mocked Facebook SDK to the User object (probably using a setter). Therefore I can't construct the Facebook SDK inside the User object. I have to construct it outside the User object, and inject the SDK into the User object. The real client of my User model is the application's controller. Therefore I have to construct the Facebook SDK inside the controller and inject it to the user object. Well, this is a problem because I want my controller to be as clean as possible. I want my controller to be ignorant about the application's data source. I'm not good at explaining something systematically, so you'll probably sleeping before reading this last paragraph. But anyway, I want to ask if anyone here ever encountered the same problem as mine? How do you solve this problem? Regards, Andree

    Read the article

< Previous Page | 30 31 32 33 34 35 36 37 38 39 40 41  | Next Page >