## Calculate minimum and maximum Ethernet (IEEE 802.3) frame size from frame format

According the frame format of Ethernet

Minimum Frame Size should be : $$7 Byte + 1Byte+6Bytes+6Bytse+2Bytes+46Bytes+4Bytes=72Bytes$$

Maximum Frame Size should be : $$7 Byte + 1Byte+6Bytes+6Bytse+2Bytes+1500Bytes+4Bytes=1526Bytes$$

But it is said that the minimum frame size is $$64Bytes$$ while the maximum frame size is $$1518 Bytes$$.

How the frame sizes are calculated ?

## Is it theoretically possible to dynamically grow array size in stack memory?

I was wondering, given the usual stack memory functioning, whether it is possible for an array like primitive type allowed to grow in size to exist.
The functioning of such primitive type is as follows.

• Any one function is allowed to have only one such primitive variable.
• Appending to such primitive variable is allowed only within the function that it was initialized in.
• If the function that such primitive variable was initialize in is not the last in the stack, such primitive variable is not allowed to grow in size.

I was wondering whether:

• Such primitive type is theoretically possible.
• Whether it is something that is already in use.

## 503 Service unavailable while uploading file on SharePoint online of size more than 249 MB

I am trying to upload the file on SharePoint online larger than 250MB using rest API. I have divided data of the file in small chunks say 100MB and used Start upload, continue Upload and Finish Upload of SharePoint. I am getting 503 services exactly after it writes 249 MB. However, The below code runs successfully for the file size up to 249MB. According to SharePoint online documentation, we can upload files of size up to 2GB. Any leads or help is much appreciated.

Thanks,

Bharti Gulati

