|
Hi, Pete O'Hanlon
Thank you so much for your reply.. The code will be run on laptops not on phones, so when a user works on a laptop, which the project will be installed on, and the customers' window will be appearing which has a list of customers' phone numbers, then just by clicking any phone number from the list, the user's android phone directly calls the number which has been clicked on the list.. I hope the idea got clearer, thank you..
|
|
|
|
|
Who is the user, and who is the customer? And how does the laptop send the dial commands to the Android phone?
|
|
|
|
|
Richard MacCutchan wrote: how does the laptop send the dial commands to the Android phone?
That's probably what he's asking!
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Yes, but not actually thought about it.
|
|
|
|
|
This isn't a trivial thing to do and is going to require the Android phone being set up to act as a mobile hotspot. Once it is available as a hotspot, the PC is going to have to connect to it and establish a Peer to Peer connection as a background service (the Android samples demonstrate how to find the IP address). Once the connection is established, you're going to send messages from the PC to the phone over this service telling it to make the call (you're going to have to use an Intent here - Google it). To be honest, unless you use Xamarin on the phone, the vast majority of what you are going to do here is going to be Java and you're going to have to get very comfortable with the Android SDK.
This space for rent
|
|
|
|
|
Thank you so much for your help.
I think the suggestions presented by OriginalGriff are good and can help me, but I am still studying them and I will test the solution that I will do based on the suggestions. When the solution works good and accurately, I will share it for all here.. also I consider your suggestion and I will try making a solution base on.. thanks so much, brother
|
|
|
|
|
Doesn't "Skype" handle "click a number and dial" type of calls?
Why does the "user" (i.e. Administration) even need a "phone"?
Is this for a "call center"?
What about VOIP?
(My last "user" wanted me to write a CSV extract because they didn't know how to "split a column" in Excel ... even though they "used Excel a lot". This sounds similar.)
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|
Hi,Gerry Schmitz
Thank you for your response..
For Skype, the Skype needs to be connected to the internet, and the policy of the company, where I work, relating to the internet using prevents running internet applications, so Skype is one of them.
The user who will work with my project needs to contact with the customers a lot and executes some another tasks, so he needs to do the calls faster because if he uses the traditional way to contact with customers (dialling the customers' numbers manually), this way will waste time, and will make him under stress. The calls are for customers mobile phones, not for a call center.
For VOIP, this technique is new for me, and I don't know how it works with VC#.NET. If you have any information about how to program it using VC#.NET, please share them..
Thanks
|
|
|
|
|
Your company needs to examine it's "policy".
A "Skype connection" does not imply unfettered internet access.
I'm at the point where I tell users their (outdated) "policies and procedures" need to accommodate the new realities (or find another "yes" man).
It's the user machine configuration that's at the core of this.
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|
Dear
I have futronic fs80 fingerprint scanner and I want to integrate with c# so I searched online but I didn't find any sample code or tutorial how to integrate it with c# also on
futronic website but it didnt give me any obvious way so I need your help?
|
|
|
|
|
Contact the manufacturers; they are most likely to have an SDK that goes with the device. If they don't then demand your money back.
|
|
|
|
|
i have tried array bytes data convert to json format
|
|
|
|
|
Does this have anything to do with C#?
|
|
|
|
|
You can't just send a byte array through JSON; you would need to serialize it first with something like:
System.Text.Encoding.UTF8.GetString(byteArray);
But on the other side you would need a mechanism to convert from a UTF-8 string into a byte array.
You can also send it via BSON NuGet Gallery | Newtonsoft.Json.Bson 1.0.1 with the same caveat, but there is a JS library built for that by MongoDB at GitHub - mongodb/js-bson: BSON Parser for node and browser.
If none of that will work for you, you will need to sent the file raw with the proper headers for the file type.
"There are three kinds of lies: lies, damned lies and statistics."
- Benjamin Disraeli
|
|
|
|
|
I have researched multiple sources and have come up with the following code that sorts the input array from low to high and outputs the sort order of position in the new sorted array.
The code below works, but I'd like to further optimize the final 11 x While loops into something that is more efficient. What is the best way to optimize this code?
Your help is greatly appreciated!
int[] i = {9, 2, 7, 6, 1, 3, 5, 4, 8};
int[] j = (int[])i.Clone();
int P01 = 0;
int P02 = 0;
int P03 = 0;
int P04 = 0;
int P05 = 0;
int P06 = 0;
int P07 = 0;
int P08 = 0;
int P09 = 0;
int va = 0;
int vp = 0;
bool swapped = true;
while (swapped) {
swapped=false;
va = 0;
while (va < i.Length -1)
{
if (i[va] > i[va+1]) {
int swap = i[va];
i[va] = i[va+1];
i[va+1] = swap;
swapped=true;
}
va++;
}
}
vp = 0;
while (vp < j.Length -1)
{
if (j[0] = i[vp]) {
P01 := vp + 1;
}
vp++;
}
vp = 0;
while (vp < j.Length -1)
{
if (j[1] = i[vp]) {
P02 := vp + 1;
}
vp++;
}
vp = 0;
while (vp < j.Length -1)
{
if (j[2] = i[vp]) {
P03 := vp + 1;
}
vp++;
}
vp = 0;
while (vp < j.Length -1)
{
if (j[3] = i[vp]) {
P04 := vp + 1;
}
vp++;
}
|
|
|
|
|
The logic of your code looks like a valid bubble-sort, but your code is not C#, and this is the C# forum. Sorting in computer science is a vast topic with many algorithms that have been extensively studied, compared; I think writing your own code for bubble-sort and quicksort is a good assignment for entry-level students.
A good review of basic sorting techniques, with code examples, in C#: [^] : look how simple their bubble-sort example is:
public static void IntArrayBubbleSort (int[] data)
{
int i, j;
int N = data.Length;
for (j=N-1; j>0; j--) {
for (i=0; i<j; i++) {
if (data [i] > data [i + 1])
exchange (data, i, i + 1);
}
}
}
public static void exchange(int[] data, int m, int n)
{
int temporary;
temporary = data[m];
data[m] = data[n];
data[n] = temporary;
}
«... thank the gods that they have made you superior to those events which they have not placed within your own control, rendered you accountable for that only which is within you own control For what, then, have they made you responsible? For that which is alone in your own power—a right use of things as they appear.» Discourses of Epictetus Book I:12
|
|
|
|
|
Hi,
what you wrote (at least the first loop) is a bubble-sort, which is quite inefficient for large arrays. There are other algorithms that basically use fewer comparison operations.
As for positions, you could merge all the remaining loops into one or two. Have a look at Dictionary<int,int>. You need to be careful when the array is allowed to contain duplicate values! Of course your positions should be stored in an array or some collection to support variable lengths.
There is a fundamental alternative, which does not modify the data array, instead it works on an index array, which holds positions, so initially it contains 0,1,2,...n-1 and finally it holds all the final positions. This in general is not the fastest approach, but it is pretty simple.
You don't have to write your own sorting code, how about:
int[] i = {...};
int[] j = (int[])i.Clone();
Array.Sort(j);
Advanced stuff: the Array.Sort() method allows you to specify a comparison method, which is useful when a special order is required, or when the array contains objects rather than numbers.
And if you allow for specialized solutions then the ultimate is:
int[] i = {9, 2, 7, 6, 1, 3, 5, 4, 8};
int[] j = {1, 2, 3, 4, 5, 6, 7, 8, 9};
|
|
|
|
|
What say you, my esteemed mentors and peers ? This is non-news; bad news; worth writing up as tip-trick ?
Use a nullable of that same generic parameter as a return value: I was aware there was some behind the scenes compiler magic with a hidden 'HasValue flag in a nullable 'struct that allowed an instance to be assigned null, but I never thought I could use the non-nullable generic parameter in the way shown here:
public static class ConversionExtensions
{
public enum ConversionType
{
SByte, Byte, Int16, Int32, Int64,
UInt32, UInt64, Single, Double,
Guid
}
static Dictionary<Type, TypeConverter> TypeToConverter = null;
public static T? TryParse<T>(this string str) where T : struct
{
if (TypeToConverter == null)
{
TypeToConverter = new Dictionary<Type, TypeConverter>();
foreach (string ct in Enum.GetNames(typeof(ConversionType)))
{
var t = Type.GetType("System." + ct);
TypeToConverter.Add(t, TypeDescriptor.GetConverter(t));
}
}
Type type = typeof(T);
if (TypeToConverter.TryGetValue(type, out TypeConverter tc))
{
try
{
return (T) tc.ConvertFromString(str);
}
catch
{
return null;
}
}
else
{
throw new KeyNotFoundException($"this converter does not handle Type: {type.FullName}");
}
return null;
}
}
«... thank the gods that they have made you superior to those events which they have not placed within your own control, rendered you accountable for that only which is within you own control For what, then, have they made you responsible? For that which is alone in your own power—a right use of things as they appear.» Discourses of Epictetus Book I:12
modified 10-Jun-18 12:33pm.
|
|
|
|
|
I think it's clever, but I can't say that I'm thrilled that this is possible. If I were using a library and got a "possible null reference exception" from a value type, I'd likely waste a fair amount of time trying to figure out what was going wrong.
I'm generally not a fan of blurring the lines between values and references.
"There are three kinds of lies: lies, damned lies and statistics."
- Benjamin Disraeli
|
|
|
|
|
Thanks for your thoughts, Nathan !
I'm not advocating this as the "best way:" I can see a valid argument foe using an out parameter, and returning a bool ... building on the 'TryParse syntax we are used to. I think I'll add the code for that technique to the post, and perhaps, get some more reactions.
By the way: in practice, I'm fanatic about controlling numeric entry in TextBoxes by using Key Event handlers to screen out unacceptable key entries, so this experiment is just a challenge I took on to get familiar with the 'TypeConverter facility.
The use of the currently shown code looks like this:
var v0 = tBxNumericUC1.Text.TryParse1<int>();
if (v0 != null)
{
} The usage of the code that's more like 'TryParse would look like:
if (tBxNumericUC1.Text.TryParse<int>(out int iresult)
{
}
«... thank the gods that they have made you superior to those events which they have not placed within your own control, rendered you accountable for that only which is within you own control For what, then, have they made you responsible? For that which is alone in your own power—a right use of things as they appear.» Discourses of Epictetus Book I:12
modified 11-Jun-18 14:15pm.
|
|
|
|
|
I have a couple of custom MVC implementations that act similarly. I'm working on one of those projects now, and I must confess that I forgot how hard it can be to troubleshoot.
Also: pretty much every other line is a null check. I sort of hate that
"There are three kinds of lies: lies, damned lies and statistics."
- Benjamin Disraeli
|
|
|
|
|
|
Google translate: "I posted this in the appropriate place, but I didn't get a quick enough reply so I thought I'd drop hints everywhere else".
They are getting clever these days, Google...
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
|
Your original post was in the correct forum.
Spamming other forums with "please look at my post" messages just because you didn't get an answer quickly enough is, at best, annoying.
Remember, the people answering questions here are volunteers. Nobody is under any obligation to answer your question at all, let alone within a particular time-frame.
Also, members are spread out across the globe, and may not have had a chance to see your original post yet.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|