simple question about epsilon and estimation turing machines

i am getting really confused by it. i got to a point i had to calculate the lim when $ n \rightarrow \infty$ for an optimization problem, and i got to the point that i had to calculate a fairly simple limit: $ lim_{n \rightarrow \infty} {3-\frac{7}{n}}$ .

now i used $ 3 – \epsilon$ and i am trying to show that there can’t be any $ \epsilon>0$ so that the estimation of the algorithm is $ 3-\epsilon$ , because there exists a “bigger estimation” – and this is the part i am not sure about, what is the correct direction of the inequality? $ 3-\frac{7}{n} > 3 – \epsilon$ or the opposite? i am trying to show that the estimation ration is close to 3.

i think that what i wrote is the correct way, but not sure. would appreciate knowing what is correct in this case. thanks.

How to install SQL Server 2017 Express in “Quiet Simple” mode without an extraction folder?

I need to install SQL Server 2017 Express with as little user interaction as possible. I am using the SQLEXPR_x64_ENU.exe setup file that I found a Microsoft download for.

Currently I can do exactly what I want with 2012 by using the following parameters:

/FEATURES="SQL, Tools" /QS /IACCEPTSQLSERVERLICENSETERMS /ADDCURRENTUSERASSQLADMIN=1 /ACTION="Install" /ERRORREPORTING=0 /INSTANCENAME="MyDB" 

In 2012 this works great, however I am trying to now do the same in 2017. The problem I have is that it creates an extraction folder called “SQLEXPR_x64_ENU” in the same directory as the install. This is not desirable.

Question: Is there anyway to prevent this extraction folder from being used, so that it functions that same as the 2012 setup?

Alternatively, one of the following solutions would be acceptable:

  • Allow the user to select the extraction location – like it does with default install (non-quiet) – but still ensure /QS mode for the rest of the setup
  • Have the extraction folder automatically deleted after setup (it wouldn’t be so bad if it cleaned up it’s mess after it was finished)

Mathematica returns uneditable long solutions for two simple quadratic equations

I tried to get positive solution(or any solution) of the following two quadratic equations with two variables. My code is:

Solve[(1/8)(-A1+x2+α+x1(-2+β)-2 β x2^2-θ x1^2)==0 &&       (1/16)(A1+3 x2-α-2β x2+x1(-2+3β))^2 - θ x2^2==0, {x1, x2}] 

It shows that there is large output, then i clicked show fulloutput, it took 5 minutes to display …and the result is in weird format, there is only one symbol in each line in the last part, and they are very difficult to identify, i can’t even find where x2 appears

How to build simple jsonb object out of multiple arrays in postgres?

If I have three (or more) Postgres arrays with the same number of elements, and I want to build a multi-level JSONB object out of them—how can I do this?

Example:

create temp table tbl1 as   select     array['a', 'b', 'c'] as keys,     array['d', 'e', 'f'] as val1,     array['g', 'h', 'i'] as val2; 

Then I can do:

select jsonb_object(keys, val1) from tbl1; 

And get:

{"a": "d", "b": "e", "c": "f"} 

Likewise I can pass val2 and get:

select jsonb_object(keys, val2) from tbl1;           jsonb_object           --------------------------------  {"a": "g", "b": "h", "c": "i"} (1 row) 

But I can’t see how I could get the following object:

{   "a": { "val1": "d", "val2": "g" },   "b": { "val1": "e", "val2": "h" },   "c": { "val1": "f", "val2": "i" } } 

I’m aware of jsonb_build_object() but that doesn’t seem to fit here.

How could the above result be created?

Simple Java Question: How to print a random int in one class that was generated in another?

Say that I have two classes, A and B, that are in the package Sample.

In class B, I have generated a random int b that is either a 0 or 1. I want to print int b in class A. What code should I use to do this?

