Search Results

Search found 30014 results on 1201 pages for 'go yourself'.

Page 42/1201 | < Previous Page | 38 39 40 41 42 43 44 45 46 47 48 49  | Next Page >

  • Is a Multi-DAL Approach the way to go here?

    - by Krisc
    Working on the data access / model layer in this little MVC2 project and trying to think things out to future projects. I have a database with some basic tables and I have classes in the model layer that represent them. I obviously need something to connect the two. The easiest is to provide some sort of 'provider' that can run operations on the database and return objects. But this is for a website that would potentially be used "a lot" (I know, very general) so I want to cache results from the data layer and keep the cache updated as new data is generated. This question deals with how best to approach this problem of dual DALS. One that returns cached data when possible and goes to the data layer when there is a cache miss. But more importantly, how to integrate the core provider (thing that goes into database) with the caching layer so that it too can rely on cached objects rather than creating new ones. Right now I have the following interfaces: IDataProvider is used to reach the database. It doesn't concern itself with the meaning of the objects it produces, but simply the way to produce them. interface IDataProvider{ // Select, Update, Create, et cetera access IEnumerable<Entry> GetEntries(); Entry GetEntryById(int id); } IDataManager is a layer that sits on top of the IDataProvider layer and manages the cache interface IDataManager : IDataProvider{ void ClearCache(); } Note that in practice the IDataManager implementation will have useful helper functions to add objects to their related cache stores. (In the future I may define other functions on the interface) I guess what I am looking for is the best way to approach a loop back from the IDataProvider implementations so that they can access the cache. Or a different approach entirely may be in order? I am not very interested in 3rd party products at the moment as I am interested in the design of these things much more than this specific implementation. Edit: I realize the title may be a bit misleading. I apologize for that... not sure what to call this question.

    Read the article

  • htaccess mod rewrite files to go through php first?

    - by jiexi
    I have a directory full of files. Originally people were allowed to direct link to these files. Now i would like to run all files through a php file first. Could someone help me with the .htaccess needed to do that? The phpfile used to handle the downloads will be called download.php and it will have a get variable called $ref So i need noob.com/games.zip to goto noob.com/download.php?ref=games.zip BUT still retaining the url of noob.com/games.zip Thanks!

    Read the article

  • Is there a way to find a specific file and then change into the directory containing it in one go?

    - by bergyman
    I'm looking for a way to find what I know will be a unique file, and then change into the directory containing that file. Something along the lines of: find . -name 'Subscription.java' | xargs cd Or: find . -name 'Subscription.java' -exec cd {} \; I know this won't work because it's both trying to cd supplying the entire absolute path, which contains the file, and also because xargs can't do any built in shell commands...but you get the point of what I want to accomplish.

    Read the article

  • How would I go about letting a user add and associate a comma separated list of categories while add

    - by Throlkim
    I've been struggling for quite a while to get this feature working: I want my user to be able to select categories when uploading a photograph, but additionally be able to specify a comma-separated list of categories to create/find and associate with the photograph. I've had this working by using an attr_accessor :new_categories on the photographs model, but having that there without the column existing breaks both Paperclip and Exifr. Obviously, image upload and EXIF data retrieval are pretty important for a photography website, but not being able to add categories while uploading a photograph is a pain in the arse. Methods I've tried so far: Using attr_accessor to add a field for new_categories. Breaks gems. Using an Ajax sub-form to add categories. Formtastic can't handle it. Adding a column for new_categories to the photograph model. It works, but it's horrific. I haven't tried using a nested form, but I'd need to intercept it and stop it from processing it as normal. Here's an example of what I'm trying to accomplish: http://imgur.com/rD0PC.png And the function I use to associate the categories: def process_new_categories unless self.new_categories.nil? for title in self.new_categories.split(",") self.categories << Category.find_or_create_by_title(title.strip.capitalize) end end end Has anyone got any ideas as to how to do this?

    Read the article

  • Who plans to go back to using Web Applications in ASP.NET 4.0?

    - by Banzor
    So, it looks like Microsoft has gone back to pushing Web Application Projects* in ASP.NET 4.0. If you are like me, you converted to Website Projects in 2.0 and have never looked back. I recently spent some time trying to convert a Website Project to Web Application Project and was surprised at how tedious it was. So I am wondering what everyone is planning to do in VS 2010? Also, feel free to mention what you use now. Maybe I am the only sucker that converted to using Website Projects in 2.0... *Excluding MVC since it is the only option there

    Read the article

  • How can I force the text go to the button of the panel?

    - by Roman
    At the moment I have the following code which works fine. label = new JLabel(panelLabel,SwingConstants.CENTER); outputPanel.add(label,BorderLayout.CENTER); I get the text in the center of the panel (in terms of the left-right position as well as in terms of the top-bottom). Now I want to set the position to the bottom (and center in terms of "left-right"). I tried to use SOUTH instead of the CENTER in the first line. Compiler does not complains but during the execution i get IllegalArgumentException: HorizontalAlignment. What is that?

    Read the article

  • How to make windows media player go to previous song in playlist?

    - by SadSido
    Hi, everyone! I am writing a simple Windows app in c++, that will be able to send commands to windows media player. My problem is that I want my app to move to the previous song in the playlist. IWMPControls::previous() seems to do the job, but its behavior differs from what is written in msdn. In fact this function rewinds current media to the beginning and then (if current position is less than 2-3 seconds) it switches to the previous song. I would like to implement two different buttons (please, don't ask me why :)) - one for rewinding to the beginning, and one - to moving to previous song. Is there any easy way to do this through IWMPControls (or any other WMP-related COM interface)? p.s. I could handle this if I could get the position (index) of the current song in the list. But as far as I read MSDN, it seems to me that there is no easy way to get the current item index from playlist...

    Read the article

  • Should try...catch go inside or outside a loop?

    - by mmyers
    I have a loop that looks something like this: for(int i = 0; i < max; i++) { String myString = ...; float myNum = Float.parseFloat(myString); myFloats[i] = myNum; } This is the main content of a method whose sole purpose is to return the array of floats. I want this method to return null if there is an error, so I put the loop inside a try...catch block, like this: try { for(int i = 0; i < max; i++) { String myString = ...; float myNum = Float.parseFloat(myString); myFloats[i] = myNum; } } catch (NumberFormatException ex) { return null; } But then I also thought of putting the try...catch block inside the loop, like this: for(int i = 0; i < max; i++) { String myString = ...; try { float myNum = Float.parseFloat(myString); } catch (NumberFormatException ex) { return null; } myFloats[i] = myNum; } So my question is: is there any reason, performance or otherwise, to prefer one over the other? EDIT: The consensus seems to be that it is cleaner to put the loop inside the try/catch, possibly inside its own method. However, there is still debate on which is faster. Can someone test this and come back with a unified answer? (EDIT: did it myself, but voted up Jeffrey and Ray's answers)

    Read the article

  • How do software projects go over budget and under-deliver?

    - by Carlos
    I've come across this story quite a few times here in the UK: NHS Computer System Summary: We're spunking £12 Billion on some health software with barely anything working. I was sitting the office discussing this with my colleagues, and we had a little think about. From what I can see, all the NHS needs is a database + middle tier of drugs/hospitals/patients/prescriptions objects, and various GUIs for doctors and nurses to look at. You'd also need to think about security and scalability. And you'd need to sit around a hospital/pharmacy/GPs office for a bit to figure out what they need. But, all told, I'd say I could knock together something with that kind of structure in a couple of days, and maybe throw in a month or two to make it work in scale. If I had a few million quid, I could probably hire some really excellent designers to make a maintainable codebase, and also buy appropriate hardware to run the system on. I hate to trivialize something that seems to have caused to much trouble, but to me it looks like just a big distributed CRUD + UI system. So how on earth did this project bloat to £12B without producing much useful software? As I don't think the software sounds so complicated, I can only imagine that something about how it was organised caused this mess. Is it outsourcing that's the problem? Is it not getting the software designers to understand the medical business that caused it? What are your experiences with projects gone over budget, under delivered? What are best practices for large projects? Have you ever worked on such a project?

    Read the article

  • Where should common static resources (images, js, css, etc) go in DotNetNuke?

    - by Joosh21
    Is there a recommended location to store static resources (images, css, js, etc) in a DotNetNuke 5.x installation? There are /images and /js folders as well as a /Resources folder that contains resources. There appears to be some overlap as MicrosoftAjax.js is in multiple locations (but might be different versions?). I also could put resources in a /DesktopModule/ModuleX location. Does anyone know if there is a difference in using any of these folders? I kinda like the idea of all static resources being under a common folder (/Resources) so I could set caching rule headers, permissions, etc on them in one place. Has anyone used a separate image server to serve DotNetNuke static content? http://stackoverflow.com/questions/913208/pros-and-cons-of-a-separate-image-server-e-g-images-mydomain-com

    Read the article

  • How does one go about writing a virtual MIDI interface?

    - by Alex
    I want to do some funky things with controlling MIDI streams, and I'd like to be able to pipe MIDI input into an application like Ableton or Reason. Presumably this involves some sort of driver level work? Ultimately I'd like to write my application in Python, so if there is some Python-based solution, I'd consider it. I'm perfectly fine with using C/C++, though, so that's not a problem.

    Read the article

  • Should I bother with C++ or go straight to C#?

    - by Pat Riley
    I have been writing embedded C applications for almost 20 years. In the last few years I have written quite a few PC based GUI interfaces in Visual C so I could interface my embedded systems to a PC. Although my primary work will still be in deeply embedded C, I have finally decided to move my PC based tools into Ruby - (for quick scripting type stuff) and C++ or C# for GUI based interfaces and applications. Should I bother with C++ or just move straight to C#?

    Read the article

  • Where does the data model go in a Prism app?

    - by HawkeyeJoeS
    I'm having trouble where to put our data model in our Prism app. Most, if not all or our data will be coming from web services and the web services are unique for each module. Unfortunately, there will be objects that need to be shared (such as a person/user object). I'm really torn about whether to add these services directly to the module, so that each is truly independent, or create a separate project to house the web service proxies and business entities. The modules are being built by different teams, but will all live in the same solution (and source control, of course).

    Read the article

  • Are WCF Services encrypted automatically if they go over SSL?

    - by michael
    Basically, if I have a plain WCF Service over HTTPS is it automatically secure? [ServiceContract] public interface ICalc { [OperationContract] int add(int a, int b); } public class Calculator : ICalc { public int add(int a, int b) { return a + b; } } I figure the actual SOAP message isn't encrypted here, but is it still secure if I use https? Basically, if I use a basichttpbinding with no security settings in my config over https://www.myserver.com/services/Calc.svc is that secure?

    Read the article

  • How do I go about link web content in a database with a nested set model?

    - by wb
    My nested set table is as follows. create table depts ( id int identity(0, 1) primary key , lft int , rgt int , name nvarchar(60) , abbrv nvarchar(20) ); Test departments. insert into depts (lft, rgt, name, abbrv) values (1, 14, 'root', 'r'); insert into depts (lft, rgt, name, abbrv) values (2, 3, 'department 1', 'd1'); insert into depts (lft, rgt, name, abbrv) values (4, 5, 'department 2', 'd2'); insert into depts (lft, rgt, name, abbrv) values (6, 13, 'department 3', 'd3'); insert into depts (lft, rgt, name, abbrv) values (7, 8, 'sub department 3.1', 'd3.1'); insert into depts (lft, rgt, name, abbrv) values (9, 12, 'sub department 3.2', 'd3.2'); insert into depts (lft, rgt, name, abbrv) values (10, 11, 'sub sub department 3.2.1', 'd3.2.1'); My web content table is as follows. create table content ( id int identity(0, 1) , dept_id int , page_name nvarchar(60) , content ntext ); Test content. insert into content (dept_id, page_name, content) values (3, 'index', '<h2>welcome to department 3!</h2>'); insert into content (dept_id, page_name, content) values (4, 'index', '<h2>welcome to department 3.1!</h2>'); insert into content (dept_id, page_name, content) values (6, 'index', '<h2>welcome to department 3.2.1!</h2>'); insert into content (dept_id, page_name, content) values (2, 'what-doing', '<h2>what is department 2 doing?/h2>'); I'm trying to query the correct page content (from the content table) based on the url given. I can easily accomplish this task with a root department. However, querying a department with multiple depths is proving to be a little harder. For example: http://localhost/departments.asp?d3/ (Should return <h2>welcome to department 3!</h2>) http://localhost/departments.asp?d2/what-doing (Should return <h2>what is department 2 doing?</h2>) I'm not sure if this can be create in one query or if there will need to be a recursive function of some sort. Also, if there is nothing after the last / then assume we want the index page. How can this be accomplished? Thank you.

    Read the article

  • How to go about signing text in a verifiable way from within ruby in a simple yet strong & portable

    - by roja
    Guys, I have been looking for a portable method to digitally sign arbitrary text which can be placed in a document and distributed while maintaining its verifiable origin. Here is an example: a = 'some text' a.sign(<private key>) # => <some signature in ASCII format> The contents of a can now be distributed freely. If a receiver wants to check the validity of said text they can do the following: b = 'some text' b.valid(<public key>, <signature supplied with text>) # => true/false Is there any library out there that already offers this kind of functionality? Ruby standard library contains SHA hashing code so at lest there is a portable way to perform the hashing but from that point I am struggling to find anything which fits purpose. Kind Regards, Roja

    Read the article

  • What is the best way to go about obscuring Java code?

    - by Waltzy
    Well, I'm planning on releasing a Jar into the world but would prefer if the code was not readably available to anyone with a Java Decompiler as I want to control access to the program with usernames / auth codes etc. After some Googling I haven't found any software to do this for me, so I was wondering what steps to take from here; if anyone can point me at any software or information on methodologies of obscurification I would be grateful. Cheers again Stack Overflow.

    Read the article

< Previous Page | 38 39 40 41 42 43 44 45 46 47 48 49  | Next Page >