w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Javascript performance suffers when hiding/displaying nested tables
Looks to me like you are getting the html content of the div that follows the button, and then inserting that after the nearest tr node. The dom has to give you the html as a string, and then parse the string that you give it back. If you just want to show and hide rows why not just set .hide() or .show() on them? That way there is no dom manipulation which is actually quite expensive because the browser has to recalculate everything incase your new additions alter anything else. CSS changes are usually faster. If you are getting the html from elsewhere you might want to look at that as being the bottleneck. Try using something like console.log((new Date()).getTime()) to profile different points in your code and see where the problem is. If you can recreate the delay in your fiddle that

Categories : Javascript

Performance of nested select
About first query: first query will evaluate the inner select first and then apply the filter to the outer query. That not so simple. In SQL is mostly NOT possible to tell what will be executed first and what will be executed later. Because SQL - declarative language. Your "nested selects" - are only visually, not technically. Example 1 - in "someTable" you have 10 rows, in "otherTable" - 10000 rows. In most cases database optimizer will read "someTable" first and than check otherTable to have match. For that it may, or may not use indexes depending on situation, my filling in that case - it will use "indexedField" index. Example 2 - in "someTable" you have 10000 rows, in "otherTable" - 10 rows. In most cases database optimizer will read all rows from "otherTable" in memo

Categories : SQL

sorting tr elements with nested tables, hide nested tbody while sorting
jsFiddle Demo At first I'd like to say that it's clear you really put effort in finding a solution on your own so it really made me want to help. The problem is that if you hide parts of the element after it begins to be dragged, the size isn't recalculated. The solution is like in the code you've linked. You have to catch a more preliminary event (like mousedown) and hide it before the dragging begins. $('tr.draggable_item').mousedown(function() { $(this).find("tbody").hide(); }); $('tr.draggable_item').mouseup(function() { $(this).find("tbody").show(); });

Categories : Jquery

Sql performance more columns or more tables for reporting
Not sure what you want to improve the performance of. Certainly normalisation is likely to improve it for collecting and maintaining data. But denormalisation tends to improve reporting. So the trick is to have two databases, one for each requirement, and populate reporting by mining the operational database. All depends on the load on the db and where you want to take the hit if you don't want to take the cost of setting up a reporting db. All you can say is, reporting will slow down operational transactions and vice versa. If you want the best performance you can get for both requirements, then two databases is the way to go, or you compromise...

Categories : Sql Server

Does specifying the schema name for tables affect performance?
The second one is faster, but barely. SET is extremely cheap. Generally, a schema-qualified table name has the potential to be slightly faster, since the query to the system catalog can be more specific. But you won't be able to measure that. It's just irrelevant, performance-wise. Setting the search_path does have implications for security and convenience though. It is generally a good idea. For instance, consider the advice in the manual on "Writing SECURITY DEFINER Functions Safely". Are you aware that there are many ways to set the search_path?

Categories : Postgresql

Improving performance of a Nested Loop
Here's a one-line LINQ option. Not the best in terms of performance (it iterates multiple times). Still worth noting. var result = myArray .OrderByDescending(i => myArray.Count(i2 => i2 >= i && i2 <= i + 5)) .First();

Categories : C#

Sql nested queries execution performance
Possible this be helpful for you - SELECT M.UserID, Browser = SUM(X.Browser) FROM ( SELECT UserName , Browser = MAX(Browser) FROM [PCMDBSERVER].[MISTestPCM_Raw].[dbo].[PCM_Log_FilterSwitchData] WHERE [DateTime] BETWEEN '20130613 12:00:00' AND '20130613 23:59:59' GROUP BY UserName ) X JOIN ( SELECT UserName , UserID FROM dbo.PCM_Stat_UserRepository WHERE MachineID = 'All' ) M ON X.UserName = Y.UserName GROUP BY M.UserID

Categories : SQL

