View images stored on the spring boot server

I want to display the images stored on the spring boot server. This is the (project structure) (1)
where I saved images. I save the images according to the course, the name of the course, the year, the student ID and the images of its result will be saved in the past year. A student ID can have multiple images. My backup code is as follows

                            "Java", myYear, studentCode);
                    String fpath = System.getProperty("user.dir") + File.separator + "course";
                    Constant.createDir(fpath);
                    fpath += File.separator + "Java";
                    Constant.createDir(fpath);
                    fpath += File.separator + myYear;
                    Constant.createDir(fpath);
                    fpath += File.separator + studentCode;
                    Constant.createDir(fpath);

                    if (imageFile.isEmpty()) {
                        System.err.println("Please Select a File");
                        addObj.put("status", "Please Select a File");
                        return addObj;
                    } else {
                        String fileName = imageFile.getOriginalFilename();
                        String ext = Constant.isGetExt(fileName);
                        String genFileName = "";
                        if (ext.equals(".pdf") || ext.equals(".jpg")) {
                            genFileName = Constant.getFileName(ext, student.getPassingYear());
                            byte() bytes = imageFile.getBytes();
                            Path path = Paths.get(baseFilePath + File.separator + genFileName);
                            Files.write(path, bytes);
                            student.setImageFile(genFileName);
                            System.out.println("File Uploaded Successfully...");

                            StudentEducationEntity studSaved = eduService.saveData(student);
                            if (studSaved != null) {
                                addObj.put("status", "success");
                                return addObj;
                            } else {
                                System.err.println("Education Not Saved");
                                addObj.put("status", "failed");
                                return addObj;
                            }

                        } else {
                            System.err.println("Wrong File Format");
                            addObj.put("status", "failed");
                            return addObj;
                        }

                    } ```

  (1): https://i.stack.imgur.com/2M2kE.png

I want to view the student details with all semester images in html using ajax. How can i fetch images from the location and view in my page?

JWT Token stored in / data / data // shared_prefs – Android Application

I test an Android app that I create for learning purposes (I use a pre-existing skeleton code that my friend gave me). The application uses firebase and stores the JWT token in an xml file in shared_prefs. I am testing this application on a root device. A malicious application could therefore access this folder (/ data / data // shared_prefs) and therefore the JWT token stored in the XML file. Is this considered the best practice? Where should I store the JWT token? Should not it be stored in shared_prefs at all?
Thank you!

custom publication types – How to update API data stored in the database at regular intervals

If I run the cron wordpress, I insert the API data for a custom publication type using advanced custom fields.

However, if I restart it, it obviously duplicates the data, which I do not want.

If the API had itself a field "updated to", I could try to update it before the most recent date, but this is not the case Is it possible to check if the API records are newer, then add new ones and update the old ones?

Or do I have to erase everything and add them each time cron is run?

function get_data_from_api() {

     $locations = ();

     $results = wp_remote_retrieve_body(wp_remote_get('https://myAPI/v1/locations'));
     $results = json_decode($results);

     if ( ! is_array( $results ) || empty( $results ) ) {
        return false;
     }

     $locations() = $results;

     foreach ($locations(0) as $location) {
            $inserted_location = wp_insert_post((
                'post_name' => $location->City,
                'post_title' => $location->City,
                'post_type' => 'location',
                'post_status' => 'publish'
            ));

              if (is_wp_error( $inserted_location ) ) {
                continue;
            }

            $fillable = (
                'field_5ddfd334b1dee' => 'Address1',
                'field_5ddfd346b1def' => 'Address2',
                'field_5ddfd353b1deg' => 'Address3',
                'field_5ddfd35fb1deh' => 'Address4',
                'field_5ddfd35fb1dei' => 'City'

            );

             foreach( $fillable as $key => $name ) {
                 update_field( $key, $location->$name, $inserted_location );
            }
     }
}

if (!wp_next_scheduled('update_locations')) {
    wp_schedule_event(time(), 'hourly', 'update_locations');

}
add_action('update_locations', 'get_data_from_api');

Why does the stored procedure take longer while normal query execution (MYSQL)?

I have a stored procedure that returns simple, but takes more than 16 seconds when I call it, but only 0.5 seconds, if I execute this by normal query.

Procedure

    DELIMITER $$
DROP PROCEDURE IF EXISTS `local_db`.`getAllMatchedStockByCompany` $$
CREATE
    PROCEDURE `local_db`.`getAllMatchedStockByCompany`(
    IN Company_ID BIGINT(20)
    )
    BEGIN
        SELECT t1.*
    FROM ((SELECT t2.SRTitle,t2.UrlPart,t2.ScheduledTime,t2.Photo,TRIM(REPLACE(REPLACE(REPLACE(REPLACE(SUBSTRING_INDEX(REPLACE(fnStripTags(t2.SRDescription),' ',''),' ',
            30), 'rntrnrnt', ''),'rntrnt',''),'rnt',''),'’',''))AS Description, 'stock-research' AS from_tbl,t2.IsActive
           ,t2.CompanyID FROM t2
          ) UNION
          (SELECT t3.ReportTitle,t3.UrlPart,t3.CreatedDate,t3.ReportImage,TRIM(REPLACE(REPLACE(SUBSTRING_INDEX(REPLACE(fnStripTags(t3.Description),' ',''),' ',
                30),'rntrnt',''),''','`')),IF(t3.SpecialReport = 1,'special-report','report'),t3.IsActive
        ,t3.CompanyID FROM t3
          )
         ) t1
         WHERE CompanyID = Company_ID AND IsActive = 1
         ORDER BY ScheduledTime DESC;
    END$$

DELIMITER ;

the total running time is 16 seconds with 1 line.
But if I use the query below

SELECT t1.*
    FROM ((SELECT t2.SRTitle,t2.UrlPart,t2.ScheduledTime,t2.Photo,TRIM(REPLACE(REPLACE(REPLACE(REPLACE(SUBSTRING_INDEX(REPLACE(fnStripTags(t2.SRDescription),' ',''),' ',
            30), 'rntrnrnt', ''),'rntrnt',''),'rnt',''),'’',''))AS Description, 'stock-research' AS from_tbl,t2.IsActive
           ,t2.CompanyID FROM t2
          ) UNION
          (SELECT t3.ReportTitle,t3.UrlPart,t3.CreatedDate,t3.ReportImage,TRIM(REPLACE(REPLACE(SUBSTRING_INDEX(REPLACE(fnStripTags(t3.Description),' ',''),' ',
                30),'rntrnt',''),''','`')),IF(t3.SpecialReport = 1,'special-report','report'),t3.IsActive
        ,t3.CompanyID FROM t3
          )
         ) t1
         WHERE CompanyID = 931 AND IsActive = 1
         ORDER BY ScheduledTime DESC;

This only took 0.5 to 1 second with a row.

Can any of you tell me why this is happening or how can I improve my SP execution time?

Thank you

stored procedures – After upgrading the database to SQL Server 2019, the SP generates an "out of memory" error

I moved a SQL Server 2012 database (size 8 GB) to a newly configured SQL Server 2019 virtual machine with the same memory and CPU configuration and changed the compatibility level in SQL Server 2019. Everything works correctly in my application, except for a stored procedure. which consists of a large SQL query with two parameters (and no fancy option). When executed, this SP allows the SQL Server process memory to reach the specified maximum level, and then returns the error "There is not enough memory to execute this request".

When I run the SQL query (inside the stored procedure) outside of it, in a clean query window in SSMS, it runs in no time and returns the 300 lines expected. Additionally, when I change the compatibility level of the database on "SQL Server 2017" and run the stored procedure, everything is fine.

I first thought that it might be a problem of parameter detection, but none of the workarounds worked (for example, OPTION (RECOMPILE)).

What other cause might be causing the error or could I have found a bug in SQL Server 2019?
Thank you very much! Anne

If a stored procedure is modified while it is currently being used in a cursor, does the cursor continue to use the old query before it is modified?

If a stored procedure (or view) is currently used in a long cursor and I modify this stored procedure, will the cursor continue to use the old instance of the stored procedure until the end? ?

Prevent compiling a stored procedure on a linked server

I have a stored procedure, which queries a view on a linked server.

It works well on prod, but our development server has some firewall restrictions, which prevent compilation. It's not a problem at the data level (because it's not very important on dev), but I can not even modify the procedure on the development server, because the SQL server is trying to compile / check it syntax / names of columns used, etc. modify the procedure (and I receive a delay in waiting).

Is there a way (option, trace flag, etc.) that I could use to prevent this syntax check and compile the procedure on the dev server (similar to the case where a table used in a procedure n & # 39, did not exist, where SQL Server only raises a Attention)?

In which folder are downloads of Google Podcasts stored?

I want to download podcasts on my phone.

When I connect my phone to my computer, in which folder can I find the podcast downloads? There are many folders named in encrypted form :-(.

stack overflow – The difference in address where the EIP is stored and that of the buffer does not add up. Please help

I am new to this field and have started to learn cybersecurity. I work on low level attacks and I work on a mission.

  void put_wisdom(void) {
  char  wis(DATA_SIZE) = {0}; 
  int   r;

  r = write(outfd, prompt, sizeof(prompt)-sizeof(char));
  if(r < 0) {
    return;
  }

  r = (int)gets(wis); 
  if (r == 0)
    return;

  WisdomList  *l = malloc(sizeof(WisdomList));

  if(l != NULL) {
    memset(l, 0, sizeof(WisdomList));
    strcpy(l->data, wis);
    if(head == NULL) {
      head = l;
    } else {
      WisdomList  *v = head;
      while(v->next != NULL) {
        v = v->next;
      }
      v->next = l;
    }
  }

  return;
}

Now I want to overwrite the return address of this function. So, what I did was used gdb. I set the put_wisdom function of the stop point.
Then I have the address of the variable wis with print & wis

print &wis
$2 = (char (*)(128)) 0xbffff078

Then I entered the info frame command.

Stack level 0, frame at 0xbffff110:
 eip = 0x8048631 in put_wisdom (wisdom-alt.c:54); saved eip 0x804880d
 called by frame at 0xbffff550
 source language c.
 Arglist at 0xbffff108, args: 
 Locals at 0xbffff108, Previous frame's sp is 0xbffff110
 Saved registers:
  ebp at 0xbffff108, edi at 0xbffff104, eip at 0xbffff10c

Now my question is that we set DATA_SIZE to 128. When I calculate the difference between the eip address and the wis address to find the number of bytes to overwrite before entering the address to which I want to locate my code , I get (0xbffff10c – 0xbffff078) = 148 (in the base of 10)
Now I see 128 bytes for the WIS variable. Can you explain what is in these 20 bytes?

postgresql – Creates a stored procedure with a dynamic number of columns + column names

I am relatively new to postgresql and have some problems creating my first stored procedure. The real problem is that I need to be dynamic, so I find it difficult to find the previous discussions that asked this question.

Let's say I have a table with the following information

Table nominal_dollars
year       GDP        Dividends
2000      100              20
2001      110              30
2002      120              40

In the table above, the numbers are not adjusted for inflation. A common procedure I want to do is to create a new table in which the numbers are adjusted for inflation. This means that I have to join the table above with a new table, Consumer Price Inflation (CPI), which looks like this:

Table cpi
year       cpi_adjustment
2000      1            
2001      2             
2002      3             

This will create a new table in which all the numbers are adjusted for inflation, that is, the original numbers are multiplied by the adjustment in cpi :

Table nominal_dollars_adj
year       GDP        Dividends
-----------------------------------------
2000      100              20
2001      220              60
2002      360              80

Where GDP for the new table is equal to the GDP of the table of origin * cpi_adjustment, and the same for dividends.

Now, I want to do this IPC adjustment procedure for many different tables – which may have a different number of columns.

So, I want to create a stored procedure that takes input from a table (or a table name), and within this function I want to create a new table with the exact same names and the same number of columns as the original table, but with all values ​​adjusted for inflation as above.

Ideas?

Good luck,

Jake