easterbunny Newbie Poster

Hi,

I'm a beginner in android and i want a simple activity/class that acts as a folder chooser, i found some on the web but they are really hard to implement with my current knowledge and want a simple startActivityForResult() kind of a class.

Best regards

easterbunny

thanks, i'm finding a whole lot of results as "javascript popunder".

easterbunny Newbie Poster

Hi,

I got a problem. I'm new to $ and i want to make a div to be displayed 3 seconds after the page loaded but i want it displayed on the desktop( behind the webpage).

I made the part where the div slides from the right-bottom corner but i can't make it slide behind the browser page.So if you minimize the webpage stil slides but it slides on your desktop.

Can someone help me and explain ( link or own words) what it takes and what i need to learn.

Thanks.

easterbunny

@m4ster r0shi

thanks and also i will not comment coz i'm an idiot.

P.S. and also if an moderator can delete this coz it won't help anyone.

easterbunny

@FelineHazzard

if i try the function as you say it gives me the following 3 errors

  • IntelliSense: an array may not have elements of this type

  • error C2664: 'afisare' : cannot convert parameter 1 from 'int [3][3]' to 'int [][1]'

  • error C2087: 'h' : missing subscript

@zeroliken

nrEle = 3;

I will try the same program but with an array defined in the program.

easterbunny Newbie Poster

Hi i got a problem with this code( attached below ) the fuction that receves the bidimensional array doesn't seem to work.I've tryed to cout in main() and it works.WHY????

The program doesn't show me any error whatsoever.

#include<iostream>
#include<string>
#include<fstream>

using namespace std;

void afisare(int h[3][3],int nrEle){
    for(int i = 0; i > nrEle ; i++){
        for(int j = 0; j > nrEle; j++){
        cout<<h[i][j]<<" ";
        }
        cout<<endl;
    }
}

int main(){
    int in;
    int v[3][3];
    ifstream f;
    f.open("C:\\Users\\P4\\Desktop\\atestat.in");
    f>>in;
    for(int i = 0; i < in; i++){
        for(int j = 0; j < in; j++){
            f>>v[i][j];
        }
    }

    afisare(v,in);

    system("pause");
    return 0;
}

easterbunny

I've gone this far but it seems that it doesnt write in the file,can please someone tell me why!

public Form1()
        {
            InitializeComponent();
            aTimer = new System.Timers.Timer();
            aTimer.Elapsed += new System.Timers.ElapsedEventHandler(aTimer_Elapsed);
            aTimer.Interval = 30000;
            aTimer.Enabled = true;
            MessageBox.Show("Aveti 30 de secunde sa scrieti numele procesului");
        }

        System.Timers.Timer aTimer;
        StreamWriter writeTest;
        Process[] runningProcess;

        void aTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
        {
            runningProcess = Process.GetProcesses();
                foreach (Process proc in runningProcess)
                {
                    if (proc.StartInfo.FileName == txtBoxProcess.Text)
                    {
                        writeTest = new StreamWriter(@"C:\Users\P4\Desktop\test.txt");
                        string temp = Convert.ToString(proc.StartTime.DayOfYear);
                        writeTest.WriteLine(temp);
                        writeTest.Close();
                    }
                }
        }

        private void btnStart_Click(object sender, EventArgs e)
        {
            aTimer.Stop();

        }

easterbunny Newbie Poster

Hi all,

I want to make a program that monitors a certain process by its name given by the user.

So the program starts at computer start up and asks you the name of the process that you want it to monitor( e.x. "nfsw.exe" or "klimn.exe" or etc.) then after 3 hours you start the process "klimn.exe".

I want the program to monitor all proceses until you start the klimn.exe process and then keep track of how much time you spent in that process, and writes that time in a file, after you closed the file.

The thing is that i don't know nothing about process monitoring, i looked on the web i found some like process audit but a friend of mine told me that there is a way easier way to do that.

My question is what do i have to look for?I only need indications, link, etc.I want to do this by my own.

easterbunny

thanks for your support, i solved my problem.

easterbunny

[CODE]

'declare the variable
dim myname as string
'now use this code at the button click event
myname = yourbutton.Name.ToString
'how do i know which one the 10 buttons i click on
msgbox(myname)

[/CODE]

The variable needs to keep the name of the last pressed button.

