How to be an active user and post a thread on an affiliate official?

Advertisement

you do not do it?

Advertise almost everything here, with CPM banners, CPM ads and CPC context links. If you wish, you can target relevant areas of the site and show ads based on the user's geographic location.

Starts at just $ 1 per CPM or $ 0.10 per CPC.

applications – Use shared preferences to not close a thread

I have an application and I use thread for connection to the server via a connection, but when I close my application, the connection ends.

I want my connection to never die and at the opening of my application my login remains open

I was doing with Shared Preferences, but not giving results. Save the data, but not the Spinner's choice and my connection is still dead. Help me, please !!!

    public void SAVE_DATA () {
getActivity (). runOnUiThread (new Runnable () {
@Override
public void run () {
SharedPreferences sharedPreferences = getActivity () .getSharedPreferences (SHARED_PREF, Context.MODE_PRIVATE);
SharedPreferences.Editor editor = sharedPreferences.edit ();

editor.putString (CONEXION, Tim .toString ());
Tim.Time_Stop_Init (0);

editor.putString (SPINNER, Spip.getOnItemSelectedListener () .toString ());

editor.putString (CONECTADO, Conec.getText () .toString ());

editor.putBoolean (SWITCH, Swcon.isChecked () == true);

editor.putString (AREA, Area.getText () .toString ());

editor.putString (USUARIO, Usuario.getText () .toString ());
Cargar_User ();

editor.putString (CONTRASEÑA, Password.getText () .toString ());

editor.commit ();

}
});
}

public void LOAD_DATA () {

SharedPreferences sharedPreferences = getActivity () .getSharedPreferences (SHARED_PREF, Context.MODE_PRIVATE);

//sharedPreferences.edit () .putString (SPINNER, Spip.getSelectedItem (). toString ()) .apply ();
//sharedPreferences.edit () .putBoolean (SWITCH, Swcon.isChecked ()) .apply ();

conexion = sharedPreferences.getString (CONEXION, "");
;
spinner = sharedPreferences.getString (SPINNER, "");

conectado = sharedPreferences.getString (CONECTADO, "");

switchi = sharedPreferences.getBoolean (SWITCH, false);

area = sharedPreferences.getString (AREA, "");

usuario = sharedPreferences.getString (USUARIO, "");

contraseña = sharedPreferences.getString (CONTRASEÑA, "");


}

public void UPDATE_DATA () {


Spip.setSelected (Boolean.parseBoolean (spinner.toString ()));
// Spip.setSelection (Integer.parseInt (spinner.toString ()));

Conec.setText (conectado);

Swcon.setChecked (switchi);

Area.setText (area);

Usuario.setText (usuario);

Password.setText (contraseña);


}

c # – Implementing the repository for thread security

I would need a revision of the code for the next implementation. Is this code safe? What can we improve?
The purpose of this code is for the study.

Public class Repository: IRepository, IDisposable
{
private IStorage _storage;
private list the entrees;

Public repository (IStorage storage)
{
_storage = storage;
_entries = storage.Load (). ToList ();
}

public void Create (input)
{
_entries.Add (entry);
}

public void Update (Enter)
{
existing var = _entries.Where (x => x.ID == entry.ID) .FirstOrDefault ();
existing name.name = entry.name;
existing.Number = entry.Number;
existing.Type = entry.Type;
}

public void Delete (Enter)
{
_entries = _entries.Where (x => x.ID! = entry.ID) .ToList ();
}

public entry GetEntry (Guid ID)
{
return _entries.FirstOrDefault (x => x.ID == ID);
}

public IEnumerable GetAlphabetically (Func support)
{
return _entries.OrderBy (x => prop (x));
}

public void Save ()
{
_storage.Persist (_entries);
}

private bool disposed = false;

public void Dispose ()
{
Eliminate (true);
GC.SuppressFinalize (this);
}

protected virtual empty Dispose (bool disposing)
{
if (! disposed)
{
if (dispose)
{
if (_entries! = null)
_entries = null;
}
willing = true;
}
}

~ Repository ()
{
Eliminate (false);
}
}

(Please delete this thread)

(@Moderator, please help remove this thread. Thank you.)

java – Spring Component Thread Safe

Recently, I refactored an application to start using Spring, and after some research, I discovered that @Component is not thread-safe. The class is this: (This is a xlsx to json string converter)

