I am trying to convert my SQLite database into Postgres database, but I don’t know how to convert name TEXT (32) NOT NULL

CREATE TABLE integrals (    id SERIAL PRIMARY KEY NOT NULL UNIQUE,    name TEXT (32) NOT NULL,    ip TEXT (32),    posx REAL NOT NULL,    posy REAL NOT NULL,    port INTEGER,    image INT,    zones TEXT,    pass TEXT ); 

This is my SQLite generated database, and I am trying to convert it, but I am very new to Postgres.

How can I convert D&D 4e adventures and settings to 5e?

At my public library, I have ready access to resource books from older editions of D&D (only 5e are in heavy demand). Most of the books at the library are 4e. I am interested in converting some of the adventures and/or campaign settings for use with the 5e group I DM.

How can I convert these 4e adventures to 5e?

My background is a few years playing and DMing AD&D back in the 80s, then nothing for 35 years. I fiddled with the 4e beginner’s set and now play 5e.

I have no experience converting. Currently my group is playing HotDQ. They enjoy it, but I find it a little railroad-y and want to expand the world.

How to convert a Dataset into an indexed dataset / association-of-associations given a column header?

Given a dataset as such


If "letter" is the header that is chosen, how do I convert it into an indexed dataset / association-of-associations?

i.e. How do I define f such that f[dataset_,columnHeader_] produces the following?

enter image description here

Please note GroupBy is close but fails as you are unable to use Part to work with the result to extract column data. eg:

data = {<|"letter" -> "a", "foo" -> 1, "bar" -> 2|>, <|"letter" -> "b", "foo" -> 3, "bar" -> 4|>, <|"letter" -> "c", "foo" -> 5, "bar" -> 6|>}; dataDS = Dataset[data]; dataDSg= GroupBy[dataDS, Key["letter"]]; dataDSg[All, "foo"] (* <- produces an error *) 

Where as data in the format of an association-of-association works fine

data2 = <|"a" -> <|"foo" -> 1, "bar" -> 2|>, "b" -> <|"foo" -> 3, "bar" -> 4|>, "c" -> <|"foo" -> 5, "bar" -> 6|>|>; data2DS = data2 // Dataset; data2DS [All, "foo"] (* <- returns a dataset with 1,3,5 *) 

How to Convert the complex notation into x, y-coordinates?

Convert the complex notation into x, y-coordinates; see also Accumulate and ListLinePlot.
enter image description here

I try to use the table to list all the summation value.( I suppose upper bounds N is 5)

plot1 = Table[{N,Sum[e^(2*Pi*I*n*Sqrt[2]),{n,1,N}]},{N,1,5}]; ListLinePlot[plot1]; 

But I just got an empty axis.
I think I need to convert the complex notation, I don’t know how to convert it.
Could you give me some suggestions?
Thank you!

Is there a program to convert OpenGL 2.0 to OpenGL-ES 2.0?

I have a 3D game library that uses OpenGL 2.0 for PC and I need to convert it to OpenGL-ES 2.0 to compile it for Android. Because the library is huge, it can’t be done by hand, so I was wondering if there is some kind of software to auto convert desktop OpenGL to OpenGL-ES source code, some wrapper, or maybe some layer running on Android that converts desktop OpenGL to ES on runtime? Perhaps there is a tool that auto converts desktop OpenGL to a cross platform 3D rendering library ?

How to convert recursive language grammar tree into automaton for optimal parsing?

So I have a definition of a sort of grammar for a programming language. Some aspects are recursive (like nesting function definitions), other parts of it are just simple non-recursive trees.

Originally I just treat this sort of like a Parsing Expression Grammar (PEG), and parse it using recursive descent. But this is kind of inefficient, as it sometimes has to build up objects as it’s parsing, only to find 10 calls down the road that it isn’t a good match. So then it backs up and has to try the next pattern.

I’m wondering what the general solution to this is. What can be done to create the most optimal algorithm starting from nothing but a tree-like data structure encoding the grammar?

Can you process the tree-like, recursive-ish BNF PEG data structure in a while loop, rather than using recursive descent? Better still, can you convert the data structure into a sort of automaton which you can (in some simple way) transition through, to parse the string without having to go down a bunch of wrong paths and generate stuff you only have to soon throw away if you find it’s a mismatch? Or if not, is there anything that can be done here with automata?

Sorry for my terminology (BNF vs. PEG), I am not using it exactly. I just mean I have a grammar, which is context-sensitive which falls outside the scope of either of these. So I am picking one or the other to simplify this question for the purpose of this site, even though I’m not 100% sure what the difference between BNF and PEG are at this point.

How to convert a bytea column to text?

how to convert a bytea column to text in PostgreSQL so that I can read the column properly in PGADMIN?

I have the following SQL query in the PGADMIN’s query editor:

SELECT event_type, created_at, encode(metadata::bytea, 'escape')  FROM public.events  ORDER BY created_at DESC LIMIT 100 

However, it produces an encoded column with each records more or less ressembling the following output:


How can I get rid of this encoded, so that I only see the original value of the column, in the text format:

some_text some_data 

What I have also tried:

SELECT event_id, event_type, created_at, decode((encode(metadata, 'escape')::text), 'escape') FROM public.events ORDER BY created_at DESC LIMIT 100 

But in the above case, the query returns a decode column of type bytea and I only see the field [binary data] for each record of the column.

I have also tried the first two ansers mentioned here without success and can’t properly translate the last answer to my query.

Is there a function to convert a trigonmetric expression to an algebraic expression suitable for ComplexPlot?

According to H. A Priesley:

"both $ cosθ$ and $ sinθ$ can be written as simple algebraic functions of $ z$ ":

$ cosθ =\frac{1}{2} (z + \frac{1}{z}) \tag1$ $ sinθ =\frac{1}{2i} (z − \frac{1}{z})\tag2$

Which is very handy but I’m not sure what function will convert say $ \frac{\sinh(ax)}{\sinh(bx)}\,$ ot $ \frac{x\cos ax}{1+x^2}\coth \frac{\pi x}{4}$ to similar algebraic functions. The only function I can find is TrigtoExp, but this does not include the needed substution $ z = \exp iθ$ to work with function ComplexPlot.

Q1. Is there a function to convert a trigonmetric expression to an algebraic expression suitable for ComplexPlot?

Q2. If not what is the best way to get around this?

How do you convert bits into a different alphabet?

I have forgotten how to do this. How do I figure out what the requirements are for a 128-bit string using a certain alphabet?

That is to say, I want to generate a UUID (128-bit) value, using only the 10 numbers for the alphabet. How many numbers do I need, and what is the general equation so I can figure this out for any alphabet of any size?

What is the equation for any n-bit value with any x-letter alphabet?

The way I do it is to guess and slowly iterate until I arrive at a close number. For powers of 10 it’s easy:

Math.pow(2, 128) 3.402823669209385e+38 Math.pow(10, 39) 1e+39 

For other numbers, it takes a little more guessing. Would love to know the equation for this.