|
Programmer 1 wrote: can you edit my code to solve problem one No.
Programmer 1 wrote: i couldn't understand. Which part?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
try
{
WebRequest request = WebRequest.Create("http://facebook.com");
HttpWebResponse response = (HttpWebResponse) request.GetResponse();
MessageBox.Show("I am here!");
}
catch (Exception ex)
{
MessageBox.Show("Error Occurred!");
}
In my country facebook is filtered and When I run this code, no exceptions will be throw, also program not display message "I am here!";
What happened?
I want to use this code in a timer_tick every 1 minute and update ui label with alive status. do you have alternative way?
|
|
|
|
|
You'll have to use the debugger to be sure, but at a guess the request.GetResponse is not returning.
It's a blocking call, so if the response doesn't complete properly, then it'll never return: HttpWebRequest.GetResponse Method (System.Net)[^]
"This method blocks waiting for content to post; if there is no time-out set and you do not provide content, the calling thread blocks indefinitely."
Since what you are trying to do is probably illegal in your country (or FarceBook wouldn't be filtered) you probably need to think long and hard before looking at alternative approaches such as proxies.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
thanks. the problem was timeout. my timer_tick interval value was less than default timeout for request and before timer_tick completion, next round of timer called.
|
|
|
|
|
Hi
I want to display alert in system tray using c#.
Message is shown in popup window (like form) ,fetched from database
it will be displayed for 10 seconds
If user forget to see ,it will be displayed as icon in the system tray
and clicking can be opened to see the popup window.
Please help me.
It is urgent.
Regards
Rama
|
|
|
|
|
WPF? Windows Forms? Running purely as a Windows service?
Have a search for NotifyIcon to get the general idea of what you're trying to do. I have done a starter search for you here[^].
This space for rent
|
|
|
|
|
First of all, we're volunteers, and yours is as urgent as every other post. Second, it looks like a set of requirements, a rough description of what the app should do. We can help if you are stuck in building it and have specific questions, but it is not a place to order free code
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
hi,
i want to create my on language translator in C# this is my university project i do not know how to start how to implement statistical machine translation algorithm in c#. can you please guide me and give me helping material to complete this task
Thanks
Abdullah Khalil
[DELETED]@gmail.com
[DELETED]@skype.com
modified 23-Sep-16 4:57am.
|
|
|
|
|
Programming language translator? Human language translator?Member 10517704 wrote: i do not know how to start how to implement statistical machine translation algorithm in c# Do you know how to use Google? Why don't you search around there and see what you can find - the research you do will be useful to you.
Finally, remove your email and Skype addresses unless you really, really want to be spammed.
This space for rent
|
|
|
|
|
i think google also use machine translator technique and this is my University task to create on translator
|
|
|
|
|
So what have you done so far? What research have you undertaken?
I have to say that I admire the breadth of your ambition - the teams at Microsoft, Google, etc, have spent years with teams of PhDs and postgraduate researchers slaving away.
This space for rent
|
|
|
|
|
i have just read Statistical Machine Translation article nothing else
|
|
|
|
|
One article or multiple articles on that subject?
This space for rent
|
|
|
|
|
|
Then I'm afraid that you have probably taken on a much bigger project than you can manage. As others have said here, you're better off looking for a project that is more to your skill level. When you do a final project, you show off the skills that you have learnt; it's never meant to be about taking on something you have no idea about.
This space for rent
|
|
|
|
|
This is a project of immense complexity. I highly suggest you pick another project, one that you can finish within the school year.
If you have to start a project by begging for tutorials in a forum and starting your "questions" with the phrase "I have no idea where to start" you've got a huge problem.
|
|
|
|
|
You are indeed a master of understatement!
He's either a damn sight better than I was at his age, or he hasn't realised that it's just a bit complicated to implement natural language translation...
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
The mind boggles!
PS: Was wanting to talk with you regarding that little bit of space you have in your sig for rent ...
|
|
|
|
|
Reasonable Rates.
This space for rent
|
|
|
|
|
Never post your email address in any forum, unless you really like spam! If anyone replies to you, you will receive an email to let you know.
I've removed them from your message.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
|
So im practicing some C# basic concepts and was writing some code to simply calculate the income of a person after asking them to input their name, PayRate and Income and then displaying the income of that same person before and after taxes. However, after the user inputs their hours-per-week the program seems to jump past asking for their PayRate and displays their weekly income before and after taxes, so if someone could point out what i did wrong itd help me out, Thanks! Also the Console.ReadLine() and the console.Read() at the end of the program is to simply keep the command window open so i can check my work since it seems to want to close immediately after the code has been run instead of allowing me a chance to analyze the output so if someone could help me with that too it would be greatly appreciated thanks again.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LearningCs
{
class Program
{
static double CalcWeeklyIncome(double hours, double PayRate)
{
double income;
income = hours * PayRate;
return income;
}
static double CalcIncomeAfterTaxes(double income)
{
const double TaxRate = .2333;
income = income - (TaxRate * income);
return income;
}
static void Main(string[] args)
{
double hours, PayRate, Income;
string name;
Console.WriteLine("Please Input your Name: ");
name = Console.ReadLine();
Console.WriteLine("Please input your hours-per-week: ");
hours = Console.Read();
Console.WriteLine("Please input your Hourly Pay Rate: ");
PayRate = Console.Read();
Income = CalcWeeklyIncome(hours, PayRate);
Console.WriteLine(name + "'s income before taxes is " + Income);
CalcIncomeAfterTaxes(Income);
Console.WriteLine("The Income After taxes for " + name + " Is " + Income);
Console.ReadLine();
Console.Read();
}
}
}
|
|
|
|
|
Console.Read returns the character code[^] of the next character from the input. For example, if the user types 3, it will return the number 51 , because that is the ASCII code for the number 3.
If the user types 37, then your code will set hours to 51 (the ASCII code for 3), and PayRate to 55 (the ASCII code for 7). When you reach the second call to Console.Read , there is already a character in the buffer, so it doesn't need to wait for the user.
This is obviously not what you want. Instead, you should use Console.ReadLine to read the entire input until the user presses the Enter key.
You can then use Double.TryParse Method[^] to attempt to convert the string to a number:
string input;
Console.WriteLine("Please input your hours-per-week: ");
input = Console.ReadLine();
while (!double.TryParse(input, out hours))
{
Console.WriteLine("Please enter a valid number: ");
input = Console.ReadLine();
}
You'll then need to repeat that for the hourly rate.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
i think u should use Console.readline for hours-per-week and pay rate , and then convert it to int it will look like this:
name = Console.ReadLine()
Convert.ToInt32(Console.ReadLine());

|
|
|
|
|
Thanks so much guys I used the Convert.ToDouble method to keep the cents part of the value after taxes, I really appreciate the help, I would never have thought of that to be honest and learned a few new concepts thanks to your responses. Thanks Again! 
|
|
|
|