|
Google found these suggestions[^] which may help you.
I must get a clever new signature for 2011.
|
|
|
|
|
|
Can you look into this app of mine, read about it and say your opinion about what problems i encounter in it?
I made an archive with some sample files and my app that use them. Its simpler and faster this way.
Link is here: http://www.sendspace.com/file/y4jc49 [download zTesting.zip]
Inside zip you will find [testu4.exe] app.
This is the content or the "Readme" that you will find inside, also.
I want to know something relating file handling. I dont mean in code but in real life.
Off, it's hard to put it into words.
The best way of my intent, is to give you an example of what i did (and not finished yet).
---------------------------------
Description of the program:
---------------------------------
Open the program [testu4.exe].
My software can list those txt files in custom rows.
Can search through their file names[up] and also through their contents[body].
When the search is finish, I have 2 options to show the content -> (Context - Concentrated)
I have an option to [show/Close all] rows. And a [Open File] that open the real file (not the text file).
The [Extract All] and [Back/Next] buttons are not implemented yet.
---------------------------------
Its purpose:
---------------------------------
I am not satisfied with it.I don't know why. Maybe you can suggest something to enlighten me.
-
The purpose of it, is to be able to quickly see inside tutorials and also, to quickly manipulate them.
Another purpose of it is to add manually files and directories and with this little app to be able to see inside them all at once.
-
Into a directory, I put together a couple of simple txt files.
Then, some html,pdf and docx files. These files I convert to txt file.
So, in the end I have a LOT of txt files.
The idea, for converting all into txt, is like so: [inside txt files, a c# software can search very quickly].
The name of the file will reflect its contents.
-
---------------------------------
TODO
---------------------------------
In the future I will add a treeview to it and the option to create a new file(txt,docx,or whatever).
I think to a drag option for files between them and a sort files.
It will be able to extract txt files from docx,html,xls,etc.
---------------------------------
------------------------------------------------------------------------------------------------------------------------------------
OK, so i hope you understand from this example what I want to create and its purpose.
What I want from you to tell me, well, I really don't know exactly for sure, but give me some suggestions to continue from.
The application is building, slowly but surely. I don't need special attention from you to its design. I want to give me an idea of how to work with these files. I mean, I want to be clear for me in the first place...then the app will do the hard work.
I am a bit ashamed for myself because of this confuse situation. But i need some help.
What i need to clarify in my head ? Or between these files?
Now I understand that this is the real programming problem that all will face in the end.
I have an idea. Maybe when I will put it to a real work, then the real problems will appear and also I will know what to repair and fix.
But its a long shot because i want it to remain a "AllPurpose" software, and not a specific one. For example, i want to see html,photoshop,c#,assembly tutorials with it, and not only c# tutorials. The problems will arrive from this corner only, and I will fix it to do its part of work in this direction, not in all. Or maybe i am thinking too much.
Give me some directions, something to start with,or clarify for me.
|
|
|
|
|
No.
Sorry, but I am not in the habit of downloading and executing unknown files from strangers. Would you?
Try describing things, instead of expecting us to download a program that could do anything when we run it...
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
Manfred R. Bihy: "Looks as if OP is learning resistant."
|
|
|
|
|
Ok, I know how it sounds, but I assure you that is not a virus or anything dangerous.
It's a simple project that is in testing form. Nothing more.
Its faster and simpler to view what i have done than to explain.
I really need some help from you guys.
Give me an alternative and I will try to make it.
Thank you.
|
|
|
|
|
merlinq12 wrote: I assure you that is not a virus or anything dangerous.
But you would say that, wouldn't you?
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
Manfred R. Bihy: "Looks as if OP is learning resistant."
|
|
|
|
|
Ok, you want to upload the project?
Ill do it, but you must put manually in Debug directory a couple of text files, some pdf's, some docx, and html, convert them all to *.txt files, compile the program and see how it read and why. The "readme.txt" file is posted here already, so you must read it first that to understand my problem.
Now I will upload the project to the only site I know sendspace.com , but if you know others in wich you trust more, tell me and I will upload through them.
thank you.
|
|
|
|
|
It not that I don't trust the site it is coming from, it's that I don't trust the content!
Without examining your source code in some detail, I cannot be sure that there is nothing in there which will potentially do something nasty. As a result, I am not going to download anything from anywhere!
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
Manfred R. Bihy: "Looks as if OP is learning resistant."
|
|
|
|
|
Ok, no problem, Ill give you the code, but not about it is the problem, but the feeling of the program itself and what it does... I really cant have words to explain better.
here is the entire project source: http://www.sendspace.com/file/vg2fq5
and here is its content:
Form1.cs
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Diagnostics;
using System.Reflection;
namespace testu3
{
public partial class Form1 : Form
{
public List<testu4.UserControl1> UC = new List<testu4.UserControl1>();
List<string> lrtb = new List<string>();
string path = Application.StartupPath;
int oneAfter = 0, posTxt = 0, multiFile = 0;
}
}
xEvents.cs
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Diagnostics;
namespace testu3
{
public partial class Form1
{
public Form1()
{
InitializeComponent();
userControl0Test.Visible = false;
}
private void Form1_Load(object sender, EventArgs e)
{
DirectoryInfo di = new DirectoryInfo(path);
foreach (var item in di.GetFiles())
{
if (item.Extension.ToLower() == ".txt")
{
testu4.UserControl1 uc = new testu4.UserControl1();
uc.Anchor = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right;
uc.Location = new Point(10, oneAfter);
uc.linkLabel0.LinkClicked += new LinkLabelLinkClickedEventHandler(linkLabelUC_LinkClicked);
uc.linkLabel1.LinkClicked += new LinkLabelLinkClickedEventHandler(linkLabelUCopen_LinkClicked);
uc.linkLabel0.Text = item.Name;
#region <_____ OPENfile _____>
foreach (var item1 in di.GetFiles())
{
string original = item.Name.Replace(".txt", "");
if (multiFile == 0)
{
if (item1.Name.Contains(original))
{
uc.linkLabel1.Links[0].LinkData = uc.linkLabel0.Text;
multiFile++;
}
}
if (multiFile > 0)
{
if (item1.Extension != ".txt")
{
if (item1.Name.Contains(original))
{
uc.linkLabel1.Links[0].LinkData = item1.FullName;
}
}
}
}
multiFile = 0;
#endregion >OPENfile-END<
uc.richTextBox1.Text = item.OpenText().ReadToEnd();
panel0.Controls.Add(uc);
UC.Add(uc);
oneAfter += uc.Height;
string pureName = item.Name.ToLower().Replace(".txt", "");
linkLabel0.Text += pureName + " | ";
linkLabel0.Links.Add(linkLabel0.Text.IndexOf(pureName), pureName.Length, item.FullName);
}
}
int indexOfNext = linkLabel_BackNext.Text.IndexOf("Next");
linkLabel_BackNext.Links.Add(0, 4);
linkLabel_BackNext.Links.Add(indexOfNext, 4);
}
private void button0Search_Click(object sender, EventArgs e)
{
panel0.Controls.Clear(); UC.Clear(); oneAfter = 0; linkLabel0.Links.Clear();
DirectoryInfo di = new DirectoryInfo(path);
foreach (var item in di.GetFiles())
{
if (item.Extension.ToLower() == ".txt")
{
posTxt = 0;
string searchText = textBox1.Text.ToLower();
if (item.Name.ToLower().Contains(searchText))
{
string pureName = item.Name.ToLower().Replace(".txt", "");
linkLabel0.ForeColor = Color.Gray;
linkLabel0.Links.Add(linkLabel0.Text.IndexOf(pureName), pureName.Length, item.FullName);
}
StreamReader sr = new StreamReader(item.FullName);
string alltxt = sr.ReadToEnd();
if (alltxt.ToLower().Contains(searchText))
{
#region <_____ addControls _____>
testu4.UserControl1 uc = new testu4.UserControl1();
uc.Anchor = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right;
uc.Location = new Point(10, oneAfter);
uc.Size = new System.Drawing.Size(panel0.Width, uc.defaultHeight);
uc.linkLabel0.LinkClicked += new LinkLabelLinkClickedEventHandler(linkLabelUC_LinkClicked);
uc.linkLabel1.LinkClicked += new LinkLabelLinkClickedEventHandler(linkLabelUCopen_LinkClicked);
uc.linkLabel0.Text = item.Name;
#region <_____ OPENfile _____>
foreach (var item1 in di.GetFiles())
{
string original = item.Name.Replace(".txt", "");
if (multiFile == 0)
{
if (item1.Name.Contains(original))
{
uc.linkLabel1.Links[0].LinkData = uc.linkLabel0.Text;
multiFile++;
}
}
if (multiFile > 0)
{
if (item1.Extension != ".txt")
{
if (item1.Name.Contains(original))
{
uc.linkLabel1.Links[0].LinkData = item1.FullName;
}
}
}
}
multiFile = 0;
#endregion >OPENfile-END<
#endregion >addControls-END<
#region <_____ Context _____>
if (button1Concentrated.Text == "Concentrated")
{
uc.richTextBox1.Text = alltxt.ToLower();
while (posTxt != -1)
{
posTxt = uc.richTextBox1.Find(searchText, posTxt, RichTextBoxFinds.MatchCase);
if (uc.richTextBox1.SelectedText == searchText)
{
uc.richTextBox1.SelectionLength = searchText.Length;
uc.richTextBox1.SelectionColor = Color.Red;
}
posTxt = uc.richTextBox1.Find(searchText, posTxt + 1, RichTextBoxFinds.MatchCase);
}
}
#endregion >Context-END<
#region <_____ Concentrated _____>
if (button1Concentrated.Text == "Context")
{
uc.richTextBox1.Text = alltxt.ToLower();
for (int i = 0; i < uc.richTextBox1.Lines.Length; i++)
{
if (uc.richTextBox1.Lines[i].Contains(searchText))
{
string line = "[line:" + (i + 1) + "/" + uc.richTextBox1.Lines.Length + "] " + uc.richTextBox1.Lines[i];
lrtb.Add(line);
}
}
uc.richTextBox1.Text = "";
foreach (var item1 in lrtb)
{
uc.richTextBox1.Text += item1 + "\r\n";
}
while (posTxt != -1)
{
posTxt = uc.richTextBox1.Find(searchText, posTxt, RichTextBoxFinds.MatchCase);
if (uc.richTextBox1.SelectedText == searchText)
{
uc.richTextBox1.SelectionLength = searchText.Length;
uc.richTextBox1.SelectionColor = Color.SpringGreen;
}
posTxt = uc.richTextBox1.Find(searchText, posTxt + 1, RichTextBoxFinds.MatchCase);
}
}
#endregion >Concentrated-END<
panel0.Controls.Add(uc);
UC.Add(uc);
oneAfter += uc.Height;
lrtb.Clear();
}
}
}
}
public void linkLabelUC_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
for (int i = 0; i < UC.Count; i++)
{
if ((i + 1) < UC.Count)
{
int firstHeight = UC[i].Height;
int firstPosition = UC[i].Location.Y;
int secondHeight = UC[i + 1].Height;
int secondPosition = UC[i + 1].Location.Y;
if (firstPosition == 0)
{
UC[i + 1].Location = new Point(10, firstHeight);
}
if (firstPosition != 0)
{
UC[i + 1].Location = new Point(10, firstHeight + firstPosition);
}
}
}
}
private void linkLabel0ShowAll_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
for (int i = 0; i < UC.Count; i++)
{
if (UC[i].richTextBox1.Lines.Length > 1)
{
if (UC[i].linkLabel0.LinkVisited)
{
UC[i].Height = UC[i].defaultHeight;
UC[i].linkLabel0.LinkVisited = false;
linkLabel0ShowAll.Text = "Show All";
}
else
{
UC[i].Height = UC[i].Height + (UC[i].richTextBox1.Lines.Length * UC[i].richTextBox1.Font.Height);
UC[i].linkLabel0.LinkVisited = true;
linkLabel0ShowAll.Text = "Close All";
}
}
if ((i + 1) < UC.Count)
{
int firstHeight = UC[i].Height;
int firstPosition = UC[i].Location.Y;
int secondHeight = UC[i + 1].Height;
int secondPosition = UC[i + 1].Location.Y;
if (firstPosition == 0)
{
UC[i + 1].Location = new Point(10, firstHeight);
}
if (firstPosition != 0)
{
UC[i + 1].Location = new Point(10, firstHeight + firstPosition);
}
}
}
}
void linkLabelUCopen_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
string target = e.Link.LinkData as string;
if (null != target) System.Diagnostics.Process.Start(target);
}
private void linkLabel0_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
this.linkLabel0.Links[linkLabel0.Links.IndexOf(e.Link)].Visited = true;
string target = e.Link.LinkData as string;
if (null != target) System.Diagnostics.Process.Start(target);
}
private void button1Concentrated_Click(object sender, EventArgs e)
{
if (button1Concentrated.Text == "Concentrated")
{
button1Concentrated.Text = "Context";
button0Search.PerformClick();
}
else
{
button1Concentrated.Text = "Concentrated";
button0Search.PerformClick();
}
}
}
}
UserControl1.cs
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace testu4
{
public partial class UserControl1 : UserControl
{
public UserControl1()
{
InitializeComponent();
}
private void UserControl1_Load(object sender, EventArgs e)
{
label0.Location = new Point(linkLabel0.Location.X + linkLabel0.Width, linkLabel0.Location.Y + 4);
}
public int defaultHeight = 55;
private void linkLabel0_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
if (richTextBox1.Lines.Length > 1)
{
if (linkLabel0.LinkVisited == false)
{
this.Height = this.Height + (richTextBox1.Lines.Length * richTextBox1.Font.Height);
linkLabel0.LinkVisited = true;
}
else
{
this.Height = defaultHeight;
linkLabel0.LinkVisited = false;
}
}
}
private void groupBox1_MouseHover(object sender, EventArgs e)
{
}
private void richTextBox1_MouseHover(object sender, EventArgs e)
{
}
}
}
|
|
|
|
|
|
Sorry for the trouble, but you look over it?
Any thoughts about it?
thanks.
|
|
|
|
|
Well, I really couldn't be bothered to read through all your code here, but a couple of things stood out on the quick look through I performed. In your Form_Load in Form1 (bad name by the way, you should try to rename your main components to be meaningful - you've got a lot of default names scattered about), you read the file details in; that's potentially going to be a long running operation so you should look to improve the user experience by running that on a thread.
Also, you have lots and lots of nested if statements, you could use short-circuit logic to make your code a bit more compact.
|
|
|
|
|
|
Hi all,
I can detect face and specific color using c# and open cv.
I hardly need code/ link/ help to detect teeth using c# and openCV.
Waiting for your helps.
|
|
|
|
|
AhmedMasum wrote: I hardly need code/ link/ help
If you hardly need it, why are you asking?
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
Manfred R. Bihy: "Looks as if OP is learning resistant."
|
|
|
|
|
sorry for using the wrong words.
Actually I really need this..
|
|
|
|
|
And what if the image has no teeth?
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Then just brush it off.
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
Manfred R. Bihy: "Looks as if OP is learning resistant."
|
|
|
|
|
I don't want teeth near my ARM.
|
|
|
|
|
if there is not teeth then it will show a message.
But if it detect teeth then it will show another message.
|
|
|
|
|
Still not got any good solution..
|
|
|
|
|
You need to spend some time thinking about this. How exactly do you think a computer can figure out the difference between a portion of a face and a tooth or teeth? This is all about image analysis which is not a simple matter of writing a few lines of code. Try looking at some of the articles on this subject here on CodeProject and on the wider internet.
I must get a clever new signature for 2011.
|
|
|
|
|
Thanks for your suggestion.
There are lots of online help for detecting face. There are some API to detect face from an image.
But I am not getting any efficient code to detect teeth from face using c#.
I am reading different articles but still can't code them.
thanks.
|
|
|
|
|
AhmedMasum wrote: But I am not getting any efficient code to detect teeth from face using c#.
Probably because it is very difficult to recognise where face ends and teeth begin. This is something like spectral analysis but without the accuracy.
I must get a clever new signature for 2011.
|
|
|
|
|
First find the mouth. Then use an edge-detection algorithm to find boundaries. The lips and teeth will be bounded by edges where the darkness changes. If you have color images, this will give you more information you can use to find edges. The bounded regions between the lips are probably teeth.
|
|
|
|
|