@Component
Public class ExcelFileConverter {

private XSSFWorkbook LoadWorkbook;

private FileInputStream fileStream;

private String filePassword;

private informationGroupDAO informationGroupDAO;

private list dbWorksheetList = new ArrayList <> ();

private WorkSheetExistsValidation workSheetExistsValidation;

private WorkSheetOrderValidation workSheetOrderValidation;

private WorkSheetValuesValidation workSheetValuesValidation;

public ExcelFile () {

}

@Autowired
public ExcelFile (WorkSheetExistsValidation workSheetExistsValidation,
WorkSheetOrderValidation workSheetOrderValidation, WorkSheetValuesValidation workSheetValuesValidation, InformationGroupDAO informationGroupDAO) {
this.workSheetExistsValidation = workSheetExistsValidation;
this.workSheetOrderValidation = workSheetOrderValidation;
this.workSheetValuesValidation = workSheetValuesValidation;
this.informationGroupDAO = informationGroupDAO;
}

public void loadProtectedFile (Final list errors) throws WorkbookLoadException {

try {
POIFSFileSystem fs = new POIFSFileSystem (this.fileStream);
EncryptionInfo info = new EncryptionInfo (fs);
Decryptor d = Decryptor.getInstance (info);

if (d.verifyPassword (this.filePassword)) {
this.loadedWorkbook = new XSSFWorkbook (d.getDataStream (fs));
} other {
Error ValidationError = new ValidationError ();
error.setId (1);
error.setMessage (new WorkbookPasswordError (). getMessage ());
errors.add (error);
}
} catch (OfficeXmlFileException oxfe) {
Error ValidationError = new ValidationError ();
error.setId (1);
error.setMessage (new WorkbookNotProtectedError (). getMessage ());
errors.add (error);
} catch (IOException ioe) {
throws new WorkbookLoadException ();
} catch (GeneralSecurityException gse) {
throws new WorkbookLoadException ();
} catch (Exception e) {
launch e; // new WorkbookLoadException ();
}
}

@SuppressWarnings ("not used")
privateUnit loadUnprotectedFile (Final list errors) throws WorkbookLoadException {
try {
this.loadedWorkbook = new XSSFWorkbook (this.fileStream);
} catch (IOException ioe) {
throws new WorkbookLoadException ();
} catch (Exception e) {
throws new WorkbookLoadException ();
}
}

public list getWorksheets () {
try {
listing result = new ArrayList();

for (int i = 0; i <this.loadedWorkbook.getNumberOfSheets (); i ++)
result.add (this.loadedWorkbook.getSheetAt (i));

return the result;
} catch (Exception e) {
launch e;
}
}

public XSSFCell getWorksheetCell (XSSFSheetheet, String address) {
try {
CellReference cellReference = new CellReference (address);
XSSFRow row = sheet.getRow (cellReference.getRow ());
XSSFCell cell = row.getCell (cellReference.getCol ());

return cell;

} catch (Exception e) {
launch e;
}
}

public list validateIfWorkSheetExists () {
return workSheetExistsValidation.validateIfWorkSheetExists (dbWorksheetList, keyWorkbook);
}

public list validateWorkSheetOrder () {
return workSheetOrderValidation.validateWorkSheetOrder (dbWorksheetList, chargedWorkbook);
}

public list validateWorkSheetValues ​​() {
return workSheetValuesValidation.validateWorkSheetValues ​​(LoadWorkbook);
}

public String convetFileToJSON () {

JSONObject result = new JSONObject ();

Map arrGroups = new LinkedHashMap <> ();

String guid = java.util.UUID.randomUUID (). ToString ();

try {

// Get groups of information
listing worksheetGroups = informationGroupDAO.findByParent (null);

for (InformationGroup group: worksheetGroups) {
arrGroups.put (group.getAlias ​​(), getGroupJSON (group));
}
JSONObject groupObj = new JSONObject (arrGroups);

result.put ("guid", guid);
result.put ("dfe", groupObj);

} catch (Exception e) {
launch e;
}

returns result.toString ();
}

Private JSONObject getGroupJSON (InformationGroup group) {

Map gCells = new LinkedHashMap <> ();

// Get the cells of the group
listing groupCells = group.getGroupCells ();

for (GroupCell cell: groupCells) {
// Get the cell value from the file
XSSFCell fileCell = this.getWorksheetCell (this.loadedWorkbook.getSheetAt (cell.getWorksheet (). GetIndex ()),
cell.getAddress ());

switch (DataType.valueOf (cell.getDataType (). toUpperCase ())) {

STRING case:
gCells.put (cell.getAlias ​​(), fileCell.getStringCellValue ());
Pause;

INTEGER box:
double cellValue = fileCell.getNumericCellValue ();
Integer i_cellValue = (int) cellValue;
gCells.put (cell.getAlias ​​(), i_cellValue);
Pause;

DECIMAL case:
double d_cellValue = fileCell.getNumericCellValue ();
gCells.put (cell.getAlias ​​(), d_cellValue);
Pause;

CASE DATE:
Date cellDate = fileCell.getDateCellValue ();
Format SimpleDateFormat = new SimpleDateFormat ("DD / MM / yyyy");
String dateString = format.format (cellDate);

gCells.put (cell.getAlias ​​(), dateString);
Pause;
}
}

if (group.getSubgroups (). size ()> 0) {
for (information subgroup: group.getSubgroups ()) {
gCells.put (subGroup.getAlias ​​(), getGroupJSON (subgroup));
}
}

JSONObject groupValues ​​= new JSONObject (gCells);
return groupValues;
}

public FileInputStream getFileStream () {
return fileStream;
}

public void setFileStream (FileInputStream fileStream) {
this.fileStream = fileStream;
}

public String getFilePassword () {
return filePassword;
}

public void setFilePassword (String filePassword) {
this.filePassword = filePassword;
}

I'm wondering if it's okay to have FileStream and the arraylist as a field, and how to handle that component that's not thread-safe.
In addition, all comments about something else will be appreciated.

Thanks in advance!

PopCash Official Thread (Popunder Network)

PopCash.net is a Popunder ad network established in 2012. It offers a self-service service for advertisers and a user-friendly interface for Publishers.

For Publishers :

  • No minimum traffic requirements and global traffic and country
  • Super fast support – Skype, chat, email, Facebook Messenger, icq
  • Fast Payments – daily on request (minimum $ 10 per request)
  • Quick approval sites
  • Miscellaneous payments …

PopCash Official Thread (Popunder Network)

Please delete this thread

That's no problem … apparently, no one is allowed to post ads for his services. I have not been here for a few years and I think this has been allowed before.

Discussion Suspender Thread Específico of um Processo (.exe) in C ++?

You are in the thread special thread of a process in C ++ to start StartAddress do thread …

Example of thread quero suspend: https://prnt.sc/m9vcef

Outro exemplo: Gostaria of fechar or chamado thread: "MyModule.dll! GlobalDllIndex + 0xac3b0Are you in front?

(Read more for the treatment process and treatment, without consistency of wire or wire.)

More than me:

#pragma how (lib, "psapi")

THREADINFOCLASS enumeration
{
ThreadQuerySetWin32StartAddress = 9,
};

typedef NTSTATUS (__ stdcall * f_NtQueryInformationThread) (HANDLE, THREADINFOCLASS, void *, ULONG_PTR, ULONG_PTR *);

ULONG_PTR GetThreadStartAddress (HANDLE hThread)
{
auto NtQueryInformationThread = reinterpret_cast(GetProcAddress (GetModuleHandleA ("ntdll.dll"), "NtQueryInformationThread"));
if (! NtQueryInformationThread)
returns 0;

ULONG_PTR ulStartAddress = 0;
NTSTATUS Ret = NtQueryInformationThread (hThread, ThreadQuerySetWin32StartAddress, & ulStartAddress, sizeof (ULONG_PTR), nullptr);

if (Ret)
returns 0;

return ulStartAddress;
}


bool SuspendThreadByStartaddress (ULONG_PTR StartAddress, DWORD dwProcId)
{
HANDLE hSnap = CreateToolhelp32Snapshot (TH32CS_SNAPTHREAD, 0);
if (! hSnap)
returns false;

THREADENTRY32 TE32 = {0};
TE32.dwSize = sizeof (THREADENTRY32);

BOOL Ret = Thread32First (hSnap, & TE32);
while (Ret)
{
if (TE32.th32OwnerProcessID == dwProcId)
{
HANDLE hTempThread = OpenThread (THREAD_ALL_ACCESS, FALSE, TE32.th32ThreadID);
if (! hTempThread)
Carry on;

if (StartAddress == GetThreadStartAddress (hTempThread))
{
SuspendThread (hTempThread);
CloseHandle (hTempThread);
CloseHandle (hSnap);
return true;
}
}
Ret = Thread32Next (hSnap, & TE32);
}

CloseHandle (hSnap);

returns false;
}


uintptr_t dwGetModuleBaseAddress (procId DWORD, const char * modName)
{
uintptr_t modBaseAddr = 0;
HANDLE hSnap = CreateToolhelp32Snapshot (TH32CS_SNAPMODULE | TH32CS_SNAPMODULE32, procId);
if (hSnap! = INVALID_HANDLE_VALUE)
{
MODULEENTRY32 modEntry;
modEntry.dwSize = sizeof (modEntry);
if (Module32First (hSnap and modEntry))
{
make
{
if (strcmp (modEntry.szModule, modName) == 0)
{
modBaseAddr = (uintptr_t) modEntry.modBaseAddr;
Pause;
}
} while (Module32Next (hSnap, & modEntry));

}
}
CloseHandle (hSnap);
return modBaseAddr;
}


int main ()
{
HWND tibiaWindow;
HANDLE hProcess;
DWORD PID;

tibiaWindow = FindWindow (NULL, "Process NameName");
if (! tibiaWindow) {
cost << "Process not found ...  n";
}
other {;
GetWindowThreadProcessId (tibiaWindow, & PID);
hProcess = OpenProcess (PROCESS_ALL_ACCESS, FALSE, PID);
uintptr_t base = dwGetModuleBaseAddress (PID, "MyModuleDll.dll");
SuspendThreadByStartaddress (base + 0xac3b08, PID);
}
getchar ();
}

Alguém tem alguma sugestão? obrigado

swing – Exception Erro in the thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException: -1

You are in the gambling sector.
Click here, click here, click here to read more. Porfica dando esse erro. it is alguem souber o que pode ser. Segue o codigo e o erro.

You are playing music to play with toys and toys

/ **
* Initialize the contents of the frame.
* /
private void initialize () {
jogo = new JogoDaVelha ("joao", "maria");
frmJogoDaVelha = new JFrame ();
frmJogoDaVelha.setResizable (false);
frmJogoDaVelha.setTitle ("Jogo da Velha");
frmJogoDaVelha.setBounds (100, 100, 444, 436);
frmJogoDaVelha.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE);
frmJogoDaVelha.getContentPane (). setLayout (null);

JPanel panel = new JPanel ();
panel.setBorder (new TitledBorder (null, "Tabuleiro", TitledBorder.LEADING, TitledBorder.TOP, null, null));
panel.setBounds (10, 11, 214, 386);
frmJogoDaVelha.getContentPane (). add (panel);
panel.setLayout (null);

JPanel panelTabuleiro = new JPanel ();
panelTabuleiro.setBounds (26, 37, 155, 192);
panel.add (panelTabuleiro);
panelTabuleiro.setLayout (new GridLayout (3, 3, 10, 10));

JButton btnNovoJogo = new JButton ("Novo Jogo");
btnNovoJogo.setBounds (57, 248, 97, 28);
panel.add (btnNovoJogo);

JButton btnNewButton = new JButton ("Result");
btnNewButton.setBounds (57, 300, 97, 28);
panel.add (btnNewButton);







for (int i = 0; i <3; i ++) {
for (int j = 0; j <3; j ++) {


labels[i][j]= new JLabel ("");
frmJogoDaVelha.getContentPane (). add (labels[i][j])
labels[i][j].setBounds (i * 60, j * 60, 50, 50); // x, y, width, height - 40x40
labels[i][j].setBackground (SystemColor.controlHighlight);
// Labels[i][j].setBorder (new LineBorder (new color (0, 0, 0)));
labels[i][j].setOpaque (true);
panelTabuleiro.add (labels[i][j])




labels[i][j].addMouseListener (new MouseAdapter () {



public void mouseClicked (MouseEvent e) {
JLabel b = (JLabel) e.getSource ();
int indexx = b.getX () / 40;
int indexy = b.getY () / 40;

if (numeroJogador == 1) {
// Simbolo = "X";
labels[indicex][indicey].setText ("X");
labels[indicex][indicey].setBackground (Color.GREEN);
labels[indicex][indicey].removeMouseListener (this);
labels[indicex][indicey].disable ();
} other {
// Simbolo = "O";
labels[indicex][indicey].setText ("X");
labels[indicex][indicey].setBackground (Color.BLUE);
labels[indicex][indicey].removeMouseListener (this);
labels[indicex][indicey].disable ();
}

labels[indicex][indicey].setText (Simbolo);
jogadavalida Boolean = jogo.jogarJogador (numeroJogador, indexy, indexx);


if (numberJogador == 1)
numeroJogador = 2;
otherwise numeroJogador = 1;
}
});






} // segundo for
}








}

