|
This is not a problem, this is a requirement, and and pretty well precise one.
The only thing you have to do is follow the instructions; so why don't you do it?
There are two kinds of people in the world: those who can extrapolate from incomplete data.
|
|
|
|
|
hi i am have an image which i would like to identify all rectangular border. does anyone know anyone know how i can do this efficiently?
an example of what i am trying to get like
0 0 0 0 0 0 0 0 0
0 1 0 0 0 1 1 0 0
0 2 2 2 2 2 2 2 0
0 2 0 0 0 0 1 2 0
0 2 0 0 0 0 0 2 0
0 2 2 2 2 2 2 2 0
0 0 0 0 0 0 1 0 0
where 1 and 2 are the same colour and 0 represents another colour
so the rectangular border i am trying to get is the rectangle coordinate of the pixel which are marked 2
|
|
|
|
|
You want to work with pixels? Go deep, deep, deep into the low-level programming, because System.Drawing [^]won't help you out.
Anyhow, how will you define a pixel to be 2, or 0, or a 1. Pixels vary in values, and even a slight different in their value would be indetectable by you, and software would provide you with a lot of unexpected results. First learn the basics, get to the intermediate level of programming then you can create an application of such logic.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
I usually stumble upon questions, which include the term "bulk" in them. Like "bulk messages". Since english is not my native language, that is why I usually get into trouble in understanding the actual purpose of the question.
So, I wanted to know, whether the blob and bulk have same meanings? Since they both denote something "large".
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
"Bulk messages" normally mean spam: either via SMS or email.
It's rarely anything that people want to receive, just product ads that the company concerned wants to send to as many people as possible, as cheaply as possible.
It's often used in questions about emails, because most web hosting services put a transmission limit on email of "nnn per hour" to prevent their systems being used as a spam source - which is often exactly what the OP is trying to do.
"blob" is a large chunk of binary data in a database context Google: Blob DataType[^] which can hold anything from basic text to a whole video file.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Blob usually means one large thing, while Bulk usually refers to a large quantity of things. See the difference?
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Yes, well the answer of OriginalGriff, gave me the idea about the actual concept.
Thanks for your answers too.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
or there's 'my blobby bulk' (me, personally), which is a lot of a large thing
|
|
|
|
|
-->app.config
<configuration>
<configsections>
<vconn>
<XMPP server="gmail.com" connectServer="talk.google.com" username="" password="" />
<startup>
<supportedruntime version="v4.0" sku=".NETFramework,Version=v4.5">
--> Configuration access file
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Configuration;
namespace ConsoleApplication7
{
namespace Config
{
public class Conn:ConfigurationSection
{
[ConfigurationProperty("XMPP")]
public ViniElement XMPP
{
get
{
return (ViniElement)base["XMPP"];
}
}
}
public class ViniElement : ConfigurationElement
{
[ConfigurationProperty("server", IsRequired = true)]
public string Server
{
get
{
return (string)this["server"];
}
}
[ConfigurationProperty("connectServer")]
public string Connserver
{
get
{
return (string)this["connectServer"];
}
}
[ConfigurationProperty("username", IsRequired = true)]
public string userName
{
get
{
return (string)this["username"];
}
}
[ConfigurationProperty("password", IsRequired = false)]
public string Password
{
get
{
return (string)this["password"];
}
}
}
}
}
-->Program.cs for connection to gmail
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;
using System.Threading.Tasks;
using agsXMPP;
using ConsoleApplication7.Config;
namespace ConsoleApplication7
{
class Program
{
private static Conn vConn = (Conn)ConfigurationManager.GetSection("Vconn");
private static XmppClientConnection Xclient = new XmppClientConnection();
static void Main(string[] args)
{
setUpXmpp();
Console.WriteLine("Waite a Second");
}
private static void setUpXmpp()
{
//Xclient.Server = Conn.VConn.XMPP.Server;
//Xclient.ConnectServer = Conn.VConn.XMPP.Connserver;
//Xclient.Username = Conn.VConn.XMPP.userName;
//Xclient.Password = Conn.VConn.XMPP.Password;
if (Xclient.Username.Length == 0)
{
Console.Write("Please enter the Gmail username : ");
Xclient.ConnectServer = Console.ReadLine();
}
if (Xclient.Password.Length == 0)
{
Console.Write("Please enter the Gmail password for " + Xclient.ConnectServer + ":");
Xclient.Password = Console.ReadLine();
}
try
{
Xclient.Open(Xclient.ConnectServer, Xclient.Password);
Xclient.OnLogin += new ObjectHandler(xmpp_OnLogin);
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
while (true)
{
System.Threading.Thread.Sleep(1000);
}
}
private static void xmpp_OnLogin(object sender)
{
Console.WriteLine("Login succeeded! Listening for connections.");
Console.WriteLine("xmpp Connection State {0}", Xclient.XmppConnectionState);
Console.WriteLine("xmpp Authenticated? {0}", Xclient.Authenticated);
}
}
}
|
|
|
|
|
|
Downvote countered.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
|
Downvote also countered.
/ravi
|
|
|
|
|
A code dump does not a question make.
There is no question asked, so we have no idea what problem you are having, or what kind of help you are seeking.
Please, try to think about how you present the problem from the POV of the reader: Remember that we can't see your screen, access your HDD, or read your mind.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Could it be that you made your properties read-only and are then attempting to assign them a value?
|
|
|
|
|
I really don't care if you downvote me or not. Just keep this in mind. The quality of the answer you get is directly determined by the quality of the question you ask.
You didn't really ask a question. You just dumped your code and hoped someone would rewrite it so it would work. You didn't do any research on your problem at all. That's what I provided you. If that wasn't good enough for you, piss off. You'll be out of a job within 6 months.
|
|
|
|
|
@Davee Kreskowiak
Sorry Sir , I am just a beginner. I tried a lot to debug but was not getting where my code is getting wrong so that's why i posted my whole of the code . And my code wasn't uploaded fully.
I am sorry if my skill of asking question is not upto match.I am jsut trying to get upto.
|
|
|
|
|
You didn't even try to ask a question!
Would you pass your shopping bag to the checkout person at the supermarket and expect her to fill it with exactly what you wanted to buy?
Of course you wouldn't! At the very least, you'd give him or her a shopping list so they had an idea what you wanted, and could ask "how much cheese?" And "which coffee brand?"
So why post your code and tell us nothing about what it should do, what it does do, and what you have done to try and work out why or fix it?
Instead of thinking about what we might need to help you, you took the lazy way and dumped cr@p on us and walked away in the hope that we'd do it for you. And when we didn't do exactly what you wanted, you decided to be rude and down vote someone. This isn't a behaviour model that is likely to get you anywhere in the real world, so why would you think it would work here in the virtual one?
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Sorry Sir , I am just a beginner. I tried a lot to debug but was not getting where my code is getting wrong so that's why i posted my whole of the code . And my code wasn't uploaded fully.
I am sorry if my skill of asking question is not upto match.I am jsut trying to get upto.
|
|
|
|
|
Hi All,
How to install system input language programatically in c#
|
|
|
|
|
|
Hey, so I have an issue with my array/code. I want the code to write out YES if the string exists within my array, and write out NO if it doesn't. Problem is that it writes out YES all the time, even if the string does not exist. What am I doing wrong?
string[] kos = new string[] { "test1", "test2", "test3" };
private void button2_Click(object sender, EventArgs e)
{
for (int i = 0; i <= kos.Count() - 1; i++)
{
if (textBox2.Text == kos[i])
{
kosCheckLabel.Text = "YES.";
kosCheckLabel.ForeColor = System.Drawing.Color.Red;
}
else if(textBox2.Text != kos[i])
{
kosCheckLabel.Text = "NO.";
kosCheckLabel.ForeColor = System.Drawing.Color.Lime;
}
}
}
modified 14-Feb-15 8:14am.
|
|
|
|
|
It looks to me like it should usually give "NO", unless the last item matches, but it's the weekend so I'm not having coffee.
The problem there is that you change it to "NO" all the time, instead of only when you've found out there are no matches. If one item doesn't match, that is in general not proof that none will.
By the way, i <= kos.Count() - 1 is more commonly written as i < kos.Length
So how about this:
kosCheckLabel.Text = "NO.";
kosCheckLabel.ForeColor = System.Drawing.Color.Lime;
for (int i = 0; i < kos.Length; i++)
{
if (kos[i] == textBox2.Text)
{
kosCheckLabel.Text = "YES.";
kosCheckLabel.ForeColor = System.Drawing.Color.Red;
break;
}
}
|
|
|
|
|
The first thing to note is that it's a loop - which means the code inside it is executed every time the value of "i" is incremented: so for your example, the code within the loop is executed 3 times: for i == 0, i == 1, and i == 2.
And because your two if conditions are opposite:
if (textBox2.Text == kos[i])
...
if(textBox2.Text != kos[i]) It will always print one string or the other.
In fact, because they are opposite, you don't need to test again at all: the else code will be executed if the first if fails, so your code is the equivalent of
for (int i = 0; i <= kos.Count() - 1; i++)
{
if (textBox2.Text == kos[i])
{
kosCheckLabel.Text = "YES.";
kosCheckLabel.ForeColor = System.Drawing.Color.Red;
}
else
{
kosCheckLabel.Text = "NO.";
kosCheckLabel.ForeColor = System.Drawing.Color.Lime;
}
}
If you want to just print once - "Yes" if it is there, or "No" if it isn't, the normal way is to use a bool value to "store" the current result:
bool isThere = false;
for (int i = 0; i <= kos.Count() - 1; i++)
{
if (textBox2.Text == kos[i])
{
isThere = true;
break;
}
}
if (isThere)
{
kosCheckLabel.Text = "YES.";
kosCheckLabel.ForeColor = System.Drawing.Color.Red;
}
else
{
kosCheckLabel.Text = "NO.";
kosCheckLabel.ForeColor = System.Drawing.Color.Lime;
}
But the simplest way to do it is to use a Linq method:
string[] kos = new string[] { "test1", "test2", "test3" };
private void button2_Click(object sender, EventArgs e)
{
if (kos.Contains(textBox2.Text)
{
kosCheckLabel.Text = "YES.";
kosCheckLabel.ForeColor = System.Drawing.Color.Red;
}
else
{
kosCheckLabel.Text = "NO.";
kosCheckLabel.ForeColor = System.Drawing.Color.Lime;
}
}
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Thank you both very much for the answers and effort in assisting me!
The output is still the same though, which I cannot understand why.
|
|
|
|