``package test;  import java.io.BufferedInputStream; import java.io.BufferedReader; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.UnsupportedEncodingException; import java.util.ArrayList; import java.util.List;  import org.apache.http.HttpResponse; import org.apache.http.NameValuePair; import org.apache.http.ParseException; import org.apache.http.client.ClientProtocolException; import org.apache.http.client.HttpClient; import org.apache.http.client.entity.UrlEncodedFormEntity; import org.apache.http.client.methods.HttpPost; import org.apache.http.entity.ByteArrayEntity; import org.apache.http.impl.client.DefaultHttpClient; import org.apache.http.impl.client.HttpClientBuilder; import org.apache.http.message.BasicNameValuePair; import org.apache.http.util.EntityUtils; import org.json.JSONObject;  public class SampleFileUpload1 {     private final static int chunkSize = 100 * 1024 * 1024;      public static void main(String args[]) throws IOException {         SampleFileUpload1 fileUpload = new SampleFileUpload1();         File file = new File("C:\users\bgulati\Desktop\twofivefive.txt");         fileUpload.genereateAndUploadChunks(file);     }      private static void executeRequest(HttpPost httpPost, String urlString) {         try {             HttpClient client = new DefaultHttpClient();             HttpResponse response = client.execute(httpPost);              System.out.println("Response Code:  " + response.getStatusLine().getStatusCode());             System.out.println("Response getReasonPhrase:  " + response.getStatusLine().getReasonPhrase());             System.out.println("Response getReasonPhrase:  " + response.getEntity().getContent().toString());             BufferedReader br = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));              while (true) {                 String s = br.readLine();                 if (s == null)                     break;                 System.out.println(s);             }         } catch (UnsupportedEncodingException e) {             e.printStackTrace();         } catch (ClientProtocolException e) {             e.printStackTrace();         } catch (IllegalStateException e) {             e.printStackTrace();         } catch (IOException e) {             e.printStackTrace();         }     }      public static void executeMultiPartRequest(String urlString, byte[] fileByteArray) throws IOException {         HttpPost postRequest = new HttpPost(urlString);         postRequest = addHeader(postRequest, "accessToken");         try {             postRequest.setEntity(new ByteArrayEntity(fileByteArray));         } catch (Exception ex) {             ex.printStackTrace();         }         executeRequest(postRequest, urlString);     }      private static HttpPost addHeader(HttpPost httpPost, String accessToken) {         httpPost.addHeader("Accept", "application/json;odata=verbose");         httpPost.setHeader("Authorization", "Bearer " + accessToken);         httpPost.setHeader("Content-Type", "application/json;odata=verbose;charset=utf-8");         return httpPost;     }      private static String getUniqueId(HttpResponse response, String key) throws ParseException, IOException {         if (checkResponse(response)) {             String responseString = EntityUtils.toString(response.getEntity(), "UTF-8");             JSONObject json = new JSONObject(responseString);             return json.getJSONObject("d").getString(key);         }         return "";     }      private static boolean checkResponse(HttpResponse response) throws ParseException, IOException {         if (response.getStatusLine().getStatusCode() == 200 || (response.getStatusLine().getStatusCode() == 201)) {             return true;         }         return false;     }      private String createDummyFile(String relativePath, String fileName) throws ClientProtocolException, IOException {         String urlString = "https://siteURL/_api/web/GetFolderByServerRelativeUrl('"+relativePath+"')/Files/add(url='" +fileName+"',overwrite=true)";         HttpPost postRequest = new HttpPost(urlString);         postRequest = addHeader(postRequest, "access_token");         HttpClient client = new DefaultHttpClient();         HttpResponse response = client.execute(postRequest);         return getUniqueId(response, "UniqueId");     }      private void genereateAndUploadChunks(File file) throws IOException {         String relativePath = "/relativePath";         String fileName = file.getName();         String gUid = createDummyFile(relativePath, fileName);          String endpointUrlS = "https://siteURL/_api/web/GetFileByServerRelativeUrl('"+relativePath+"/"+fileName+"')/savebinarystream";         HttpPost postRequest = new HttpPost(endpointUrlS);         postRequest = addHeader(postRequest, "access_token");         HttpClient client = new DefaultHttpClient();         HttpResponse response = client.execute(postRequest);          long fileSize = file.length();         if (fileSize <= chunkSize) {          }          else {             byte[] buffer = new byte[(int) fileSize <= chunkSize ? (int) fileSize : chunkSize];              long count = 0;             if (fileSize % chunkSize == 0)                 count = fileSize / chunkSize;             else                 count = (fileSize / chunkSize) + 1;             // try-with-resources to ensure closing stream             try (FileInputStream fis = new FileInputStream(file);                 BufferedInputStream bis = new BufferedInputStream(fis)) {                 int bytesAmount = 0;                 ByteArrayOutputStream baos = new ByteArrayOutputStream();                 int i = 0;                 String startUploadUrl = "";                 int k = 0;                 while ((bytesAmount = bis.read(buffer)) > 0) {                     baos.write(buffer, 0, bytesAmount);                     byte partialData[] = baos.toByteArray();                     if (i == 0) {                         startUploadUrl = "https://siteURL/_api/web/GetFileByServerRelativeUrl('"+relativePath+"/"+fileName+"')/StartUpload(uploadId=guid'"+gUid+"')";                                                executeMultiPartRequest(startUploadUrl, partialData);                         System.out.println("first worked");                         // StartUpload call                     } else if (i == count-1) {                         String finishUploadUrl = "https://siteURL/_api/web/GetFileByServerRelativeUrl('"+relativePath+"/"+fileName+"')/FinishUpload(uploadId=guid'"+gUid+"',fileOffset="+i+")";                         executeMultiPartRequest(finishUploadUrl, partialData);                         System.out.println("FinishUpload worked");                         // FinishUpload call                     } else {                         String continueUploadUrl = "https://siteURL/_api/web/GetFileByServerRelativeUrl('"+relativePath+"/"+fileName+"')/ContinueUpload(uploadId=guid'"+gUid+"',fileOffset="+i+")";                         executeMultiPartRequest(continueUploadUrl, partialData);                         System.out.println("continue worked");                     }                     i++;                 }             }         }      } } ``

## How do I increase the font size for a specific application in Ubuntu 18.04 running Gnome?

I installed the Unity Editor on my Thinkpad x1 Carbon, which has a resolution of `2560 x 1440`, and is considered HiDPI. In order to deal with very small font sizes, I installed `gnome-tweak-tools` and set my `Fonts` `Scaling Factor` to `1.34`. This has resulted in an acceptable font size in every application I have tried so far, with some tweaks in programs like Firefox.

However, the Unity Editor doesn’t have a font size modifier for its UI. It looks like this on my machine:

The font size is unreadably small.

I see that under `gnome-tweak-tools`, I can set font sizes specifically for things such as “Window Title” or “Document,” but not, for example, “Unity Editor.”

I could set “Scaling Factor” very high but this makes other programs have unacceptably large fonts.

I could modify, under the regular `Settings` app, under `Displays`, the `Scale` property, from `100%` to `200%`, but this makes every other application have a terribly bloated, nearly unusably large UI.

How can I change the font size for only one application, specifically, Unity Editor?

EDIT: By the way, there does not appear to be any intention on the Unity Editor engineering team to implement a font size changer: https://forum.unity.com/threads/how-to-change-font-size-in-unity-editor.149481/

## ZFS Snapshot size exceed actual data Size

I have an issue with the ZFS snapshots

I’m trying to keep only last 7 days of the snapshots but still, snapshot-size exceeds original data size

Do you have any idea?

``[root@rds1 ~]# zfs list -o space -r pool NAME                  AVAIL   USED  USEDSNAP  USEDDS  USEDREFRESERV  USEDCHILD pool                  1.25T   142T        0B    205K             0B       142T pool/Lab              1.25T   142T     89.2T   52.5T             0B         0B pool/Lab@autosnapdaily   -  5.33M         -       -              -          - pool/Lab@autosnapdaily   -  4.56M         -       -              -          - pool/Lab@autosnapdaily   -  4.99M         -       -              -          - pool/Lab@autosnapdaily   -  4.66M         -       -              -          - pool/Lab@autosnapdaily   -  4.95M         -       -              -          - pool/Lab@autosnapdaily   -   160G         -       -              -          - pool/Lab@autosnapdaily   -   698M         -       -              -          - pool/Lab@autosnapdaily   -  47.8M         -       -              -          - [root@rds1 ~]#  ``

Thank you Nasir

## How one should know about perfect font size?

Guys in one of my recent interview I was asked about my project and in that he asked me what was the reason behind choosing the font size you have chosen for your app? I wasn’t able to give a satisfying answer. Could someone help me how to know what should be the perfect font size?

## How to call full size BannerImageUrl using ajax in Sharepoint Framework

I am creating a news webpart and need to call the banner image for different news articles. The parameter BannerImageUrl is technically ‘working,’ but is returning a very low res (300×200) thumbnail version of the banner rather than the original. How do make BannerImageUrl return the full size image/is there a different parameter to use to do this?

## How do you get the pixel location and image size in a fabric js filter’s fragment shader?

How do you get the pixel location and image size inside the fragment shader for the WebGL version of a FabricJS filter? If you just have to pass it in as a uniform is the information available inside the filter or does it need to be passed to the filter as an option?

## How do you get the pixel location and image size in a fabric js filter’s fragment shader?

How do you get the pixel location and image size inside the fragment shader for the WebGL version of a FabricJS filter? If you just have to pass it in as a uniform is the information available inside the filter or does it need to be passed to the filter as an option?