Search Results

Search found 8021 results on 321 pages for 'resource monitoring'.

Page 72/321 | < Previous Page | 68 69 70 71 72 73 74 75 76 77 78 79  | Next Page >

  • ResourceSerializable: an alternate to ORM and ActiveRecord

    - by Levi Morrison
    A few opinionated reasons I don't like the traditional ORM and ActiveRecord patterns: They work only with a database. Sometimes I'm dealing with objects from an API and other objects from a database. All the implementations I have seen don't allow for that. Feel free to clue me in if I'm wrong on this. They are brittle. Changes in the database will likely break your implemenation. Some implementations can help reduce this, but a few of the ones I've seen don't. Their very design is influenced by the database. If I want to switch to using an API, I'll have to redesign the object to get it to work (likely). It seems to violate the single-responsibility pattern. They know what they are and how they act, but they also know how they are created, destroyed and saved? Seems a bit much. What about an approach that is somewhat more familiar in PHP: implementing an interface? In php 5.4, we'll have the JsonSerializable interface that defines the data to be json_encoded, so users will become accustomed to this type of thing. What if there was a ResourceSerializable interface? This is still an ORM by name, but certainly not by tradition. interface ResourceSerializable { /** * Returns the id that identifies the resource. */ function resourceId(); /** * Returns the 'type' of the resource. */ function resourceType(); /** * Returns the data to be serialized. */ function resourceSerialize(); } Things might be poorly named, I'll take suggestions. Notes: ResourceId will work for API's and databases. As long as your primary key in the database is the same as the resource ID in the API, there is no conflict. All of the API's I've worked with have a unique ID for the resource, so I don't see any issues there. ResourceType is the group or type associated with the resource. You can use this to map the resource to an API call or a database table. If the ResourceType was person, it could map to /api/1/person/{resourceId} and the table persons (or people, if it's smart enough). resourceSerialize() returns the data to be stored. Keys would identify API parameters and database table columns. This also seems easier to test than ActiveRecord / Orm implemenations. I haven't done much automated testing on traditional ActiveRecord/ORM implemenations, so this is merely a guess. But it seems that I being able to create objects independently of the library helps me. I don't have to use load() to get an existing resource, I can simply create one and set all the right properties. This is not so easy in the ActiveRecord / Orm implemenations I've dealt with. Downsides: You need another object to serialize it. This also means you have more code in general as you have to use more objects. You have to map resource types to API calls and database tables. This is even more work, but some ORMs and ActiveRecord implementations require you to map objects to table names anyway. Are there other downsides that you see? Does this seem feasible to you? How would you improve it? Note: I almost asked this on StackOverflow because it might be too vague for their standards, but I'm still not really familiar with programmers.stackexchange.com, so please help me improve my question if it doesn't shape up to standards here.

    Read the article

  • Set Time Limits in Windows Parental Controls

    So you decided that Window 7 s Parental Controls feature could help you with monitoring your child s activities on your computer. You already learned how to enable Parental Controls on your PC. While its default settings will help your monitoring efforts setting your own rules provides more of a hands-on monitoring experience.... Comcast? Business Class - Official Site Learn About Comcast Small Business Services. Best in Phone, TV & Internet.

    Read the article

  • How to set minimum SQL Server resource allocation for a database?

    - by Jeff Widmer
    Over the past Christmas holiday week, when the website I work on was experiencing very low traffic, we saw several Request timed out exceptions (one on each day 12/26, 12/28, 12/29, and 12/30) on several pages that require user authentication. We rarely saw Request timed out exceptions prior to this very low traffic week. We believe the timeouts were due to the database that it uses being "spun down" on the SQL Server and taking longer to spin up when a request came in. There are 2 databases on the SQL Server (SQL Server 2005), one which is specifically for this application and the other for the public facing website and for authentication; so in the case where users were not logged into the application (which definitely could have been for several hours at a time over Christmas week) the application database probably received no requests. We think at this point SQL Server reallocated resources to the other database and then when a request came in, extra time was needed to spin up the application database and the timeout occurred. Is there a way to tell SQL Server to give a minimum amount of resources to a database at all times?

    Read the article

  • Cacti is not monitoring the correct host... How do I change SNMP target?

    - by wil
    I have been handed a Cacti server that monitors a few hosts. I noticed that three of the targets were displaying the exact same data - the cacti machine, machine a and machine b. After doing a bit of digging, I noticed that machine a and machine b had "Local Linux Machine" set under "Host Template". I have since changed the host template to "Generic SNMP-enabled Host", however, all the graphs still only display data from the local cacti machine (Updates every 5 minutes - I changed this yesterday - 12 hours). I can't think what else is wrong and was wondering if anyone knows/can recommend anything?

    Read the article

  • Apache config that uses two document roots based on whether the requested resource exists in the first

    - by mattalexx
    Background I have a client site that consists of a CakePHP installation and a Magento installation: /web/example.com/ /web/example.com/app/ <== CakePHP /web/example.com/app/webroot/ <== DocumentRoot /web/example.com/app/webroot/store/ <== Magento /web/example.com/config/ <== Site-wide config /web/example.com/vendors/ <== Site-wide libraries The server runs Apache 2.2.3. The problem The whole company has FTP access and got used to clogging up the /web/example.com/, /web/example.com/app/webroot/, and /web/example.com/app/webroot/store/ directories with their own files. Sometimes these files need HTTP access and sometimes they don't. In any case, this mess makes my job harder when it comes to maintaining the site. Code merges, tarring the live code, etc, is very complicated and usually requires a bunch of filters. Abandoned solution At first, I thought I would set up a new subdomain on the same server, move all of their files there, and change their FTP chroot. But that wouldn't work for these reasons: Firstly, I have no idea (and neither do they remember) what marketing materials they've sent out that contain URLs to certain resources they've uploaded to the server, using the main domain, and also using abstract subdomains that use the main virtual host because it has ServerAlias *.example.com. So suddenly having them only use static.example.com isn't feasible. Secondly, The PHP scripts in their projects are potentially very non-portable. I want their files to stay in as similar an environment as they were built as I can. Also, I do not want to debug their code to make it portable. Half-baked solution After some thought, I decided to find a way to section off the actual website files into another directory that they would not touch. The company's uploaded files would stay where they were. This would ensure that I didn't break any of their projects that needed HTTP access. It would look something like this: /web/example.com/ <== A bunch of their files are in here /web/example.com/app/webroot/ <== 1st DocumentRoot; A bunch of their files are in here /web/example.com/app/webroot/store/ <== Some more are in here /web/example.com/site/ <== New dir; Contains only site files /web/example.com/site/app/ <== CakePHP /web/example.com/site/app/webroot/ <== 2nd DocumentRoot /web/example.com/site/app/webroot/store/ <== Magento /web/example.com/site/config/ <== Site-wide config /web/example.com/site/vendors/ <== Site-wide libraries After I made this change, I would not need to pay attention to anything except for the stuff within /web/example.com/site/ and my job would be a lot easier. I would be the only one changing stuff in there. So here's where the Apache magic would happen: I need an HTTP request to http://www.example.com/ to first use /web/example.com/app/webroot/ as the document root. If nothing is found (no miscellaneous uploaded company projects are found), try finding something within /web/example.com/site/app/webroot/. Another thing to keep in mind is, the site might have some problems if the $_SERVER['DOCUMENT_ROOT'] variable reads /web/example.com/app/webroot/ but the actual files are within /web/example.com/site/app/webroot/. It would be better if the DOCUMENT_ROOT environment variable could be /web/example.com/site/app/webroot/ for anything within the /web/example.com/site/app/webroot/ directory. Conclusion Is my half-baked solution possible with Apache 2.2.3? Is there a better way to solve this problem?

    Read the article

  • In CentOS 4.3 Webmin 1.3000 bandwidth monitoring is eating disk space. How to delete those files?

    - by Silkograph
    I maintain Linux server being used for Mail, Squid and DNS service. Recently I observed that something was eating server disk space. But at last, today I caught the culprit which was consuming the disk by storing large number of files. On this server, Webmin 1.300 is installed. We use Squid proxy and Sarg to monitor Internet access. I always manually clear Sarg generated files under /var/www/html/squid for last few years. But I never realized that Webmin is also storing some kind of bandwidth log files in its' directory structure. I have noticed that under /etc/webmin/bandwidth/hours it has stored more thousands of files since year 2007 totaling about 17 GB. We have used 40 GB HDD for this server machine. My question is how can I delete those (/etc/webmin/bandwidth/hours) files safely?

    Read the article

  • Windows Azure Server Supported by RealCloud Pro

    CopperEgg CEO Scott Johnson commented on the new release: RevealCloud Pro is quickly gaining traction with our customers deploying and managing services in the cloud, virtual environments and data centers. The addition of server monitoring for Windows Azure addresses the needs of developers building services on the Azure platform as well as hybrid environments, who are looking for a robust server monitoring solution that is quickly deployed, easy to use and provides instant insight into server health. The key benefits provided by RevealCloud Pro's server monitoring begin with its flexibilit...

    Read the article

  • Can I associate my spare Elastic IP addresses to an Amazon EC2 instance started in an Autoscale group and Monitoring?

    - by undefined
    I want to know if I can reserve a number of Amazon Elastic IP addresses and assign them to instances started by Autoscale. So basically, when a new instance is started because a trigger has been triggered can I also set the API to look for a spare IP address and allocate it to the instance. I need to do this because the started instance will need to communicate to a server outside the cloud and get through a firewall which will only allow remote access from a predefined set of IP addresses. So i think i need to reserve some IPs, add them to my firewall settings then allocate them (automatically) when a new instance is started. Any ideas?

    Read the article

  • What is the best resource or method for learning more about servers and networking?

    - by kaleidomedallion
    I can get around a server to some degree, but everything I have learned has been as I have needed to learn it. Every once in a while I will learn about some new command that will revolutionize how I think about systems and networking, and realize how I could have been using it this whole time if only I had known about it. Anything to bring someone from novice to some kind of fluency? Do I just need to earn the battle scars bit by bit over the course of years? (I mean of course I do but what can I do to help it be not quite so painful?) For instance, I am still fuzzy on all of networking. Any help would be greatly appreciated.

    Read the article

  • Monitoring the wall time of a process on windows?

    - by Sean Madden
    Windows Task Manager has the ability to show the current CPU time of any given running process on windows, is there any way (not necessarily through Task Manager) to get the current wall time of a process? An example, let's say I have a script that reliably runs for about 45 minutes. Without adding a progress bar to the script, is there any way to figure out for how long it has been running? The math behind this seems pretty straight forward; WallTime = CurrentWallTime - WallTimeProcessStarted. Likewise, since the math is so simple, is there anyway to get the time that a process was started at?

    Read the article

  • How does 301 redirection work across the network? & should I use it if there is a chance we made need to change the resource back to the original URL?

    - by Faust
    I've built a CMS that makes it fairly easy for my client to relocate pages in their site hierarchy. This site has all human-readable and intuitive URLs, so moving a page necessarily means that its URL changes. I am storing records of each resource's past URLs in the data store so that requests for bygone URLs are re-routed to their appropriate successors. I'm warning my clients not to re-arrange the site willy-nilly (for numerous reasons). But nevertheless I suspect there's a chance page moves could get reversed from time to time. So I'm trying to figure out whether 301 or 302 or 307 redirects should be used when serving up pages to requests for out-of-date URLs. I understand the value of using 301 for search engine optimization. But my concern is with this system possibly inadvertently making some pages unavailable to some users QUESTIONS: That is, if the clients move a page at location/URL A to a new location B, then users get the redirect for A to B, and then the clients move the page back to A again, how long can I expect any of those users to keep getting their requests for A redirected to B -- in this case sending them to my friendly 404 page? Is it until an item in their browser history is cleared? Is the redirect somehow cached in routers throughout the internet? How does this work? How long can I expect the 301 redirect to linger out there ?

    Read the article

  • Is there a way to use VirtualBox without using it's resource registry?

    - by Catskul
    Summary VirtualBox seems to want everything to be "registered" which makes it much more annoying to work with on the command line. I'm attempting to create an automated script which will create, move, start, stop, and destroy virtual machines and virtual disks. Requiring registration will complicate the task for the following reasons. leaves state information around that can cause unpredicted edgecases causing scripts to fail. creates potential name space collisions for multiple process creating VMs with the same name moving/copying resources on the same machine is more complicated because references in the registry need to be updated copying resources (disk + vm combination) to another machine require reconfiguration once they reach their target machine, and require the transfer of extra meta data to do the reconfiguration. If something unexpectedly fails, and an unregister thus fails to happen, left over configuration information can cause problems in subsequent runs. Use Case My specific use case is for a continuous integration server which creates and destroys VMs and Disk images potentially with the same name, and would require more logic to deal with the registry's statefulness. Imaginary Example It seems that I should just be able to for example (using some imaginary and/or incorrect commands): mkdir foobar customdiskimg_script ./foo/foo.vdi vboxmanage createvm --name "foo" --ostype Linux --basefolder ./foo/foo.xml vboxmanage storagectl ./foo/foo.xml --name foo --add ide vboxmanage storageattach --storagectl foo --medium ./foo/foo.vdi ./foo/foo.xml vboxmanage startvm ./foo/foo.xml TLDR Is there a way to use virtualbox without "registering" harddisks and VMs?

    Read the article

  • SSH & SFTP: Should I assign one port to each user to facilitate bandwidth monitoring?

    - by BertS
    There is no easy way to track real-time per-user bandwidth usage for SSH and SFTP. I think assigning one port to each user may help. Idea of implementation Use case Bob, with UID 1001, shall connect on port 31001. Alice, with UID 1002, shall connect on port 31002. John, with UID 1003, shall connect on port 31003. (I do not want to lauch several sshd instances as proposed in question 247291.) 1. Setup for SFTP: In /etc/ssh/sshd_config: Port 31001 Port 31002 Port 31003 Subsystem sftp /usr/bin/sftp-wrapper.sh The file sftp-wrapper.sh starts the sftp server only if the port is the correct one: #!/bin/sh mandatory_port=3`id -u` current_port=`echo $SSH_CONNECTION | awk '{print $4}'` if [ $mandatory_port -eq $current_port ] then exec /usr/lib/openssh/sftp-server fi 2. Additional setup for SSH: A few lines in /etc/profile prevents the user from connecting on the wrong port: if [ -n "$SSH_CONNECTION" ] then mandatory_port=3`id -u` current_port=`echo $SSH_CONNECTION | awk '{print $4}'` if [ $mandatory_port -ne $current_port ] then echo "Please connect on port $mandatory_port." exit 1 fi fi Benefits Now it should be easy to monitor per-user bandwidth usage. A Rrdtool-based application could produce charts like this: I know this won't be a perfect calculation of the bandwidth usage: for example, if somebody launches a bruteforce attack on port 31001, there will be a lot of traffic on this port although not from Bob. But this is not a problem to me: I do not need an exact computation of per-user bandwidth usage, but an indicator that is approximately correct in standard situations. Questions Is the idea of assigning one port for each user is a good one? Is the proposed setup an reliable one? If I have to open dozens of ports for many users, should I expect a performance drawback? Do you know a rrdtool-based application which could make the chart above?

    Read the article

  • Can someone please explain these Network Activity entries are? (resource monitor windows 7)

    - by Keyes
    The first one is the address microsoftword.com.br. What is this? I noticed when I connected windows to the internet briefly, and it went away soon after. when I typed the address into my tablet, it redirected to bing with the search "microsoftword com" with MSSRPD at the end of the address. The other unknowns seemed to appear when my brothers laptop was connected to the network. Is that normal? Usually if I disconnected and reconnected they would appear, but I noticed when I had disconnected and reconnected to try it didn't happen as he wasn't connected. I'm concerned about the microsoftword one is. Is it legitimate? The svchost that associated with is a legit svchost image.

    Read the article

  • Error using eclipse for Android - No resource found that matches the given name.

    - by Kenny
    Common problem I'm sure, but I can't figure it out. In my AndroidManifest.xml and main.xml I'm getting the no resource found that matches the given name. I've double checked for typos and it used to work, but now I'm popping up with all these errors saying it can't find my strings in my strings.xml. These are the ones I'm getting errors for in my main.xml. <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginTop="10dip" android:text="@string/instructions" /> <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginTop="10dip" android:text="@string/level_prompt" /> <Spinner android:id="@+id/spinner" android:layout_width="fill_parent" android:layout_height="wrap_content" android:prompt="@string/level_array" /> These are the ones I'm getting for my androidmanifest.xml. <application android:icon="@drawable/icon" android:label="@string/app_name"> <activity android:name=".HelloFormStuff" android:label="@string/title"> This is what my strings.xml looks like. <string name="title">Title</string> <string name="app_name">Application name</string> <string name="instructions">Enter instructions here.</string> <string name="level_prompt">Choose an item</string> <string-array name="level_array"> <item>Item One</item> <item>Item Two</item> <item>Item Three</item> <item>Item Four</item> </string-array> Any ideas? Any help would be appreciated!!

    Read the article

  • Boto - How to delete a record set from route53 -Tried to delete resource record set but it was not found

    - by Tampa
    I am using the following to delete route53 records. I get no error messages. conn = Route53Connection(aws_access_key_id, aws_secret_access_key) changes = ResourceRecordSets(conn, zone_id) change = changes.add_change("DELETE",sub_domain, "A", 60,weight=weight,identifier=identifier) change.add_value(ip_old) changes.commit() all required fields are present and they match..weight, identifier, ttl=60 etc.\ e.g. test.com. A 111.111.111.111 60 1 id1 test.com. A 111.111.111.222 60 1 id2 I want to delete 111.111.111.222 and the record set. So, what is the proper way to delete a record set? For a record set, I will have multiple values that are distinguished by a unique identifier. When an ip address becomes in active I want to remove from route53. I am using a a poor mans load balancing. Here is the meta of the record want to delete. {'alias_dns_name': None, 'alias_hosted_zone_id': None, 'identifier': u'15754-1', 'name': u'hui.com.', 'resource_records': [u'103.4.xxx.xxx'], 'ttl': u'60', 'type': u'A', 'weight': u'1'} Traceback (most recent call last): File "/home/ubuntu/workspace/rtbopsConfig/classes/redis_ha.py", line 353, in <module> deleteRedisSubDomains(aws_access_key_id, aws_secret_access_key,platform=platform,sub_domain=sub_domain,redis_domain=redis_domain,zone_id=zone_id,ip_address=ip_address,weight=1,identifier=identifier) File "/home/ubuntu/workspace/rtbopsConfig/classes/redis_ha.py", line 341, in deleteRedisSubDomains changes.commit() File "/usr/local/lib/python2.7/dist-packages/boto-2.3.0-py2.7.egg/boto/route53/record.py", line 131, in commit return self.connection.change_rrsets(self.hosted_zone_id, self.to_xml()) File "/usr/local/lib/python2.7/dist-packages/boto-2.3.0-py2.7.egg/boto/route53/connection.py", line 291, in change_rrsets body) boto.route53.exception.DNSServerError: DNSServerError: 400 Bad Request <?xml version="1.0"?> <ErrorResponse xmlns="https://route53.amazonaws.com/doc/2011-05-05/"><Error><Type>Sender</Type><Code>InvalidChangeBatch</Code><Message>Tried to delete resource record set hui.com., type A, SetIdentifier 15754-1 but it was not found</Message></Error><RequestId>9972af89-cb69-11e1-803b-7bde5b9c457d</RequestId></ErrorResponse> Thanks

    Read the article

  • RESTful API design question - how should one allow users to create new resource instances?

    - by Tamás
    I'm working in a research group where we intend to publish implementations of some of the algorithms we develop on the web via a RESTful API. Most of these algorithms work on small to medium size datasets, and in many cases, a user of our services might want to run multiple queries (with different parameters) on the same dataset, so for me it seems reasonable to allow users to upload their datasets in advance and refer to them in their queries later. In this sense, a dataset could be a resource in my API, and an algorithm could be another. My question is: how should I let the users upload their own datasets? I cannot simply let users upload their data to /dataset/dataset_id as letting the users invent their own dataset_ids might result in ID collision and users overwriting each other's datasets by accident. (I believe one of the most frequently used dataset ID would be test). I think an ideal way would be to have a dedicated URL (like /dataset/upload) where users can POST their datasets and the response would contain a unique ID under which the dataset was stored, but I'm not sure that it does not violate the basic principles of REST. What is the preferred way of dealing with such scenarios?

    Read the article

  • Where's the Win32 resource for the mouse cursor for dragging splitters?

    - by Luther Baker
    I am building a custom win32 control/widget and would like to change the cursor to a horizontal "splitter" symbol when hovering over a particular vertical line in the control. IE: I want to drag this vertical line (splitter bar) left and right (WEST and EAST). Of the the system cursors (OCR_*), the only cursor that makes sense is the OCR_SIZEWE. Unfortunately, that is the big, awkward cursor the system uses when resizing a window. Instead, I am looking for the cursor that is about 20 pixels tall and around 3 or 4 pixel wide with two small arrows pointing left and right. I can easily draw this and include it as a resource in my application but the cursor itself is so prevalent that I wanted to be sure it wasn't missing something. For example: when you use the COM drag and drop mechanism (CLSID_DragDropHelper, IDropTarget, etc) you implicitly have access to the "drag" icon (little box under the pointer). I didn't see an explicit OCR_* constant for this guy ... so likewise, if I can't find this splitter cursor outright, I am wondering if it is part of a COM object or something else in the win32 lib.

    Read the article

  • Ruby on Rails: how to get error messages from a child resource displayed?

    - by randombits
    I'm having a difficult time understanding how to get Rails to show explicitly the error messages that a child resource is failing on when I render an XML template. Hypothetically, I have the following classes: class School < ActiveRecord::Base has_many :students validates_associated :students end class Student < ActiveRecord::Base belongs_to :school validates_format_of :email, :with => /^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i, :message => "You must supply a valid email" end Now, in the controller, let's say we want to build a trivial API to allow us to add a new School with a student in it (again, I said, it's a terrible example, but plays its role for the purpose of the question) class SchoolsController < ApplicationController def create @school = School.new @student = school.students.build @student.email = "bad@email" respond_to do |format| if @school.save # some code else format.xml { render :xml => @school.errors, :status => :unprocessable_entity } end end end end Now the validation is working just fine, things die because the email doesn't match the regex that's set in the validates_format_of method in the Student class. However the output I get is the following: <?xml version="1.0" encoding="UTF-8"?> <errors> <error>Students is invalid</error> </errors> I want the more meaningful error message that I set above with validates_format_of to show up. Meaning, I want it to say: <error>You must supply a valid email</error> What am I doing wrong for that not to show up?

    Read the article

  • How to create a JAX-RS service where the sub-resource @Path doesn't have a leading slash

    - by Matt
    I've created a JAX-RS service (MyService) that has a number of sub resources, each of which is a subclass of MySubResource. The sub resource class being chosen is picked based on the parameters given in the MyService path, for example: @Path("/") @Provides({"text/html", "text/xml"}) public class MyResource { @Path("people/{id}") public MySubResource getPeople(@PathParam("id") String id) { return new MyPeopleSubResource(id); } @Path("places/{id}") public MySubResource getPlaces(@PathParam("id") String id) { return new MyPlacesSubResource(id); } } where MyPlacesSubResource and MyPeopleSubResource are both sub-classes of MySubResource. MySubResource is defined as: public abstract class MySubResource { protected abstract Results getResults(); @GET public Results get() { return getResults(); } @GET @Path("xml") public Response getXml() { return Response.ok(getResults(), MediaType.TEXT_XML_TYPE).build(); } @GET @Path("html") public Response getHtml() { return Response.ok(getResults(), MediaType.TEXT_HTML_TYPE).build(); } } Results is processed by corresponding MessageBodyWriters depending on the mimetype of the response. While this works it results in paths like /people/Bob/html or /people/Bob/xml where what I really want is /people/Bob.html or /people/Bob.xml Does anybody know how to accomplish what I want to do?

    Read the article

< Previous Page | 68 69 70 71 72 73 74 75 76 77 78 79  | Next Page >