16,018,664 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Visual Basic questions
View Javascript questions
View .NET questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by smoula99 (Top 31 by date)
smoula99
8-Nov-16 5:34am
View
OK. It is not possible create file and folder with same name.
Thanks for answes
smoula99
12-Mar-15 4:26am
View
but "short" must by as string not as struct
smoula99
11-Mar-15 3:49am
View
in debug mode at Watch window you write:
short (and to next row) Type.GetType("System.Int16") and you see different
short - is type short
Type.GetType("System.Int16") - is type System.Type
I need wite string "System.Int16" (I not write short), but I want struct short
e.g example where is possible to use
(short)12 - but I have variable type and in time, that I need use (something"System.Int16")12
smoula99
16-Jan-15 3:06am
View
I have functional program created in PyDev. I thought when is OK in PyDev and program working - than must working in IronPyton too?
When I run program VS 2013 Python + PTVS 2.1 VS 2013.msi + IronPython 2.7.5 - program working, but when I run in VS 2013 C# + PTVS 2.1 VS 2013.msi + IronPython 2.7.5 - using DLL from IronPython - program not working.
smoula99
15-Jan-15 2:07am
View
Hi
This file have about 1000rows code. I import My_H where I have dictionary, and MainFile.py a many time call value from dictionary like:
my_h.My_STATE['My_UP']
Problem is in C#, because I run MainFile from (VS 2013 Python + PTVS 2.1 VS 2013.msi + IronPython 2.7.5) - everything is OK
Problem is only when I run code using C# and IronPython (using code show above, ScriptEngine engine....)
smoula99
15-Jan-15 1:58am
View
Hi
I don't think your proposal is right because on another forum is used
from System.Windows import WindowState as WindowState1
After "as" can by used whatever how alias name
http://stackoverflow.com/questions/21857875/ironpython-import-two-enums-with-the-same-name
smoula99
2-Nov-14 12:57pm
View
Hi OriginalGriff
You have right in data. I don't understood. When I open file and give to my Expresso it work.
When I read file in c# and in debug mode get data and give to Expresso it not work.
Problem is in the read data :(
smoula99
2-Nov-14 12:41pm
View
I don't understood. I look code from Expresso. Only different is in the setting
public static Regex regex = new Regex("<w:r>(.*?)", RegexOptions.CultureInvariant | RegexOptions.Compiled );
But when I use this code in my program, still don't work :(
Why???
Best regards
smoula99
2-Nov-14 11:16am
View
readZipFile return text string from docx (word/document.xml). When I debug and look returned data - everything is OK.
Now I try Expresso 3.0 program. I give your pattern and use SPLIT and I got result what I want.
But when I use
string[] substrings = System.Text.RegularExpressions.Regex.Split(text, pat);
I got different result how give me Expresso program.
What I have bad in regex split syntax?
smoula99
2-Nov-14 10:38am
View
My code is this:
string text = readZipFile(@"d:\test.docx");
string pat = @"(?<=<w:r>).*?(?=)";
System.Text.RegularExpressions.Regex r = new System.Text.RegularExpressions.Regex(pat, System.Text.RegularExpressions.RegexOptions.IgnoreCase);
foreach (System.Text.RegularExpressions.Match ma in System.Text.RegularExpressions.Regex.Matches(text, pat))
{
ma.Value.ToString();
}
I use .net 4.0
Best regards
smoula99
2-Nov-14 10:12am
View
Hi
Can you provide your code? My string is longer, I give there only part of code. But when I test only short part, still not working.
I don't know what I work bad?
Best regars
smoula99
2-Nov-14 8:01am
View
Both regex are same. But don't work with pattern who you wrote.
smoula99
2-Nov-14 7:52am
View
Deleted
No comment
smoula99
2-Nov-14 7:48am
View
String sourcestring = "source string to match with pattern";
Regex re = new Regex(@"(?<=<w:r>).*?(?=)");
MatchCollection mc = re.Matches(sourcestring);
int mIdx=0;
foreach (Match m in mc)
{
for (int gIdx = 0; gIdx < m.Groups.Count; gIdx++)
{
Console.WriteLine("[{0}][{1}] = {2}", mIdx, re.GetGroupNames()[gIdx], m.Groups[gIdx].Value);
}
mIdx++;
}
smoula99
2-Nov-14 7:39am
View
Hi
Yes, this text is XML (from DOCX file). But I don't use XDocument or another class for work with XML, but I need work with this as text (not XML). Because I will work with restriction I must use only Regex.
Best regards
smoula99
2-Nov-14 7:31am
View
When click on this site (https://www.myregextester.com/index.php) options a "C#.NET", this give a source code in C#.
smoula99
2-Nov-14 7:14am
View
When I use your pattern, match result is a NULL.
What I doing wrong?
On this site is possible valid result (https://www.myregextester.com/index.php)
Raw Match Pattern:
(?<=<w:r>).*?(?=)
Matches Found:
NO MATCHES.
smoula99
2-Nov-14 6:30am
View
Hi
How get data between <w:r> and </w:r> using regex?
Thank you
smoula99
6-Sep-13 7:29am
View
I wrote this line (dataGridView1.Columns.Insert(1, "new DataGridViewColumn()...) - symbolic
full code for insert columns to datagridview is:
DataGridViewColumn _addColumns = new DataGridViewColumn();
_addColumns.Name = "something name";
_addColumns.HeaderText = "something name";
_addColumns.ValueType = typeof(string);
_addColumns.CellTemplate = new DataGridViewTextBoxCell();
dataGridView1.Columns.Insert(5, _addColumns); //5 is position of insert columns
smoula99
6-Sep-13 7:19am
View
I use datagridview for many options (in first option is > 60 colums, for second option is < 10 columns, etc.) I can't create columns "static", because I have different many columns (and rows). When I have only static count columns, then I can create just like you write.
I load datatable who have > 60 colums, that I processing (manual or programmatic) and unnecessary columns and row I delete. And I need datatable from this processing data in datagridview
i can do this processing in datatable instead datagridview, but insert new columns and next delete columns in datatable will cause shift position new added columns (unless at firt delete columns and next add columns)
smoula99
6-Sep-13 6:30am
View
yes, i make typist's error
dataGridView1.DataSource = ds.Tables[0]; - this is correct
but still, no columns/rows how need
when I use AutoGenerateColumns by inicialize
InitializeComponent();
dataGridView1.AutoGenerateColumns = false;
no data are displayed in datagridview
smoula99
6-Sep-13 6:01am
View
i think, it must be easy something like you suggest (setting something properties or ???)
when I set AutoGenerateColumns to false, then I don't add new columns to datagridview
My code is:
DataSet ds - "contains my data - example datatable columns count = 5"
dataGridView1.DataSource = ds;
dataGridView1.Columns.Insert(1, "new DataGridViewColumn() - insert a 1 new columns")
Datatable dtGridSource = (DataTable)dataGridView1.DataSource;
dtGridSource contains only 5 columns instead 6
if use AutoGenerateColumns = false
dataGridView1.DataSource = ds;
dataGridView1.AutoGenerateColumns = false;
dataGridView1.Columns.Insert(1, "new DataGridViewColumn() - insert a 1 new columns") - then I can't add new columns to datagridview
Datatable dtGridSource = (DataTable)dataGridView1.DataSource;
dtGridSource contains only 5 columns
smoula99
6-Sep-13 5:27am
View
I need "convert/transfer" updated data from datagridview to datatable/datasource/dataset (not reverse)
I wrote something like this:
private DataTable GetDataGridViewAsDataTable(DataGridView _DataGridView)
{
try
{
if (_DataGridView.ColumnCount == 0) return null;
DataTable dtSource = new DataTable();
//////create columns
foreach (DataGridViewColumn col in _DataGridView.Columns)
{
if (col.ValueType == null)
dtSource.Columns.Add(col.Name, typeof(string));
else
dtSource.Columns.Add(col.Name, col.ValueType);
dtSource.Columns[col.Name].Caption = col.HeaderText;
}
///////insert row data
foreach (DataGridViewRow row in _DataGridView.Rows)
{
DataRow drNewRow = dtSource.NewRow();
foreach (DataColumn col in dtSource.Columns)
{
drNewRow[col.ColumnName] = row.Cells[col.ColumnName].Value;
}
dtSource.Rows.Add(drNewRow);
}
return dtSource;
}
catch { return null; }
}
smoula99
6-Sep-13 5:12am
View
for example
if original datasource have a 5 columns and bind to datagridview and then I add to datagridview 2 new columns
using your solution datatable will have 5 columns instead 7 columns (5 orginal + 2 new)
smoula99
27-Aug-13 12:21pm
View
Deleted
I want ask about "IMEX=1"
On internet I found: set all value as string data type - this is, what I want.
Why didn't work in my string!?!?! Where is a error?
_StringXLS = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + openFileDialog_Xls.FileName + ";Extended Properties=\"Excel 12.0 Xml;HDR=YES;IMEX=1;TypeGuessRows=0;ImportMixedTypes=Text\"";
smoula99
10-Jul-13 2:09am
View
you are best man for create this effective part of code
can you give me link where I can read (learn) about effective using this programing
thanks you
smoula99
9-Jul-13 3:25am
View
How Can I transfer List (type of string) - created and filled to List (type of class - where I want fill only 1 part of class, type of string) without using cycle FOR
ZItems.ForEach(x => new Item().ItemName = x) here I would like use ToList(), but it not possible
ZItems.ForEach(x => List2.Add(new Item().ItemName = x)) this indicate error
smoula99
4-Jul-13 8:15am
View
yes, it is what I want to find
thank you
smoula99
4-Jul-13 0:18am
View
.NET 3,5
smoula99
3-Jul-13 4:20am
View
ok, thank you (i thought for solution will be using LINQ)
i use solution with for loop
smoula99
3-Jul-13 3:56am
View
yes, thanks
but I need use for (or foreach)
maybe I will have 50000 item of list
then will it slowly?
Show More