w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
How to remove additional Comma in Text file casing data to Mismatch or Overflow to other Columns
The problem is you are stripping the delimiting quotes. CSV files can have values quoted. When you have a comma in the value you need to quote it. In your example, the file already appears to be in CSV format except for the file extension. I don't know if your actual production file is more complicated and requires more formatting. However, in this example it would simply require a file rename. See RFC 4180 for pretty standard specifications. It's a little dense.

Categories : C#

Gridview: editing after searching
Try this : fill_grid() { // populate your grid SqlCommand cmd = new SqlCommand(); cmd.CommandText = " your select statement "; cmd.CommandType = CommandType.Text; cmd.Connection = this.sqlConnection1; this.yourConnection .Open(); SqlDataAdapter adpt = new SqlDataAdapter(cmd); DataSet ds = new DataSet(); adpt.Fill(ds); yourGrid.DataSource = ds; yourGrid.DataBind(); this.sqlConnection1.Close(); } Then hook to the button click event of your search button like this : yourButton_Click ((object sender, EventArgs e) { GridViewRow clickedRow = ((Button)sender).NamingContainer as GridViewRow; //Then find your parameter from your textbox in the clicked row Tex

Categories : Asp Net

display gridview data in another page or other gridview with row data in editable mode
You need to add RowCommand Event in GridView. <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" OnRowCommand="GridView1_RowCommand"> <asp:LinkButton ID ="lnkEdit" runat ="server" CommandArgument='<%#Eval("Recordid")%>' CommandName ="cmdEdit" Text ='Edit'></asp:LinkButton> </asp:GridView> Here rocordid is the id of your record. In Page behind you need to write code. protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "cmdEdit") { string Recordid = Convert.ToString(e.CommandArgument.ToString()); Response.Redirect("EditPage.aspx?recordid="+Recordid ); } } On EditPage you can get recordid from the query string and can fetch the record form the datab

Categories : Asp Net

Gridview returning empty even when there is data. I want to use data in the gridview to update another database
Per my comment above you may want to do something like: List<string> _OrderIds = new List<string>(); DataTable table = gvOrderLines.DataSource as DataTable; foreach (GridViewRow gvr in table.Rows) { Label myOrderIDLablel = (Label)gvr.FindControl("lblOrderID"); //find control since it is a template field _OrderIds.Add(myOrderIDLablel.Text); } I hope this get you headed in the right direction.

Categories : C#

Gridview onRowCommand fired gridview no data
Problem in this line ID = gvWorkshop.DataKeys[grdrow.RowIndex]["workshopID"].ToString(); You have mention "grdrow" in place of "row". please change it to ID = gvWorkshop.DataKeys[row.RowIndex]["workshopID"].ToString();

Categories : C#

SQL Statement - Excluding certain data
You can use a LEFT JOIN. The LEFT JOIN keyword returns all rows from the left table with the matching rows in the right table. The result is NULL in the right side if there is no match. Since you want the jobs without a matching department, you can check if the joined DepartmentID is NULL: SELECT Job.Job FROM Job LEFT JOIN Jobs ON Job.ID = Jobs.JobID WHERE Jobs.DepartmentID IS NULL; Checkout this demo. Let me know if it works.

Categories : SQL

R: Data.table on subset excluding by value
Use a tiny bit of elementary maths: d[, c("tmp.mean", "N") := list(mean(Stops), .N), by = Market] d[, exep.mean := (tmp.mean * N - sum(Stops)) / (N - .N), by = list(Market,Carrier)] # Market Carrier Stops tmp.mean N exep.mean # 1: IAH:SNA Delta 1 2.00 4 3.000000 # 2: IAH:SNA Delta 1 2.00 4 3.000000 # 3: IAH:SNA Southwest 3 2.00 4 1.000000 # 4: IAH:SNA Southwest 3 2.00 4 1.000000 # 5: MSP:CLE Southwest 2 1.75 4 1.500000 # 6: MSP:CLE Southwest 2 1.75 4 1.500000 # 7: MSP:CLE American 2 1.75 4 1.666667 # 8: MSP:CLE JetBlue 1 1.75 4 2.000000

Categories : R

understanding the casing system in magento
Magentotutorial_configviewer_model_observer is just a namespace to keep things unique, say if you has multiple classes to fire off one event in one module. It does not have to be any case, the closing and opening elements just have to match, most people just generally use lower case. For your other questions about camel casing I am not really sure, I think it may have something to do with the config defining a module rather than module config. Magento has bizarre and inconsistent casing, modules are capitalised but only on the first letter, you can capitalise them all but it can cause real headaches because when you are calling the module you have to use camel case instead.

Categories : Magento

SSRS report - Casing parameter
First add the parameter and set it's Type as Text and multiple values checked as below And then set the default values to set by query and select the dataset

Categories : SQL

How to get with MappingJacksonHttpMessageConverter a Json with Pascal casing?
I solved it by using JsonProperty annotation. You can give the name that jackson will use to build the json field. Here there is an example with jtable (jquery): public class ElementsInList<T> { @JsonProperty("Result") private String result = "OK"; @JsonProperty("Records") private List<T> records; public String getResult() { return result; } public void setResult(String result) { this.result = result; } public List<T> getRecords() { return records; } public void setRecords(List<T> records) { this.records = records; } } The result json is this: {"Result":"OK","Records":[{"roleName":"admin"... But there is more about this annotations. Check the api for more info: http://fasterxml.gith

Categories : Json

Conditionally excluding spring data jpa repositories
I would use spring profiles to achieve this, for example in your spring-context.xml: <beans profile="AWS> <jpa:repostiories base-package="package.repositories.aws"/> <!-- package with aws repository --> <beans> <beans profile="Azure"> <jpa:repositories base-package="package.repositories.azure"> <beans> Repositories will be created only for active profile. Profiles is a thing you certainly should be interested in.

Categories : Spring

Excluding record NON unique Field Data
SELECT id, name, address, phone FROM clients WHERE state IN ( 'MO', 'LA', 'CT' ) AND foo > 40 AND phone not in ( select phone from clients group by phone having count(*) > 1 ) ORDER BY foo

Categories : Mysql

Excluding specific data from sql when field entry begins with #
This can be done by using a NOT LIKE statement, i.e. by adding the following to the WHERE criteria AND categories_name NOT LIKE '#%' As an addition, it may be an idea to add the table prefix to all field names for clarity later on. I don't know which tables each column comes from though so you're on your own on that.

Categories : Mysql

Oracle - Table names and columns - could I change the casing?
In the data dictionary, yes, identifiers are converted to upper case by default. You can change that behavior by creating case-sensitive identifiers. It is generally not a good idea to do so, but you can. In order to do so, you would need to enclose the table name and column names in double quotes both when you create the object and every time you want to refer to them. You'll also need to get the casing right because the identifiers will be case-sensitive unlike the normal case-insensitive behavior. If you CREATE TABLE "foo" ( "MyMixedCaseColumn" number ); then the table name and column name will be stored in mixed case in the data dictionary. You'll need to use double-quotes to refer to either identifier in the future. So SELECT "MyMixedCaseColumn" FROM "foo" will work.

Categories : Database

Regex for Adding Forward Slash on Character Casing
This inserts a slash before an uppercase letter if the previous character is a lowercase letter or a digit: Regex regex = new Regex(@"(?<=[p{Ll}d])(?=p{Lu})"); newStr = regex.Replace(str, "/");

Categories : C#

SSMS tool/option for correcting casing of DB objects in a script
Devart's SQL Complete (http://www.devart.com/dbforge/sql/sqlcomplete/) will do it: http://www.devart.com/dbforge/sql/sqlcomplete/documentation/formatting-code.html

Categories : Sql Server

Implementing Tagging and Excluding Filters with Solrj / Spring Data Solr
With link I can do this :- ModifiableSolrParams params = new ModifiableSolrParams(); params.add("fq", "{!tag=dt}doctype:pdf"); params.add("facet.field", "{!ex=dt}doctype");

Categories : Solr

Fastest data structure for inserting data, not for searching
Tongue-in-cheek answer: if you are only doing insertions and nothing else, the easiest data structure is nothing at all - just don't store anything. That makes insertions instantaneous, since you do absolutely nothing to do an insertion. More realistic answer: if you are just trying to store a bunch of data as quickly as possible and you have an upper bound on the number of total elements, just use an array and keep track of the next free index. If the array stores pointers to elements, then each insertion is a pointer assignment plus an increment of the next free index. If you're storing copies, then each insertion makes a copy (which you'd have to do anyway) and an increment. Since any structure that stores elements has to either store a pointer or copy to it, the overhead is a sing

Categories : C++

ASP.Net object reference error when writing data to xml file via Gridview Empty data template
The issue is when you have the xml file without 'po' node. You can move the node to a new method like: Private Function CreatePOSDataset() As DataSet Dim oDs As New DataSet() oDs.DataSetName = "newshipmentnotification" oDs.Tables.Add("pos") oDs.Tables("pos").Columns.Add("pos_Id") oDs.Tables("pos").Columns("pos_Id").ColumnMapping = MappingType.Hidden oDs.Tables.Add("po") oDs.Tables("po").Columns.Add("ponumberID") oDs.Tables("po").Columns.Add("pos_Id") oDs.Tables("po").Columns("pos_Id").ColumnMapping = MappingType.Hidden oDs.Tables("po").Columns.Add("ponumber") Dim pos_po As DataRelation = oDs.Relations.Add("pos_po", oDs.Tables("pos").Columns("pos_Id"), _ oDs.Tables("po").Columns("pos_Id"))

Categories : Asp Net

Export Gridview Data to Excel in ASP.NET Linq data bind
It's pretty easy to set up the excel export that will export only the gridview. This has been tested and will only export the gridview that appears on your given web page. For your C# code use the following: using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; public partial class vxcel_export : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void Button2_Click(object sender, EventArgs e) { Response.Clear(); Response.AddHeader("content-disposition", "attachment;filename=file-name.xls"); Response.ContentType = "application/vnd.xlsx"; System.IO.StringWriter stringWrite = new System.IO.StringWriter(); Sys

Categories : Asp Net

What is the difference between searching for intermodular calls and searching for names/labels in OllyDBG?
Eventhough this question is from 2013, some people might still like an answer. Intermodular calls: = Displays Address + Displays Disassembly (e.g. "call <jmp.&kernel32.CreateThread>") = Displays Destination ("Name" in Names) Names: = Displays Address + Displays Section (e.g. ".idata") + Displays Type (Import / Export) = Displays Name ("Destination" in intermodular calls) + Allows to toggle search between "current module" and "all modules". Other than that, it's pretty much the same.

Categories : Debugging

PLINQ and Large Data Searching
If you're going to be saving into a database anyway, why don't you just bulk import your data and use queries to join the two sets of data? That should perform much faster than trying to do it in memory. I would hate to see the memory you are consuming with millions of entities. If you must do it in memory, using PLinq MAY prove to be faster. There is an overhead to thread creation and context switching. With PLinq, you should let the engine determine the thread allocations. You should rarely create threads explicitly at this point. However, if the list you are comparing against is relatively static, you may benefit more from making it a dictionary and relying on the key for the lookup as you won't have to scan through the entire list for each item you are trying to find.

Categories : C#

Java SAX Searching an XML file for Data
Assuming you can read the XML relatively quickly using SAX or DOM, I would parse it in advance, and use the attributes to construct a map of postcode vs long/lang e.g. Map<String, Pair<BigDecimal,BigDecimal>> and simply lookup using Map.get(String) I note that you say: Some of these files have up to 50k lines, so storing them in memory is a no no if at all possible I wouldn't worry about that at all. A map of 50k entries isn't going to be a major deal.

Categories : Java

NullReferenceException when searching for data in DataGridView
Most likely, of the following is null, which is causing the exception when you dereference it: dataGridView2 row.Cells["CardSerial"] row.Cells["CardSerial"].Value textBox2 dataGridView2.Rows[row.Index] dataGridView2.Rows[row.Index].DefaultCellStyle To find out which one, debug your program, and make use of the watch window, immediate window, or add a number of debug/trace output lines. Of specific note may be the case where row.Cells["CardSerial"].Value is null.

Categories : C#

Searching a specific data using VBA inputBox
This small macro will allow you to enter a name and then tell you where it can be found on the active sheet. Sub FindName() Dim v As String v = Application.InputBox(Prompt:="Enter Name:", Type:=2) mesage = "" For Each r In ActiveSheet.UsedRange If InStr(1, r.Value, v) > 0 Then mesage = mesage & r.Address & vbCrLf End If Next If mesage = "" Then mesage = "Name not found" End If MsgBox mesage End Sub

Categories : Excel

data structure for co-ordinate x,y which allows O(log n) searching on both x and y
I think you could use an R-tree for this. I'm not really familiar with it myself, but I think it is a common data structure for multidimensional data. Link: http://en.wikipedia.org/wiki/R-tree

Categories : Algorithm

Searching for a data table within a directory?
DataItem is the data source bound to it. Text is a property within the row of the data source. Look for a Repeater.DataSource = X line, or a DataSourceID="X" on the repeater's markup. That will identify the data source.

Categories : Asp Net

Data structure for searching strings
Practically, if you want to do auto suggest, then storing upto 3-4 chars should suffice. I mean suggest as and when user types "a" or "ab" or "abc" and the moment he types "abcd" or more characters, you can use map.keys starting with "abcd" using c# language support lamda expressions. Hence, I suggest, create a map like: Map<char, <Map<char, Map<char, Set<string>>>>> map; So, if user enters "a", you look for map[a] and finds all children.

Categories : C#

Improve page rendering time having gridview, child gridview and grand child gridview on it
You are creating way too many grids. A grid is an expensive component. You could alter your user interface to allow users to select an Item and bind the inner grid only on selection. This ensures that rather than one grid per row or parent grid, you will have only one child grid displayed at a time.

Categories : C#

MySQL - searching a self join and ranges or data
Your query shouldn't be taking 40 seconds on a smallish data set. The best way to know what is going on is to use explain before the query. However, I suspect the problem is the condition on me. The MySQL engine might be creating all possible combinations for all users and then filtering you out. You can test this by modifying this code: from `large` `match` INNER JOIN `large` `me` ON me.id_q = match.id_q WHERE me.id_user = 1 AND match.id_user != 1 AND . . . . To: from `large` `match` INNER JOIN (select me.* from `large` `me` where me.id_user = 1 ) me ON me.id_q = match.id_q WHERE match.id_user != 1 AND . . . . In addition, the following indexes might help the query: large(id_user, id_q) and large(id_q).

Categories : Mysql

Indexing and searching lists of data in elasticsearch
Here is an example that does what you want to do. At least from my understanding of your question. Index and query: curl -XPUT localhost:9200/test/ curl -XPOST localhost:9200/test/testtype/1 -d '{"array" : [{ "title" : "The Great Gatsby" }, { "title" : "Enders game" }] }' curl -XPOST localhost:9200/test/testtype/2 -d '{"array" : [{ "title" : "Enders game" }, { "title" : "The name of the wind" }] }' curl -XPOST localhost:9200/test/testtype/3 -d '{"array" : [{ "title" : "The name of the wind" }, { "title" : "The Great Gatsby" }]}' curl -XPOST localhost:9200/test/testtype/_search -d '{ "query" : { "term" : { "title" : "great" } }}' Result: { "took" : 2, "timed_out" : false, "_shards" : { "total" : 1, "successful" : 1, "failed" : 0 }, "hits" : { "total" : 2,

Categories : Elasticsearch

Searching for matching cells and copying row data
This should get you started. Was the statement within the If block a typo? I think you might have meant to copy from one workbook/worksheet to the other (not from the same one)? Sub Firm_Number_Transfer() Dim i As Integer Dim x As Integer Dim row As Integer Dim oldRow As Integer Dim found As Boolean Dim xlBook As Workbook, xlBook2 As Workbook Dim xlSheet As Worksheet, xlSheet2 As Worksheet Dim rng As Range, cell As Range, rng2 As Range, cell2 As Range xlBook2 = Workbooks("PM Firms - Step 1 - REVEIWED") xlSheet2 = xlBook2.Worksheets("Sheet1") Set rng2 = xlSheet2.Range("B2:B4843") xlBook = Workbooks("PM Firm Contacts - Step 2 - REVIEWED") xlSheet = xlBook.Worksheets("Sheet2") Set rng = xlSheet.Range("B

Categories : Excel

Can SearchDisplayController show data before starting searching
may be you add data in 'searchResults' array while delegate method... -(BOOL)searchDisplayController:(UISearchDisplayController *)controller shouldReloadTableForSearchString:(NSString *)searchString in your case you need whole data in search display controller's table view without search may be not call above delegate method and your array has no data... so you need to add data in 'searchResults' array before reload of search display controller's table view. [self.searchDisplayController.searchResultsTableView reloadData];

Categories : IOS

Slow get data from data gridview into SQL Server
A fast way to insert many records into an SQL Server's table is to use the SqlBulkCopy class. First you will need a function which will copy the content of your DataGridView into a DataTable. Private Function GetDataTable() As DataTable Dim DataTable1 As New DataTable Dim i1, i2, RowsCount1 As Integer For i1 = 0 To DataGridView1.Columns.Count - 1 DataTable1.Columns.Add(DataGridView1.Columns(i1).Name, DataGridView1.Columns(i1).ValueType) Next If DataGridView1.AllowUserToAddRows = True Then RowsCount1 = DataGridView1.Rows.Count - 1 Else RowsCount1 = DataGridView1.Rows.Count End If For i1 = 0 To RowsCount1 - 1 DataTable1.Rows.Add(DataTable1.NewRow) For i2 = 0 To DataGridView1.Columns.Count - 1 DataTabl

Categories : Vb.Net

Searching 2 Tables for a unique entry, then changing the data
SET requires , between assignments. EDIT Fixed your query: UPDATE regusers_test AS rt INNER JOIN alt_toon_test AS att ON att.`toonname` = rt.`toonname` SET rt.`server` = CASE WHEN rt.`username`='$user' AND rt.`server`='$oserver' AND rt.`toonname`='$otoon' THEN '$server' ELSE rt.`server`, att.`server` = CASE WHEN att.`username`='$user' AND att.`server`='$oserver' AND att.`toonname`='$otoon' THEN '$server' ELSE att.`server` WHERE ( rt.`username`='$user' AND rt.`server`='$oserver' AND rt.`toonname`='$otoon' ) OR ( att.`username`='$user' AND att.`server`='$oserver' AND att.`toonname`='$otoon' )

Categories : PHP

Remote Server Searching in RestKit with Core Data
I wouldn't use the in-memory store. I'd just put the search results into the main store and bypass the issues with copying. I'd then have a purge that ran to clean out the old search results that aren't required any more. You might want to tag search results that need to be kept around for some reason. And you can get RestKit to do the purge automatically when each new search is performed (see "Fetch Request Blocks and Deleting Orphaned Objects" in these docs) For your other question, about tagging. When you make the search request, the search term is in the URL. If you use RKObjectManager and routing then you can access the metadata that is provided to the mapping to get the search term and store it into the returned objects. Something like: @"@metadata.routing.parameters.searchTerm":

Categories : IOS

Correct layout for Json data when searching different attributes
I would suspect that given the number of tube stations (270?) that you're not going to notice any particular data arrangement being superior. A simple iteration would be barely noticeable on virtually any platform. I would rather (as ever) concentrate on making the code legible and easy to manage/maintain, and worry about specific performance issues as they arise.

Categories : Javascript

How to create fastest searching (filtering data) field in C#
There is no much tecniques on this: Use AJAX to query the subset of users On server side, one time request was got, get first (say) 10 elements of the subset found and send it to the user On client side use defered scrolling: the control that shows the list of users do not show all users od subset got from the server, but only set of them. When user scrolls down/up list refreshes by querying again the server. Say on list view it's possible to see 10 users at a time, you get from server 15, so on scrolling at least next 5 will appear immediately. Something like this.

Categories : C#

Speeding up searching for indices within a Large R Data Frame
Check data.table package. It works just like data.frame but faster. Like this (where df is your data frame): table <- data.table(df) and use table

Categories : R

Searching data from database using checkbox list for a ecommerce website
You need to iterate through your checkboxlist and test the selected value for each item and build a string containing each of your options. string queryparam = ''; for (int i=0; i<checkboxlist1.Items.Count; i++) { if (checkboxlist1.Items[i].Selected) { queryparam += (queryparam.Length = 0) ? "id = " + checkboxlist1.Items[i].Text : " or id = " checkboxlist1.Items[i].Text } } This should give you an idea to start with.

Categories : C#



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