segue o erro.

Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException: -1
to JogoDaVelha.jogarJogador (JogoDaVelha.java:60)
to Tabuleiro $ 2.mouseClicked (Tabuleiro.java:127)
on java.awt.Component.processMouseEvent (Source unknown)
at javax.swing.JComponent.processMouseEvent (Source unknown)
on java.awt.Component.processEvent (Source unknown)
on java.awt.Container.processEvent (Source unknown)
at java.awt.Component.dispatchEventImpl (Source unknown)
at java.awt.Container.dispatchEventImpl (Source unknown)
at java.awt.Component.dispatchEvent (Source unknown)
at java.awt.LightweightDispatcher.retargetMouseEvent (Source unknown)
on java.awt.LightweightDispatcher.processMouseEvent (Source unknown)
at java.awt.LightweightDispatcher.dispatchEvent (Source unknown)
at java.awt.Container.dispatchEventImpl (Source unknown)
at java.awt.Window.dispatchEventImpl (Source unknown)
at java.awt.Component.dispatchEvent (Source unknown)
at java.awt.EventQueue.dispatchEventImpl (Source unknown)
at java.awt.EventQueue.access 500 $ (Source unknown)
at java.awt.EventQueue $ 3.run (Source unknown)
at java.awt.EventQueue $ 3.run (Source unknown)
at java.security.AccessController.doPrivileged (Native Method)
on java.security.ProtectionDomain $ JavaSecurityAccessImpl.doIntersectionPrivilege (Source unknown)
on java.security.ProtectionDomain $ JavaSecurityAccessImpl.doIntersectionPrivilege (Source unknown)
at java.awt.EventQueue $ 4.run (Source unknown)
at java.awt.EventQueue $ 4.run (Source unknown)
at java.security.AccessController.doPrivileged (Native Method)
on java.security.ProtectionDomain $ JavaSecurityAccessImpl.doIntersectionPrivilege (Source unknown)
at java.awt.EventQueue.dispatchEvent (Source unknown)
on java.awt.EventDispatchThread.pumpOneEventForFilters (Source unknown)
on java.awt.EventDispatchThread.pumpEventsForFilter (Source unknown)
on java.awt.EventDispatchThread.pumpEventsForHierarchy (Source unknown)
on java.awt.EventDispatchThread.pumpEvents (Source Unknown)
on java.awt.EventDispatchThread.pumpEvents (Source Unknown)
at java.awt.EventDispatchThread.run (Source unknown)

