Jump to content

Wikipedia:Reference desk/Archives/Computing/2019 September 11

From Wikipedia, the free encyclopedia
Computing desk
< September 10 << Aug | September | Oct >> September 12 >
Welcome to the Wikipedia Computing Reference Desk Archives
The page you are currently viewing is an archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages.


September 11

[edit]

Creating digital pictures and wallpaper

[edit]

How are 3d wallpapers created? I am not a good painter with brush. Is it possible to create digital arts with any software using own imagination? — Preceding unsigned comment added by 2405:205:602A:13F4:B5BB:2306:846F:85B8 (talk) 07:12, 11 September 2019 (UTC)[reply]

If you're not good at drawing, you probably don't want to use a program like MS Paint. You could also use a pixel editor to make some repeating small geometric pattern, like cubes, by setting the color of each pixel one at a time. For computer generated 3D images, there are programs that allow you to specify the location and attributes of larger basic geometric shapes, like cubes, spheres, cylinders, etc. See 3D modeling, ray tracing and texture mapping. You could also apply textures, colors, lighting, etc., to complex 3D objects they provide. But to actually create your own complex 3D image, like a person, would require a great deal of time and expertise, to make it look any good. Also, some programs, like ray tracing, require significant CPU time, so you may have to wait for it to finish processing. Anther option is to do a screen grab of some 3D image you like, such as the victory screen on a game you won. Or you could start from digital photographs (perhaps from your cell phone) and then modify the image(s). For example, you could create an image of somebody about to be squished by a giant falling domino, by combining images of the person and falling domino, at different scales.
Note that making 2D images look like they are 3D can be done with techniques such as perspective and 3D projections. If you have some particular type of 3D image in mind, we might be able to suggest the best way to make it. Also, do you already know how to set an image as wallpaper ? SinisterLefty (talk) 12:32, 11 September 2019 (UTC)[reply]
Blender, 3D Studio Max, Maya 3D, LightWave... You can do some 3D-like effects from 2D pictures with GIMP and Photoshop (depending on what you're trying to do). 93.136.122.4 (talk) 19:19, 13 September 2019 (UTC)[reply]

Setting maximum JSON length property on JsonSerializer

[edit]

I've run into a problem at work. I am using ASP.NET Core to build a controller taking JSON requests. The controller method looks something like this:

[HttpPost]
public IActionResult DoStuff([FromBody] MyModelClass model)
{
  /* Do something with the model */
  return new JsonResult() { /* parameters */ };
}

which is then supposed to receive HTTP requests with the Content-Type header set to application/json. This works all well and good, but then I found out that some of the request bodies are several megabytes long, which causes an error that the body length exceeds the maximum JSON length. And I couldn't find any easy solution to set a new value for the maximum JSON length. I tried googling for it, and found plenty of pages advising me to set the MaximumJsonLength property. But that only works for JavaScriptSerializer, and the ASP.NET Core framework seems to use JsonSerializer instead, which doesn't appear to have this property.

In the end I found this page advising me to write a custom input formatter, and this appeared to work. I just replaced all of this weird "protobuf" stuff with a JavaScriptSerializer that I was able to set the maximum JSON length property to. But it appears that this has caused the loss of all the pre-made JsonSerializer functionality.

What my question here is, is there any easier way to do this? JIP | Talk 20:44, 11 September 2019 (UTC)[reply]

The opposite approach is to modify your code to return the data in smaller pieces, or only return those portions which have actually been changed. This isn't always possible, but when it is, it could solve your problem. If you can describe what the code does, maybe we can think of ways to break up this task. SinisterLefty (talk) 21:08, 11 September 2019 (UTC)[reply]
No, the problem is not with returning data, it's with receiving data. It's the incoming requests that are several megabytes long, not the outgoing responses. JIP | Talk 04:06, 12 September 2019 (UTC)[reply]
There are some event driven (SAX-style) JSON parsers around, no idea what the situation is for Windows but "SAX-style JSON parser" might be a reasonable set of search terms to start with. That will let you handle unlimited sized json docs at the cost of complicating your code. Otherwise, maybe you can just allocate more memory to your process so it can handle the docs you need. Megabytes is no big deal, gigabytes might take some planning. 67.164.113.165 (talk) 02:02, 19 September 2019 (UTC)[reply]