|
Thanks for your reply.
I tried to build mine.dll with x86 and x64 and run c# app.
But the result is same.
I think mysql.data.dll is problem.
what about your thought?
|
|
|
|
|
Hi,
if you want effective help, please start providing accurate information, and answers to all questions asked. Answers should be literal, not approximate! I will number my questions to make it easy for you to answer them. I am not promising a solution here, I am inviting you to provide enough information for someone to come up with substantiated suggestions rather than wild guesses as to what is going on.
1. If not present yet, put try/catch around the failing code, and make it show the following information:
1a. the entire exception, using its ToString() method;
1b. the error code (MySqlException has a number of properties!);
1c. the inner exception, again with ToString().
Put all of these in your next message!
2. Show your exact connection string or strings (replace password by asterisks). MySQL is known to be picky!
3. Where did you get your mysql DLL's (exact URL) ? what is their version number?
4. Sketch the history of database connects and disconnects up to the moment the failure occurs.
5. Have you modified any of the MySQL configuration parameters, things such as MaxUserPort and many others?
6. Have you specified timeout values that might be critically low?
7. Did you try calling Square(2)? What was its result when compiled with x86 and with x64.
8. What is your operating system? is it Windows10? is it 64-bit?
9. what is your development system? is it Visual Studio? which version?
10. What is the purpose of your app?
11. What is the purpose of your C++ function, the one that seems to sabotage further database accesses?
12. Is there anywhere in your code a try/catch block where the catch block is empty? i.e. are you swallowing exceptions, hence ignoring problematic situations, which is bound to make it extremely hard to understand what goes wrong??
13. are there any TCP actions involved, other than the MySQL accesses?
14. is there anything strange or peculiar happening before the MySqlException occurs, something you considered irrelevant and forgot to mention so far...?
That is it for now...
|
|
|
|
|
Member 14490964 wrote: I think mysql.data.dll is problem. Not very likely. Post some code to reproduce the issue, and we'll look at it.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
I am trying to build a main system ( web application ) that contain different systems
that provide service for sales , packing and HR dept etc , so i have many users (about one thousand users ) with different page access permissions ( dynamic responsibility that may change at any time )
what is the best design for the responsibility system that can give them the permission to access for some page that developed for them
thx in advance
|
|
|
|
|
Start by looking at how you ar identifying users to your system - most login systems include a "role" facility which allows you to separate things users can do / see from things they can't.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
to explain my case i will provide an example :
i have 3 systems with one login and dashboard page
each one of this systems have a multi pages
so i want to give user A access to system s1 and s2
and from s1 he can view page p1 and p2 just
and so on,
the IT supervisore is who responsable to give this users this roles dynamicly
|
|
|
|
|
I'd just use Identity, it has a role based system and you can apply attributes to actions that restrict access to certain roles (if it's MVC).
|
|
|
|
|
to explain my case i will provide an example :
i have 3 systems with one login and dashboard page
each one of this systems have a multi pages
so i want to give user A access to system s1 and s2
and from s1 he can view page p1 and p2 just
and so on,
the IT supervisore is who responsable to give this users this roles dynamicly
and yes it is MVC5 web application
|
|
|
|
|
|
I have a design issue in my code which I want to clear off.
I have an SMS data contains lakhs of records group by an Unique Code in my C# appplication. So under each Unique code, there will tens/thousands/lakhs of records to sent. So currently, applications picks up one Unique code, select all the unsend records and send. Then move forward and picks the next one like this going one. This is creating more delay in sending and clearing off the sms in a single day where we have lakhs of sms to send. So I think of converting the same to Multi-threaded application, so multiple threads starts at same time, picks up each unique id set and select records to sent, there by running two / three process running at same time, and it will be faster, i believe.
Please advise if this is the correct method to implement or is there any other better ways.
|
|
|
|
|
Threading is not a magic bullet: it won't automatically speed things up, indeed it can slow things down!
Threads require a free core to run, if one is not available then the thread is suspended until the next one that is free (this is an oversimplification, windows preempts tasks to give other threads a chance). And thread handling adds an processing overhead in terms of both speed and memory - so if the number of threads you create exceeds the number of cores, you get into the realms of diminishing returns.
So just "creating threads" to do the job "at the same time" won't necessarily help you - you need to look at how you are sending the SMS: if there is hardware involved such as a mobile phone you are interfacing to, threading will not speed things up as the mobile can only process one SMS at a time.
Start by looking at your whole system, and identify where the bottleneck is: you should concentrate of improving that, rather than looking for "magic bullet" solutions.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Look at the whole process, perhaps plot it out on paper as a chart.
You can add code to measure the time of each process, start time and stop time, then stop - start = time.
Maybe it's your DB write, when you update the record as sent. Writes can take forever.
Consider grabbing 100 numbers at a time, send, update an in memory array, and then grab another 100, and while it's sending, update the database as many in the background.Sort of a flip flop method.
If it ain't broke don't fix it
Discover my world at jkirkerx.com
|
|
|
|
|
Hello, how can I add a polygon to the map as in the picture below? From a certain point of coordinates should open a polygon long, for example, 1 kilometer and a 120-degree opening angle.
https://i.ibb.co/ZLKgvJs/image.png[^]
My code can only draw a circle. Can it be changed so that it can draw a polygon from a certain point of coordinates with an indication of the direction, distance of drawing and the angle of aperture?
private void CreateCircle(Double lat, Double lon, double radius, int ColorIndex)
{
GMapOverlay markers = new GMapOverlay(mygmap, "markers");
PointLatLng point = new PointLatLng(lat, lon);
int segments = 1080;
List<PointLatLng> gpollist = new List<PointLatLng>();
for (int i = 0; i < segments; i++)
{
gpollist.Add(FindPointAtDistanceFrom(point, i * (Math.PI / 180), radius / 1000));
}
GMapPolygon polygon = new GMapPolygon(gpollist, "Circle");
switch (ColorIndex)
{
case 1:
polygon.Fill = new SolidBrush(Color.FromArgb(80, Color.Red));
break;
case 2:
polygon.Fill = new SolidBrush(Color.FromArgb(80, Color.Orange));
break;
case 3:
polygon.Fill = new SolidBrush(Color.FromArgb(20, Color.Aqua));
break;
default:
MessageBox.Show("No search zone found!");
break;
}
polygon.Stroke = new Pen(Color.Red, 1);
markers.Polygons.Add(polygon);
mygmap.Overlays.Add(markers);
}
public static GMap.NET.PointLatLng FindPointAtDistanceFrom(GMap.NET.PointLatLng startPoint, double initialBearingRadians, double distanceKilometres)
{
const double radiusEarthKilometres = 6371.01;
var distRatio = distanceKilometres / radiusEarthKilometres;
var distRatioSine = Math.Sin(distRatio);
var distRatioCosine = Math.Cos(distRatio);
var startLatRad = DegreesToRadians(startPoint.Lat);
var startLonRad = DegreesToRadians(startPoint.Lng);
var startLatCos = Math.Cos(startLatRad);
var startLatSin = Math.Sin(startLatRad);
var endLatRads = Math.Asin((startLatSin * distRatioCosine) + (startLatCos * distRatioSine * Math.Cos(initialBearingRadians)));
var endLonRads = startLonRad + Math.Atan2(Math.Sin(initialBearingRadians) * distRatioSine * startLatCos, distRatioCosine - startLatSin * Math.Sin(endLatRads));
return new GMap.NET.PointLatLng(RadiansToDegrees(endLatRads), RadiansToDegrees(endLonRads));
}
public static double DegreesToRadians(double degrees)
{
const double degToRadFactor = Math.PI / 180;
return degrees * degToRadFactor;
}
public static double RadiansToDegrees(double radians)
{
const double radToDegFactor = 180 / Math.PI;
return radians * radToDegFactor;
}
|
|
|
|
|
Hi,
with the current code each of your segments spans one degree (or pi/180), having more than 360 of them makes no sense; with 1080 you cover three full circles. What you want is
segments=120;
|
|
|
|
|
Hi,
Below is the code and the output. Not sure how the second destructor getting called. Can anyone explain?
class Test
{
public:
Test()
{
cout << "user defined default constructor is called\n";
}
~Test()
{
cout << "user defined default destructor is called\n";
}
};
void main()
{
std::vector<Test> someVector;
Test t;
someVector.emplace_back(t);
}
output:
user defined default constructor is called <-- i understand this one
user defined default destructor is called <-- i understand this one
user defined default destructor is called <--- who is this?
|
|
|
|
|
You've posted this in the C# forum, but it appears to be C++.
Despite the similar names and vaguely similar syntax, they are completely different languages.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
See vector Class | Microsoft Docs[^]. This method creates a new object in place, so there is a second destructor to call when the vector goes out of scope.
|
|
|
|
|
I am working on a project of calculating the overall performance of a processing machine called (OEE), I write a WPF software c # create a form to enter data and program the formula to self-output in textblock. recipe : OEE = A * P * Q
A = production time - total downtime = run time (A)
P = Theoretical Cycle time * run time = The theoretical output (P) compares with the actual Output with the ratio of%
but the theoretical cycle time is how much detail is the data taken on a 5-minute machine (but here I just need to enter the estimated direct value to simulate)
All of the above indicators are percentages and time converted to minutes for easy calculation. It sounds easy to tangle but can you help me a little bit please !!![enter image description here][1]
modified 6-Dec-19 4:39am.
|
|
|
|
|
Member 14680372 wrote: It sounds easy to tangle but can you help me a little bit please Help you how? You have not explained what part of your code is the problem.
|
|
|
|
|
Your calculation is simple:
OEE = A * P * Q But ... P is A times a theoretical value and Q isn't defined at all ...
And we have no idea what part of this is giving you a problem!
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind - we only get exactly what you type to work with. So you need to give us "proper" information, including the context that is obvious to you because we have no idea what the "missing context" is!
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Was this project ever completed?
|
|
|
|
|
Working on a WPF app that hit's a Web API.On the server, I have this code in my BizObject:
public UserEntity Login(CredentialsEntity credentials)
{
var user = _repository.GetUser(credentials.UserName);
if (user != null)
{
if (Cryptology.CompareHashedString(user.Password, credentials.Password))
{
if (user.CanLogIn.HasValue && user.CanLogIn.Value)
{
return user;
}
}
}
return null;
}
While it works, the Password on the Credential object (credentials.Password) is in plain text. I know this isn't right, but I'm not sure of the correct way to do this?
What's the right way here?
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.
|
|
|
|
|
Make sure the web API is only available over HTTPS. That way, the transport takes care of encrypting the data in-flight for you.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I had a problem which I cannot solve for weeks and could not found any solution for it even I tried to look at NLayers but still not sure on how to do it. Can I ask that how can I read MPG Video into Naudio and control the left right channel? My customer does not want to change the video format to MP4, insist on using MPG file format for their KTV System.
Below is my snippet of codes
Im using Object as Player
<object id="Player" width="50" height="50" classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" VIEWASTEXT>
<param name="SendPlayStateChangeEvents" value="true" />
<param name="autostart" value="true" />
<param name="URL" value="<%=mySrc %>"/>
<param name="enabled" value="True"/>
<param name="balance" value="0"/>
<%--<param name="currentPosition" value="<%=myFForRewind %>"/>--%>
<param name="enableContextMenu" value="True"/>
<param name="fullScreen" value="true"/>
<param name="mute" value="False"/>
<param name="playCount" value="1"/>
<param name="rate" value="1"/>
<param name="stretchToFit" value="false"/>
<param name="uiMode" value="none"/>
<param name="volume" value="<%=myVolume %>"/>
<!--[if !IE]>-->
<!--<![endif]-->
</object>
The Naudio Code as below:
protected void ImageButton7_Click(object sender, ImageClickEventArgs e)
{
Page.ClientScript.RegisterStartupScript(this.GetType(), "CallMyFunction", "StartMeUp()", true);
player.player1 = new DirectSoundOut();
player.player1.Init(player.mono);
player.player1.Play();
}
|
|
|
|
|
Naudio says it handles "audio" files and makes no mention of "video" files.
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
|
|
|
|