Search Results

Search found 11153 results on 447 pages for 'count zero'.

Page 2/447 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Possibility of recovering files from a dd zero-filled hard disk

    - by unknownthreat
    I have "zero filled" (complete wiped) an external hard disk using dd, and from what I have heard: people said you should at least "zero fill" 3 times to be sure that the data are really wiped and no one can recover anything. So I decided to scan the disk once again after I've zero filled the disk. I was expecting the disk to still have some random binary left. It turned out that it has only a few sequential bytes in the very beginning. This is probably the file structure type and other headers stuff. Other than that, it's all zeros and nothing else. So if we have to recover any file from a zero filled disk, ...how? From what I've heard, even you zero fill the disk, you should still have some data left. ...or could dd really completely annihilate all data?

    Read the article

  • Count files in directories AND subdirectories? iPhone

    - by AWright4911
    I am trying to count entire files in a directory, including subdirectories. This is what I have to count files in the first folder: -(NSString *)numberOfPhotos { NSString *MyPath = @"/rootdirectory/"; NSArray *directoryContent = [[NSFileManager defaultManager] directoryContentsAtPath:MyPath]; return [NSString stringWithFormat:@"%d", [directoryContent count]]; } I was thinking maybe something like for (file in folder){ [file count] { but doesnt seem to work.

    Read the article

  • Top 10 unless count is zero

    - by datatoo
    This is probably easy, but eludes me. SQL server2005 I want to show top 100 but if there are not 100 only want to show those and not include zero counts in the result SELECT TOP (100) UserName, FullName_Company, FullName, (SELECT COUNT(*) FROM dbo.Member_Ref WHERE (RefFrom_UserName = dbo.view_Members.UserName) AND (RefDate >= '5/1/2010') AND (RefDate <= '6/1/2010')) AS RefFromCount FROM dbo.view_Members WHERE (MemberStatus = N'Active') ORDER BY RefFromCount DESC I have tried using Group By and HAVING COUNT(*)0 all with the same wrong results

    Read the article

  • mysql multi count() in one query

    - by atno
    Hi, I'm trying to count several joined tables but without any luck, what I get is the same numbers for every column (tUsers,tLists,tItems). My query is: select COUNT(users.*) as tUsers, COUNT(lists.*) as tLists, COUNT(items.*) as tItems, companyName from users as c join lists as l on c.userID = l.userID join items as i on c.userID = i.userID group by companyID The result I want to get is --------------------------------------------- # | CompanyName | tUsers | tlists | tItems 1 | RealCoName | 5 | 2 | 15 --------------------------------------------- what modifications do i have to do to my query to get those results? Cheers

    Read the article

  • Microsoft Word - Word count excluding specific Styles?

    - by Andrew
    Hi, I was wondering if there's a way to get a word count that excludes text with a specific Style in a Microsoft Word 2007 document? I've seen this related question, but I've got blocks of source code scattered throughout which would mean I'd have to go through each of my documents a section at a time.. Does anyone know a way to do this with a macro or a splash of VB Script or some such? Thanks you!

    Read the article

  • Changing a SUM returned NULL to zero

    - by Lee_McIntosh
    I have a Stored Procedure as follows: CREATE PROC [dbo].[Incidents] (@SiteName varchar(200)) AS SELECT ( SELECT SUM(i.Logged) FROM tbl_Sites s INNER JOIN tbl_Incidents i ON s.Location = i.Location WHERE s.Sites = @SiteName AND i.[month] = DATEADD(mm, DATEDIFF(mm, 0, GetDate()) -1,0) GROUP BY s.Sites ) AS LoggedIncidents 'tbl_Sites contains a list of reported on sites. 'tbl_Incidents containts a generated list of total incidents by site/date (monthly) 'If a site doesnt have any incidents that month it wont be listed. The problem I'm having is that a site doesnt have any Incidents this month and as such i get a NULL value returned for that site when i run this sproc, but i need to have a zero/0 returned to be used within a chart in SSRS. I've tried the using coalesce and isnull to no avail. SELECT COALESCE(SUM(c.Logged,0)) SELECT SUM(ISNULL(c.Logged,0)) Is there a way to get this formatted correctly? Cheers, Lee

    Read the article

  • Return Count from Netflix oData Service When the LINQ Count() Method Doesn't Work

    - by Craig Shoemaker
    Is there a way to use a LINQ expression to request a Count query from the Netflix oData service? The Netflix documentation shows that you can return counts by appending $count to a request for a collection, but a URL like this: http://netflix.cloudapp.net/Catalog/Genres/$count Is not generated from an expression like this: var count = (from g in catalog.Genres select g).Count(); The above code returns an error saying that the Count method is not supported. Is there a way to do this in LINQ, or do I just need to make WebClient request to get the value?

    Read the article

  • Update count every second causing massive memory problems

    - by Josh
    Just on my local machine, trying the run the following script causes my computer to crash... What am I doing wrong? (function($) { var count = '6824756980'; while (count > 0) { setInterval(function() { $('#showcount').html(Math.floor(count-1)); count--; }, 1000 ); } })(jQuery); All I need to do is subtract one from the var "count" and update/display it's value every second.

    Read the article

  • MySQL: Count two things in one query?

    - by Nebs
    I have a "boolean" column in one of my tables (value is either 0 or 1). I need to get two counts: The number of rows that have the boolean set to 0 and the number of rows that have it set to 1. Currently I have two queries: One to count the 1's and the other to count the 0's. Is MySQL traversing the entire table when counting rows with a WHERE condition? I'm wondering if there's a single query that would allow two counters based on different conditions? Or is there a way to get the total count along side the WHERE conditioned count? This would be enough as I'd only have to subtract one count from the other (due to the boolean nature of the column). There are no NULL values. Thanks.

    Read the article

  • How can I selectively override a django .count() method

    - by Tom Viner
    I'm using postGresSQL and my main table has about 20,000 rows. Sometimes count() methods can take ages or even timeout. Mod.manager.filter(...).count() I need to selectively override the count() method depending on what filter has been applied. Just having a cache of results would be a great gain but I'd like to be able to say: if filter query is just {'enabled'=True} then return 20,000 without touching the db. Note: I can't prevent the call to .count() as it's inside django's pagination, which always does a count.

    Read the article

  • How do you access the value of an SQL count () query in a Java program

    - by Ankur
    I want to get to the value I am finding using the COUNT command of SQL. Normally I enter the column name I want to access into the getInt() getString() method, what do I do in this case when there is no specific column name. I have used 'AS' in the same manner as is used to alias a table, I am not sure if this is going to work, I would think not. Statement stmt3 = con.createStatement(); ResultSet rs3 = stmt3.executeQuery("SELECT COUNT(*) FROM "+lastTempTable+") AS count"); while(rs3.next()){ count = rs3.getInt("count"); }

    Read the article

  • Use count or have a field that tallies?

    - by Dan LaManna
    Fairly simple concept, making an extremely basic message board system and I want users to have a post count. Now I was debating on whether or not to have a tally in their row that is added each time a post by them is created, or subtracted by one each time a post of theirs is deleted. However I'm sure that performing a count query when the post count is requested would be more accurate due to unforseen circumstances (say a thread gets deleted and it doesn't lower their tally properly), however this seems like it would be less efficient to run a query EVERY time their post count is loaded, especially in the case of them having 10 posts on the same page and it lists their post count each post. Thoughts/Advice? Thanks

    Read the article

  • Count problem in SQL when I want results from diffrent tabels

    - by Nicklas
    ALTER PROCEDURE GetProducts @CategoryID INT AS SELECT COUNT(tblReview.GroupID) AS ReviewCount, COUNT(tblComment.GroupID) AS CommentCount, Product.GroupID, MAX(Product.ProductID) AS ProductID, AVG(Product.Price) AS Price, MAX (Product.Year) AS Year, MAX (Product.Name) AS Name, AVG(tblReview.Grade) AS Grade FROM tblReview, tblComment, Product WHERE (Product.CategoryID = @CategoryID) GROUP BY Product.GroupID HAVING COUNT(distinct Product.GroupID) = 1 This is what the tabels look like: **Product** |**tblReview** | **tblComment** ProductID | ReviewID | CommentID Name | Description | Description Year | GroupID | GroupID Price | Grade | GroupID GroupID is name_year of a Product, ex Nike_2010. One product can have diffrent sizes for exampel: ProductID | Name | Year | Price | Size | GroupID 1 | Nike | 2010 | 50 | 8 | Nike_2010 2 | Nike | 2010 | 50 | 9 | Nike_2010 3 | Nike | 2010 | 50 | 10 | Nike_2010 4 | Adidas| 2009 | 45 | 8 | Adidas_2009 5 | Adidas| 2009 | 45 | 9 | Adidas_2009 6 | Adidas| 2009 | 45 | 10 | Adidas_2009 I dont get the right count in my tblReview and tblComment. If I add a review to Nike size 8 and I add one review to Nike size 10 I want 2 count results when I list the products with diffrent GroupID. Now I get the same count on Reviews and Comment and both are wrong. I use a datalist to show all the products with diffrent/unique GroupID, I want it to be like this: ______________ | | | Name: Nike | | Year: 2010 | | (All Sizes) | | x Reviews | | x Comments | | x AVG Grade | |______________| All Reviewcounts, Commentcounts and the Average of all products with the same GroupID, the Average works great.

    Read the article

  • In SQL, why is "select *, count(*) from sentGifts group by whenSent;" ok, but when "*" and "count(*)

    - by Jian Lin
    In SQL, using the table: mysql> select * from sentGifts; +--------+------------+--------+------+---------------------+--------+ | sentID | whenSent | fromID | toID | trytryWhen | giftID | +--------+------------+--------+------+---------------------+--------+ | 1 | 2010-04-24 | 123 | 456 | 2010-04-24 01:52:20 | 100 | | 2 | 2010-04-24 | 123 | 4568 | 2010-04-24 01:56:04 | 100 | | 3 | 2010-04-24 | 123 | NULL | NULL | 1 | | 4 | 2010-04-24 | NULL | 111 | 2010-04-24 03:10:42 | 2 | | 5 | 2010-03-03 | 11 | 22 | 2010-03-03 00:00:00 | 6 | | 6 | 2010-04-24 | 11 | 222 | 2010-04-24 03:54:49 | 6 | | 7 | 2010-04-24 | 1 | 2 | 2010-04-24 03:58:45 | 6 | +--------+------------+--------+------+---------------------+--------+ 7 rows in set (0.00 sec) The following is OK: mysql> select *, count(*) from sentGifts group by whenSent; +--------+------------+--------+------+---------------------+--------+----------+ | sentID | whenSent | fromID | toID | trytryWhen | giftID | count(*) | +--------+------------+--------+------+---------------------+--------+----------+ | 5 | 2010-03-03 | 11 | 22 | 2010-03-03 00:00:00 | 6 | 1 | | 1 | 2010-04-24 | 123 | 456 | 2010-04-24 01:52:20 | 100 | 6 | +--------+------------+--------+------+---------------------+--------+----------+ 2 rows in set (0.00 sec) But suppose we want the count(*) to appear as the first column: mysql> select count(*), * from sentGifts group by whenSent; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '* from sentGifts group by whenSent' at line 1 it gave an error. Why is it so and what is a way to fix it? I realized that this is ok: mysql> select count(*), whenSent from sentGifts group by whenSent; +----------+------------+ | count(*) | whenSent | +----------+------------+ | 1 | 2010-03-03 | | 6 | 2010-04-24 | +----------+------------+ 2 rows in set (0.00 sec) but what about the one above that gave an error? thanks.

    Read the article

  • Word count for LaTeX within emacs

    - by Seamus
    I want to count how many words my LaTeX document has in it. I can do this by going to the website for the texcount package and using the web interface there. but that's not ideal. I'd rather have some shortcut within emacs to just return number of words in a file (or ideally number of words in file and in all files called by \input or \include within the document). I have downloaded texcount script, but I don't know what to do with it. That is, I don't know where to put the .pl file, and how to call it within emacs.

    Read the article

  • Rails validation count limit on has_many :through

    - by Jeremy
    I've got the following models: Team, Member, Assignment, Role The Team model has_many Members. Each Member has_many roles through assignments. Role assignments are Captain and Runner. I have also installed devise and CanCan using the Member model. What I need to do is limit each Team to have a max of 1 captain and 5 runners. I found this example, and it seemed to work after some customization, but on update ('teams/1/members/4/edit'). It doesn't work on create ('teams/1/members/new'). But my other validation (validates :role_ids, :presence = true ) does work on both update and create. Any help would be appreciated. Update: I've found this example that would seem to be similar to my problem but I can't seem to make it work for my app. It seems that the root of the problem lies with how the count (or size) is performed before and during validation. For Example: When updating a record... It checks to see how many runners there are on a team and returns a count. (i.e. 5) Then when I select a role(s) to add to the member it takes the known count from the database (i.e. 5) and adds the proposed changes (i.e. 1), and then runs the validation check. (Team.find(self.team_id).members.runner.count 5) This works fine because it returns a value of 6 and 6 5 so the proposed update fails without saving and an error is given. But when I try to create a new member on the team... It checks to see how many runners there are on a team and returns a count. (i.e. 5) Then when I select a role(s) to add to the member it takes the known count from the database (i.e. 5) and then runs the validation check WITHOUT factoring in the proposed changes. This doesn't work because it returns a value of 5 known runner and 5 = 5 so the proposed update passes and the new member and role is saved to the database with no error. Member Model: class Member < ActiveRecord::Base devise :database_authenticatable, :registerable, :recoverable, :rememberable, :trackable, :validatable attr_accessible :password, :password_confirmation, :remember_me attr_accessible :age, :email, :first_name, :last_name, :sex, :shirt_size, :team_id, :assignments_attributes, :role_ids belongs_to :team has_many :assignments, :dependent => :destroy has_many :roles, through: :assignments accepts_nested_attributes_for :assignments scope :runner, joins(:roles).where('roles.title = ?', "Runner") scope :captain, joins(:roles).where('roles.title = ?', "Captain") validate :validate_runner_count validate :validate_captain_count validates :role_ids, :presence => true def validate_runner_count if Team.find(self.team_id).members.runner.count > 5 errors.add(:role_id, 'Error - Max runner limit reached') end end def validate_captain_count if Team.find(self.team_id).members.captain.count > 1 errors.add(:role_id, 'Error - Max captain limit reached') end end def has_role?(role_sym) roles.any? { |r| r.title.underscore.to_sym == role_sym } end end Member Controller: class MembersController < ApplicationController load_and_authorize_resource :team load_and_authorize_resource :member, :through => :team before_filter :get_team before_filter :initialize_check_boxes, :only => [:create, :update] def get_team @team = Team.find(params[:team_id]) end def index respond_to do |format| format.html # index.html.erb format.json { render json: @members } end end def show respond_to do |format| format.html # show.html.erb format.json { render json: @member } end end def new respond_to do |format| format.html # new.html.erb format.json { render json: @member } end end def edit end def create respond_to do |format| if @member.save format.html { redirect_to [@team, @member], notice: 'Member was successfully created.' } format.json { render json: [@team, @member], status: :created, location: [@team, @member] } else format.html { render action: "new" } format.json { render json: @member.errors, status: :unprocessable_entity } end end end def update respond_to do |format| if @member.update_attributes(params[:member]) format.html { redirect_to [@team, @member], notice: 'Member was successfully updated.' } format.json { head :no_content } else format.html { render action: "edit" } format.json { render json: @member.errors, status: :unprocessable_entity } end end end def destroy @member.destroy respond_to do |format| format.html { redirect_to team_members_url } format.json { head :no_content } end end # Allow empty checkboxes # http://railscasts.com/episodes/17-habtm-checkboxes def initialize_check_boxes params[:member][:role_ids] ||= [] end end _Form Partial <%= form_for [@team, @member], :html => { :class => 'form-horizontal' } do |f| %> #... # testing the count... <ul> <li>Captain - <%= Team.find(@member.team_id).members.captain.size %></li> <li>Runner - <%= Team.find(@member.team_id).members.runner.size %></li> <li>Driver - <%= Team.find(@member.team_id).members.driver.size %></li> </ul> <div class="control-group"> <div class="controls"> <%= f.fields_for :roles do %> <%= hidden_field_tag "member[role_ids][]", nil %> <% Role.all.each do |role| %> <%= check_box_tag "member[role_ids][]", role.id, @member.role_ids.include?(role.id), id: dom_id(role) %> <%= label_tag dom_id(role), role.title %> <% end %> <% end %> </div> </div> #... <% end %>

    Read the article

  • Why did instruments report a leak while its ref count did become zero

    - by bromj
    Hello guys, green hand i am. I'm using instruments, and it did a great help to me so far, but I'm confused now 'cause it report a memory leak to me while its leaked block history shows me that the ref count of that memory had finally become 0. What does it mean? It's really embarrassing that I couldn't post a image here... so I have to describe it in text. Hope it would be clear enough for you: Event Type || RefCt || Responsible Library || Responsible Caller Malloc         || 1        || MyWeather              || +[ForecastData parseSingleForecastWithXMLElement:] Autorelease||           || MyWeather              || +[ForecastData parseSingleForecastWithXMLElement:] Retain         || 2        || MyWeather              || +[ForecastData parseWithData:] Release      || 1        || Foundation              || +[NSAutoreleasePool drain:] Retain         || 2        || Foundation              || +[NSThread initWithTarget:selector:object:] Release      || 1        || Foundation              || +[NSString compare:options:] Release      || 0        || MyWeather              || +[RootViewController dealloc] Any help will be appreciated~

    Read the article

  • Iphone NsMutableArray Count

    - by Claudio
    I have a struct SystemStruct *sharedStruct = [SystemStruct sharedSystemStruct]; implemented as a singleton, to share 3 Arrays. the problem is that when i try to count the array's objects the system crash. es: This code Crash: - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { SystemStruct *SharedStruct = [SystemStruct sharedSystemStruct]; return SharedStruct.path.count; } This Code Work: SystemStruct *SharedStruct = [SystemStruct sharedSystemStruct]; NSLog(@"%d", SharedStruct.path.count); How can i return the correct array count?

    Read the article

  • Using XSD to validate node count

    - by heath
    I don't think this is possible but I thought I'd throw it out there. Given this XML: <people count="3"> <person>Bill</person> <person>Joe</person> <person>Susan</person> </people> Is it possible in an XSD to force the @count attribute value to be the correct count of defined elements (in this case, the person element)? The above example would obviously be correct and the below example would not validate: <people count="5"> <person>Bill</person> <person>Joe</person> <person>Susan</person> </people>

    Read the article

  • Count total number of Phone Numbers in AddressBook iPhone

    - by AWright4911
    I am trying to get the total count for the phone numbers listed in the AddressBook, in all groups as a whole. I can successfully retrieve Person count and Group count, just not the total number of Phone Numbers. ABAddressBookRef m_addressbook = ABAddressBookCreate(); CFIndex nPeople = ABAddressBookGetPersonCount(m_addressbook); CFIndex nGroups = ABAddressBookGetGroupCount(m_addressbook);

    Read the article

  • Returning several COUNT results from one ASP SQL statement

    - by user89691
    Say I have a table like this: Field1 Field2 Field3 Field4 fred tom fred harry tom tom dick harry harry and I want to determine what proportion of it has been completed for each field. I can execute: SELECT COUNT (Field1) WHERE (Field1 <> '') AS Field1Count SELECT COUNT (Field2) WHERE (Field2 <> '') AS Field2Count SELECT COUNT (Field3) WHERE (Field3 <> '') AS Field3Count SELECT COUNT (Field4) WHERE (Field4 <> '') AS Field4Count Is it possible to roll up these separate SQL statements into one that will return the 4 results in one hit? Is there any performance advantage to doing so (given that the number of columns and rows may be quite large in practice)?

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >