Search Results

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

Page 9/447 | < Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >

  • get count from Iqueryable<T> in linq-to-sql?

    - by Pandiya Chendur
    The following code doesn't seem to get the correct count..... var materials = consRepository.FindAllMaterials().AsQueryable(); int count = materials.Count(); Is it the way to do it.... Here is my repository which fetches records... public IQueryable<MaterialsObj> FindAllMaterials() { var materials = from m in db.Materials join Mt in db.MeasurementTypes on m.MeasurementTypeId equals Mt.Id where m.Is_Deleted == 0 select new MaterialsObj() { Id = Convert.ToInt64(m.Mat_id), Mat_Name = m.Mat_Name, Mes_Name = Mt.Name, }; return materials; }

    Read the article

  • How to count the letters in a text with Javascript?

    - by Doguhanca
    I am currently trying to write a ''web application'' that has a simple text area inside, in which I want the letters of the text written to be pointed out. For example, if I write: ''How old are you? I am 19 years old'' I need a code to tell me how many 'A's and 'Y's and 'D's (and all letters of the alphabet from 0-26) are used in this sentence when I press a button on a HTML/ CSS page. Could you please tell me what I must write into my .JS file and what I should write into my .HTML file to do this with a click of a button when something is written in the ? I hope my explanation was detailed enough. Thanks! Edit (I'm very sorry for the problems I caused) - What I have done so far looks like this: HTML: <link rel="stylesheet" type="text/css" href="theme.css"> <meta charset="utf-8"> <script src="test.js" type="text/javascript"></script> <div class='header'> Al.Fa.Be </div> <div class='yaz'> <textarea></textarea> </div> <div class='description'> <a href='http://www.google.com'>Ara</a> </div> <div class='description2'> <input id="clickMe" type="button" value="Hesapla" onclick="doFunction();" /> </div> CSS: body{ background:white; } selection{ background:#CCC; } #clickMe{ background:#CCC; border:1px solid #333; } .header{ font-size:70px; font-weight:bold; font-family:Arial; color:#333; margin-left:580px; padding-top:200px; } textarea{ width:1210px; height:40px; color:black; margin-top:20px; margin-left:100px; padding-left:10px; padding-top:10px; font-size:18px; font-family:Arial; } .description{ background:#f2f2f2; padding:6px; width:50px; text-align:center; border:1px solid #ddd; font-family:Arial; margin-left:620px; margin-top:20px; font-size:14px; } .description a{ color:#555; text-decoration:none; } .description2{ background:#f2f2f2; padding:6px; width:60px; text-align:center; border:1px solid #ddd; font-family:Arial; margin-left:750px; margin-top:-30px; font-size:14px; } .description2 a{ color:#555; text-decoration:none; } .yaz{ color:white; } Javascript: // Input name. Count number of alphabets a-z class program                                                          {     public static void main(String[] args)     {         String name = args[0];         int count[] = new int[29];         int i,p;         int n = name.length();         name = name.toUpperCase();         char c;         for (i=0; i<29; i++)         {             count[i] = 0;           }         for (i=0; i<n; i++)         {             c = name.charAt(i);             p = (int) c;             count[p-65]++;         }         for (i=0; i<29 ; i++)         {             if (count[i] >0)             {                 System.out.println((char)(i+65) + " occurs " + count[i] + " times");             }         }     } }

    Read the article

  • How can I count existing and non-existing values with MySQL?

    - by jaya malladi
    I am new to MySQL. I have a table with answer ids. Answers can look like this:a1, a2, a3 ..., but due to some problems some are NULL, some are blank, and some are others like 1 a etc. Now I want to calculate the count of ids with a1 a2 a3 distinctly. But how is it possible to do this leaving others like NULL, blanks and garbage. The output should look like this atype count a1 45 a2 0 a3 56 If there is no row entry for a particular answer, the count should be 0.

    Read the article

  • Android-SQLite: How to Count specific value from Column?

    - by sanpatil
    I have two table (TABLE_EXAM,TABLE_RESULT). Here is value of my TABLE_RESULT. result_id exam_id question_id correct_answer 1 2 4 y 2 2 5 y 3 2 6 n 4 2 7 y I need to count how many correct_answer='y' where exam_id=2. I try following code but it return 0. public int calculateResult(int examId,String confirmAnswer) { int correctAnswer=0; try { SQLiteDatabase db=this.getWritableDatabase(); String selectQuery=("select count(correctAnswer) from result where exam_id ='" + examId + "' and correctAnswer ='" + 'y' +"'" ); // String selectQuery=("SELECT COUNT(*)FROM result WHERE exam_id ='" + examId + "' and correctAnswer ='" + confirmAnswer +"'" ); Cursor cursor = db.rawQuery(selectQuery, null); if(cursor.moveToLast()) { correctAnswer=cursor.getInt(3); } } catch(Exception e) { e.printStackTrace(); } return correctAnswer; } In variable confirm_answer i pass "y". Give me some hint or reference. Any help is appreciated. Thanks in Advance

    Read the article

  • Count function on tree structure (non-binary)

    - by Spevy
    I am implementing a tree Data structure in c# based (largely on Dan Vanderboom's Generic implementation). I am now considering approach on handling a Count property which Dan does not implement. The obvious and easy way would be to use a recursive call which Traverses the tree happily adding up nodes (or iteratively traversing the tree with a Queue and counting nodes if you prefer). It just seems expensive. (I also may want to lazy load some of my nodes down the road). I could maintain a count at the root node. All children would traverse up to and/or hold a reference to the root, and update a internally settable count property on changes. This would push the iteration problem to when ever I want to break off a branch or clear all children below a given node. Generally less expensive, and puts the heavy lifting what I think will be less frequently called functions. Seems a little brute force, and that usually means exception cases I haven't thought of yet, or bugs if you prefer. Does anyone have an example of an implementation which keeps a count for an Unbalanced and/or non-binary tree structure rather than counting on the fly? Don't worry about the lazy load, or language. I am sure I can adjust the example to fit my specific needs. EDIT: I am curious about an example, rather than instructions or discussion. I know this is not technically difficult...

    Read the article

  • How do I count how many arrays have the same name within a multidimensional array with php?

    - by zeckdude
    I have a multidimensional array, and I would have multiple arrays within it. Some of those arrays contain multiple arrays within them as well, and I would like to count how many arrays are within the second array(the date). This is an example of the structure of the multidimensional array: $_SESSION['final_shipping'][04/03/2010][book] $_SESSION['final_shipping'][04/12/2010][magazine] $_SESSION['final_shipping'][04/12/2010][cd] This is the foreach statement I am currently using to count how many of the second array(the one with the dates) exists. foreach($_SESSION['final_shipping'] as $date_key => $date_value) { foreach ($date_value as $product_key => $product_value) { echo 'There are ' . count($date_key) . ' of the ' . $date_key . ' selection.<br/>'; } } It is currently outputting this: There are 1 of the 04/03/2010 selection. There are 1 of the 04/12/2010 selection. There are 1 of the 04/12/2010 selection. I would like it to output this: There are 1 of the 04/03/2010 selection. There are 2 of the 04/12/2010 selection.

    Read the article

  • Zero-channel RAID for High Performance MySQL Server (IBM ServeRAID 8k) : Any Experience/Recommendati

    - by prs563
    We are getting this IBM rack mount server and it has this IBM ServeRAID8k storage controller with Zero-Channel RAID and 256MB battery backed cache. It can support RAID 10 which we need for our high performance MySQL server which will have 4 x 15000K RPM 300GB SAS HDD. This is mission-critical and we want as much bandwidth and performance. Is this a good card or should we replace with another IBM RAID card? IBM ServeRAID 8k SAS Controller option provides 256 MB of battery backed 533 MHz DDR2 standard power memory in a fixed mounting arrangement. The device attaches directly to IBM planar which can provide full RAID capability. Manufacturer IBM Manufacturer Part # 25R8064 Cost Central Item # 10025907 Product Description IBM ServeRAID 8k SAS - Storage controller (zero-channel RAID) - RAID 0, 1, 5, 6, 10, 1E Device Type Storage controller (zero-channel RAID) - plug-in module Buffer Size 256 MB Supported Devices Disk array (RAID) Max Storage Devices Qty 8 RAID Level RAID 0, RAID 1, RAID 5, RAID 6, RAID 10, RAID 1E Manufacturer Warranty 1 year warranty

    Read the article

  • Why does an EXE file that does *nothing* contain so many dummy zero bytes?

    - by Lambert
    Hi, I've compiled a C file that does absolutely nothing (just a main that returns... not even a "Hello, world" gets printed), and I've compiled it with various compilers (MinGW GCC, Visual C++, Windows DDK, etc.). All of them link with the C runtime, which is standard. But what I don't get is: When I open up the file in a hex editor (or a disassembler), why do I see that almost half of the 16 KB is just huge sections of either 0x00 bytes or 0xCC bytes? It seems rather ridiculous to me... is there any way to prevent these from occurring? And why are they there in the first place? Thank you!

    Read the article

  • Pressing zero key brings up lock/switch user screen in W7

    - by qinghua
    This issue started after my cat walked all over the keyboard... Whenever I press the "zero" key, the screen goes black and I'm taken to the lock/switch user screen. The other functions of the key work fine - it can produce ) and / like usual. Numlock is off, and as far as I know, my computer doesn't have Function Lock. If I log out of my user account and sign in as a guest, the "zero" works again, but if I create a new user profile, it doesn't work. I get the same issue when I hit "zero" using the on-screen keyboard. My keyboard layout is set to US English. I've uninstalled and reinstalled the ATK package, and updated my keyboard drivers. I have an ASUS U43JC-X1 laptop running Windows 7, and I haven't installed any new programs lately.

    Read the article

  • NASM: Count how many bits in a 32 Bit number are set to 1.

    - by citronas
    I have a 32 Bit number and want to count know how many bits are 1. I'm thinking of this pseudocode: mov eax, [number] while(eax != 0) { div eax, 2 if(edx == 1) { ecx++; } shr eax, 1 } Is there a more efficient way? I'm using NASM on a x86 processor. (I'm just beginning with assembler, so please do not tell me to use code from extern libraries, because I do not even know how to include them ;) ) (I just found http://stackoverflow.com/questions/109023/best-algorithm-to-count-the-number-of-set-bits-in-a-32-bit-integer which also contains my solution. There are other solutions posted, but unfortunatly I can't seem to figure out, how I would write them in assembler)

    Read the article

  • MySQL Query, how to group and count in one row ?

    - by Akarun
    Hi All, To simplify, I have tree tables: products, products-vs-orders, orders products fields : 'ProductID', 'Name', 'isGratis', ... products-vs-orders fields : 'ProductID', 'OrderID' orders fields : 'OrderID', 'Title', ... Actually, I have a query like this: SELECT orders.OrderID, orders.Title, COUNT(`products`.`isGratis`) AS "Quantity", `products`.`isGratis` FROM `orders`, `products-vs-orders`, `products` WHERE `orders`.`OrderID` = `products-vs-orders`.`OrderID` AND `products-vs-orders`.`ProductID` = `products`.`ProductID` GROUP BY `products`.`PackID`, `products`.`isGratis` This query works and return this surch of result: OrderID, Title, Quantity, isGratis 1 My Order 20 0 1 My Order 3 1 2 An other 8 0 2 An other 1 1 How can I retrieve the count of products 'gratis' and 'paid' in to separate cols ? OrderID, Title, Qt Paid, Qt Gratis 1 My Order 20 3 2 An other 8 1 Thanks for your help

    Read the article

  • count(*) vs count(row-name) - which is more correct?

    - by bread
    Does it make a difference if you do count(*) vs count(row-name) as in these two examples? I have a tendency to always write count(*) because it seems to fit better in my mind with the notion of it being an aggregate function, if that makes sense. But I'm not sure if it's technically best as I tend to see example code written without the * more often than not. count(*): select customerid, count(*), sum(price) from items_ordered group by customerid having count(*) > 1; vs. count(row-name): SELECT customerid, count(customerid), sum(price) FROM items_ordered GROUP BY customerid HAVING count(customerid) > 1;

    Read the article

  • count(*) vs count(column-name) - which is more correct?

    - by bread
    Does it make a difference if you do count(*) vs count(column-name) as in these two examples? I have a tendency to always write count(*) because it seems to fit better in my mind with the notion of it being an aggregate function, if that makes sense. But I'm not sure if it's technically best as I tend to see example code written without the * more often than not. count(*): select customerid, count(*), sum(price) from items_ordered group by customerid having count(*) > 1; vs. count(column-name): SELECT customerid, count(customerid), sum(price) FROM items_ordered GROUP BY customerid HAVING count(customerid) > 1;

    Read the article

  • SharpDX and game engines, back to zero?

    - by Baboon
    I'm a desktop developer (I mainly do WPF for a living) but I want to make games as a hobby. So a few months ago, I started reading blogs, gamedevSE, you name it. I understand in the C++ DirectX world, you have engines such as Unity3D with designers and whatnot, but as much as I'm ok to spend months understanding game development, I'd prefer to stay with my comfy C#. So I thought I'd develop my first games in /C#/DirectX through SharpDX But then, I can't use game engines anymore, since they're made for C++DirectX and not SharpDX. (ok, I could do P/Invokes but that defeats the purpose of SharpDX). I do know about XNA, and I also do know I can't publish to the marketplace with it (and quite frankly, I don't really want to learn an API that is in jeopardy). So how do you conceal writing games in C# and using existing game engines instead of reinventing the wheel? wait for ports? So I've found out the following: After doing the first tutorials of MOgre and digging around, it seems MOgre gives you the worse of both worlds: . You can't port it with Mono because it directly references a C++/CLI dll (Ogre) and C++/CLI isn't supported by Mono. And since it's not C++ itself, you can't make a pure build. Which, as far as I understand, means I'd be stuck on windows (and not even WinRT/Metro compatible), without capability of porting anything to mobiles or other OS (Mac/Linux). Even though it looks really nice to develop with MOgre, I'd like to learn something a little more open to future broadening. On the other hand, MonoGame seems to be a rewrite of XNA with SharpDX which sounds very promising: Mono allows me to easily port my games to other platforms, mobiles included. SharpDX allows me to access the latest DirectX versions XNA would be my first choice if only MS showed some hope for the future It really looks like MonoGame is nothing else than XNA on SharpDX. Axiom looks good too but I lack info on the subject (and pages with poor design don't give me a good feeling about an API...) XNA with SunBurn looks good: It should be portable to Mono (can anyone with experience give us feedback on that?), thus multi-platform. It's then marketplace-able since Mono itself is. Did I miss something or are 2) and 4) my best options (aside from the fact Mono doesn't support any XAML)?

    Read the article

  • Keep website and webservices warm with zero coding

    - by oazabir
    If you want to keep your websites or webservices warm and save user from seeing the long warm up time after an application pool recycle, or IIS restart or new code deployment or even windows restart, you can use the tinyget command line tool, that comes with IIS Resource Kit, to hit the site and services and keep them warm. Here’s how: First get tinyget from here. Download and install the IIS 6.0 Resource Kit on some PC. Then copy the tinyget.exe from “c:\program files…\IIS 6.0 ResourceKit\Tools'\tinyget” to the server where your IIS 6.0 or IIS 7 is running. Then create a batch file that will hit the pages and webservices. Something like this: SET TINYGET=C:\Program Files (x86)\IIS Resources\TinyGet\tinyget.exe"%TINYGET%" -srv:dropthings.omaralzabir.com -uri:http://dropthings.omaralzabir.com/ -status:200"%TINYGET%" -srv:dropthings.omaralzabir.com -uri:http://dropthings.omaralzabir.com/WidgetService.asmx?WSDL - status:200 First I am hitting the homepage to keep the webpage warm. Then I am hitting the webservice URL with ?WSDL parameter, which allows ASP.NET to compile the service if not already compiled and walk through all the operations and reflect on them and thus loading all related DLLs into memory and reducing the warmup time when hit. Tinyget gets the servers name or IP in the –srv parameter and then the actual URI in the –uri. I have specified what’s the HTTP response code to expect in –status parameter. It ensures the site is alive and is returning http 200 code. Besides just warming up a site, you can do some load test on the site. Tinyget can run in multiple threads and run loops to hit some URL. You can literally blow up a site with commands like this: "%TINYGET%" -threads:30 -loop:100 -srv:google.com -uri:http://www.google.com/ -status:200 Tinyget is also pretty useful to run automated tests. You can record http posts in a text file and then use it to make http posts to some page. Then you can put matching clause to check for certain string in the output to ensure the correct response is given. Thus with some simple command line commands, you can warm up, do some transactions, validate the site is giving off correct response as well as run a load test to ensure the server performing well. Very cheap way to get a lot done.

    Read the article

  • How to Be a King of the First Page on Google With Zero Cost

    Reaching the first page on Google in order to be successful and noticed in Network Marketing Online industry is one of the most important goals of every networker. I am going to show you how to reach the FIRST PLACE on the first page on Google, which is highly valuated technique, but first let me explain why do you need to get high Google ranking.

    Read the article

  • Zero bytes on home partition

    - by Michael Z
    I decided to replace the hard drive on my machine running Ubuntu 12.04 LTS . After using the new hard drive for a few days, I noticed that the new hard drive has bad sectors. So I decided to plug my old hard drive back in. First, I plugged both hard drives in and copied some data files from the new hard drive to the old one. After unplugging the new hard drive, I booted the computer with the old hard drive, and here I got a surprise: I can see 0 bytes available on my /home partition! The df utility shows that the /home partition has 0 available bytes. I have tried to move some files. But I still has 0 bytes on /home! However, GParted correctly shows that the available size is near 2Gb. UPDATE 1: To my surprise, System Monitor shows me that approximately 2 Gb are free and 0 bytes are available on the /home partition. It's slightly shocked me! Are "free" and "available" not the same? Any help is really appreciated!

    Read the article

  • Google Webmaster Tools Index dropped to Zero [closed]

    - by Brian Anderson
    Earlier this year I rebuilt my website using ZenCart. Immediately I saw a drop in index status from 59 to 0. I then signed up for Google Webmaster Tools and noticed the Index status took a dramatic drop and has never recovered. I have worked to add content and I know I am not done, but have not seen any recovery of this index since. What confuses me is when I look at the sitemap status under Optimization it shows me there are 1239 submitted and 1127 pages indexed. Most of my pages have fallen off page one for relevant search terms and some are as far back as page 7 or 8 where they used to be on the first page. I have made some changes in the past week to robots.txt and sitemap.xml, but have not seen any improvements. Can anyone tell me what might be going on here? My website is andersonpens.net. Thanks! Brian

    Read the article

< Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >