Convert postgres varchar[] to text[] without downtime

As I discovered in researching this question, converting a column from varchar(100)[] to text[] requires a table rewrite and rebuilding indexes.

Is there a way to manage this conversion without the locking and rewriting through some catalog trickery like that used in this question? Particularly interested in version 10 if possible

Convert HTML Script to Shortcode

I want to convert this code into a shortcode from the Code Snippets plugin, I have seen an example come up but when I put it it does not work, the example is the following:

add_shortcode( 'shortcode_name', function () {      $  out = '<p>write your HTML shortcode content here</p>';      return $  out; } ); 

I want to convert the following code to rotate banners:

<script> Date();;      function rnd() {         rnd.seed = (rnd.seed*9301+49297) % 233280;         return rnd.seed/(233280.0);     }      function rand(number) {         var result = Math.floor(rnd() * number);         if (!result) result = 0;         return result     }     var bannerimgs = new Array("a.jpg", "b.jpg");     var bannerlnks = new Array("", "");     var banneralt = new Array("a", "b");     var rotatorHtml = "";     var endJs = "";      for(var img in bannerimgs){         var thisImg = new Image();         thisImg.src = bannerimgs[img];     }     var bannerimgCt = 2;     var bannercurrentAd = rand(bannerimgCt);     var openlink = "";     var bannerbanner = document.getElementById('banner');     var bannerlink = document.getElementById('banneradLink');              if(bannerlnks[bannercurrentAd] != ""){         rotatorHtml += '<a href="' + bannerlnks[bannercurrentAd] + '" id="banneradLink"  target="_blank">';         endJs = "</a>";     }     rotatorHtml += '<img src="' + bannerimgs[bannercurrentAd] + '" alt = "' + banneralt[bannercurrentAd] + '" id="bannerbanner">' + endJs;     document.getElementById("banner_div").innerHTML = rotatorHtml;   </script> 

How can this script be converted to a shortcode? I have replaced what it says but errors appear, then I do something wrong. How can this script be converted to a shortcode? Do you know any other way?

Prevent WordPress from convert ✔ (& other text symbols/emoji) to SVG [duplicate]

In my page content, I have the following:

<li><span class="tick">✔</span> Fully qualified and insured technicians, with over a decade of experience</li> 

On the frontend, WordPress changes the ✔ to:

<img draggable="false" role="img" class="emoji" alt="✔" src=""> 

I can’t change the colour of this SVG image, it is black, and we need it white.

How do I prevent the conversion of emojis to SVG?


I’ve found this answer which says to use:

add_filter( 'emoji_svg_url', '__return_false' ); 

All that does is break the image but display the alt text in the correct format:

enter image description here

The same code remains:

<img draggable="false" role="img" class="emoji" alt="✔" src=""> 

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.