browser – How to view pages saved on storage (or disk)

I have a very simple html page that I saved on my disk on my computer. It only contains a link to an image, saved in the same folder with that html page.

I can view it without any problems on my computer.
But when I copy the page (and the image) on my phone in a folder, I can’t properly view the page. I am using Chrome on the phone.

I know the phone does not have a hard disk, it just has flash memory used as storage, as computers use disks. But “disk” sounds more clear like storage memory (to me).

My page is named “page.htm” and the image it is named “mypic.jpg”
the page only contains this code:

<img src=mypic.jpg></img>

It works very well on the computer but it doesn’t work on the phone.
It looks like the browser simply can’t understand links to local files, stored on the phone storage. It doesn’t matter the images are in the same folder with the html page. It still doesn’t understand where the image is.

Is there any fix for this?

entities – Value in my custom base field added to user entity isn’t saved

I’ve created a new custom basefield for user entity type like this:

function hd_is_integration_entity_base_field_info_alter(&$fields, DrupalCoreEntityEntityTypeInterface $entity_type) {
  if ($entity_type->id() === 'user') {
    $fields('is_uid') = BaseFieldDefinition::create('text')
      ->setName('is_uid')
      ->setLabel(t('IS User ID'))
      ->setDescription(t('ID of this user in HD IS.'))
      ->setSettings((
        'max_length' => 50,
        'text_processing' => 0,
      ))
      ->setDefaultValue('')
      ->setDisplayOptions('view', (
        'label' => 'above',
        'type' => 'string',
        'weight' => 0,
      ))
      ->setDisplayOptions('form', (
        'type' => 'string_textfield',
        'weight' => 0,
      ))
      ->setDisplayConfigurable('form', TRUE)
      ->setDisplayConfigurable('view', TRUE);
  }
}

I’ve also updated the entity schema with update hook:

function hd_is_integration_update_8001(&$sandbox) {
  $field_storage_definition = BaseFieldDefinition::create('string')
    ->setName('is_uid')
    ->setLabel(t('IS User ID'))
    ->setDescription(t('ID of this user in HD IS.'))
    ->setSettings((
      'max_length' => 50,
      'text_processing' => 0,
    ))
    ->setDefaultValue('')
    ->setDisplayOptions('view', (
      'label' => 'above',
      'type' => 'string',
      'weight' => 0,
    ))
    ->setDisplayOptions('form', (
      'type' => 'string_textfield',
      'weight' => 0,
    ))
    ->setDisplayConfigurable('form', TRUE)
    ->setDisplayConfigurable('view', TRUE);

  Drupal::entityDefinitionUpdateManager()
    ->installFieldStorageDefinition('is_uid', 'user', 'user', $field_storage_definition);
}

The field is displaying fine in the user edit form, but any value added in it isn’t saved. What am I missing, please?

Link Extractor saved files are blank

This is really weird because I just scraped like 1800 URLs that found 20X that number of internal links. All of the links are in the TXT file

Then I try to scrape ONE URL, https://www.zipcodestogo.com/ZIP-Codes-by-State.htm, and it finds 70 internal links but when I open the TXT file, there’s nothing there.

I also disabled my proxies (they were getting a “socket error # 10054”) and then I tried to scrape the homepage of The Onion as a test.

Same problem, it says that 33 internal links were found but nothing saved to the file.

And I tried using my three ProxyMesh proxies, my StormProxies that I just bought today, and no proxies. Every time it says it’s saved but the file is empty.

Any ideas?

Also, is there a way to save scraped data with a more descriptive name? It’s really difficult to find files when the file name is just a long string of numbers.

Thanks!

Are 301 redirects you create permanently saved by the web server and Google?

A WordPress plugin may have incorrectly redirected some pages using a 301 redirect.

Are these 301 redirects permanent?

Is there no way we can set correct 301 redirects in the .htaccess file?

Does Google permanently save 301 redirects?

Is there any way of asking Google to recheck the redirected URL for an updated 301 redirect.

Why is a password saved putty private key 48byte and a non password protected private key 36byte of length

I’m currently working on a library with secure authentication process. I wanted to support ppk file loading for ed25519 private keys. I used the original source code of putty to determine how the decoding of password protected files worked. I generated a demo file with a password protected and a non password protected private key. Decrypting both files turned out that the private key of the password protected file was 12 bytes longer, both decrypted private keys shared the first 36byte. They both had the same public key.

From the putty source code i can’t see any sublisting. Am I doing something wrong? Other libraries have have the same result.

recovery – Where is the DMG saved when the hard disk is erased?

Good Morning,

Assuming you would go into recovery and format the data carrier on which macOS is installed, where would the DMG be located from which you booted with “CMD + R”, because as far as I know it is also on the hard drive and would be like that can be deleted with.

I guess this DMG is loaded into the main memory for a short time, I don’t know if it’s true.

Thanks for answers

How to show ui dynmaic row saved values in edit form magento2

I am facing an issue with dynamic rows in ui form…created a form with dynamic rows and saved successfully but in edit form the saved values of dynamic rows not displaying…how can i solve this issue?

unity – Why when saving a game it’s writing the saved game only if I leave the editor window and then coming back?

It’s not saving in runtime for some reason. Only when I stop the game and only when leaving the editor window then when coming back to the editor window I see it’s writing the saved game file on the hard drive.

This is script is how I’m saving in the game with the K key for saving and L key for loading :

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class SaveTest : MonoBehaviour
{
    public SaveLoad saveLoad;

    // Start is called before the first frame update
    void Start()
    {
        
    }

    // Update is called once per frame
    void Update()
    {
        if(Input.GetKeyDown(KeyCode.K))
        {
            StartCoroutine(saveLoad.SaveWithTime());
        }

        if(Input.GetKeyDown(KeyCode.L))
        {
            saveLoad.Load(null, null);
        }
    }
}

Then the SaveLoad script at the bottom :

public IEnumerator SaveWithTime()
    {
        yield return new WaitForSeconds(timeToStartSaving);

        Save(null,null);

        StartCoroutine(fadeInOutSaveGame.OverAllTime(savingFadeInOutTime));
    }

    public IEnumerator SaveWithTime(string FolderToSave, string FileName)
    {
        yield return new WaitForSeconds(timeToStartSaving);

        Save(FolderToSave, FileName);

        StartCoroutine(fadeInOutSaveGame.OverAllTime(savingFadeInOutTime));
    }

The fading script :

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class FadeInOutSaveGameText : MonoBehaviour
{
    public Canvas canvas;
    public float fadingSpeed;

    private bool stopFading = false;
    private const float THRESHOLD = 0.01F;

    // Start is called before the first frame update
    void Start()
    {

    }

    IEnumerator CanvasAlphaChangeOverTime(Canvas canvas, float duration)
    {
        float alphaColor = canvas.GetComponent<CanvasGroup>().alpha;

        while (true)
        {
            alphaColor = (Mathf.Sin(Time.time * duration) + 1.0f) / 2.0f;
            canvas.GetComponent<CanvasGroup>().alpha = alphaColor;

            // only break, if current alpha value is close to 0 or 1
            if (stopFading && Mathf.Abs(alphaColor) <= THRESHOLD)//if (stopFading && (Mathf.Abs(alphaColor) <= THRESHOLD || Mathf.Abs(alphaColor - 1) <= THRESHOLD))
            {
                break;
            }

            yield return null;
        }
    }

    public IEnumerator OverAllTime(float time)
    {
        stopFading = false;

        StartCoroutine(CanvasAlphaChangeOverTime(canvas, fadingSpeed));

        yield return new WaitForSeconds(time);

        stopFading = true;
    }
}

And last the saving to the hard disk :

using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using UnityEngine;

public static class SaveSystem
{
    private static readonly string SAVE_FOLDER = Application.dataPath + "/Saved Games";
    private static string content;

    public static void Init()
    {
        if (!Directory.Exists(SAVE_FOLDER))
        {
            Directory.CreateDirectory(SAVE_FOLDER);
        }
    }

    public static void Save(string saveString)
    {
        string fileName = Path.Combine(SAVE_FOLDER, "savegame.txt");
        File.WriteAllText(fileName, saveString);
    }

    public static void Save(string SaveString, string FolderToSave, string FileName)
    {
        if (!Directory.Exists(FolderToSave))
        {
            Directory.CreateDirectory(FolderToSave);
        }

        string fileName = Path.Combine(FolderToSave, FileName);
        File.WriteAllText(fileName, SaveString);
    }

    public static string Load()
    {
        content = "";
        string fileName = Path.Combine(SAVE_FOLDER, "savegame.txt");

        if (File.Exists(fileName))
            content = File.ReadAllText(fileName);

        return content;
    }

    public static string Load(string FolderToLoadFrom, string FileName)
    {
        content = "";
        string fileName = Path.Combine(FolderToLoadFrom, FileName);

        if (File.Exists(fileName))
            content = File.ReadAllText(fileName);

        return content;
    }
}

It’s a bit long but all the scripts are connected and I didn’t added the whole SaveLoad script only it’s bottom.

I don’t understand why it’s writing the saved game file to the hard disk only when leaving the editor window and coming back and when the game is not running already.

It should make the whole saving and writing the file in runtime.

I added the completed SaveLoad script to pastebin.com if it’s needed :

https://pastebin.com/3wraQhCU

This software saved my online business.

ShopZPresso Review: The best money-making software ever?
>>

View attachment 940

<<

macos – echo $PATH not reflecting saved paths

I have attempted to add, export PATH="$PATH:/Users/My_Name/desktop/My_Folder, to .bash_profile, .bashrc, and .profile. I executed the command source ~/.bash_profile, source ~/.bashrc, and source ~/.profile to refresh the $PATH and it does reflect that when I execute echo $PATH.

However, when I open a new terminal and execute echo $PATH it is unchanged.

The issue is my system (macOS Big Sur) will not recognize the updated $PATH when I open a new terminal unless I execute the source command every time to refresh my $PATH.

For context, I edited all three because I have scoured multiple sites for suggestions and have exhausted all my options.