I have a quite a interesting problem regarding table primary key when inserting new rows to Postgres DB using Hasura. In a short summary this is what happened: There was old backend for the app that I am currently developing which used MySql database and my task was to move all of data to new Hasura/Postgress DB, so i wrote scripts that move that data and it went fine. Script inserted all of the users data including their primary keys because of user relationship with other tables. Problem occurred when i tried to insert new users with Hasura mutation:  Uniqueness violation. duplicate key value violates unique constraint &quot;users_pkey&quot;  What I assume happened is: My PK on users is not default type integer/auto-increment , it is:  id - integer, primary key, unique, default: nextval('users_id_seq'::regclass)  and when i try to insert new row it tries to assign it latest PK that Hasura remembers it inserted and user with that PK is already imported from MySql DB. Is there some way to edit my table PK so it is integer/auto-increment or someone has some creative solution. Thanks in advance!
I ran into the problem that my primary key sequence is not in sync with my table rows.   That is, when I insert a new row I get a duplicate key error because the sequence implied in the serial datatype returns a number that already exists.  It seems to be caused by import/restores not maintaining the sequence properly.
What is the 'molecular' origin of the viscosity? The molecular origin of elasticity is almost clear for me: at the very bottom the 'elasticity' comes from the attraction and repulsion between atoms when they are reasonably far from each other or very close (like Lennard-Jones potential). Is there a similar description for the viscosity as well? Where does it come from? As every American teenager "knows" there is no speed limit on the Autobahn. My understanding, however, is that there is still such a thing as excessive speed even on this free-for-all.   So, ignoring the practical "don't be an idiot" and "don't drive faster than you can handle," at what speeds would die Polizei be pulling you over?  Bonus points for translating km/hr into miles/hr. Render scene with background jpg in python Fairly new to python and blender, so apologies if this is super basic. I've searched around and haven't found an answer.  I'd like to render some procedurally generated objects with a background image. In case it makes a difference, I'm using:    I don't need any interaction between the generated object and the background image so I've left a skeleton script I'm using to render below  import os DIR ="/home/path/to/folder" bg_file = os.path.join(DIR, "myimage.jpg") bg_img = bpy.data.images.load(bg_file) bpy.data.scenes['Scene'].render.filepath = os.path.join(DIR, "image") bpy.context.scene.camera = bpy.data.objects['Camera'] bpy.ops.render.render(write_still=True)   I managed to find some scripts that seem to be trying to do what I want online, but none that I could get to work. e.g.  import bpy filepath = "/home/path/to/folder" img = bpy.data.images.load(filepath)  for area in bpy.context.screen.areas:     if area.type == 'VIEW_3D':         space_data = area.spaces.active         bg = space_data.background_images.new()         bg.image = img         break  cam = bpy.data.cameras.new("Camera") cam_ob = bpy.data.objects.new("Camera", cam) bpy.context.scene.camera = cam_ob bpy.context.scene.objects.link(cam_ob) bpy.context.scene.objects.active = bpy.context.scene.objects["Camera"]   Any thoughts/tips would be greatly appreciated! As the topic is there exist a homeomorphism between either pair of $(0, 1),(0,1],[0,1]$ Faithful group actions for singleton group or for empty set Let $G$ be a group, possibly a singleton. Let $M$ be a set, possibly empty. Let $\mu: M \times G \to M$ be a right group action. Let $1_G$ be the identity of $G$.  I understand 's second definition of faithful as follows:     $\mu$ is faithful if for each $g \in G$ such that $g \ne 1_G$, there exists $x \in M$ such that $\mu(x,g) \ne x$. $\tag{1}$   Later  says if $\mu$ is free and $M$ is a non-empty set, then $\mu$ is faithful.  Question: Given the idea that we can have $M$ as an empty set, I would like to clarify: Are these correct?   If $G$ is a singleton, then every action $\mu$ is faithful, whether or not $M$ is empty. If $G$ is not a singleton, but $M$ is empty, then every action $\mu$ is not faithful. What should I do when the GETDEB repository is down? The usual explanation for warm fluids rising past cooler ones is that the warmer fluid has a lower density.  I'm trying to understand what this looks like at a molecular scale.  The density seems to be a large-scale phenomenon, and I don't understand how it can affect whether a particular molecule rises or falls.  Consider a cylinder of fluid that is being heated at the bottom.  The molecules at the bottom have a higher average energy.  How does this result in the tendency of the warmer molecules at the bottom to move upwards past the cooler ones? Version of the app: 1.0.51. (It is up to date at the time of writing according to Google Play.)  This started happening after the network problem that happened earlier this morning. Both my tablet and my phone are popping up notifications for events (comments, and probably edits too) that happened prior to the network issue. I had received notifications for these events already and had already cleared them before the network issue happened.  The repeated notifications do not show up in the bar displayed at the top of the Stack Exchange sites. In other words, I get notified again in Android but do not get notified again on the SE web sites. How to backup 20+TB of data? We have a NAS server at the company I work for that is being used for storing photography sessions. Each session is approximately 100gb. Over the last couple of years this server has accumulated 10+ TB of data, and we are increasing the amount of photoshoots exponentially. I estimate that by the end of next year we will have 20+ TB stored on this NAS. We are currently backing this server up to tape using LTO-5 tapes with Symantec BackupExec. Since the size of this server has grown, full backups of this server are not completing overnight. Does anyone have any suggestion on how to backup this amount of data? Should we be backing it up to tape? Are there any other options which may be better? I ran into a problem today when I decided to use npm update -g in a nodejs app directory. This was a bad decision, because it caused me to run into a .   The solution is to reinstall nodejs and npm. Unfortunately when I go to install npm using sudo apt-get install npm it doesn't work.  The full error in the terminal is here:  Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that  some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation: The following packages have unmet dependencies:  npm : Depends: nodejs but it is not going to be installed    Depends: node-abbrev (&gt;= 1.0.4) but it is not going to be installed    Depends: node-ansi but it is not going to be installed    Depends: node-archy but it is not going to be installed    Depends: node-block-stream but it is not going to be installed    Depends: node-fstream (&gt;= 0.1.22) but it is not going to be installed    Depends: node-fstream-ignore but it is not going to be installed    Depends: node-github-url-from-git but it is not going to be installed    Depends: node-glob (&gt;= 3.1.21) but it is not going to be installed    Depends: node-graceful-fs (&gt;= 2.0.0) but it is not going to be installed    Depends: node-inherits but it is not going to be installed    Depends: node-ini (&gt;= 1.1.0) but it is not going to be installed    Depends: node-lockfile but it is not going to be installed    Depends: node-lru-cache (&gt;= 2.3.0) but it is not going to be installed    Depends: node-minimatch (&gt;= 0.2.11) but it is not going to be installed    Depends: node-mkdirp (&gt;= 0.3.3) but it is not going to be installed    Depends: node-gyp (&gt;= 0.10.9) but it is not going to be installed    Depends: node-nopt (&gt;= 2.1.1) but it is not going to be installed    Depends: node-npmlog but it is not going to be installed    Depends: node-once but it is not going to be installed    Depends: node-osenv but it is not going to be installed    Depends: node-read but it is not going to be installed    Depends: node-read-package-json (&gt;= 1.1.0) but it is not going to be installed    Depends: node-request (&gt;= 2.25.0) but it is not going to be installed    Depends: node-retry but it is not going to be installed    Depends: node-rimraf (&gt;= 2.2.2) but it is not going to be installed    Depends: node-semver (&gt;= 2.1.0) but it is not going to be installed    Depends: node-sha but it is not going to be installed    Depends: node-slide but it is not going to be installed    Depends: node-tar (&gt;= 0.1.18) but it is not going to be installed    Depends: node-which but it is not going to be installed E: Unable to correct problems, you have held broken packages.   What can I do to get npm properly installed and running again?  Thanks. I have a 8 GB pendrive. I used to write raw data into the pendrive (without creating filesystem) using the dd command.    Today, when I inserted the pen drive, the I am unable to write anything on to it.  When I open gparted it is showing the total space on the pen drive as 500 MB. I am unable to create a new partition table or a partition on the pen drive now.   Here is the fdisk -l output.   Disk /dev/sdb: 0 MB, 512000 bytes 255 heads, 63 sectors/track, 0 cylinders, total 1000 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disk identifier: 0x00095df6   What's wrong with the pen drive? How can I recover the lost space?   Device Boot      Start         End      Blocks   Id  System   When I open gnome-disks, it shows the total space as 8 GB but when I try to create a new partition using it, it shows the following error:  Error creating partition on /dev/sdb: Command-line parted --align optimal --script "/dev/sdb" "mkpart primary ext2 1MiB 7969177599b"' exited with non-zero exit status 1: Error: The location 7969177599b is outside of the device /dev/sdb.  (udisks-error-quark, 0) Where are the Unity desktop wallpapers located? Please see the picture below. Where are the Unity desktop wallpapers located? Is the total energy of the universe zero? I found  where a technician with a lot of experience seems to clean his PCBs using water, and then he just puts it in the sun so it can dry. I was just amazed to see the circuit keeps working as intended, he says he keeps doing this all the time and several times, however I doubt this is normal.  Which leave me some questions:   What are the recommended methods to clean huge PCBs like the one in the video? What happens to charged capacitors when water shorts them out? Solder joints do not get any kind of corrosion? Is the antisolder mask waterproof? How do I invoke a Java method when given the method name as a string? I have played the game Othello (Reversi) numerous times but I never approach it with a specific logic or algorithm to apply on each move in my mind. I won many times and lost as much. How would one approach this game? How would one work in his mind to prune the possible moves and choose the &quot;right&quot; one in each step? I see that most Othello CPUs more or less &quot;think&quot; the same at each move, how should I think on each move? Installing Teamspeak and creating TeamSpeak3 .desktop file I am very new to Ubuntu and I want to create desktop launcher.  I have this in my TeamSpeak3.desktop in   [Desktop Entry] Name=TeamSpeak 3 Comment=TeamSpeak 3 VoIP Communicator Exec=/opt/TeamSpeak3-Client-linux_amd64/ts3client_runscript.sh Terminal=false Type=Application Categories=Network;Application; Icon=/opt/TeamSpeak3-Client-linux_amd64/styles/default/logo-128x128.png   in my ~/.local/share/applications/TeamSpeak3.desktop But I dont see it in my launcher and when I double click on it files, it just opens the text file. I even made it executable with     chmod +x TeamSpeak3.desktop  drwx------ 15 hung hung     4096 srp 16 12:29 . drwxr-xr-x  3 root root     4096 pro  9 19:22 .. -rw-------  1 hung hung   174627 srp 16 12:29 CHANGELOG -rwx------  1 hung hung   227136 srp 16 12:29 error_report drwx------  2 hung hung     4096 srp 16 12:29 gfx drwx------  3 hung hung     4096 srp 16 12:29 html drwx------  2 hung hung     4096 srp 16 12:29 iconengines drwx------  2 hung hung     4096 srp 16 12:29 imageformats -rwx------  1 hung hung   334520 srp 16 12:29 libc++abi.so.1 -rwx------  1 hung hung  1934744 srp 16 12:29 libcrypto.so.1.0.0 -rwx------  1 hung hung   746960 srp 16 12:29 libc++.so.1 -rwx------  1 hung hung  5842312 srp 16 12:29 libQt5Core.so.5 -rwx------  1 hung hung   484832 srp 16 12:29 libQt5DBus.so.5 -rwx------  1 hung hung  5683224 srp 16 12:29 libQt5Gui.so.5 -rwx------  1 hung hung  1335584 srp 16 12:29 libQt5Network.so.5 -rwx------  1 hung hung   290008 srp 16 12:29 libQt5Positioning.so.5 -rwx------  1 hung hung  3829280 srp 16 12:29 libQt5Qml.so.5 -rwx------  1 hung hung  3831288 srp 16 12:29 libQt5Quick.so.5 -rwx------  1 hung hung   234552 srp 16 12:29 libQt5Sql.so.5 -rwx------  1 hung hung   331232 srp 16 12:29 libQt5Svg.so.5 -rwx------  1 hung hung   117104 srp 16 12:29 libQt5WebChannel.so.5 -rwx------  1 hung hung 67570152 srp 16 12:29 libQt5WebEngineCore.so.5 -rwx------  1 hung hung   208344 srp 16 12:29 libQt5WebEngineWidgets.so.5 -rwx------  1 hung hung  6439120 srp 16 12:29 libQt5Widgets.so.5 -rwx------  1 hung hung  1334528 srp 16 12:29 libQt5XcbQpa.so.5 -rwx------  1 hung hung   180248 srp 16 12:29 libquazip.so -rwx------  1 hung hung    22936 srp 16 12:29 libsnappy.so.1 -rwx------  1 hung hung   111888 srp 16 12:29 libsrtp.so.0 -rwx------  1 hung hung   383072 srp 16 12:29 libssl.so.1.0.0 -rwx------  1 hung hung    51080 srp 16 12:29 libudev.so.0 -rw-------  1 hung hung     4340 srp 16 12:29 openglblacklist.json -rwx------  1 hung hung   260232 srp 16 12:29 package_inst drwx------  2 hung hung     4096 srp 16 12:29 platforms -rw-------  1 hung hung       26 srp 16 12:29 qt.conf drwx------  2 hung hung     4096 srp 16 12:29 qtwebengine_locales -rwx------  1 hung hung    19720 srp 16 12:29 QtWebEngineProcess drwx------  2 hung hung     4096 srp 16 12:29 resources drwx------  6 hung hung     4096 srp 16 12:29 sound drwx------  2 hung hung     4096 srp 16 12:29 soundbackends drwx------  2 hung hung     4096 srp 16 12:29 sqldrivers drwx------  3 hung hung     4096 srp 16 12:29 styles drwx------  2 hung hung     4096 srp 16 12:29 translations -rwx------  1 hung hung 18987008 srp 16 12:29 ts3client_linux_amd64 -rwx------  1 hung hung     1364 srp 16 12:29 ts3client_runscript.sh -rwx------  1 hung hung  2206064 srp 16 12:29 update drwx------  2 hung hung     4096 srp 16 12:29 xcbglintegrations Is it correct to omit preposition before date? For example, you're a fashion designer who wants to get the opinion of both a professional and someone who doesn't know much about fashion. What's a term for the latter person? Don't delete comments with link to duplicate if they are modified A user just posted his question a second time here on meta after the first was closed as a duplicate. I wrote a comment on the second post, explaining that the answer to his question is in the linked duplicate and that he shouldn't circumvent the closure process by asking a second identical question.  When the second post was closed as a duplicate my comment was automatically deleted. As far as I understand this is a heuristic that removes obsolete comments, which it considers every comment that contains a link to one of the duplicates.  This heuristic is too aggressive and removes comments that go beyond "Duplicate here: link". I suggest that it should be changed to only remove the default duplicate comment, and not any comment that was edited by the owner nor any free-form comment that happens to include a link to the duplicate.  This also triggers for any comment that contains the word "duplicate" and link to any question, not only the question being chosen as duplicate, which makes this much worse.