|
How many variants are there on the split up of the string ? - you show two, ie,
If String Starts With 'AB', then Format is AB, XX, YYYYYYYY, ZZZZZZ
If String Starts With 'VD', then Format is VD, XXXXXX, YYYY, ZZZZZZ
Before you go reaching for Regex, Id almost be suggesting that you look at Recursive Descent Parsing, or a parser based on a Grammar, using ANTLR perhaps - this would allow you to have rules, validation built in
'g'
|
|
|
|
|
how to split all hindi unicode characters.
StringBuilder sb = new StringBuilder();
string[] data = textBox1.Text.Split(new char[] { ' ' });
foreach (string s in data)
{
Regex ex = new Regex(@"(\w|\d)",RegexOptions.CultureInvariant);
MatchCollection col = ex.Matches(s);
foreach (Match mat in col)
{
// string d = Worddictonary[mat.ToString()];
sb.Append(mat.ToString());
sb.Append("\n");
}
}
For the input मोहनदास I am getting the output as
म ह न द स
The desired output is
म ो ह न द ा स
Can anyone please help to split Unicode Hindi string. Its very urgent.
Thanks in advance..
|
|
|
|
|
Unfortunately the 'normal' rules for string splitting often do not work for non-Latin languages. You will have to write your own parser that recognises the different characters.
Veni, vidi, abiit domum
|
|
|
|
|
string[position] returns the character at the given position. I just tested it with your example text, and it worked correctly:
private void button1_Click(object sender, EventArgs e)
{
StringBuilder sb = new StringBuilder();
for (int i = 0; i < textBox1.Text.Length; i++)
{
char indianChar = textBox1.Text[i];
sb.Append(indianChar);
sb.Append(" ");
}
MessageBox.Show(sb.ToString());
}
|
|
|
|
|
I am working on a touch surface, I need to create two desktops on a single surface running on a single Operating System (Windows 7), so that two users can simultaneously use them. Please guide me where to start and provide related links.
|
|
|
|
|
Saad.0071 wrote: Please guide me where to start and provide related links. Google and MSDN would be the logical choice.
Veni, vidi, abiit domum
|
|
|
|
|
Only a single desktop can be shown simultaneous. That's a technical limitation in Windows.
You could show two remote desktops on a single screen.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Do I understand that correctly:
- there is only one computer.
- that computer runs Windows 7
- there are two monitors attached to this computer.
- there are two users, each of them uses one of the monitors
The limitation of Windows 7 is that only one user can have an interactive session at a time. Hence, from the point of view of Windows, there is only one user in your scenario (i.e. both of your users work in the same session, with the same Windows account).
All user interface elements run in the UI thread of the program instance - a real multitasking is not possible with the user interface. You could circumvent that by starting two instances of your program. Each instance would communicate with a "server" (a Windows Service) which provides the back-end for your UI applications and which may run on the same computer.
|
|
|
|
|
Hi
Leslie Sanford created a midi toolkit:
http://www.codeproject.com/Articles/6228/C-MIDI-Toolkit
I have a question:
How we can store (For example in a text file) the converted midi to frequecy list and duration.
thanks
|
|
|
|
|
If you have a question about an article, use the forum at the bottom of the article:
C# MIDI Toolkit : Comments & Discussions[^]
The author of the article will be the person most likely to be able to answer your question.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Thanks
I asked but no reply is received yet!
|
|
|
|
|
Sorted I was being stupid, cant believe I had trouble with that.
modified 23-Jan-14 8:47am.
|
|
|
|
|
Why do you think I am going to go a a random site and download random code, the size and nature of which I do not know? Why do you think I want to search your code to find the code you write about? Do you think that is a good use of my time?
Edit your question, remove the links, and paste the relevant code fragments - just the bits with the problem and a few lines around for context - to make it easier for us to identify your problem.
Help us to help you!
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
|
I can: I tend to read what I meant to write...
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
I am looking for a plugin (dll or wotever) that will enable me to view an Analogue voltage on a grid type view. I also want to be able to follow this Analogue voltage and therefore the current value will be displayed in the middle of the grid.
It would also be nice to have scroll bars so I can stop the sampling and look back on previous values.
I could write one from scratch but it will obviously take time.
A free plugin that has these features would be ideal if anyone has any suggestions.
Thanks.
|
|
|
|
|
The Chart control that ships with Visual Studio is more than capable of doing this.
|
|
|
|
|
Tools: Visual Studio 2010 Ultimate, Language C#, Database MySql
Hi,
I am searching this a while, but to date didn't find any suitable solution.
I've a form with bound DataGridView with 5 columns, ProductID, ProductName, Qty, Price and Amount. After normal data entry user can click button to save data to Mysql database, no problem there.
At present user is manually enter ProductID after which an Sql command is executed to fetch ProductName and sets it to DataGridView ProductName Column. I need a way to show a ListView below ProductID column when it got focus, so that user can select product (ProductID and ProductName) from ListView and set it to DataGridView's Row which user is currently using.
Is it possible to show listview below ProductID cell when user click or when got focus?
Thanks
Ahmed
|
|
|
|
|
You use a data or edit template.
Consider popping a dialog as your data entry tool, you will have infinitely more control over your UI and it is dramatically simpler to manage a dialog that faffing about with a DGV.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Thanks for the reply.
Using Dialog for data entry is good idea...but can you guide me about how can I show that dialog box when user click or enter in DataGridView row? better if it shows below the current row
|
|
|
|
|
Create the dialog for data entry
Add -
pop the dialog with a new instance of the object
save the new object to the database
add the saved object to the DGV collection
Edit
Trap the DGV double click event
Check for a selected row in the DGV
Pass the select rows data to the dialog
save the edited object to the database
update the selected rows object with the modifications.
Not sure if the last bit is required, it has been too many years since I did winforms
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Aaa...now I see where the misunderstanding starts...
Actually the requirement is not to do the Data entry via dialog but to get data from Dialog/list to DataGridView. That is why I need the listview at first place. The main form contain DataGridView, from which user can make data entry for each product. Which is working just fine for saving/editing/deleting data to database.
What I need to provide facility to the data entry process, and give the user a list to select product instead of typing ProductID, user can select product from list and it will copy to Datagridview's active Row alongwith its ProductDesc, the list should only show when user enter ProductID in DataGridView.
|
|
|
|
|
hello, looking for an algorithms/library in .NET that Algorithms which Max(x) Min(y)
I think "Mean Variance Optimization" is the word for it - however MVO is used for portfolio selection/optimization: Max(Mean) Min(Variance)
Some generic be nice and also how to find the edge cases? How optimized...?
Thanks
|
|
|
|
|
hi
I have a button named Button1 in my form, and a text box named TexBox1.
I've written code that when I click the Button1, a Radio button gets created with it's own name:
c#:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
namespace WebApplication7
{
public partial class WebForm1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
ViewState["Counter"] = 0;
}
}
protected void Button1_Click(object sender, EventArgs e)
{
HtmlGenericControl div = new HtmlGenericControl("div");
for (int i = 0; i < Convert.ToInt32(ViewState["Counter"]); i++)
{
RadioButton rb = new RadioButton();
rb.GroupName = "GN1";
rb.ID = i.ToString();
rb.Text = "Button" + i.ToString();
rb.Checked = false;
rb.CheckedChanged += radioButton_CheckedChanged;
div.Controls.Add(rb);
Panel1.Controls.Add(div);
}
ViewState["Counter"] = Convert.ToInt32(ViewState["Counter"]) + 1;
}
private void radioButton_CheckedChanged(object sender, EventArgs e)
{
RadioButton btn = sender as RadioButton;
TextBox1.Text = btn.Text;
}
}
}
.NET
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication7.WebForm1" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Panel ID="Panel1" runat="server">
</asp:Panel>
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" />
<br />
<br />
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<br />
<br />
<br />
</div>
</form>
</body>
</html>
the problem is after several radio buttons being created, i want the program works as if each of them is checked, the TextBox1.Text gets the radio button's text string
but the function radioButton_CheckedChanged doesnt execute
|
|
|
|
|
As you radio buttons are dynamic there will not be exist on the next post-back. You have to recreate them every time you got a post-back, so you have to maintain some state that tells you if there was radio buttons.
As now the only time you create the radio button is on Button.OnClick...
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is. (V)
|
|
|
|