Nested template foreach performance
First, your fiddle isn't rendering the nested template because you forgot your quotes around the inner template name. Your code : template: { name : ContactLine, foreach: Contacts } should have the name in quotes like this : template: { name : "ContactLine", foreach: Contacts } With that fixed, 1500 items can be a sizable amount of rendering depending on what's going on in the template, although I've worked on projects where we're pushing about that much data in a table without too much trouble. Our slow-down was actually mapping from raw JSON to the view models; rendering was acceptably fast. With that said, it's not too hard to add paging, even if you want to keep all that data on the client-side for quick sorting. If your bottleneck is actually the render and not mapping, th

Categories : Knockout Js

bulk delete from two related tables performance
The objectName column should be indexed for better performance. And try the following queries. $idToBeDeleted = SELECT ext_id FROM ai_tr_tbl_extids WHERE objectName='$object' AND sfID ='$s'" ; DELETE FROM ai_tr_tbl_extids WHERE ext_id='$idToBeDeleted'; DELETE FROM ai_$object WHERE ext_id='$idToBeDeleted'; But if you will be able to get the list of ext_id to be deleted, you can remove the loop and just delete with IN. DELETE FROM ai_tr_tbl_extids WHERE ext_id IN ($idToBeDeletedCommaSeparatedValue'); DELETE FROM ai_$object WHERE ext_id IN ($idToBeDeletedCommaSeparatedValue');

Categories : PHP

Massive performance issue with nested ItemsControl
Add the following property to all your ItemsControls (root and nested ones): <ItemsControl.ItemsPanel> <ItemsPanelTemplate> <VirtualizingStackPanel/> </ItemsPanelTemplate> </ItemsControl.ItemsPanel>

Categories : Wpf

Awesome nested set: Performance improvement for self_and_descendants
After spending some time and no replies. :) I landed up doing this. class Group < ActiveRecord::Base acts_as_nested_set def self_and_descendants_hashed ActiveRecord::Base.connection.select_all("SELECT * FROM groups WHERE lft >= #{self.lft} AND rgt <= #{self.rgt} order by lft") end end

Categories : Ruby

Database Design: Many tables VS One "long" table _ Performance-Wise?
Databases are designed to store and manage data. Thousands of rows is considered a "small" table. You should store all the information about attributes in one table, assuming the attributes are common across all items. The reasons for using multiple databases would involve security or backup requirements. If you do get really big tables (say tens of millions of rows) and performance is an issue, then you can start learning about (vertical) partitions.

Categories : Mysql

Iterator equivalent to nested for loops shows 50 % performance breakdown - why?
The boxQuantity's virtual operator*=() will not be inlined, which prevents a lot of optimizations. In your example you don't derive from this class. Removing this virtual operator enables the code to be inlined and the SIMD instructions to be used: 00861330 movsd xmm0,mmword ptr [edx+eax*8] 00861335 mulsd xmm0,mmword ptr [edi+eax*8] 0086133A movsd mmword ptr [edi+eax*8],xmm0 0086133F dec ecx 00861340 jne main+90h (0861330h)

Categories : C++

FULL TEXT INDEX - Huge Performance Decrease on Multiple Tables
Your question comments suggest you improved performance to a satisfactory level by rewriting an unrelated part of the query (not shown in the question). This is fair enough if it works, but doesn't explain why the two separate queries and the combined query differ so significantly, when other unrelated parts of the query are kept constant. It's difficult to say confidently without seeing a query plan and statistics results; however I can think of two possibilities based solely on reasoning about how the SQL queries are written: One or both of the ID columns (from FooBar and FooBalls) may be non-unique in the row set after these two tables have been inner joined. Doing two, rather than one, join to CONTAINSTABLE result sets may thus be "breeding" rather more records than a single join

Categories : Sql Server

Reading Lua nested tables in C++
Lua table indices range from [1 .. N] instead of [0 .. N-1]. Your loop should be: int cmdNbr = 1; for( lua_next(L, -2); cmdNbr <= numcmds; cmdNbr++ ) { ... } or as I prever it: lua_rawgeti(L, 3, 2 ); int id = lua_tointeger(L, -1); // this successfully retrieves id 42 lua_pop(L, 1); lua_rawgeti(L, 3, 3); { // commands table at stack top size_t N = lua_objlen(L,-1); // size of the table for (int i = 1; i <= N; ++i) { lua_rawgeti(L,-1, i); // cmd# at stack top { lua_rawgeti(L,-1,1); // first entry int cmd = lua_tointeger(L,-1); lua_pop(L,1); lua_rawgeti(L,-1,2); // second entry int arg = lua_tointeger(L,-1); lua_pop(L,1); } lua_pop(L, 1); // pop cmd#

