Search Results

Search found 9244 results on 370 pages for 'thinking sphinx'.

Page 40/370 | < Previous Page | 36 37 38 39 40 41 42 43 44 45 46 47  | Next Page >

  • Is it an good idea to make a wrapper specifically for a DateTime that respresents Now?

    - by Dirk Boer
    I have been noticing lately that is really nice to use a DateTime representing 'now' as an input parameter for your methods, for mocking and testing purposes. Instead of every method calling DateTime.UtcNow themselves, I do it once in the upper methods and forward it on the lower ones. So a lot of methods that need a 'now', have an input parameter DateTime now. (I'm using MVC, and try to detect a parameter called now and modelbind DateTime.UtcNow to it) So instead of: public bool IsStarted { get { return StartTime >= DateTime.UtcNow; } } I usually have: public bool IsStarted(DateTime now) { return StartTime >= now; } So my convention is at the moment, if a method has a DateTime parameter called now, you have to feed it with the current time. Of course this comes down to convention, and someone else can easily just throw some other DateTime in there as a parameter. To make it more solid and static-typed I am thinking about wrapping DateTime in a new object, i.e. DateTimeNow. So in one of the most upper layers I will convert the DateTime to a DateTimeNow and we will get compile errors when, someone tries to fiddle in a normal DateTime. Of course you can still workaround this, but at least if feels more that you are doing something wrong at point. Did anyone else ever went into this path? Are there any good or bad results on the long term that I am not thinking about?

    Read the article

  • MVC and Checkboxes...leaves a bit to be desired

    - by Josh
    Here is my problem. I have a list of models that are displayed to the user. On the left is a checkbox for each model to indicate that the user wants to choose this model (in this case, we're building products a user can add to their shopping cart). The model has no concept of being chosen...it strictly has information about the product in question. I've talked with a few other developers after having gone through and the best I could come up with is getting the formcollection and string parsing the key values to determine whether the checkbox is checked or not. This doesn't seem ideal. I was thinking there would be something more strongly bound, but I can't figure out a way to do it. I tried creating another model that had a boolean property to represent being checked and a property of the model and passing a list of that model type to the view and creating a ActionResult on the controller that accepts a list of the new model / checked property, but it comes back null. Am I just thinking too much like web forms and should just continue on with parsing checkbox values?

    Read the article

  • What is an efficient way to serve images (PHP)?

    - by Scarface
    Hey guys currently I am thinking of serving images using an image handler script. I have two sources of images. One is from my web images folder where images that are used to construct my site interface are served. The other is in each users images folder where they can store their own images. I was thinking of giving each user image a unique id and then searching that id with the image handler script and serving the image, and changing the file name. The problem is that my site images folder does not have any information in the database and thus has no ids, should I just serve directly? Also this way of serving user images does not seem like the most efficient. If anyone has any suggestions I would really appreciate it. $sql="SELECT username,file_name FROM images WHERE id=?"; $stmt=$conn->prepare($sql); $result=$stmt->execute(array($ID)); while($row = $stmt->fetch(PDO::FETCH_ASSOC)){ $image_name = $row['file_name']; $username = $row['username']; } $path="$username/images/$image_name"; header("Expires: -1"); header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false); readfile($path);

    Read the article

  • Is it possible to do a wget dry-run?

    - by Svish
    I know you can download webpages recursively using wget, but is it possible to do a dry-run? So that you could sort of do a test-run to see how much would be downloaded if you actually did it? Thinking about pages that have a lot of links to media files like for example images, audio or movie files.

    Read the article

  • Recommendations for an inexpensive Surveillance Camera Kit that I can remotely access

    - by dr dork
    Hello! I just saw a deal on Newegg for this surveillance camera kit and it got me to thinking about installing a setup in my house. Can anyone recommend a decent surveillance camera kit, nothing fancy, that will allow me to access it from any computer (whether it's through a webpage or client program I need to install)? Thanks so much in advance for your help, I'm going to start researching this question right now.

    Read the article

  • SGE - limit a user to a certain host, using resource quota configuration

    - by pufferfish
    Is it possible to limit a user to a particular host, using the Resource Quota Configuration option in qmon for Sun Grid Engine? I'm thinking of a line to the effect of: { ... limit users {john} to hostname=compute-1-1.local } The documentation mentions built in resource types: slots, arch, mem_total, num_proc, swap_total, and the ability to make custom types. Details: SGE 6.1u5 on Rocks update: The above rule seems to be valid, since using an unknown hostname mangling the resource name 'hostname' both cause errors

    Read the article

  • Monitoring physical RAM errors on Linux

    - by user40157
    I would like to monitor the ram of two linux systems (Ubuntu and Red Hat). I realize I can run memtest86 from boot to diagnose bad ram. But are there are any solutions to monitor ram while the system is still running. I'm sort of thinking a daemon that writes and reads back from random unused memory. Anybody seen something like this before?

    Read the article

  • multiple webapps in tomcat -- what is the optimal architecture?

    - by rvdb
    I am maintaining a growing base of mainly Cocoon-2.1-based web applications [http://cocoon.apache.org/2.1/], deployed in a Tomcat servlet container [http://tomcat.apache.org/], and proxied with an Apache http server [http://httpd.apache.org/docs/2.2/]. I am conceptually struggling with the best way to deploy multiple web applications in Tomcat. Since I'm not a Java programmer and we don't have any sysadmin staff I have to figure out myself what is the most sensible way to do this. My setup has evolved through 2 scenarios and I'm considering a third for maximal separation of the distinct webapps. [1] 1 Tomcat instance, 1 Cocoon instance, multiple webapps -tomcat |_ webapps |_ webapp1 |_ webapp2 |_ webapp[n] |_ WEB-INF (with Cocoon libs) This was my first approach: just drop all web applications inside a single Cocoon webapps folder inside a single Tomcat container. This seemed to run fine, I did not encounter any memory issues. However, this poses a maintainability drawback, as some Cocoon components are subject to updates, which often affect the webapp coding. Hence, updating Cocoon becomes unwieldy: since all webapps share the same pool of Cocoon components, updating one of them would require the code in all web applications to be updated simultaneously. In order to isolate the web applications, I moved to the second scenario. [2] 1 Tomcat instance, each webapp in its dedicated Cocoon environment -tomcat |_ webapps |_ webapp1 | |_ WEB-INF (with Cocoon libs) |_ webapp1 | |_ WEB-INF (with Cocoon libs) |_ webapp[n] |_ WEB-INF (with Cocoon libs) This approach separates all webapps into their own Cocoon environment, run inside a single Tomcat container. In theory, this works fine: all webapps can be updated independently. However, this soon results in PermGenSpace errors. It seemed that I could manage the problem by increasing memory allocation for Tomcat, but I realise this isn't a structural solution, and that overloading a single Tomcat in this way is prone to future memory errors. This set me thinking about the third scenario. [3] multiple Tomcat instances, each with a single webapp in its dedicated Cocoon environment -tomcat |_ webapps |_ webapp1 |_ WEB-INF (with Cocoon libs) -tomcat |_ webapps |_ webapp2 |_ WEB-INF (with Cocoon libs) -tomcat |_ webapps |_ webapp[n] |_ WEB-INF (with Cocoon libs) I haven't tried this approach, but am thinking of the $CATALINA_BASE variable. A single Tomcat distribution can be multiply instanciated with different $CATALINA_BASE environments, each pointing to a Cocoon instance with its own webapp. I wonder whether such an approach could avoid the structural memory-related problems of approach [2], or will the same issues apply? On the other hand, this approach would complicate management of the Apache http frontend, as it will require the AJP connectors of the different Tomcat instances to be listening at different ports. Hence, Apache's worker configuration has to be updated and reloaded whenever a new webapp (in its own Tomcat instance) is added. And there seems no way to reload worker.properties without restarting the entire Apache http server. Is there perhaps another / more dynamic way of 'modularizing' multiple Tomcat-served webapps, or can one of these scenarios be refined? Any thoughts, suggestions, advice much appreciated. Ron

    Read the article

  • MySQL and PostgreSQL on the same hardware

    - by Kamil Kisiel
    We recently bought some new hardware for a database server which we were intending to dedicate to the operation of PostgreSQL. However now we have the requirement to also run MySQL as some software we want to use only supports that database. Since the storage on this machine is the most suitable for hosting a DB, and we don't currently have the budget for more hardware,we're thinking of running both of them on the same server. Are there any caveats or best practices we should be aware of?

    Read the article

  • i5 vs. i7 processor dev laptop

    - by vector
    Greetings! I need to get a laptop for dev work ( mostly server side Java, NetBeans ) and wonder if anyone had a chance to use either the i5 or i7 based laptop? Is the i7 an overkill? ... or will the i5 handle it just fine? I'm thinking something from the HP line running Ubuntu. Thanks

    Read the article

  • Setting up a software access point on Gigabyte GN-WPKG x64

    - by Reckage
    I'm using a Gigabyte GN-WPKG card on Windows 7 64-bit and was thinking it would be good to turn it into a wireless AP (I have a wired internet connection). Connectify, which would normally be the solution, says it's not compatible. There are instructions for setting up an AP, but they seem to be for 32-bit. I found the equivalent drivers for 7 and they don't seem to do anything. Is there no SoftAP for Vista and later on a Gigabyte card?

    Read the article

  • Pos receipt printer

    - by unknown (google)
    Is it possible to connect a receipt printer to a telephone for printing similar to how a Credit card terminal works when connected to a telephone line. Our clients donot have internet connections where we can connect the printer over Ethernet, so was thinking if it was possible to do the same via telephone line.

    Read the article

  • Practical differences between OpenBSD and FreeBSD?

    - by simon
    I have OpenBSD installed as a router/firewall, and have been thinking about trying either OpenBSD or FreeBSD out as a desktop system, as well. What kind of practical differences (not philosophical, like "OpenBSD's focus is security" [those are well explained at wikipedia ) are there between FreeBSD and OpenBSD? E.g. default shell, different commands or ways of configuring things etc.?

    Read the article

  • Recommendations for a Surveillance Camera Kit that I can remotely access

    - by dr dork
    Hello! I just saw a deal on Newegg for this surveillance camera kit and it got me to thinking about installing a setup in my house. Can anyone recommend a decent surveillance camera kit, nothing fancy, that will allow me to access it from any computer (whether it's through a webpage or client program I need to install)? Thanks so much in advance for your help, I'm going to start researching this question right now.

    Read the article

  • What is a good layout for a somewhat advanced home network and storage solution?

    - by Shaun
    My home network/storage needs are changing and I am searching for some opinions and starting points on what a good network/storage layout would be that can serve my needs for a few years into the future. I think I have a decent starting point for equipment, but I am also willing to invest fairly heavily in a solution that can last me for a while. I am a bit of a tech nerd and I have a moderate tolerance for setup of the solution. I would prefer if maintenance of the system is somewhat low once it is setup, but I am willing to accept some tradeoffs. Existing equipment: Router - Netgear WNDR3700 (gigabit) Router - DLink Gamerlounge DGL-4300 (gigabit) Switch - 16 port Trendnet green switch (gigabit) Switch - 5 port Trendnet green (gigabit) Computer - i7-950 office computer (gigabit ethernet) Computer - Q6600 quad core media center, hooked up to TV, records shows (gigabit ethernet) Computer - Acer 1810T ultraportable laptop (gigabit and N ethernet) NAS - Intel SS4200-E (gigabit) External hard drive - 2TB WD Green drive (esata) All kinds of miscellaneous network connected TV, Bluray, Verizon network extender, HDhomerun TV tuners, etc. Requirements: -Robust backup solution for a growing collection of huge family picture files and personal files, around 1.5TB. (Including offsite backup) -Central location for all user's files, while also keeping them secure from each other. -Storage for terabytes of movie backups and recorded TV, and access to them from all computers (maybe around 4TB eventually) -Possibility to host files to friends and family easily Nice to have: -Backup of terabytes of movie backups Intriguing possibilities: -Capability to have users' Windows desktops and files look the same from all network computers I am not sure if the new Windows Home Server 2011 would fit into this well, if I need a domain server, how best to organize my backups, or how to most effectively use RAID. Currently I am simply backing up all computers to a RAID 1 on the NAS box, which I was thinking could prevent a situation where I reach for a backup and find that the disk is corrupt. One possibility that I am thinking about now is simply using my media center PC with a huge RAID of hard drives on which all files are stored. Pseudo-backup of all files would be present because of the RAID, but important files would also be backed up off site via carrying hard drives to work. But what if corruption seeps into the files and the corrupted data is then backed up? Does RAID protect against this? I really want to take next to zero risks with the irreplaceable files. I can handle some degree of risk with the movies and other files. I'm looking for critiques on this idea as well as other possibilities. To summarize, my goal is high functionality, media capable, and robust backup of irreplaceable files.

    Read the article

  • Logging network activity of LAMP server using BASH

    - by Yarin
    I've got a Fedora LAMP server on Amazon EC2 functioning as a HTTP pseudo-proxy (Sorry, don't know the terminology- It's not a true proxy where requests are relayed through apache, rather client requests are being translated by a PHP script, which then sends a new request.) I'd like to be able to fully log the HTTP cycle CLIENT - PROXY PROXY - SERVICE SERVICE - PROXY PROXY - CLIENT I'm hoping to do this using BASH tools- thinking netcat? Looking for advice and examples. Thanks!

    Read the article

  • ram monitoring on linux

    - by user40157
    I would like to monitor the ram of two linux systems (Ubuntu and Red Hat). I realize I can run memtest86 from boot to diagnose bad ram. But are there are any solutions to monitor ram while the system is still running. I'm sort of thinking a daemon that writes and reads back from random unused memory. Anybody seen something like this before?

    Read the article

  • Question about network topology and routing performance

    - by algorithms
    Hello I am currently working on a uni project about routing protocols and network performance, one of the criteria i was going to test under was to see what effect lan topology has, ie workstations arranged in mesh, star, ring etc, but i am having doubts as to whether that would have any affect on the routing performance thus would be useless to do, rather i'm thinking it would be better to test under the topology of the routers themselves, ie routers arranged in either star, mesh ring etc. I would appreciate some feedback on this as I am rather confused. Thank You

    Read the article

  • individual license to volume license

    - by Carl
    Hello, my company has about 100 computer each using individual licenses for MS Office and Windows. We are looking to upgrade about 50 computers. We, in the past, have used Dell as our main supplier of PCs and would like to continue with them. What would be the best route for us in upgrading these 50 computers. We were thinking volume licensing for quicker setup and configuration. Thanks, Carl

    Read the article

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