mysql – Communication link failed – Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException

I have created a database on phpmyadmin and when I try to export data there, I get "Communication link failure, exception in the wire" AWT- EventQueue-0 "java.lang.NullPointerException". I use XAMPP to access phpmyadmin

public class MyConnection
{
public static connection getConnection () {
Connection con = null;

try{
Class.forName ("com.mysql.jdbc.Driver");
con = DriverManager.getConnection ("jdbc: mysql: // localhost / java_login_register", "root", "");

}
catch (Exception ex) {
System.out.println (ex.getMessage ());

}
return con;
}   

}

// I created this class to connect to the database.

// private void jButton_Register_ActionPerformed (java.awt.event.ActionEvent evt) {
// TODO adds your manipulation code here:

String fname = jTextField_FN.getText ();
String lname = jTextField_LN.getText ();
String uname = jTextField_UN.getText ();
String pass = String.valueOf (jPasswordField_PASS.getPassword ());
String re_pass = String.valueOf (jPasswordField_REPASS.getPassword ());


SimpleDateFormat dateformat = new SimpleDateFormat ("yyyy-MM-dd");
String bdate = dateformat.format (jDateChooser_BDATE.getDate ());
String address = jTextArea_ADDRESS.getText ();


PreparedStatement ps;
String query = "INSERT INTO" the_app_users (u_fname, u_name, u_uname, u_pass, u_bdate, u_address) VALUES (?,?,?,?,?,? ";

try {
ps = MyConnection.getConnection (). prepareStatement (query);

ps.setString (1, fname);
ps.setString (2, lname);
ps.setString (3, uname);
ps.setString (4, bdate);
ps.setString (5, address);

if (ps.executeUpdate ()> 0)
{
JOptionPane.showMessageDialog (null, "New user added");
}


} catch (SQLException ex) {
Logger.getLogger (RegisterForm.class.getName ()). Log (Level.SEVERE, null, ex);
}