Search Results

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

Page 23/447 | < Previous Page | 19 20 21 22 23 24 25 26 27 28 29 30  | Next Page >

  • What is the minimum interface that has the Count property in .Net

    - by SoMoS
    Hello, I need to change a method that has one parameter that takes a serie of objects. I need to find the lowest Interface (in inheritance tree) that has the Count property. Until now I was using the IEnumerable but as this has not Count I need to change it to the wider interface possible so the method can work with the biggest number of types of series (collections, lists, arrays, etc). Thanks in advance.

    Read the article

  • Count words like Microsoft Word does

    - by Maarten
    I need to count words in a string using PHP or Javascript (preferably PHP). The problem is that the counting needs to be the same as it works in Microsoft Word, because that is where the people assemble their original texts in so that is their reference frame. PHP has a word counting function (http://php.net/manual/en/function.str-word-count.php) but that is not 100% the same as far as I know. Any pointers?

    Read the article

  • Wordpress - Total User Count who only have posts

    - by knightrider
    I want to display total number of user who only have posts at Wordpress. I can get all users by this query <?php $user_count = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->users;"); echo $user_count ?> But for the user count only with posts, i think i might need to join another table, does anyone have snippets ? Thanks.

    Read the article

  • exec() in BeanShell macro causes jEdit to hang when it returns non-zero exit code

    - by rossmeissl
    I have a jEdit BeanShell macro that runs my Markdown files through Maruku when I save them: if (buffer.getMode().toString().equals("markdown")) { cmd = "C:\\Ruby\\bin\\maruku.bat -o " + buffer.getDirectory() + buffer.getName().replaceAll("markdown$", "html") + " " + buffer.getPath(); exec(cmd); } This works great when the Markdown file is valid. But if I've made a mistake, jEdit just waits around forever for the exec() call to "succeed," which it never will. When this happens, I have to kill jEdit's javaw.exe process and run Maruku manually from the command line to discover the error, e.g.: E:\bp\plan\supply_chain>maruku business_plan.markdown ___________________________________________________________________________ | Maruku tells you: +--------------------------------------------------------------------------- | Could not find ref_id = "17" for md_link(["17"],"17") | Available refs are [] +--------------------------------------------------------------------------- !C:/Ruby/lib/ruby/gems/1.8/gems/maruku-0.6.0/lib/maruku/errors_management.rb:49:in `maruku_error' !C:/Ruby/lib/ruby/gems/1.8/gems/maruku-0.6.0/lib/maruku/output/to_html.rb:716:in `to_html_link' !C:/Ruby/lib/ruby/gems/1.8/gems/maruku-0.6.0/lib/maruku/output/to_html.rb:970:in `send' !C:/Ruby/lib/ruby/gems/1.8/gems/maruku-0.6.0/lib/maruku/output/to_html.rb:970:in `array_to_html' !C:/Ruby/lib/ruby/gems/1.8/gems/maruku-0.6.0/lib/maruku/output/to_html.rb:961:in `each' \___________________________________________________________________________ Not creating a link for ref_id = "17". Then I restart jEdit, fix the error, and re-save the file, at which point the macro succeeds. How can I make my macro more resilient to either die helpfully (display Maruku's error output) or, at the very least, die silently so I don't have to kill jEdit?

    Read the article

  • Zero code coverage with cobertura 1.9.2 but tests are working

    - by eraonel
    I run the code coverage target: <junit fork="yes" dir="${basedir}" failureProperty="test.failed"> <!-- Note the classpath order: instrumented classes are before the original (uninstrumented) classes. This is important. --> <classpath path="${instrumented.dir}" /> <classpath path="${classes.dir}" /> <classpath refid="classpath" /> <!-- The instrumented classes reference classes used by the Cobertura runtime, so Cobertura and its dependencies must be on your classpath. --> <classpath refid="cobertura.classpath" /> <formatter type="xml" /> <!--<test name="${testcase}" todir="${reports.xml.dir}" if="testcase" />--> <batchtest fork="yes" todir="${reports.xml.dir}"> <fileset dir="${classes.dir}"> <include name="**/generated/AllTests.class" /> </fileset> </batchtest> </junit> <junitreport todir="${reports.xml.dir}"> <fileset dir="${reports.xml.dir}"> <include name="TEST-*.xml" /> </fileset> <report format="frames" todir="${reports.html.dir}" /> </junitreport> Then I get the following output ( when using fork="true"): java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at net.sourceforge.cobertura.util.FileLocker.lock(FileLocker.java:124) at net.sourceforge.cobertura.coveragedata.ProjectData.saveGlobalProjectData(ProjectData.java:331) at net.sourceforge.cobertura.coveragedata.SaveTimer.run(SaveTimer.java:31) at java.lang.Thread.run(Thread.java:595) Caused by: java.io.IOException: No locks available at sun.nio.ch.FileChannelImpl.lock0(Native Method) at sun.nio.ch.FileChannelImpl.lock(FileChannelImpl.java:784) at java.nio.channels.FileChannel.lock(FileChannel.java:865) ... 8 more --------------------------------------- Unable to get lock on /vobs/rnc/rrt/roam2/roamSs/RoamMao_swb/RoamMao_bldu/ant_build/cobertura.ser.lock: null This is known to happen on Linux kernel 2.6.20. Make sure cobertura.jar is in the root classpath of the jvm process running the instrumented code. If the instrumented code is running in a web server, this means cobertura.jar should be in the web server's lib directory. Don't put multiple copies of cobertura.jar in different WEB-INF/lib directories. Only one classloader should load cobertura. It should be the root classloader. I am using Ant 1.7.0 and cobertura 1.9.2. Any ideas why there is no coverage? Test run ok as I see in my target. I have tried to switch java versions ( 1.5.0_06 and 1.6.0_10) but no difference.

    Read the article

  • Negative zero using Crystal Report ToText()

    - by Dan Ward
    Using Crystal Reports 8.5 on Windows Vista or 7, I'm using the ToText function to report a value: totext(Sum ({ap121w7.yrentamt}, {@type1099})*100,"000000000000000000") The result (if yrentamt is 0) is -000000000000000000 The dash (I assume it's a negative sign) is unneccessary and unwanted in my report. Is this a bug, or is there an easy solution? --Note-- I would very much like to avoid the following: if {ap121w7.yrentamt}=0.00 then yrentamt := "000000000000" else yrentamt := totext({ap121w7.yrentamt}*100,"000000000000"); I have about 100 files to fix with multiple formulas per file, and the above solution doesn't seem to work consistently either.

    Read the article

  • How to count no of elements ?

    - by rajesh
    hi suppose i have what i want is inside maindiv i want to count no of elements(may be div input tags)present. there may be use of getElementByTagName(). But the problem is that how to count element. Thanks

    Read the article

  • count and fetch rows in php

    - by Mac Taylor
    hey guys i have a table in my mysql database named (names) now everyone can save their real names now i want to query this table and find out how many times these names used forexample the output should be : Jakob (20) Jenny (17) now this is my own code : list($usernames) =mysql_fetch_row(mysql_query('SELECT name FROM table_user GROUP BY name ORDER BY COUNT(name) DESC LIMIT 50 ')); list($c) =mysql_num_rows(mysql_query('SELECT COUNT(name) FROM table_user GROUP BY name ')); print $usernames.'('.$c.')' is this a correct approach ?!

    Read the article

  • drop down list had zero value

    - by KareemSaad
    I had ddl which in selected changed it execute some code but when i tried to do that it wasn't worked well WHEN i checked the reason i found that ddl in selected value =0 also i made all well and this is my code protected void DDlProductFamily_SelectedIndexChanged(object sender, EventArgs e) { if (DDlProductFamily.DataValueField.Contains("ProductCategory_Id")) using (SqlConnection Con = Connection.GetConnection()) { SqlCommand Com = new SqlCommand("GetListViewByProductCategory", Con); Com.CommandType = CommandType.StoredProcedure; Com.Parameters.Add(Parameter.NewInt("@ProductCategory_Id", DDlProductFamily.SelectedValue.ToString())); SqlDataAdapter DA = new SqlDataAdapter(Com); DA.Fill(dt); DataList1.DataSource = dt; DataList1.DataBind(); } }

    Read the article

  • MySQL 5.1.41 leading zero is deleted

    - by iggnition
    Hello, I have a MySQL database where i want to store phonenumbers among other things. The fieldtype is INT(10) When I try to insert a number starting with a 0, like 0504042858 it's stored like 504042858. This only happens with zeros when the number start with any other number it's stored correctly. What am I doing wrong?

    Read the article

  • Socket Read In Multi-Threaded Application Returns Zero Bytes or EINTR (-1)

    - by user309670
    Hi. Am a c-coder for a while now - neither a newbie nor an expert. Now, I have a certain daemoned application in C on a PPC Linux. I use PHP's socket_connect as a client to connect to this service locally. The server uses epoll for concurrent connections via a Unix socket. A user submitted string is parsed for certain characters/words using strstr() and if found, spawns 4 joinable threads to different websites simultaneously. I use socket, connect, write and read, to interact with the said webservers via TCP on port 80 in each thread. All connections and writes seems successful. Reads to the webserver sockets fail however, with either (A) all 3 threads seem to hang, and only one thread returns -1 and errno is set to 104. The responding thread takes like 10 minutes - an eternity long:-(. *I read somewhere that the 104 (is EINTR) suggests that ...'the connection was reset by peer', or (B) 0 bytes from 3 threads, and only 1 of the 4 threads actually returns some data. Isn't the socket read/write thread-safe? Otherwise, use thread-safe (and reentrant) libc functions such as strtok_r, gethostbyname_r, etc. *I doubt that the said webhosts are actually resetting the connection, because when I run a single-threaded standalone (everything else equal) all things works perfectly right. There's a second problem too (oops), I can't write back to the client who connect to my epoll-ed Unix socket. My daemon application will hang and hog CPU 100% for ever. Yet nothing is written to the clients end. Am sure the client (a very typical PHP socket application) hasn't closed the connection whenever this is happening - no error(s) detected either. I cannot figure-out whatever is wrong even with Valgrind or GDB

    Read the article

  • ASP.NET client side validation with dataannotations - javascript minimumlength zero

    - by Kordonme
    Hi! I'm doing client side validation on a project I'm working on. Everything works, except for the minimumlength property of the StringLength attribute (it works when submitting and a serverside validation is done): [StringLength(50, MinimumLength = 6)] The javascript generated by Html.EnableClientValication(); is the following: // snip {"FieldName":"User.Password","ReplaceValidationMessageContents":true,"ValidationMessageId":"User_Password_validationMessage","ValidationRules":[{"ErrorMessage":"The field Password must be a string with a minimum length of 6 and a maximum length of 50.","ValidationParameters":{"minimumLength":0,"maximumLength":50},"ValidationType":"stringLength"}]}],"FormId":"form0","ReplaceValidationSummary":false}) The important thing is here: {"minimumLength":0,"maximumLength":50} It produces javascript with the wrong minimumproperty. You guys have a hint? Is this a possible bug?

    Read the article

  • Django: get count of ForeignKey item in template?

    - by AP257
    Straightforward question - apologies if it is a duplicate, but I can't find the answer if so. I have a User model and a Submission model, like this: class Submission(models.Model): uploaded_by = models.ForeignKey('User') class User(models.Model): name = models.CharField(max_length=250 ) How can I show the number of Submissions made by each user in the template? I've tried {{ user.submission.count }}, like this: for user in users: {{ user.name }} ({{ user.submission.count }} submissions) but no luck...

    Read the article

  • Zero KB SQLite File created by Core Data on application start up

    - by Tots
    I'm developing an iPhone application using Core Data. I had everything working and had to make an adjustment to the database schema and change the relationships through the xcdatamodel file. I deleted the my project's sqlite file in Library/Application Support/iPhone Simulator/3.1.3//Documents. Build and run the application, it creates the sqlite file, but its empty with a file size of 0 KB. At a minimum the table information should be in there. There are no errors/warning in the console. Anyone have an idea what is wrong?

    Read the article

  • Count Total Number of XmlNodes in C#

    - by mjmcloug
    Hey, I'm trying to find a way to get the total number of child nodes from an XmlNode recursively. That it is to say I want to count all the children, grand children etc. I think its something like node.SelectNodes(<fill in here>).Count but I don't know what the XPath is. Thanks

    Read the article

  • Need to try and count repeated lists within a list

    - by user1828603
    Im trying to count how many repeated lists there are inside a list. But it doesnt work the same way I could count repeated elements in just a list. Im fairly new to python, so apologies if it sounds too easy. this is what i did x= [["coffee", "cola", "juice" "tea" ],["coffee", "cola", "juice" "tea"] ["cola", "coffee", "juice" "tea" ]] dictt= {} for item in x: dictt[item]= dictt.get(item, 0) +1 return(dictt)

    Read the article

  • wssql always returning zero rows

    - by Lavinski
    I'm using the windows search 4.0 service (wssql) to find some files, it works fine on my computer but on our server which has two drives C: and D: always returns 0 rows when searching D: Also i'm not sure if it's related but cd d: goes back to c: in the command prompt.

    Read the article

  • QWinWidget's position is always 0 (zero)

    - by Kevin
    I hosted a QWinWidget in a CView and want it to stay at a designated position when resizing. But QWinWidget always moves to (0, 0), i.e. left-top corner of the CView. I tried to debug in this way: QWinWidget* pWidget = new QWinWidget(pCView); pWidget->move(50, 50); QPoint pos = pWidget->pos(); Note that: the pos is always (0, 0). Why is that?

    Read the article

  • SQLite SQLite column can't be updated to any value but zero (real type)

    - by user1065320
    Hi I'm trying to create a three fields table (date,text,real), I can insert and update the first two fields but can't set or update the last one. createSQL = @"CREATE TABLE IF NOT EXISTS ACTIVITIES (MYDATE DATETIME PRIMARY KEY, ACTIVITY TEXT , LENGTH REAL);"; try to insert char *update = "INSERT OR REPLACE INTO ACTIVITIES (MYDATE, ACTIVITY , LENGTH) VALUES (?, ? ,?);"; sqlite3_stmt *stmt; if (sqlite3_prepare_v2(database, update , -1, &stmt, nil) == SQLITE_OK) { sqlite3_bind_double(stmt, 1, valueToWrite); sqlite3_bind_text(stmt, 2, [task UTF8String], -1, NULL); sqlite3_bind_double(stmt, 3, 1.5); } if (sqlite3_step(stmt) != SQLITE_DONE) { NSAssert1(0, @"Error updating table: %s", errorMsg); } sqlite3_finalize(stmt); sqlite3_close(database); The first two values are updated but the last one remains 0 even if I'm writing a value like 1.5 or put a double variable with a different value Thanks

    Read the article

  • Count the number of lines in a file with Ruby, without reading entire file into memory

    - by smnirven
    I'm processing huge data files (millions of lines each). Before I start processing I'd like to get a count of the number of lines in the file, so I can then indicate how far along the processing is. I am using Ruby, and because of the size of the files, it would not be practical to read the entire file into memory just to count how many lines there are. Does anyone have a good suggestion on how to do this?

    Read the article

  • Scan for first zero bit (Assembly)?

    - by cthulhu
    I have some numbers in AH, AL, BL, BH registers. I need to check whether there is 0 bit in each of the registers in left half of the number. If yes, then put into check variable value 10 else -10. How can I do this? I tried something like that: org 100h check dw 0 mov ah, 11111111b mov al, 11111111b mov bl, 11111111b mov bh, 11111111b mov check, -10 shr ah, 4 shr al, 4 shr bl, 4 shr bh, 4 cmp ah, 0Fh jz first first: cmp al, 0Fh jz second second: cmp bl, 0Fh jz third third: cmp bh, 0Fh jz final final: mov check, 10 ret

    Read the article

< Previous Page | 19 20 21 22 23 24 25 26 27 28 29 30  | Next Page >