|
|
I wrote script in Python which activates webcam and take picture for the code,
I want to change the webcam to digital camera but, the code didnt recognize the device as a camera so I can't use it.
I want to know how a digital camera can connect to a python code like a webcam." :laugh
|
|
|
|
|
|
I searched on Google and did not find but I saw that there was such a thing but there was no explanation or code how to do it
|
|
|
|
|
Message Removed
modified 25-Oct-19 2:03am.
|
|
|
|
|
I am buliding a calculator app to calculate the productivity for an application/project. I am not sure on how to calculate the productivity. Hours * days * Working hours
Any suggestion? Thank you
|
|
|
|
|
Um. How many employees do you know who get just one day off every second month? What do they do in February?
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
it is just an time saving estimation. I just will take the employees who access the app in May since the app launched in May
|
|
|
|
|
And how many days are there in May and July?
How many days a week do your employees work? I'm pretty sure it's not 7, or even 6.77 ... So if it's 5, then you estimate will be off by 35% or so.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
can you write the formula? Thank you
|
|
|
|
|
No, it's your homework, and your tutor wants to see your thoughts, not mine!
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
thank you. I have solved the questions
|
|
|
|
|
It sounds less ridiculous if you stick to "saves one hour per day". Or not.
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it.
― Confucian Analects: Rules of Confucius about his food
|
|
|
|
|
In win7 I do not install Microsoft Agent Core Components (Msagent.exe) as winxp. It's warning error in win7. In winform C# I want install similar software as Microsoft Agent Core Components to use for win7 or win10 ? It is programmable in C # similar to "Microsoft Agent", does anyone know this software ?
|
|
|
|
|
|
I know Microsoft Agent no longer supports Windows 7 and later, do you know any software name similar to Microsoft Agent that can be used in Windows 7 or Windows 10 ?
|
|
|
|
|
Sorry, no idea. You could try one of the Microsoft help forums.
|
|
|
|
|
i have many payment rows in same date and i want to count how many payments i this date and put count result in new 1 row
i'm made it manually by excel but i want make it in c# with SQL Server & Data Grid View
this 2 photos make you understand
https://i.stack.imgur.com/mWj1M.png
https://i.stack.imgur.com/UhOzB.png
|
|
|
|
|
Try:
SELECT MyDateField, COUNT(MyDateField)
FROM MyTable
GROUP BY MyDateField
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
I've a nested n-level TreeView that consists of data such as grand father, father, child, and list goes on further. I want to bind Selected TreeView Item to so that I can get the Name and Age of selected person using Linq. Please help me. I'll be very grateful of you.
public class Person
{
public Person()
{
Children = new ObservableCollection<Person>();
}
public string Name { get; set; }
public int Age { get; set; }
public ObservableCollection<Person> Children { get; set; }
}
ObservableCollection<Person> Souce = new ObservableCollection<Person>();
Person P1 =
new Person()
{
Name = "GrandFather",
Age = 90
};
Person P11 = new Person()
{
Name = "Father1",
Age = 60
};
Person P111 = new Person()
{
Name = "Child1",
Age = 30
};
P11.Children.Add(P111);
Person P12 = new Person()
{
Name = "Father2",
Age = 60
};
P1.Children.Add(P11);
P1.Children.Add(P12);
Person P2 =
new Person()
{
Name = "GrandFather2",
Age = 91
};
Person P3 =
new Person()
{
Name = "GrandFather3",
Age = 92
};
Souce.Add(P1);
Souce.Add(P2);
Souce.Add(P3);
trVwPerson.ItemsSource = Souce;
My XAML:
<TreeView Name="trVwPerson" xmlns:obj="clr-namespace:TestWpf">
<TreeView.ItemTemplate>
<HierarchicalDataTemplate DataType = "{x:Type obj:Person}" ItemsSource="{Binding Path=Children}">
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Path=Name}"/>
<TextBlock Width="10"/>
<TextBlock Text="{Binding Path=Age}"/>
</StackPanel>
</HierarchicalDataTemplate>
</TreeView.ItemTemplate>
</TreeView>
|
|
|
|
|
Shouldn't that just be:
<TreeView SelectedItem="{Binding SelectedPerson, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"> Then in your view model you must have a property to connect the binding:
class ViewModel
{
public Person SelectedPerson { get; set; }
} However, you don't seem to have a view model for the entire TreeView.
I think you can set the TreeView's DataContect to an instance of the ViewModel.
For instance:
trVwPerson.DataContext = new ViewModel() But instead I suggest you specify the ViewModel to the MainWindow/UserControl containing the TreeView. For instance: You have your TreeView in your MainWindow or maybe a UserControl to contain the TreeView. For that container specify its DataContext to an instance of the ViewModel.
class MainWindow
{
public MainWindow()
{
this.DataContext = new ViewModel();
}
}
You also need to implement the INotifyPropertyChanged in the ViewModel.
However this is kinda clunky, ugly and tedious. Instead I recommend you use an automatic implementation of INotifyPropertyChanged as a NuGet-package. For instance: PropertyChanged.
I think that should give you some advice how fix your problem.
I have note tested my code, so have in mind if it's now is working right off.
Best regards,
/Steffe
|
|
|
|
|
I have the following code, I put a label in Form_Paint to track the number jump, I see the label jumping continuously but e.Graphics.DrawString(...) only looks once, does anyone know why ?
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
progressBar1.Minimum = 0;
progressBar1.Maximum = 100;
this.Paint += new System.Windows.Forms.PaintEventHandler(this.Form1_Paint);
}
int iNum = 0;
private void btnDrawText_Click(object sender, EventArgs e)
{
progressBar1.Value = 0;
progressBar1.Visible = true;
this.timer1.Interval = 100;
this.timer1.Enabled = true;
}
private void ShadowedTextPaint(PaintEventArgs e, int num)
{
using (Font font1 = new Font("Times New Roman", 250, FontStyle.Bold, GraphicsUnit.Pixel))
{
PointF pointF1 = new PointF(310, 270);
e.Graphics.DrawString(num.ToString(), font1, Brushes.LightGreen, pointF1);
lblNum.Text = num.ToString();
}
}
private void Form1_Paint(object sender, PaintEventArgs e)
{
ShadowedTextPaint(e, iNum);
}
private void timer1_Tick(object sender, EventArgs e)
{
if (progressBar1.Value < 100)
{
Random rd = new Random();
iNum = rd.Next(0, 999);
progressBar1.Value++;
}
else
{
this.timer1.Enabled = false;
progressBar1.Visible = false;
}
}
}
|
|
|
|
|
My first guess would be it's because you're setting the Text property of a Label control in your paint event, which will cause the label to Invalidate and require painting, which may be generating another WM_PAINT message for your form.
Handle the paint event, but only do painting in it, not messing with other controls that have nothing to do with drawing content.
Also, your in Tick event handler, the else clause of the If statement is unnecessary. The Timer control in the ToolBox does not need to be re-enabled on every tick, and the ProgressBar is always going to be visible since you never set it to not be visible.
Your Random really shouldn't be recreated on every tick of the timer. You can just create a single instance as the class level and just keep using that. But, since you're not even using the random numbers you're getting, why even have it in there?
|
|
|
|
|
The Label Control I put in the Form_Paint event is for me to troubleshoot it without affecting or messing up the information in the Form_Paint event or argument, I verified this with the Debug.Print debugger ("..." );
My Random function gets a random number and the Tick event determines the time to stop redrawing, the ideas you give me are incorrect.
What do you think is the use of Form_Paint to draw random numbers continuously over time ?
|
|
|
|
|
The Label control was a bad idea because it changes the behavior of your code. When you set the value of the Text property, the label does not get repainted at that time. It forces the label to Invalidate itself, telling Windows that it needs to repaint. Windows will get around to posting a WM_PAINT message to the applications message queue. When the UI thread finally goes back to idle, the queue will get processed and the paint message makes it way to the label control, telling it that it is now OK to paint itself. That is when the label actually changes on screen.
Moving on, you never use the value of the Random so it's never being painted anywhere.
Form_Paint is a bit much for this. I'd create a Control specifically for the purpose. This makes the code reusable and easily maintained.
The control would have it's own Random, it's own Timer, and a couple of methods to Start and Stop it's behavior.
|
|
|
|