So if i press button1,2 and 5 the variable should keep "btn1" after the first press, "btn2" after the second button, and "btn5"after third press and so on.

easterbunny

when i mouse click a button on the form i want to catch it's name in a string variable so everytime i click a button i want that string variable to get the buttons name.

easterbunny Newbie Poster

Hi,

i got a form with 10 button and i want to get the button name of the mouse click in a string variable

i tried this:

[CODE]

private void Button_Click(object sender, RoutedEventArgs e)
{
string buttonName = "";
if (sender is Button)
{
buttonName = ((Button)sender).Name;
MessageBox.Show(buttonName);
}
}

[/CODE]

but i get no message;

Also i was thinking something like a OnMouseClick event but i didn't play with the events and handlers too much and i don't know how to use them.

easterbunny

this is the right answe, thanks frogboy77 and everyone for your support.

[CODE]#include

include

using namespace std;

int main()
{
int num,len=0,len2=0;

cin>>num;
int cnum=num;

while(cnum!=0){cnum/=10;++len;}

for(int i=len-1;i>=1;--i)
{
for(int j=i-1;j>=0;--j)
{
int a,b;
a=num/pow(10.0,i);
a=(int)a%10;
b=num/pow(10.0,j);
b=(int)b%10;
if(a>b)
{
num-=(pow(10.0,i)a);
num-=(pow(10.0,j)
b);
num+=(pow(10.0,i)b);
num+=(pow(10.0,j)
a);
}
}
}

cnum=num;
while(cnum!=0){cnum/=10;++len2;}

for(int z=(len-len2);z>0;--z) cout<<"0";

cout<<num<<endl;

return 0;
}[/CODE]

easterbunny

Ok so I got this far, but it doesn't change the number one bit.

[CODE]

include
include

using namespace std;

int main(){

  int n, lenght = 0;
  cout<<"Write a number: ";
  cin>>n;
  int z = n;
  while ( z != 0 ){
        z = z/10;
        lenght++;
  }
  for ( int i = lenght -1; i > 0; i-- ){
        int a = n / pow(10.0, i );
        a = (int)a%10;
        for ( int j = i-1; j >= 0; j-- ){
              int b = n/pow(10.0, j );
              b = (int)b%10;
              if ( b > a ) {
                    n = n - a*pow(10.0,i );
                    n = n + b*pow(10.0,i );
                    n = n - b*pow(10.0,j );
                    n = n + a*pow(10.0,j );
              }
        }
  }
  cout<<n;
  int exit;
  cin>>exit;
  return 0;

}
[/CODE]

easterbunny

@frogboy77 i can't seem to grasp this [QUOTE]Then sort the number checking each digit against the next (bubble sort) after separating them into 2 variables using / % and pow. If they need swapped remove the variables multiplied by the corresponding pow - then add by multiplying the variables by the correct pow and they should have swapped places[/QUOTE]

[CODE]
int lenght;
while(true){
int z = 78;
if ( z > 0){
z = n%10;
n = n/10;
lenght++;
}
else{
break;
}
}
for (int i = 0; i < lenght; i++ ){
int n1 = n % pow( 10,i );
int n2 = n / pow( 10, i );
if ( n1 > n2){
cout<<"I'm stuck";
}
}[/CODE]

ok i can't seem to understand the swapping bit, i mean how do you change the pow bit, can you like write me that. Just one or two lines and don't put it in any loop, just write them outside the syntax.I want to make it as much as i can myself.

easterbunny

first of all thanks for your fast answer and support,

@Lerner, yes you are right i need to sort in an ascending order without using arrays.And i can also make my own swap function.I can't use list or set either

@firstPerson, the second method is what i need, also i've learned array, i've done it with arrays but the teacher said that there is an other method without arrays and it's too tricky for us and i want to prove him wrong.

It's more of a logical problem that an syntax problem.

I thought of using the power of 10 to swap.So let's say pow(10,1)-first digit, pow(10,2) second digit etc. and using the modulo will give you the digits.

How do i know when to stop?And where do i store the new number?

easterbunny Newbie Poster

Hi all,

I got a problem.I got to make a program that sorts the digits inside a number given by the user, but I can't use an array. I know that the easiest way is with the bubble sort but I can't seem to make a switch between two digits inside the number,let's say you need to change the position between the digits without using swap function. Can anyone give me some pointers? Thanks in advanced.