w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Highstock Data Grouping to Use Last Data Time as Index
You should be able to change this by modifying seriesProto.groupData function. There is grouping and approximation applied. Also you can change smoothed option, so set it to true, and: if (dataGroupingOptions.smoothed) { i = groupedXData.length - 1; groupedXData[i] = xMax; while (i-- && i > 0) { groupedXData[i] += interval / 2; // remove '/2' -> it will create delay to group to last point } groupedXData[0] = xMin; }

Categories : Highcharts

To index or not to index – are there reasons to index columns already included in a primary key?
Based upon your application you can decide what works best for indexes on the other columns in the table. For example, if you have a large percentage of queries including certain columns it may make sense to include them as indexes. You can include a single index per column or create a "covering index" that may include additional columns that you know will be returned in SQL queries frequently by your application. Here is some other helpful advice: You can run SQL Management Studio and issue some of your SELECT/INSERT/UPDATE/DELETE queries using the "Display Estimated Execution Plan". This will give you a visual graph of what the DBMS is doing under the covers. If you see "table scans" or "index scans" you can increase performance by adding indexes to change to "table seek" or "index s

Categories : Sql Server

How does index affect the result of two tables - one with index and another without index?
But the order of the rows are not the same and I don't know how to compare the data in both Of course. You added a clustered index - this means that the indexed table is stored sorted according to the index. But without an ORDER BY clause, there is not defined order. I don't know how to compare the data in both Use the ORDER BY clause to order the data as you wish. This will allow for comparisons. The query you have posted should return corresponding rows in the same order as your join condition is on COL_1, so not so sure why the issue is.

Categories : SQL

Error at BFS search .Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index
When the user enters something that is greater than 220 as a starting position, this line trace[start] = -1; will throw an exception, since start is indeed out of trace bounds. Therefore you need to force user to enter something you can handle. Like this: Console.Write("Please Input the Starting Node : "); starting_position = Convert.ToInt32(Console.ReadLine()); while (starting_position < 0 || starting_position >= trace.Count) { Console.Write("Starting Node is invalid. Should be between 0 and 220. Please enter another one : "); starting_position = Convert.ToInt32(Console.ReadLine()); } This is just an idea, point is - you should think about user input validation so it does not break your program. Update. Actually I did not realize that trace in the code above conta

Categories : C#

Error 13038: Can't find any special indices: 2d (needs index), 2dsphere (needs index)
With countless hours of debugging, I've found that installing the Geocoder Gem from HEAD actually fixed the problem, as the Gem's Author said: gem 'geocoder', github: 'alexreisner/geocoder' But at the time it didn't work for me. I think my database was corrupted. I say that because I had to completely remove all DBs from my Local Machine and also Remove & Add the MongoHQ addon again to my Heroku instance as well, just to make it work (since the problem persisted on Heroku as well). Once I did that, I just re-did rake db:mongoid:create_indexes and everything was working perfectly.

Categories : Mongodb

Index on calculated column triggers 900 byte index size limit
Try CAST(CASE ... END AS VARCHAR(106))... CAST(CASE WHEN city_id IS NULL THEN name ELSE name + REPLICATE(' ', 100 - LEN(name)) + city_id END AS VARCHAR(106)) COLLATE Modern_Spanish_CI_AI or simply ignore it... It's only a warning.

Categories : Sql Server

Why does MySQL Innodb "Creating sort index" when unique index exists?
If the values for column B are not available in the index pages, then MySQL will need to access pages in the underlying table. Also there no predicate that filters which rows are being considered, and that means MySQL is seeing that ALL rows need to be returned. This could explain why the index is not being used. Also note that the LIMIT operations are processed at the end of the statement, as nearly the last step in the execution plan, with a some exceptions. 8.2.1.3. Optimizing LIMIT Queries http://dev.mysql.com/doc/refman/5.5/en/limit-optimization.html I suspect that your query could make use of a covering index, for example "ON hugetable (A,B)", to avoid the sort operation. Absent a covering index, you could try rewriting the query something like this, to see if this will make use

Categories : Mysql

Does MongoDB maintain index statistics (data distribution for index key column)?
As of the current version of MongoDB (2.4), statistics about each index key are not kept. MongoDB query optimizer has a different approach to selecting which index to use (or whether to do a collection scan). The first time you run a particular query, if there are several indexes that could be used for the query, the query engine tries all of them in parallel and the one that finishes first wins (the others get killed off) - now this is a simplification but in a nutshell that's how a query plan is selected for the next X queries (query plans are periodically re-evaluated at various points). You can read more about this in MongoDB documentation of indexes.

Categories : Mongodb

Query optimizer index selection on compound index when querying only by the second field
Compound index are generally used, for prefix matched queries, or full matched ones. Clearly your first query don't qualify. You don't need to provide a hack for this. Instead you can just hint the optimiser to use the { a : 1, b : 1 } index db.Collection.find({ b: 1 }).hint({ a:1, b:1 })

Categories : Mongodb

Hibernate Search/JPA - Can't create initial index; program hangs AFTER apparent index creation
In the Indexer class, after closing the Entity Manager (em.close) you must close the Entity Manager Factory (entityManagerFactory.close();) or else the program will hang. This is explained in the FAQ list and is a common problem, but it is surprising how many examples only show fragments of code and don't include this line.

Categories : Hibernate

rich:dataScroller index refers previous dataTable scroller index inside a4j:repeat
I think you have to change the <ui:repeat> to a (JSTL) <c:forEach> (see http://www.crazysquirrel.com/computing/java/jsp/jstl-forEach.jspx) because it has another lifecycle and your implementation using ui:repeat won't work in this scenario. After doing so you probably also need some kind of "discriminator" for your IDs, because you cannot name all table components the same. You would have to use something like id="datatable0",... id="datatable1" and so on. You can use c:forEach's varStatus="status"property to do so. It has a property which you can use as the counter: #{status.index}

Categories : JSF

Copy index from DataFrame to second frame when 'index length mismatch'
Here's one way to do it: In [32]: from pandas import DataFrame, date_range, concat In [33]: from numpy.random import randn In [34]: df = DataFrame(randn(5, 1), index=date_range('20010101', periods=5), columns=['A']) In [35]: df2 = DataFrame(randn(3, 2), columns=list('BC')) In [36]: concat([df, df2.set_index(df.index[:len(df2)])], axis=1) Out[36]: A B C 2001-01-01 -0.043 0.759 -0.125 2001-01-02 -1.377 0.895 0.629 2001-01-03 0.263 -0.007 -0.515 2001-01-04 1.546 NaN NaN 2001-01-05 -0.657 NaN NaN You can also do this with DataFrame.join() for slightly shorter code: In [7]: df.join(df2.set_index(df.index[:len(df2)])) Out[7]: A B C 2001-01-01 -0.607 -0.038 0.593 2001-01-02 0.573 0.399 -0.627 2001-01-03 0.319 0.312

Categories : Python

.htaccess way to serve index.html/index.php based on timestamp
I would set up a Cron Job that runs every hour no matter if a visitor has hit your site or not. http://www.thesitewizard.com/general/set-cron-job.shtml 0 * * * * wget -O - -q http://www.website.com/cron.php

Categories : PHP

combobox search invalidargument=value of '0' is not valid for 'index'. parameter name index vb.net
You should check if your datasource contains items before binding them to the ComboBox. I don't know what type MyDataset is, but with Option Infer On the following should work, otherwise you should change the Dim dataSource = line to include the type. Private Sub TextBox9_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox9.TextChanged Try Dim dataSource = Me.MyDataset.Items.Select("ItemName like '%" & TextBox9.Text & "%'") If dataSource.Items.Count > 0 Then ComboBox3.DataSource = datasource ComboBox3.Update() End If If ComboBox3.Items.Count <> 0 Then ComboBox3.DroppedDown = True Me.Cursor = Cursors.Default

Categories : Vb.Net

Multi-column index combined with unique index efficiency
It depends on the % of rows with flag=1, and on how many rows you select (how many gbid's you have in the IN clause). If it is low (1-2%) and you are selecting a lot of gbid's, options 2 and 3 might be faster (I think option 3 will be better in that case). If you have a more even distribution of flag values having it in the index won't make a difference. If you want to be sure you should benchmark it with a sample of real data.

Categories : Mysql

Route user to some file like: index.php from any folder which is not having index.php | using .htaccess
What you basically want is to avoid listing all files of a folder when there is no index file. You can achieve this by adding this to your .htaccess file: Options All -Indexes

Categories : PHP

.htaccess - hide both "/index.html" and "/index" in root and directories
Check it here i think, its your problem. Also you can check this

Categories : Apache

When I am trying to dragging cell at last index in UITableView getting exception and it is happening for the last index only?
Check number of rows before and after you replace the cell. The error showing you itself says that number of rows before replacing are not equal to the number of rows after replacement.

Categories : IOS

OpenCL Index operations: algorithmic vs constant index buffer
Computation is almost always faster on the GPU than global memory access to do the same thing (like a look-up-table). In particular, because the GPU keeps so many kernels "in flight" the math happens while it is waiting on the I/O from the previous kernel slot. So if your math is not too complex, prefer to do it rather than burn a global memory access.

Categories : Performance

MAMP Pro cannot load or run from Kohana application's index.php. Displays "Index of /"
The fix for this was to remove in MAMP PRO the path I had set in the Directory Index text field of the Others tab for my particular host. Here's my setup for running an SSL web app that's placed on another location other than MAMP PRO's htdocs folder: Under hosts->General, I added my server name (i.e. subdomain.domain.local), checked local name resolution, and SSL, port 443 for Server Setting text box, and Disk Location points to the folder path where your Kohana's index.php file is (also make sure that you have permission's to your web app folder) Advanced tab: I have the options Indexes, FollowSymLinks checked; and also AllowOverride: All; Order: Allow,Deny; Allow: from all SSL tab: set the paths to your self-signed certificates for both certificate file and certificate key (if you d

Categories : PHP

Run mongo index command from terminal, solutions for a very large index
You should use the background option. db.collection.ensureIndex({ text: 'text', background: true }) From mongodb's documentation: Builds the index in the background so that building an index does not block other database activities. More information here http://docs.mongodb.org/manual/reference/method/db.collection.ensureIndex/

Categories : Mongodb

CakePHP and AngularJs in routing harmony: htaccess rules to send user to index.html or bootstrap index.php
Keep it simple One of Cake's main principles is KISS ("Keep it Simple (Stupid)"). You don't need any rewrite rule changes if the response for the url / is that of your index.html file i.e. do the equivalent of this: cd app mv webroot/index.html View/Pages/home.ctp <edit View/Pages/home.ctp> If you put the following at the top of the view file: <?php $this->layout = false; ?> You can also leave the contents as the complete raw html file. Doing this would remove the need for any .htaccess modifications. A specific note about one of the bullet points: If the user goes to domain.com/#/home, display index.html and let Angular take care of the hash route Nothing needs doing for that, as a url fragment is not sent by browsers with requests - the url received on the

Categories : Htaccess

index unrelated entities in same index with hibernate search
Using Hibernate Search you can easily make an index containing both, or you can have two indexes one for each entity but query them as it was a single index. @Indexed @Entity public class Person { int id; @Field String name; } @Indexed @Entity public class Workplace { int id; @Field String name; List<int> personId; } You can then use this index to find matching Persons and/or Workplace instances. org.apache.lucene.search.Query q = ...[a standard Lucene query] FullTextQuery fullTextQuery = fullTextSession.createFullTextQuery( q, Person.class ); List<Person> list = fullTextQuery.list(); or targetting both types: FullTextQuery fullTextQuery = fullTextSession.createFullTextQuery( q, Person.class, Workspace.class ); List list = fullTextQuery.list(); or

Categories : Hibernate

Create full text index by querying for index name
Just build the string manually, and then execute it: DECLARE @SQLString nvarchar(1000) DECLARE @ParmDefinition nvarchar(1000) DECLARE @keyIndex nvarchar(100); set @keyIndex = 'Id' SET @SQLString = N'CREATE FULLTEXT INDEX ON dbo.objects ( [Name] Language 1033, [Description] Language 1033 ) KEY INDEX ' + @keyIndex +N' WITH STOPLIST = SYSTEM, CHANGE_TRACKING AUTO;'; EXEC(@SQLString)

Categories : Sql Server

What is the index clustering factor of and index organize table
The clustering factor number is calculated by imagining a full scan of the index, in the order of the indexed values, and counting the number of times that the block from which the current row would be read is different to the block from which the previous row is fetched (there's a 12c (I think) enhancement that extends this beyond the previous 1 value). So in a disordered table each row is likely to be found in a different block to the prior one. In an ordered table it is likely to be in the same block. Therefore the minimum clustering factor is generally equal to the number of blocks in the table, and the maximum is generally equal to the number of rows in the table. For an IOT, the clustering factor for the IOT index (not the secondary indexes) is threfore likely to be the same as th

Categories : Oracle

.htaccess redirect index.php / index only if directly after root URL?
Try this code: Options +FollowSymLinks -MultiViews # Turn mod_rewrite on RewriteEngine On RewriteBase / RewriteCond %{THE_REQUEST} ^[A-Z]{3,}s(.*?)/index.php[?s] [NC] RewriteRule ^ /%1 [L,R=301]

Categories : Htaccess

What is the difference between MySQL's create index and alter add index?
The implementation is the same on the server-side. The only practical difference is that with ALTER TABLE, you have the option to create an index without specifying a name for the index. The server generates a default name, as the name of the first column in the index, with a number suffix if necessary. Whereas with CREATE INDEX syntax, you must specify a name for the index.

Categories : Mysql

How to get row index and cell index of row click kendo grid
If all you need is knowing the row and column index in the table you can do: $(grid.tbody).on("click", "td", function(e) { var row = $(this).closest("tr"); var rowIdx = $("tr", grid.tbody).index(row); var colIdx = $("td", row).index(this); console.log("row:", rowIdx, "cell:", colIdx); }); Where I set a click handler for clicking in the cells of the grid. Then I find to which row (<tr>) that cell belongs to using jQuery closest. Next use jQuery index for finding the index of that row in the table. Do the same for finding the cell index inside the row. But maybe there are simpler ways as detecting if the user clicked on an image, or set some CSS class in the image and then check if the clicked cell has that class,... EDIT If in addition you want to retrieve the o

Categories : Kendo Ui

What are the Cypher commands to delete index and index entry
Well, I'm not sure if there's a way to delete an Index using Cypher.. But you can do it using Neo4j API as follows: for ( String indexName : server.getDatabase().graph.index() .nodeIndexNames() ) { try{ server.getDatabase().graph.index() .forNodes( indexName ) .delete(); } catch(UnsupportedOperationException e) { // Encountered a read-only index. } } for ( String indexName : server.getDatabase().graph.index() .relationshipIndexNames() ) { try { server.getDatabase().graph.index()

Categories : Neo4j

Undefined index: URL [APP/View/Clients/index.ctp, line 90]
One possible solution is to check for variables '$var' and '$client[0]['contacts']['type_of']' in the condition, like this: if(isset($client[0]['contacts']['type_of']) && $client[0]['contacts']['type_of']==3 && isset($var) && $var=='clients_with_contacts' && $this->Paginator->current()==1){ echo '<td style="background:lightblue">'.$client[0]['Client'][$field].'</td>'; }

Categories : PHP

Coverting Index into MultiIndex (hierachical index) in Pandas
Once we have a DataFrame import pandas as pd df = pd.read_csv("input.csv", index_col=0) # or from another source and a function mapping each index to a tuple (below, it is for the example from this question) def process_index(k): return tuple(k.split("|")) we can create a hierarchical index in the following way: df.index = pd.MultiIndex.from_tuples([process_index(k) for k,v in df.iterrows()]) An alternative approach is to create two columns then set them as the index (the original index will be dropped): df['e-mail'] = [x.split("|")[0] for x in df.index] df['date'] = [x.split("|")[1] for x in df.index] df.set_index(['e-mail', 'date']) or even shorter df['e-mail'], df['date'] = zip(*map(process_index, df.index)) df.set_index(['e-mail', 'date'])

Categories : Python

datastore and index.yaml: no matching index found
The index that you defined are using 3 properties. Your query only use one index, either you changed your query to use 3 properties defined in the index, or you define the date field to be indexed in the model declaration.

Categories : Java

Why does an inner join produce an index scan vs an index seek
The way I determine if an index is needed or not is one of two ways. The first is execute the query using Display Estimated Execution Plan. Then if the execution plan shows that an index is missing (in green) right click the green missing index message and select Missing Index Details... This will open a new window with code to insert the missing index that can help this query. Simply uncomment the lower section of the code and replace with the name for the new index and execute the code. You may need to repeat this process a few times for any missing indexes that may help this code. The second method is more of a long term approach to database performance. PINAL DAVE has published a series of scripts on his blog at http://blog.sqlauthority.com/ that help identify missing indexes

Categories : Sql Server

Remove at index function removes all elements before index
There are several problems with the remove() method. First of all, you should only be changing listPtr if index == 0. In all other cases, you need to adjust node.next of the node at position index - 1. P.S. Having index as a data member of List looks like an accident waiting to happen.

Categories : Java

how get column index and row index in gridpane of javafx
You can get the row index and column index by utilising the static methods getRowIndex() and getColumnIndex() which are located in the GridPane class. System.out.println("Row: "+ GridPane.getRowIndex(text1)); System.out.println("Column: "+ GridPane.getColumnIndex(text1)); See for reference: http://docs.oracle.com/javafx/2/api/javafx/scene/layout/GridPane.html#getRowIndex(javafx.scene.Node)

Categories : Java

Store a table row index as an array index
If I understoold correctly, you want to store and index where you can check/set whether an item is selected or not. If that is the case, you are looking for a "key - value" data structure. Then, why not use a map? var selected_row = {}; function toggleRowNumber(rowIndex) { if(selected_row[rowIndex]) selected_row[rowIndex] = 0; //or = undefined; else selected_row[rowIndex] = 1; } That is better because hash map will save you time and space. Space becuase you are not storing hundreds of 'undefined' values in a vector. Time because, hash function used to access elements is pretended to hit the right position in many cases.

Categories : Javascript

priority to index.html for index.php in .htaccess
If you define via DirectoryIndex that the server should deliver index.html if it is there, and you access the url /?page_id=16, then index.html with that parameter is delivered. And the parameter does nothing - it's static HTML. You cannot use BOTH index.html and index.php as DirectoryIndex for / and expect it to work. Add code to index.php that returns the content of index.html if no parameter is given. readfile('index.html'); exit(); might be enough. Only use index.php as DirectoryIndex.

Categories : PHP

Get character index from word index in a text
import re def char_index(sentence, word_index): sentence = re.split('(s)',sentence) #Parentheses keep split characters return len(''.join(sentence[:word_index*2])) >>> s = 'The die has been cast' >>> char_index(s,3) #'been' has index 3 in the list of words 12 >>> s[12] 'b' >>>

Categories : Python

.htaccess redirect index.php?q=* to index.php?q=* on another domain
You don't need multiple lines of these: Options +FollowSymLinks -MultiViews RewriteEngine On Just put only once at the top and it should be effective for rest of the file. Then to solve your problem move this rule on top of all other rules in your .htaccess file: RewriteCond %{HTTP_HOST} ^(www.)?dkcherta.ru$ [NC] RewriteRule ^ http://dkchertanovo.ru%{REQUEST_URI} [L,R=301]

Categories : Htaccess

Import from one index to a new index with a persistence model
Well, the reason you're getting that error is that in your view, I would guess, you're referring to the paginate gem. First thing to do is either check your view, and strip paginate out of the view and the controller, OR, if you need paginate, do this simple test: Your application should load the will_paginate gem. To see if the library has been loaded, open the console for your app and try the following lines: defined? WillPaginate ActiveRecord::Base.respond_to? :paginate If any of these lines return nil/false, will_paginate has not properly loaded in your app. (( from https://github.com/mislav/will_paginate/wiki/Troubleshooting )) If it fails out, make sure you have the following two lines in your Gemfile: gem 'will_paginate', '~> 3.0.3' gem

Categories : Elasticsearch



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.