Here is class B:

  package Sample;   import java.util.Random;      public class B {         Random random = new Random();         int b = random.nextInt(2); //b is either 0 or 1     } 

And I need code to go in class A here:

package Sample;   public class A {  //How do I print out the int b here?  } 

Linear programming: reduce a contstraint with simple minimun

I have an almost linear programme. However one of the constraints has a form $ z = min(x,y)$ (all the other things are linear in the model). Is there a way to substitute this with something (or introduce additional variables) to turn this into a linear programme?

In other words, I have the problem that looks like the following: $ $ \mathbf c’ \mathbf x \to \min, $ $ s.t. $ $ A \mathbf x = \mathbf b,\quad x_1 = \min(x_2, x_3). $ $

Required a simple guide for secure messaging application

For my personal research i have to create a messaging app, but security is only important part of application, security from MITM (man in the middle attack), at device end, and at server level. (note : this will not end to end encryption, as i want to backup messages on server for cross device access like telegram).

Right now i created following model :

  1. Server creates RSA key pair first time at installation and keeps private key in a file on server, and broadcast public key with its clients, (A,B)
  2. A&B also creates RSA key pair at first time login, and stores private key at device level and send public key to server.
  3. Now A want to send message to B, A will do, following steps:

    create a random salt_key;
    encrypt message with this salt_key (AES)
    encrypt salt_key with server’s public key (RSA)
    send RSA encrypted key, and AES encrypted message to server
    now server can decrypt salt_key with RSA private key and than message
    now server will do same as A did, but with B’s public key
    and B will decrypt salt_key with private key than decrypt message.

Is this a secure way, or any another way to secure my messaging app.

thanks,

jaikey

Creating A Very Simple Relational Database

I would like to create a database to organize archived projects. Initially, I thought this could be accomplished by using google sheets or airtable. But it turns out my needs are a bit more complicated because of nested tables. I’m wondering if I need something like mySQL with a custom UI.

I have illustrations below of what the database could look like. What I need is the following:

  • At it’s simplest, a table with many nested tables
  • The ability to have multiple input options (such as checkbox, drop-down, multi-select, numbers, paragraphs of text, etc).
  • The ability to sort the items by Year, then Project Number
  • The ability to see both a big-picture view of the data, and a condensed view
  • The ability to have a new drop-down input automatically added to the list of available items in the drop-down. (No error if the item wasn’t already on the list. It just adds it to the list)
  • Ideally, a form that allows me to enter this information without editing the table manually

Is this something that needs to be custom built, or is there a platform that could make this possible? Appreciate any help!

Database View 1: Database View 1

Database View 2: Database View 2

Database Record Entry: Database Record Entry

Strange diagonal line artifact in simple ripple shader

I have a simple shader, converted from GLSL to HLSL. This is the original: https://www.shadertoy.com/view/tdKSWG

The problem is that there is a very visible diagonal line artifact going from UV(1,1) to UV(0,0) and this artifact is not visible in the GLSL original.

Ripples pinched along the diagonal line Speckled line along diagonal, "echo" ripples off right edge of grey area

No artifacts visible when ripples are started in any other screen position:

Ripple not near the edge or diagonal, undistorted, with no speckles or echoes

The sampler AddressU is set to “Wrap” and in shadertoy it is set to “Repeat”, it should do the same but the waves still get reflected at the screen border (It works fine in GLSL)…

Does anyone know how to fix this?

This is my HLSL version:

//-- Include some common stuff #include "mta-helper.fx"  float STRENGTH = 5.0; float MODIFIER = 0.91; float STEP = 2.6; float FADESTRENGTH = 20; float2 iResolution = {1024,512}; float3 iMouse = {0,0,0}; texture buffer;  sampler myself = sampler_state {     Texture = (buffer);     MinFilter = Linear;     MagFilter = Linear;     MipFilter = Linear;     AddressU = Wrap;     AddressV = Mirror; };  //------------------------------------------------------------------------------------------ // Structure of data sent to the vertex shader //------------------------------------------------------------------------------------------ struct VSInput {     float4 Position : POSITION0;     float4 Diffuse : COLOR0;     float2 TexCoord : TEXCOORD0; };  //------------------------------------------------------------------------------------------ // Structure of data sent to the pixel shader ( from the vertex shader ) //------------------------------------------------------------------------------------------ struct PSInput {     float4 Position : POSITION0;     float4 Diffuse : COLOR0;     float2 TexCoord: TEXCOORD0; };  //------------------------------------------------------------------------------------------ // VertexShaderFunction //------------------------------------------------------------------------------------------ PSInput VertexShaderFunction(VSInput VS) {     PSInput PS = (PSInput)0;      // Calculate screen pos of vertex     PS.Position = MTACalcScreenPosition(VS.Position);      // Pass through color and tex coord     PS.TexCoord = VS.TexCoord;     //PS.TexCoord.y -= 0.5;     PS.Diffuse = VS.Diffuse;     return PS; }  float4 psFunction(PSInput PS) : COLOR0 {      float4 color = tex2D(myself, PS.TexCoord);     float value = 0;      float3 direction = float3(STEP, STEP, 0) / iResolution.xyy;      float s1 = tex2D(myself, PS.TexCoord - direction.zy).r;     float s2 = tex2D(myself, PS.TexCoord - direction.xz).r;     float s3 = tex2D(myself, PS.TexCoord + direction.xz).r;     float s4 = tex2D(myself, PS.TexCoord + direction.zy).r;      if (length(PS.TexCoord - iMouse.xy) < 0.005 && iMouse.z == 1) {         value = STRENGTH * smoothstep(3, 0.5, length(iMouse.xy - PS.TexCoord));     }      value += -(color.g - 0.5) * 2 + (s1 + s2 + s3 + s4 - 2);     value *= MODIFIER;     value = value * 0.5 + 0.5;      float alphaFade = saturate(FADESTRENGTH * PS.TexCoord.y) * saturate(FADESTRENGTH * (1 - PS.TexCoord.y));     return float4(value, color.r, value, alphaFade); }  technique shield {     pass P0     {         VertexShader = compile vs_3_0 VertexShaderFunction();         PixelShader  = compile ps_3_0 psFunction();     } }