[.NET] DataGridView not showing the image from Data Table

Hey, there! recently working with my winform project, I came across a problem, I created a Data table programmatically and gave one column of it, the path to an image. I have done it many times, and it worked all the times before, but this time, the image didn't show, instead it said: "string.byte()" or … Continue reading [.NET] DataGridView not showing the image from Data Table

[VB.NET] DataGrid view slow drawing

Today, working on one of my projects, I came across an irritating problem of .net Control (DataGridView). even with 53 records, the control was drawing very slowly that I could see it stuttering, I thought of enabling "Double Buffer" which I usually do for my forms, but unfortunately, Microsoft doesn't give this feature for DataGridView … Continue reading [VB.NET] DataGrid view slow drawing

[CodeChef Problem] Beautiful Arrays Problem Code: ICPC16B

#include<iostream> using namespace std; int main() { int i,t=0; int T,n; cin>>T; string result[T]; do{ int zero=0,one=0,min_one=0,other_num=0; cin>>n; int a[n]; for(i=0;i<n;i++) { cin >> a[i]; if(a[i]==1) one++; else if(a[i]==0) zero++; else if(a[i]==-1) min_one++; else other_num++; } result[t] = ((other_num > 1) || (min_one > 1 && one == 0) || (min_one > 0 && other_num … Continue reading [CodeChef Problem] Beautiful Arrays Problem Code: ICPC16B

[CodeChef Problem] Snake Procession

The annual snake festival is upon us, and all the snakes of the kingdom have gathered to participate in the procession. Chef has been tasked with reporting on the procession, and for this he decides to first keep track of all the snakes. When he sees a snake first, it'll be its Head, and hence he will mark a 'H'. The snakes are long, and when he sees the snake finally slither away, he'll mark a 'T' to denote its tail. In the time in between, when the snake is moving past him, or the time between one snake and the next snake, he marks with '.' s.

Regula-Falsi Method C++

#include<iostream> #include<cmath> using namespace std; float f(float x) { return pow(x,3)-2*x-5; } float rFalsi(float a, float b) { return (a*f(b) - b*f(a))/(f(b) - f(a)); } int main() { float a,b,c,e=0,tlr,oldr; int itr=1,dc; cout<<"Enter First value of Interval:"; cin>>a; cout<<"Enter second value of interval:"; cin>>b; cout<<"Please Enter Desired Tolerance(eg. 0.0001):"; cin>>tlr; cout<<"Enter Number of digits for … Continue reading Regula-Falsi Method C++

Newton-Raphson Method C++

#include<iostream> #include<cmath> using namespace std; float f(float x) { return pow(x,3)-2*x-5; } float df(float x) { return 3*pow(x,2)-2; } float newt(float a) { return a-(f(a)/df(a)); } int main() { float a,c,e=0,tlr,oldr; int itr=1,dc; cout<<"Enter First value of Interval:"; cin>>a; cout<<"Please Enter Desired Tolerance(eg. 0.0001):"; cin>>tlr; cout<<"Enter Number of digits for precision:"; cin>>dc; cout<<"\nEntered Interval is: … Continue reading Newton-Raphson Method C++