Error con “main” no definida en linux ubuntu

acabo de instalar ubuntu en mi pc y quise programar desde la consola y para ello instale un notepad (se llama notepadqq) al momento de ejecutar yo un programa simple manda error

#include <stdio.h>  int main(){      printf ("Hello world");      return 0; } 

El error que salta al compilar desde la consola de linux es: En la función _start': (.text+0x20): referencia amain’ sin definir collect2: error: ld returned 1 exit status

How to hide a widget from the main shop page

I want to hide an attribute widget from the main shop page. For example an atteribute widget such as colour doesnt need to be in the main shop page. It only needs to be there when a category is chosen in which there are colour variations. I want to hide the ‘type’ widget from the main shop page at simplicy.com.bd. How do i go about doing it?

Is this kind of attack something I should report to the main developer?

Vending machines at my workplace got recently changed and the new ones support an hybrid NFC\BT system to pay through a dedicated application.

Looking for online, I found some articles about this app being cracked and how it was done. Being several months later, I expected some new security measure to have been added so I decided to have a try and see if I could bypass them and repeat the process.

Original crack consisted of manually changing the data stored locally on a DB with a weak password, but since I don’t have a rooted phone and I have found traces of HTTPS requests being performed with checks on consistency on the credit, I decided to go another way.

Assumin vending machines do not connect online, I changed all the references to the remote REST endpoint (plain string constants) with a server of my own and I have successfully been able to login (or at least, make the app believe I logged in).

Now, assuming I fill the gaps and will be able to successfully buy stuff, is all this worth sharing with the developer, to have them take further security measures? Is there something serious they could do that would not require completely changing the infrastructure?

Error manejo de memoria con hilos main: malloc.c:2401: sysmalloc: Assertion