Categories : C++

Alternative to nested tables
Since paging isn't an option... You're right that it doesn't matter what technology you're using - more curiosity than anything on my part. Also, I'm not familiar with PHP so take my ideas as abstract here please. Have you tried/considered the following (I created a fiddle to demonstrate the graphical portion of this http://jsfiddle.net/ninja1/ynuDV/): Use CSS "table" to define that the display for any/all "tables" in that given page use display:inline-block; Render first table without any nesting. Use a button or whatever control you wish to have a lever/key/rowId/userId whatever you have that would reflect your selection. You'd then intercept this control's action, if a button - then whenever the button is clicked it would then call a method to create the second table dynamically an

Categories : HTML

Nested select on three tables
You said you want the Place_name but your code shows that you select Place_code instead. You just need a normal WHERE to solve this: SqlDataAdapter a = new SqlDataAdapter(string.Format("SELECT Place_name FROM PlaceCodeName, DeviceConfig, DevInOut WHERE Cardserial = '{0}' AND PlaceCodeName.Place_code = DeviceConfig.Place_code AND DeviceConfig.IP = DevInOut.IP",textBox12.Text), con);

Categories : C#

Simple Inner Join on 2 tables resulting in wrong estimated rows and slow performance
Non updated statistics might have something to do with it. Try running a exec sp_updatestats and see if the plan changes. Also make sure you have a maintenance job running on the SQL server that updates the statistics periodically.

Categories : SQL

Converting nested tables to JSON
There is a library which converts table to json format: https://github.com/lightswitch05/table-to-json i hope it helps.

Categories : Jquery

nested Rowkey in Hbase tables
there. I guess you are going to save huge amount of istantharvestInfo and dailyHarvestInfo for each station. Since there is parent-child relationship in your data model, I think you could design the schema as: ------------------------------------------------------------------------- **Row-Key**: Province + city + station + timestamp --------+---------------------+------------------------------------------ Family | Qualifier | Value --------+---------------------+------------------------------------------ | istantharvestInfo | "value of istantInfo" F +---------------------+------------------------------------------ | dailyHarvestInfo | "value of dailyInfo" --------+---------------------+------------------------

Categories : Hadoop

same row height for nested tables in different columns
If changing layout is a possibility: <tr> <td>1</td> <td>123 Technologies</td> <td colspan="2"> <table> <tbody> <tr> <td style="width: 50%">Item 1</td> <td>Blah blah blah</td> </tr> <tr> <td>Item 2</td> <td>Blah blah blah</td> </tr> <tr> <td>Item 3</td> <td>Blah blah blah</td> </tr> </tbody> </table> </td> </tr> Otherwise, I think JS is neede

Categories : Javascript

Making a nested/hierarchical set of tables using D3
Here's what I would do: http://jsfiddle.net/j43Nb/ Looking at your data, it seems more appropriate to have one table per parent and one row per child, and not wrap the whole thing in one big table. If you really need one big table, just replace the div.section/h4 bits with another table/tr/td sequence. The key to understanding how "child" objects become an array of cell data is in this bit at the end: var cells = rows.selectAll('td') .data(function(d) { // return cell data as an array of prop values, // ordered according to prop names in cols return cols.map(function(prop) { return d[prop]; }) }); where the field names in cols are used to build a corresponding array of cell values for each given row (child).

Categories : Javascript

