|
If the file is opened within a thread you control, then perhaps you could set something up to track which files you have open. Then you could just check against the tracker.
Perhaps this tracker could also fire events so that other threads wouldn't have to keep checking to see if the file is available. Maybe even a waiting list so you can see how many threads are waiting to open a file, you could even prioritize the list.... the possibilities are endless. But err, maybe just a list of files you have open.
My current favourite word is: I'm starting to run out of fav. words!
-SK Genius
Game Programming articles start - here[ ^]-
|
|
|
|
|
Asalamoalekum all,
friends my objective is to achieve indexing of any video(any format DVD, AVI etc) on the basis of the vocal emotions like humourus, tradegic, action. video should be segmented into scenes(in respective categories) on the click with respect to the frequencies spectrums(patterns) of the voices in the video.
can anybody guide me any way to achieve this goal.
how should i take a start to it in C# ??
please highlight basic features that will be required to accomplish my target!
please suggest any software to download which can covert audio frequencies to values!
thanking you!
waiting for reply.......
God bless you all!
regards,
Sana
$@N@
|
|
|
|
|
Can you please explain what your purpose is by indexing video in such a way. May be there is a work around.
Ahsan Ullah
Senior Software Engineer
|
|
|
|
|
Thanks to all of you for giving response!
from INDEXING VIDEO i mean:
any interface which allow opening a video, then if i want to have look at only humours scenes in the video i just click a button(whose back coding is fixed with particular audio frequency range which helps in identifying humour in conversation) and all the scenes which contain humour in it are all listed and then i can click them one by one to enjoy..similarly with the other types of emotions(tradegic, action)... HOPE U GOT MY POINT!
"ITS NOT MY FINAL YEAR PROJECT"
"I am not well knowned to C# so dont know whether it has any contro which allow video adding...as it allows image adding using picture box....please guide me"
again thanks in advance for further help!
$@N@
|
|
|
|
|
sana17 wrote: how should i take a start to it in C# ??
please highlight basic features that will be required to accomplish my target!
It sounds like you are well out of your depth here. I would try a simpler project and build up to something like this.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
I would recommend hiring a programmer to do the work for you.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
sana17 wrote: can anybody guide me any way to achieve this goal.
Complex sh*t... You should have knowledge of:
- video file formats
- digital signal processing
- data mining & expert systems
This sounds like a final project for college. Am I right?
|
|
|
|
|
sana17 wrote: Asalamoalekum all,
What does it mean?
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
hello everybody .
I have a little problem. I have a little problem. I have added the TextboxColumn to the datagridview. I want to add event keyUP to that TextBoxColumn. How can I do this?
please provide some some solution.
|
|
|
|
|
You wouldn't create a KeyUp event for the column, you would need to create the event for a DataGridViewTextBoxCell[^] in that column
Don't be overcome by evil, but overcome evil with good
|
|
|
|
|
Hi I am writing a netflow collector in C# and for some or other reason the TcpListener object does not go into a pending state as the netflow packets arrive. Does anybody know of a workaround for this. The code follows
<pre>
using System.IO;
using System.Net;
using System;
using System.Threading;
using N = System.Net;
using System.Collections;
class TalkServ
{
System.Net.Sockets.TcpListener server;
protected String file = "";
protected int port = 4055;
public static void Main(String [] args)
{
TalkServ TS = null;
try
{
TS = new TalkServ(args[0],args[1]);
}
catch (Exception e)
{
Console.WriteLine("\nMust specify a file path as first parameter...\nThe file is used to capture netflow data...");
Console.WriteLine("\nMust specify a port as second parameter...\nThe port is the netflow port...");
}
}
public TalkServ(string f,string p)
{
port = Convert.ToInt32(p);
server = new System.Net.Sockets.TcpListener(port);
file = f;
while (true)
{
server.Start();
if (server.Pending())
{
N.Sockets.TcpClient connection = server.AcceptTcpClient();
Console.WriteLine("Connection made");
BackForth BF = new BackForth(connection,file);
}
}
}
}//end of class TalkServ
class BackForth
{
N.Sockets.TcpClient client;
System.IO.StreamReader SR;
string file;
public BackForth(System.Net.Sockets.TcpClient c,String f)
{
client = c;
file = f;
Thread t = new Thread(new ThreadStart(init));
t.Start();
}
private void run()
{
try
{
string l = "";
while (true)
{
l = SR.ReadLine();
if (l != null)
{
if (!l.Equals(""))
{
StreamWriter writer = new StreamWriter(file, true);
writer.WriteLine(l);
writer.Close();
Console.WriteLine(l);
}
}
}
}
catch (Exception e44) { Console.WriteLine(e44); }
}
private void init()
{
SR = new System.IO.StreamReader(client.GetStream());
Thread t = new Thread(new ThreadStart(run));
t.Start();
}
}
</pre>
Stephen Lintott Bsc IT (RAU)
|
|
|
|
|
I found this site called MSDN, it has so many answers, like the following:
Remarks
This non-blocking method determines if there are any pending connection requests. Because the AcceptSocket and AcceptTcpClient methods block execution until the Start method has queued an incoming connection request, the Pending method can be used to determine if connections are available before attempting to accept them.
Wow!
|
|
|
|
|
Yes but this does not answer my question. I know what it is used for I just don't seem to pick up the netflow data with my application. It soesn't pick up any connection. Can anybody help with this.
Stephen Lintott Bsc IT (RAU)
|
|
|
|
|
Stephen Lintott wrote: Yes but this does not answer my question. I know what it is used for I just don't seem to pick up the netflow data with my application.
If you are not sending any data, that will just continue to loop forever.
Stephen Lintott wrote: It soesn't pick up any connection. Can anybody help with this.
I dont know the netflow protocol, you sure it is the correct port and protocol? From what I read it uses UDP or SCTP, neither of which you are using.
|
|
|
|
|
OK now we are getting some where. Could you maby supply a code sample for me. I am new to network programming in C# (Normally java). This would help a great deal just for the UDP connections and so on.
Stephen Lintott Bsc IT (RAU)
|
|
|
|
|
Stephen Lintott wrote: OK now we are getting some where. Could you maby supply a code sample for me.
You are getting somewhere. No, I do not have code off by hand. Best will be for you to figure it out, and learn how to do it. You are studying to become a programmer, right?
Stephen Lintott wrote: This would help a great deal just for the UDP connections and so on.
Look at the UdpClient class, it can send and receive IIRC.
|
|
|
|
|
No I am one... Just trying out .net for a change. Thanks for the help I found some code samples on the net.
Stephen Lintott Bsc IT (RAU)
|
|
|
|
|
I'd like to deep-copy the ListCollectionView. How can I do that? I have tried several techniques but the most of techniques that I tried are not working. Any idea would be appreciated.
|
|
|
|
|
Deep copy, as in clone the objects too?
|
|
|
|
|
yes but i dont want to have an reference of the original object.
For example ~
List<Person> persons = new List<Person>;
public void populateDataAndBindItToTreeView(){
///.........
}
public void UpdateData(){
List<Person> newPersons = new List<Person>;
/// Do something here.
DeepCopy(persons, newPersons); // will update the persons and treeview.
}
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
|
|
|
|
|
Michael Sync wrote: yes but i dont want to have an reference of the original object.
Which object, the list or the contents? Is Person clonable?
|
|
|
|
|
leppie wrote: Which object, the list or the contents?
Yes. the list of person.
leppie wrote: Is Person clonable?
No.
(Actually, I'm using ListCollectionView instead of List<person> in my project. AFAIK, ListCollectionView is not a clonable )
Thanks.
|
|
|
|
|
Michael Sync wrote: leppie wrote:
Is Person clonable?
No.
Then it will be a shallow clone, with new List<Person>(yourlistcollectionview) , you maybe have to cast/convert the ListCollectionView' IEnumerable to a IEnumerable<Person> first.
|
|
|
|
|
Sorry for making you confused. Let me elaborate it again..
This is our real scenario...
We are using WPF and Data-binding. We are using ListCollectionView to bind the control (e.g. Datagrid, TreeView or etc) ... The reason why we are using ListCollectionView is that it supports sorting, filtering and etc...
So, our code will be like that. Note: We are using MVVM pattern in our project so we dont want to write the code in code-behind. We wrote the most of code in ViewModel and bind that ViewModel with View..
=====
Class
=====
class Person() : INotification {
private int _id;
private string _Name;
private List<pet> myPets = new List<pet>;
public int ID{
///
}
public string Name{
///
}
public List<pet> MyPets{
//
}
//impelementation for INotification.
}
then.. I bind it with TreeView.
===========
View - XAML
===========
<herichical>
Souce="Pet" // child class
...
/>
<datatemplate>
.... Pet.Name />
<treeview> ItemSouce={... personListViewCollection } //personListViewCollection is the object from code below
...
/>
===========
ViewModel
===========
ListViewCollection personListViewCollection ;
void Constructor(){
populateData();
}
void populateData(){
List<person> persons = new List<person>();
Person p1 = new Person();
p1.ID =1;
..
List<pet> pets = new List<pet>();
pets.Add(new Pet(){ ...... } );
pets.Add(new Pet(){ ...... } );
p1.MyPets.AddRange(pets);
person.Add(p1);
/// add p2 p3 p4
///note: // Let's say personListViewCollection.GetHashCode() == 1000100
personListViewCollection = new ListViewCollection(persons);
}
So, those data will be displayed on TreeView.. then, I wanna re-populatethe data.
void reload(){
List<person> newPersons = new List<person>();
Person newP1 = new Person();
newP1.ID =1;
..
List<pet> newPets = new List<pet>();
newPets.Add(new Pet(){ ...... } );
newPets.Add(new Pet(){ ...... } );
newP1.MyPets.AddRange(newPets);
newPersons.Add(newP1);
///HERE is the problem. I dont want the hashcode of personListViewCollection to change.
personListViewCollection = new ListViewCollection(newPersons); //Problem..
}
then, I want to refresh the treeview and display the new data...
Any Idea?
|
|
|
|
|
Iterate through each items in the persons collection, create new items with the same value and add to newPersons . This will be the most easiest way. Something like
foreach(Person person in persons)
{
newPersons.Add(new Person(person.Name,person.Email,...));
} You will have new instances with same value in the newPersons collection. Is this what you are looking for or I got you wrong ?
|
|
|
|