Tengo un problema con el manejo de memoria cuando manejo hilos para realizar el mismo proceso de manera paralela. La secuencia de creación y ejecución de los hilos es la siguiente:

    for(i=0; i<cantHilos; i++){         pthread_create(&hilos[i], NULL, &accionHilo, nombres[i]);         //sleep(1);           }     for(i=0; i<cantArchivos; i++){         pthread_join(hilos[i], NULL);     } 

La funcion accionHilo es la siguiente

char* nombre1 = crearCadena( (char*) argumentos); Info info = leerInformacionArchivo(nombre1); 

Y el problema radica en leerInformacionArchivo, en especifico en esta parte

while( it < lineas ){     fgets(linea, 100, archivo);           infoAux = crearInfo(linea);     resultado[it] = infoAux;     it++; } 

Si esta lectura de archivo la hago por separado (secuencialmente) no lanza error, incluso si se hace con distintos procesos, pero cuando la hago con hilos arroja diferentes errores, a veces este

main: malloc.c:2401: sysmalloc: Assertion `(old_top == initial_top (av) && old_size == 0) || ((unsigned long) (old_size) >= MINSIZE && prev_inuse (old_top) && ((unsigned long) old_end & (pagesize - 1)) == 0)' failed. Aborted (core dumped) 

y a veces este simple

Segmentation fault (core dumped) 

Yo creo que se trata de un error del manejo de memoria con hilos, porque si lo hago con sleep(1) (el que está comentado en el codigo) no se genera este error. Llevo mucho tiempo intentando detectar el error y no he podido

cualquier consejo – indicación es de gran ayuda.

Error al instalar en emulador aplicacion “Calling main entry com.android.commands.wm.Wm”

Estoy usando un ejemplo de internet para crear un sistema de login con PHP + Mysql, cuando trato de ejecutar la aplicación no hace nada y me devuelve esto en el logcat

2019-09-13 11:31:03.749 5897-5897/? D/AndroidRuntime: >>>>>> START com.android.internal.os.RuntimeInit uid 2000 <<<<<< 2019-09-13 11:31:03.751 5897-5897/? D/AndroidRuntime: CheckJNI is ON 2019-09-13 11:31:03.769 5897-5897/? W/art: Unexpected CPU variant for X86 using defaults: x86 2019-09-13 11:31:03.772 5897-5897/? D/ICU: No timezone override file found: /data/misc/zoneinfo/current/icu/icu_tzdata.dat 2019-09-13 11:31:03.787 5897-5897/? E/memtrack: Couldn’t load memtrack module (No such file or directory) 2019-09-13 11:31:03.787 5897-5897/? E/android.os.Debug: failed to load memtrack module: -2 2019-09-13 11:31:03.787 5897-5897/? I/Radio-JNI: register_android_hardware_Radio DONE 2019-09-13 11:31:03.794 5897-5897/? D/AndroidRuntime: Calling main entry com.android.commands.wm.Wm 2019-09-13 11:31:03.799 5897-5897/? D/AndroidRuntime: Shutting down VM

el codigo de la activiy de inicio es este

package com.paquete;  import android.app.ProgressDialog; import android.os.Bundle; import android.widget.Button; import android.widget.EditText;  import androidx.appcompat.app.AppCompatActivity;  import com.paquete.Utilidades.SessionHandler;  public class LoginActivity extends AppCompatActivity {      private static final String KEY_STATUS = "status";     private static final String KEY_MESSAGE = "message";     private static final String KEY_FULL_NAME = "full_name";     private static final String KEY_USERNAME = "username";     private static final String KEY_PASSWORD = "password";     private static final String KEY_EMPTY = "";     private EditText etUsername;     private EditText etPassword;     private Button register, login;     private String username;     private String password;     private ProgressDialog pDialog;     private String login_url = "http://urllogin/login/login";     private SessionHandler session;      @Override     protected void onCreate(Bundle savedInstanceState) {         super.onCreate( savedInstanceState );          session = new SessionHandler(getApplicationContext());        if(session.isLoggedIn()){             loadDashboard();         }          setContentView( R.layout.activity_login );          etUsername = findViewById(R.id.etLoginUsername);         etPassword = findViewById(R.id.etLoginPassword);          register = findViewById(R.id.btnLoginRegister);         login = findViewById(R.id.btnLogin);     //Launch Registration screen when Register Button is clicked         register.setOnClickListener(new View.OnClickListener() {             @Override             public void onClick(View v) {                 Intent i = new Intent(LoginActivity.this, RegisterActivity.class);                 startActivity(i);                 finish();             }         });          login.setOnClickListener(new View.OnClickListener() {             @Override             public void onClick(View v) {                 //Retrieve the data entered in the edit texts                 username = etUsername.getText().toString().toLowerCase().trim();                 password = etPassword.getText().toString().trim();                 if (validateInputs()) {                     login();                 }             }         });      }      private void loadDashboard() {         Intent i = new Intent(getApplicationContext(), DashboardActivity.class);         startActivity(i);         finish();      }      private void displayLoader() {         pDialog = new ProgressDialog(LoginActivity.this);         pDialog.setMessage("Logging In.. Please wait...");         pDialog.setIndeterminate(false);         pDialog.setCancelable(false);         pDialog.show();      }      private void login() {         displayLoader();         JSONObject request = new JSONObject();         try {             //Populate the request parameters             request.put(KEY_USERNAME, username);             request.put(KEY_PASSWORD, password);          } catch (JSONException e) {             e.printStackTrace();         }         JsonObjectRequest jsArrayRequest = new JsonObjectRequest                 ( Request.Method.POST, login_url, request, new Response.Listener<JSONObject>() {                     @Override                     public void onResponse(JSONObject response) {                         pDialog.dismiss();                         try {                             //Check if user got logged in successfully                              if (response.getInt(KEY_STATUS) == 0) {                                 session.loginUser(username,response.getString(KEY_FULL_NAME));                                 loadDashboard();                              }else{                                 Toast.makeText(getApplicationContext(),                                         response.getString(KEY_MESSAGE), Toast.LENGTH_SHORT).show();                              }                         } catch (JSONException e) {                             e.printStackTrace();                         }                     }                 }, new Response.ErrorListener() {                      @Override                     public void onErrorResponse(VolleyError error) {                         pDialog.dismiss();                          //Display error message whenever an error occurs                         Toast.makeText(getApplicationContext(),                                 error.getMessage(), Toast.LENGTH_SHORT).show();                      }                 });          // Access the RequestQueue through your singleton class.         MySingleton.getInstance(this).addToRequestQueue(jsArrayRequest);     }      private boolean validateInputs() {         if(KEY_EMPTY.equals(username)){             etUsername.setError("Username cannot be empty");             etUsername.requestFocus();             return false;         }         if(KEY_EMPTY.equals(password)){             etPassword.setError("Password cannot be empty");             etPassword.requestFocus();             return false;         }         return true;     }    } 

El archivo manifest.xml quedo asi

<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android"     package="com.qbacode.papelografo">      <uses-permission android:name="android.permission.INTERNET"/>       <application         android:allowBackup="true"         android:icon="@mipmap/ic_launcher"         android:label="@string/app_name"         android:roundIcon="@mipmap/ic_launcher_round"         android:supportsRtl="true"         android:theme="@style/AppTheme">         <activity android:name=".DashboardActivity"></activity>         <activity android:name=".RegisterActivity"             android:configChanges="orientation|keyboardHidden|screenSize" />         <activity android:name=".LoginActivity"             android:configChanges="orientation|keyboardHidden|screenSize">             <intent-filter>                 <action android:name="android.intent.action.MAIN" />                  <category android:name="android.intent.category.LAUNCHER" />             </intent-filter>         </activity>     </application>    </manifest> 

Exception in thread “main” java.util.EmptyStackException at tarea6.edd.Tarea6EDD.main(Tarea6EDD.java:43)

saludos cordiales. La situacion esta asi:

Efectuar un programa en java que dado dos objeto de clase stack tipo string (estacionamiento principal y estacionamiento secundario)

  • Llegada de un auto leer una placa tipo string e insertarlo en el estacionamiento principal
  • Salida de un auto buscando por la placa y que coincida con el del tope de la pila si no es asi se pasa ese auto al estacionamiento secundario hasta encontrar el auto a salir, este se borra de la pila y se regresan los autos del estacionamiento secundario al principal

Mi problema esta en que no cumple la segunda condicion que me pide lo he intentado de muchas formas, con for, con while, do while, etc

`

package tarea6.edd; import javax.swing.JOptionPane; import java.util.Stack; public class Tarea6EDD {     public static void main(String[] args) {          Stack<String> Primario = new Stack<String>();         Stack<String> Secundario = new Stack<String>();          int n;         n = Integer.parseInt(JOptionPane.showInputDialog("Numero de autos a entrar"));          String placa = "", r = "";          for (int i = 0; i < n; i++) {              placa = JOptionPane.showInputDialog("Numero de placa del vehiculo");             Primario.push(placa);          }          r = "Estacionamiento 1: " +Primario;          r+= "\n Tope de la Pila: "+Primario.peek();          JOptionPane.showMessageDialog(null, r);          String salida = JOptionPane.showInputDialog("Placa del Auto a salir: ");            for (int i = 0; i < n; i++) {             String primer = Primario.peek();              for (int j = 0; j < n; j++) {                 if (primer == Primario.peek()) {             Secundario.push(Primario.peek());             Primario.pop();                 }                 else                      do {                                                 Primario.pop();                       Secundario.push(Primario.peek());                     } while (primer == Primario.peek());             }         }              r = "Estacionamiento 1: " +Primario+ "\n Estacionamiento 2: "+Secundario;          r+= "\n Tope de la Pila: "+Primario.peek();         JOptionPane.showMessageDialog(null, r);       }     } 

`

Grub accidentally installed on my main OS instead of USB

I’m new to this forum. I run windows 10 on my PC and successfully installed ubuntu onto a USB flash drive, but ended up installing the Grub bootloader onto my main PC nvme drive that my OS is on. It doesn’t effect my booting in anyway. My PC will boot straight into windows and into ubuntu when I f12 to the boot manager screen and select ubuntu. Its shows my exact main OS drive twice in the windows boot manager. It shows my main drive and then it shows my main drive again with along with the name ubuntu. I know how to do it right next time and how to get the bootloader onto my USB drive, but how to I remove grub from windows PC? I have no idea where it installed and how to remove it. Thanks in advance everyone!