style only first tr in table, without nested tables
I think you cant use another class CSS for chiltable same that: <table class="calc1"> <tr><td>title</td><td>title2</td></tr> <tr> <td> <table class = "calc2"> <tr><td>text</td><td>text</td></tr> <tr><td>text</td><td>text</td></tr> </table> </td> <td> text </td> </tr> <table> CSS: .calc1 tr:first-child { background:red; } table td { border:1px solid #000; padding:10px; } .calc2 tr:first-child { background:blue; }

Categories : HTML

Caption element and 100% width on nested tables
Remove the display properties form caption 2 & 3 .caption-02 { position: relative; } .caption-03 { } Jsfiddle

Categories : HTML

Laravel Eloquent Get certain columns from nested tables using with()
See Laravel Eloquent: How to get only certain columns from joined tables The easiest way to do it is filter the columns in the model (as stated in the top answer linked above). However, that can be inconvenient when you want to build dynamic queries. Theoretically you should be able to do: $this->shop->with(array('locations' => function($query) { $query->select('id', '...etc...'); } ...unfortunately it doesn't seem to work for select(); when I tested it I got a blank array. Other methods do work, however, e.g. $this->shop->with(array('locations' => function($query) { $query->orderBy('id', 'DESC');

Categories : PHP

Semantic of nested tables and table header
Is this the best semantic solution? Not really. While the act of nesting an element A within another element B can be used to indicate that A is a child of B, that isn't what you're doing here: you're nesting the table within a completely different row, so there's no implication of a parent-child relationship between A and B. By creating a cell that spans all the columns in the table and then building another table inside that with the same number of columns, you're also effectively saying "these are some other columns, that don't relate to the ones in the outer table". You can see the implied (lack of) relationship between the columns by adding a border to the cells in your example above: Obviously you can fix that with CSS, but the unstyled rendering of a piece of HTML is often a g

Categories : HTML

Database design with multiple nested tables
If you already have an idea, what you want to store in the schema, a good strategy for creating the schema itself is: Draw your requirements as ER-diagram ( https://en.wikipedia.org/wiki/Entity%E2%80%93relationship_model ) Translate the diagram into a SQL schema If necessary, bring into 3rd normal form ( http://en.wikipedia.org/wiki/Database_normalization ) In your case, in step 1 you should have something like ______ ___________ _______ _____ ____________ | Subj. |____/ associated \_______| Proc. |___/ has \__| Proc.prop. | |_______| \____________/ |_______| \_____/ |____________| If you have different types of processes, you can think about specialization of the Process-entity. If you really want to chose the concrete process-properties for every

Categories : SQL

Rails - how to join/group nested tables and get joined values out?
You can make this little bit more prettier than raw sql by using rails AR querying methods: AccountGroup. select("account_groups.id, SUM(net_position), account_groups.name"). joins("LEFT JOIN accounts ON accounts.account_group_id = account_groups.id"). joins("LEFT JOIN positions ON positions.account_id = accounts.id"). group("account_groups.id,account_groups.name")

Categories : Ruby On Rails

Rely on multiple tables inside a nested select and a delete MySQL statement
You should implement this as a BEFORE DELETE trigger on the `users_sessions_exercise_t_ws_correlation' table. Have a look at this answer as a good example. Here's a good general reference on using Triggers for Logging.

Categories : PHP

Performance Differences of Nested If Else Statements vs. ElseIf Statements
It depends on your code. The if statement is only accessed when a condition is met, otherwise it is ignored. the if elseif else block is the same but it is testing for many conditions and depending on which one is met a different action might have to be performed in order to get the results u want. My opinion is "It depends upon cases". If you want to execute everything in your code,then use elseif.. if you want to ignore something use if..

Categories : Dotnet

Struts 1.1 nested and in combination
Use <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> and the code will look like <c:choose> <c:when test="${element.method1 == true}"> <c:choose> <c:when test="${element.method2 == true}"> <span style="color:green;"><c:out value="${element.prop1}/></span> </c:when> <c:otherwise> <span style="color:red;"><c:out value="${element.prop1}/></span> </c:otherwise> </c:choose> </c:when> <c:otherwise> <span style="color:black;"><c:out value="${element.prop1}/></span> </c:otherwise> </c:choose>

Categories : Java

Clojure performance - why does the "ugly" "array swap trick" improve lcs performance?
As Chas mentions, loops with primitive hints are problematic. Clojure attempts to keep ints unboxed when you provide a hint, but it will (for the most part) silently fail when it can't honor the hints. Therefore he is forcing it to happen by creating a deftype with mutable fields and setting those inside the loop. It's a ugly hack, but gets around a few limitations in the compiler.

Categories : Arrays

itextsharp html to .pdf with vb.net
Alright, I discovered what the issue was and it was rather trivial but just in case anyone else runs into the same issue I'll explain what It was. I was using an older version of the base itextsharp.dll from the version of itextsharp.xmlworker.dll. Now I do not know that the versions must be the same, all I know is that you must make sure your version of .dll is current.

Categories : HTML

HTML to PDF - CSS in iTextSharp
Just pull out height attribute outside the style tag and use it like this:- <div height='400' style="font-family:Courier;font-size:9px"> herrow </div>

Categories : C#

Some questions about iTextSharp
Inorder to make Headers and Cell text to centre just use <RowStyle HorizontalAlign="Center" /> <AlternatingRowStyle HorizontalAlign="Center" /> In your gridview

Categories : C#

Write FDF to PDF using iTextsharp
I was able to do it by not using the MemoryStream: File.Copy(formLocation, outputFileNameAndPath, true); using (FileStream pdfFlat = new FileStream(outputFileNameAndPath,FileMode.Open)) using (PdfReader pdfReader = new PdfReader(formLocation)) using (PdfStamper pdfStamper = new PdfStamper(pdfReader, pdfFlat)) using (FdfReader fdfReader = new FdfReader(fdfFileNameAndPath)) { AcroFields pdfForm = pdfStamper.AcroFields; pdfForm.SetFields(fdfReader); pdfStamper.FormFlattening = true; pdfStamper.Writer.CloseStream = false; fdfReader.Close(); pdfStamper.Close(); pdfReader.Close(); pdfFlat.Close(); } I am not sure but when I was using the MemoryStream to open the file and then save it into another FileStream, something was not wo

Categories : Pdf

Unable to set td padding in ITextSharp
The HTMLWorker was deprecated long ago in favor of the XmlWorker so I recommend looking into that first. That said, if you look at the source code for CSS resolution that the HTMLWorker eventually calls you'll see that HtmlTags.CELLPADDING never gets used. The HtmlTags class has pretty much every HTML tag and attribute (at least from the 4.0 era) but few of the attributes were actually implemented. Zero work will ever be done in HTMLWorker so you shouldn't expect any changes ever. Once again, check out the XmlWorker. However, once you parse your HTML you should get back a collection of IElement objects. You can manually walk these objects looking for ones of type PdfPTable and then use the code here to manually set your own padding.

Categories : C#

How to get back the value using reflection in iTextSharp
System.Reflection.FieldInfo[] fi = typeof(iTextSharp.text.PageSize).GetFields(); FieldInfo[] is array of fields metadata, not the objects themselves. So after you get the necessary metadata, you need to get actual field value like this: FieldInfo field = fi[si]; PageSize size = (PageSize)field.GetValue(null); GetValue(object) returns actual value of the field. As these fields are static, you pass null, as there is no specific object to query.

Categories : C#

How to implement getDirectContent() itextsharp
That's easy. Go to the C# port of the examples of my book. Take a look at the code samples in Chapter 3. You'll find examples with lines such as: PdfContentByte over = writer.DirectContent; This is one of the minor differences between the Java version and the C# version.

Categories : C#

get text paragraph from pdf using itextsharp
using (MemoryStream ms = new MemoryStream()) { Document document = new Document(PageSize.A4, 25, 25, 30, 30); PdfWriter writer = PdfWriter.GetInstance(document, ms); document.Open(); document.Add(new Paragraph("Hello World")); document.Close(); writer.Close(); Response.ContentType = "pdf/application"; Response.AddHeader("content-disposition", "attachment;filename=First PDF document.pdf"); Response.OutputStream.Write(ms.GetBuffer(), 0, ms.GetBuffer().Length); } here are some samples which ll help you on this.... This is may not be exactly your looking for, but it may help you..

Categories : C#



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