Search Results

Search found 6934 results on 278 pages for 'zero fill'.

Page 11/278 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • fill array with binary numbers

    - by davit-datuashvili
    hi, first of all this is not homework!! my question is from book: Algorithms in C++ third edition by robert sedgewick question is: there is given array of size n by 2^n(two dimensional) and we should fill it by binary numbers with bits size exactly n or for example n=5 so result will be 00001 00010 00011 00100 00101 00110 00111 and so on we should put this sequence of bits into arrays please help me

    Read the article

  • Why fill() and copy() of Collections in java is implemented this way

    - by Priyank Doshi
    According to javadoc... Collections.fill() is written as below : public static <T> void fill(List<? super T> list, T obj) { int size = list.size(); if (size < FILL_THRESHOLD || list instanceof RandomAccess) { for (int i=0; i<size; i++) list.set(i, obj); } else { ListIterator<? super T> itr = list.listIterator(); for (int i=0; i<size; i++) { itr.next(); itr.set(obj); } } } Its easy to understand why they didn't use listIterator for if (size < FILL_THRESHOLD || list instanceof RandomAccess) condition as of RandomAccess. But whats the use of size < FILL_THRESHOLD in above? I mean is there any significant performance benefit over using iterator for size>=FILL_THRESHOLD and not for size < FILL_THRESHOLD ? I see the same approach for Collections.copy() also : public static <T> void copy(List<? super T> dest, List<? extends T> src) { int srcSize = src.size(); if (srcSize > dest.size()) throw new IndexOutOfBoundsException("Source does not fit in dest"); if (srcSize < COPY_THRESHOLD || (src instanceof RandomAccess && dest instanceof RandomAccess)) { for (int i=0; i<srcSize; i++) dest.set(i, src.get(i)); } else { ListIterator<? super T> di=dest.listIterator(); ListIterator<? extends T> si=src.listIterator(); for (int i=0; i<srcSize; i++) { di.next(); di.set(si.next()); } } } FYI: private static final int FILL_THRESHOLD = 25; private static final int COPY_THRESHOLD = 10;

    Read the article

  • how can I force automatic filling to be enabled on webpages?

    - by thepaulpage
    I'm using the Chrome Browser. I enjoy the "automatic filling" that it uses to fill in things like my address when I'm shopping online. Sometimes I get a message that says: "This webpage has disabled automatic filling for this form" Is there a way that I can tell Chrome to ignore what the webpage wants and just give me what I want? I'm not talking about passwords, I'm talking about Chrome's automatic filling in of things like my email address, zip code, etc. For Example: https://www.kansas.gov/ump/register/account?

    Read the article

  • How to change the colors of a legend item in flex legend?

    - by AngelHeart
    in my flex chart I changed the fill of the PieSeries to use custom colors (set colors that I was prepared to be used according to values in the data provider of the Pie Chart)... The problem that the legend that is linked to my PieChart still shows the flex default colors and not the new colors from the PieChart series! Any idea how can I render the marker fill color of the flex legend items to meet the colors in the Pie Chart?

    Read the article

  • Newline-separated xargs

    - by porneL
    Is it possible to make xargs use only newline as separator? (in bash on Linux and OS X if that matters) I know -0 can be used, but it's PITA as not every command supports NUL-delimited output.

    Read the article

  • Apple Push notifications server - Feedback always returns zero tuples

    - by Franz
    Hi, I am developing an iPhone App that uses Apple Push Notifications. On the iPhone side everything is fine, on the server side I have a problem. Notifications are sent correctly however when I try to query the feedback service to obtain a list of devices from which the App has been uninstalled, I always get zero results. I know that I should obtain one result as the App has been uninstalled from one of my test devices. After 24 hours and more I still have no results from the feedback service.. Any ideas? Does anybody know how long it takes for the feedback service to recognize that my App has been uninstalled from my test device? Could it be due to the sandbox environment?

    Read the article

  • Graphics.FromHwnd(IntPtr.Zero) returns null, why?

    - by Martin Moser
    I'm currently investigating a problem with a 3rd party component (DevExpress) in my application. My issue is quite similar to this one DevExpress KB article. I get the same exception with more less the same stacktrace. So I used .NET Reflector to find out, what may be null in this scenario, and the only object which is a candiate to be null is Graphics. This is created with Graphics.FromHwnd(IntPtr.Zero). Because I don't have a broad knowledge about GDI, I would like to know if somebody can tell me possible scenarios when this may return null... I tried to reproduce it in a scenario where windows is out of GDI handle's, but then I'm getting a "out of handles" - exception at least once, which is not the case in the issue I'm investigating tia, Martin

    Read the article

  • ERRNO: 2 Division by zero error

    - by chupinette
    I am getting this error : ERRNO: 2 TEXT: Division by zero I have the following function in my class Customer public static function GetQuotationDetails($string) { $sql = 'SELECT I.name, I.discounted_price, I.other_name FROM item I WHERE ( I.name LIKE CONCAT( '%', :string, '%' )) AND T.item_name=:string'; $parameters = array(':string' => $string); DB::GetAll($sql,$parameters); } Then, $this->results = Customer::GetQuotationDetails('grinder'); and i echo the results by echo $obj_quotations->results; Can anyone help me?

    Read the article

  • How can I compact the VHD file with Ubuntu?

    - by AmShegar
    I use windows server 2008r2 with role Hyper-V. The guest system is Ubuntu 12.04 LTC. It is situated on the dynamic virtual hard disk. I want to compact this VHD (The real size is 50 GB, 360 GB on the disk). But I can not do this, because the Ubuntu file system is not NTFS. What do I need (gparted, sdelete, ...) for solving this problem? The main problem is that the filesystem is not NTFS, but ext4.

    Read the article

  • Decimal data Type Display scale part as zero

    - by Wael Dalloul
    I have Decimal field in SQLserver 2005 table, Price decimal(18, 4) if I write 12 it will be converted to 12.0000, if I write 12.33 it will be converted into 12.3300. Always it's putting zero to the right of the decimal point in the count of Scale Part(4). I was using these in SQL Server 2000, it was not behaving like this, in SQL Server 2000 if I put 12.5 it will be stored as 12.5 not as 12.5000 what SQLServer2005 do. My Question is how to stop SQL Server 2005 from putting zeros to the right of the decimal point?

    Read the article

  • Desimal data Type Display scale part as zero

    - by Wael Dalloul
    I have Decimal field in SQLserver 2005 table, Price decimal(18, 4) if I write 12 it will be converted to 12.0000, if I write 12.33 it will be converted into 12.3300. Always it's putting zero to the right of the decimal point in the count of Scale Part(4). I was using these in SQL Server 2000, it was not behaving like this, in SQL Server 2000 if I put 12.5 it will be stored as 12.5 not as 12.5000 what SQLServer2005 do. My Question is how to stop SQL Server 2005 from putting zeros to the right of the decimal point?

    Read the article

  • Fill data gaps - UNION, PARTITION BY, or JOIN?

    - by Dave Jarvis
    Problem There are data gaps that need to be filled. Would like to avoid UNION or PARTITION BY if possible. Query Statement The select statement reads as follows: SELECT count( r.incident_id ) AS incident_tally, r.severity_cd, r.incident_typ_cd FROM report_vw r GROUP BY r.severity_cd, r.incident_typ_cd ORDER BY r.severity_cd, r.incident_typ_cd Data Sources The severity codes and incident type codes are from: severity_vw incident_type_vw The columns are: incident_tally severity_cd incident_typ_cd Actual Result Data 36 0 ENVIRONMENT 1 1 DISASTER 27 1 ENVIRONMENT 4 2 SAFETY 1 3 SAFETY Required Result Data 36 0 ENVIRONMENT 0 0 DISASTER 0 0 SAFETY 27 1 ENVIRONMENT 0 1 DISASTER 0 1 SAFETY 0 2 ENVIRONMENT 0 2 DISASTER 4 2 SAFETY 0 3 ENVIRONMENT 0 3 DISASTER 1 3 SAFETY Question How would you use UNION, PARTITION BY, or LEFT JOIN to fill in the zero counts?

    Read the article

  • Regex expression with leading zero

    - by user1874087
    I'm rather new to regex expressions and need help with a simple expression. I'm using Pentaho for ETL (Replace in String transformation) and I have column values that I need to add leading zeros to and parse out text as part of the database import. So far I have been unable to add the leading zero. The column is called Region and the values are "region 8", "region 10", "region 11". My regex expression is ['Region'] which will eliminate the region text but produces results = "8", "10", "11". I need values to produce "08", "10", "11". So all the single digit numbers must have leading zeros.

    Read the article

  • MySQL - Join as zero if record Not IN

    - by Zurahn
    To explain by example, take two tables, A and B Table A id foo 1 x 2 y 3 z Table B id aid bar 1 3 50 2 1 100 An example join SELECT foo, bar FROM a, b WHERE a.id = b.aid; Garners a result of foo bar z 50 x 100 What I would like to do is get all values of foo and for any instances where there isn't a corresponding bar value, return 0 for that column. My best guess was something along the lines of SELECT foo, bar AS br FROM a, b WHERE a.id = b.aid OR a.id NOT IN (SELECT aid FROM b); But that returns duplicates and non-zero values for bar. Possible?

    Read the article

  • Can't return nil, but zero value of slice

    - by Sergi
    I am having the case in which a function with the following code: func halfMatch(text1, text2 string) []string { ... if (condition) { return nil // That's the final code path) } ... } is returning []string(nil) instead of nil. At first, I thought that perhaps returning nil in a function with a particular return type would just return an instance of a zero-value for that type. But then I tried a simple test and that is not the case. Does anybody know why would nil return an empty string slice?

    Read the article

  • MYSQL: COUNT with GROUP BY, LEFT JOIN and WHERE clause doesn't return zero values

    - by Paul Norman
    Hi guys, thanks in advance for any help on this topic! I'm sure this has a very simply answer, but I can't seem to find it (not sure what to search on!). A standard count / group by query may look like this: SELECT COUNT(`t2`.`name`) FROM `table_1` `t1` LEFT JOIN `table_2` `t2` ON `t1`.`key_id` = `t2`.`key_id` GROUP BY `t1`.`any_col` and this works as expected, returning 0 if no rows are found. So does: SELECT COUNT(`t2`.`name`) FROM `table_1` `t1` LEFT JOIN `table_2` `t2` ON `t1`.`key_id` = `t2`.`key_id` WHERE `t1`.`another_column` = 123 However: SELECT COUNT(`t2`.`name`) FROM `table_1` `t1` LEFT JOIN `table_2` `t2` ON `t1`.`key_id` = `t2`.`key_id` WHERE `t1`.`another_column` = 123 GROUP BY `t1`.`any_col` only works if there is at least one row in table_1 and fails miserably returning an empty result set if there are zero rows. I would really like this to return 0! Anyone enlighten me on this? Beer can be provided in exchange if you are in London ;-)

    Read the article

  • previousFailureCount always stays on 0 (zero)

    - by itai alter
    Hello all, First of all, I'd like to thank the good people who helped me around on this site. Thanks. I'm trying to detect a failed authentication attempt in my app... I'm using the didReceiveAuthenticationChallenge method, and the checking if [challenge previousFailureCount] is equal to 0. The problem is that it's always stays on zero, even if the username and password that I send with the credentials are incorrect. I couldn't find any info about this kind of issue, any help will be much appreciated. Thanks!

    Read the article

  • Fill data gaps without UNION

    - by Dave Jarvis
    Problem There are data gaps that need to be filled, possibly using PARTITION BY. Query Statement The select statement reads as follows: SELECT count( r.incident_id ) AS incident_tally, r.severity_cd, r.incident_typ_cd FROM report_vw r GROUP BY r.severity_cd, r.incident_typ_cd ORDER BY r.severity_cd, r.incident_typ_cd Code Tables The severity codes and incident type codes are from: severity_vw incident_type_vw Actual Result Data 36 0 ENVIRONMENT 1 1 DISASTER 27 1 ENVIRONMENT 4 2 SAFETY 1 3 SAFETY Required Result Data 36 0 ENVIRONMENT 0 0 DISASTER 0 0 SAFETY 27 1 ENVIRONMENT 0 1 DISASTER 0 1 SAFETY 0 2 ENVIRONMENT 0 2 DISASTER 4 2 SAFETY 0 3 ENVIRONMENT 0 3 DISASTER 1 3 SAFETY Any ideas how to use PARTITION BY (or JOINs) to fill in the zero counts?

    Read the article

  • Fill spinner from cursor in android

    - by Rickard
    Hi, i have searched for a awnser for this for a while today. It all looks so easy but i never get it to work. I want to fill a spinner with my cursor. I have been trying to use SimpleCursorAdapter for this as a lot of sites say i shall but i never get it to work. Show me just how easy it is :) Thanks for your time! My cursor Cursor cursor = db.query(DATABASE_TABLE_Clients, new String[] {"_id", "C_Name"}, null, null, null, null, "C_Name"); My spinner (Spinner) findViewById(R.id.spnClients); My Code Cursor cursor_Names = SQLData.getClientNames(); startManagingCursor(cursor_Names); String[] columns = new String[] { "C_Name" }; int[] to = new int[] { R.id.txt_Address }; SimpleCursorAdapter mAdapter = new SimpleCursorAdapter(this, android.R.layout.simple_spinner_dropdown_item, cursor_Names, columns, to); Spinner spnClients = (Spinner) findViewById(R.id.spnClients); spnClients.setAdapter(mAdapter);

    Read the article

  • C#: Fill DataGridView From Anonymous Linq Query

    - by mdvaldosta
    // From my form BindingSource bs = new BindingSource(); private void fillStudentGrid() { bs.DataSource = Admin.GetStudents(); dgViewStudents.DataSource = bs; } // From the Admin class public static List<Student> GetStudents() { DojoDBDataContext conn = new DojoDBDataContext(); var query = (from s in conn.Students select new Student { ID = s.ID, FirstName = s.FirstName, LastName = s.LastName, Belt = s.Belt }).ToList(); return query; } I'm trying to fill a datagridview control in Winforms, and I only want a few of the values. The code compiles, but throws a runtime error: Explicit construction of entity type 'DojoManagement.Student' in query is not allowed. Is there a way to get it working in this manner?

    Read the article

  • Java JDBC: Reply.fill()

    - by Harv
    Hi, I get the following exception at times: com.ibm.db2.jcc.b.gm: [jcc][t4][2030][11211][3.50.152] A communication error occurred during operations on the connection's underlying socket, socket input stream, or socket output stream. Error location: Reply.fill(). Message: Connection reset. ERRORCODE=-4499, SQLSTATE=08001 The problem is that, the code executes successfully for quite some time and then suddenly I get this exception. However it runs perfrectly when I run the code again. Could some one please tell me what could be wrong and provide me some pointers to resolve this. Thanks, Harveer

    Read the article

  • Fill WinForms DataGridView From Anonymous Linq Query

    - by mdvaldosta
    // From my form BindingSource bs = new BindingSource(); private void fillStudentGrid() { bs.DataSource = Admin.GetStudents(); dgViewStudents.DataSource = bs; } // From the Admin class public static List<Student> GetStudents() { DojoDBDataContext conn = new DojoDBDataContext(); var query = (from s in conn.Students select new Student { ID = s.ID, FirstName = s.FirstName, LastName = s.LastName, Belt = s.Belt }).ToList(); return query; } I'm trying to fill a datagridview control in Winforms, and I only want a few of the values. The code compiles, but throws a runtime error: Explicit construction of entity type 'DojoManagement.Student' in query is not allowed. Is there a way to get it working in this manner?

    Read the article

  • Increase columns width in Silverlight DataGrid to fill whole DG width

    - by Henrik P. Hessel
    Hello, I have a DataGrid Control which is bound to a SQL Table. The XAML Code is: <data:DataGrid x:Name="dg_sql_data" Grid.Row="1" Visibility="Collapsed" Height="auto" Margin="0,5,5,5" AutoGenerateColumns="false" AlternatingRowBackground="Aqua" Opacity="80" > <data:DataGrid.Columns> <data:DataGridTextColumn Header="Latitude" Binding="{Binding lat}" /> <data:DataGridTextColumn Header="Longitude" Binding="{Binding long}" /> <data:DataGridTextColumn Header="Time" Binding="{Binding time}" /> </data:DataGrid.Columns> </data:DataGrid> Is it possible increase the single columns sizes to fill out the complete width of the datagrid? thx!, rAyt Edit: Columns with "*" as width are coming with the Silverlight SDK 4.

    Read the article

  • Make jqGrid fill it's container

    - by Horacio
    I am using the jQuery layout plugin and the jqGrid plugin in one of my projects and they work great except for a little problem... I want the jqGrid to fill up completely the pane (jQuery layout pane) that contains it. Resizing the pane should resize the jqGrid, closing the pane should hide the jqGrid, etc, etc... Both jqGrid and jQuery Layout provide callbacks but when I use them the page layout breaks horribly. Has anyone any experience mixing jqGrid with jQuery Layout? http://www.secondpersonplural.ca/jqgriddocs/index.htm http://layout.jquery-dev.net/

    Read the article

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