Kotlin VerifyError: Uninitialized object exists on backward branch 90 - intellij-idea

I am using the Kotlin getting started guide to setup Kotlin for the first time on IntelliJ IDEA with the following configuration:
IntelliJ IDEA 2017.2.5
Build #IC-172.4343.14, built on September 26, 2017
JRE: 1.8.0_152-release-915-b12 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Mac OS X 10.11.6
I created an App.kt file in a new Kotlin project with the following code:
fun main(args: Array<String>) {
println("hello")
}
On running the code through the IDE, I get the following error:
Error:Internal error: (java.lang.VerifyError) Uninitialized object exists on backward branch 90
Exception Details:
Location:
org/jetbrains/kotlin/jps/build/KotlinBuilder.createCompileEnvironment(Ljava/util/Map;Lorg/jetbrains/kotlin/incremental/components/LookupTracker;Lorg/jetbrains/jps/incremental/CompileContext;Lorg/jetbrains/kotlin/jps/build/KotlinBuilder$MessageCollectorAdapter;)Lorg/jetbrains/kotlin/compilerRunner/JpsCompilerEnvironment; #171: goto
Reason:
Error exists in the bytecode
Bytecode:
0000000: bb03 fe59 b703 ff3a 0619 063a 0719 0713
0000010: 02d7 2cb6 0403 5719 0713 0405 bb04 0759
0000020: 2b3a 083a 093a 0a3a 0b3a 0c19 083a 0dbb
0000030: 0409 5919 08b9 040a 0100 b804 10b7 0411
0000040: c002 893a 0e19 0db9 028c 0100 c000 b03a
0000050: 0f19 0fb9 00b9 0100 3a10 1910 b900 be01
0000060: 0099 004d 1910 b900 c201 003a 1119 0e19
0000070: 11c0 028e 3a12 3a13 1912 b902 9101 00c0
0000080: 00c4 b804 173a 1419 1319 1419 11c0 028e
0000090: 3a15 3a16 3a17 1915 b902 9401 003a 1819
00000a0: 1719 1619 18b9 041b 0300 57a7 ffaf 190e
00000b0: 0000 3a13 190c 190b 190a 1909 1913 b704
00000c0: 1eb6 0403 5719 0713 0420 bb04 2259 2c2b
00000d0: 2db7 0425 b604 0357 1907 b604 283a 052a
00000e0: b704 2c3a 0619 06c6 0010 1906 b904 3101
00000f0: 00b6 013c 9a00 1319 04b2 0216 1304 3301
0000100: 0701 b801 fa01 b0bb 0262 5919 0619 05b2
0000110: 002e b604 3719 04c0 01c7 bb04 3959 b704
0000120: 3ab7 043d b0
Stackmap Table:
full_frame(#90,{Object[#2],Object[#649],Object[#727],Object[#98],Object[#428],Top,Object[#1022],Object[#1022],Object[#649],Uninitialized[#28],Uninitialized[#28],Object[#1005],Object[#1022],Object[#649],Object[#649],Object[#176],Object[#187]},{})
same_frame_extended(#174)
full_frame(#247,{Object[#2],Object[#649],Object[#727],Object[#98],Object[#428],Object[#1102],Object[#1070],Object[#1022],Object[#649],Object[#1031],Object[#1031],Object[#1005],Object[#1022],Object[#649],Object[#649],Object[#176],Object[#187],Top,Top,Object[#649]},{})
same_frame(#263)
java.lang.VerifyError: Uninitialized object exists on backward branch 90
Exception Details:
Location:
org/jetbrains/kotlin/jps/build/KotlinBuilder.createCompileEnvironment(Ljava/util/Map;Lorg/jetbrains/kotlin/incremental/components/LookupTracker;Lorg/jetbrains/jps/incremental/CompileContext;Lorg/jetbrains/kotlin/jps/build/KotlinBuilder$MessageCollectorAdapter;)Lorg/jetbrains/kotlin/compilerRunner/JpsCompilerEnvironment; #171: goto
Reason:
Error exists in the bytecode
Bytecode:
0000000: bb03 fe59 b703 ff3a 0619 063a 0719 0713
0000010: 02d7 2cb6 0403 5719 0713 0405 bb04 0759
0000020: 2b3a 083a 093a 0a3a 0b3a 0c19 083a 0dbb
0000030: 0409 5919 08b9 040a 0100 b804 10b7 0411
0000040: c002 893a 0e19 0db9 028c 0100 c000 b03a
0000050: 0f19 0fb9 00b9 0100 3a10 1910 b900 be01
0000060: 0099 004d 1910 b900 c201 003a 1119 0e19
0000070: 11c0 028e 3a12 3a13 1912 b902 9101 00c0
0000080: 00c4 b804 173a 1419 1319 1419 11c0 028e
0000090: 3a15 3a16 3a17 1915 b902 9401 003a 1819
00000a0: 1719 1619 18b9 041b 0300 57a7 ffaf 190e
00000b0: 0000 3a13 190c 190b 190a 1909 1913 b704
00000c0: 1eb6 0403 5719 0713 0420 bb04 2259 2c2b
00000d0: 2db7 0425 b604 0357 1907 b604 283a 052a
00000e0: b704 2c3a 0619 06c6 0010 1906 b904 3101
00000f0: 00b6 013c 9a00 1319 04b2 0216 1304 3301
0000100: 0701 b801 fa01 b0bb 0262 5919 0619 05b2
0000110: 002e b604 3719 04c0 01c7 bb04 3959 b704
0000120: 3ab7 043d b0
Stackmap Table:
full_frame(#90,{Object[#2],Object[#649],Object[#727],Object[#98],Object[#428],Top,Object[#1022],Object[#1022],Object[#649],Uninitialized[#28],Uninitialized[#28],Object[#1005],Object[#1022],Object[#649],Object[#649],Object[#176],Object[#187]},{})
same_frame_extended(#174)
full_frame(#247,{Object[#2],Object[#649],Object[#727],Object[#98],Object[#428],Object[#1102],Object[#1070],Object[#1022],Object[#649],Object[#1031],Object[#1031],Object[#1005],Object[#1022],Object[#649],Object[#649],Object[#176],Object[#187],Top,Top,Object[#649]},{})
same_frame(#263)
at org.jetbrains.kotlin.jps.build.KotlinBuilderService.createModuleLevelBuilders(KotlinBuilderService.java:30)
at org.jetbrains.jps.incremental.BuilderRegistry.<init>(BuilderRegistry.java:54)
at org.jetbrains.jps.incremental.BuilderRegistry.<init>(BuilderRegistry.java:33)
at org.jetbrains.jps.incremental.BuilderRegistry$Holder.<clinit>(BuilderRegistry.java:36)
at org.jetbrains.jps.incremental.BuilderRegistry.getInstance(BuilderRegistry.java:43)
at org.jetbrains.jps.cmdline.BuildRunner.runBuild(BuildRunner.java:133)
at org.jetbrains.jps.cmdline.BuildSession.runBuild(BuildSession.java:295)
at org.jetbrains.jps.cmdline.BuildSession.run(BuildSession.java:125)
at org.jetbrains.jps.cmdline.BuildMain$MyMessageHandler.lambda$channelRead0$0(BuildMain.java:236)
at org.jetbrains.jps.cmdline.BuildMain$MyMessageHandler$$Lambda$3/1147174008.run(Unknown Source)
at org.jetbrains.jps.service.impl.SharedThreadPoolImpl.lambda$executeOnPooledThread$0(SharedThreadPoolImpl.java:42)
at org.jetbrains.jps.service.impl.SharedThreadPoolImpl$$Lambda$1/684874119.run(Unknown Source)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

This is due to a bug in earlier JDK 8 versions. Open up the project structure for your project and change your project SDK to a more recent version.
Upgrading from JDK 1.8.0_11 to 1.80_72 solved the problem for me.

Just check "Use embedded JDK" in File>Project Structure>SDK Location> JDK Location

Related

VerifyError: Bad type on operand stack dropwizard

We upgraded the java version to 11 in a microservice.
When we tried to run the app, we got the following message:
Caused by: java.lang.VerifyError: Bad type on operand stack
Exception Details:
Location:
com/template/main/App.initialize(Lio/dropwizard/setup/Bootstrap;)V #153: invokespecial
Reason:
Type 'io/dropwizard/configuration/EnvironmentVariableSubstitutor' (current frame, stack[4]) is not assignable to 'org/apache/commons/text/StrSubstitutor'
Current Frame:
bci: #153
flags: { }
locals: { 'com/template/main/App', 'io/dropwizard/setup/Bootstrap', 'com/bendb/dropwizard/jooq/JooqBundle' }
stack: { 'io/dropwizard/setup/Bootstrap', uninitialized 137, uninitialized 137, 'io/dropwizard/configuration/ConfigurationSourceProvider', 'io/dropwizard/configuration/EnvironmentVariableSubstitutor' }
Bytecode:
0000000: 2a2b b700 052a b600 064d 2b2c b600 072b
0000010: bb00 0859 b700 09b6 0007 2bbb 000a 59b7
0000020: 000b b600 0c2a b800 0d12 0eb6 000f bb00
0000030: 1059 b700 11b6 0012 bb00 1359 2cb7 0014
0000040: b600 12bb 0015 59b7 0016 b600 12bb 0017
0000050: 59b7 0018 b600 12bb 0019 59b7 001a b600
0000060: 12bb 001b 59b7 001c b600 1204 bd00 1d59
0000070: 0312 1e53 b600 1fb2 0020 b600 21b5 0022
0000080: 2b2a b400 22b6 0007 2bbb 0023 592b b600
0000090: 24bb 0025 5903 b700 26b7 0027 b600 282b
00000a0: bb00 2959 2ab7 002a b600 0c2b bb00 2b59
00000b0: 2ab7 002c b600 07b1
Any idea how can we fix it?

tornado-maven-osgi-project template for IntelliJ does not work [duplicate]

I am using the Kotlin getting started guide to setup Kotlin for the first time on IntelliJ IDEA with the following configuration:
IntelliJ IDEA 2017.2.5
Build #IC-172.4343.14, built on September 26, 2017
JRE: 1.8.0_152-release-915-b12 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Mac OS X 10.11.6
I created an App.kt file in a new Kotlin project with the following code:
fun main(args: Array<String>) {
println("hello")
}
On running the code through the IDE, I get the following error:
Error:Internal error: (java.lang.VerifyError) Uninitialized object exists on backward branch 90
Exception Details:
Location:
org/jetbrains/kotlin/jps/build/KotlinBuilder.createCompileEnvironment(Ljava/util/Map;Lorg/jetbrains/kotlin/incremental/components/LookupTracker;Lorg/jetbrains/jps/incremental/CompileContext;Lorg/jetbrains/kotlin/jps/build/KotlinBuilder$MessageCollectorAdapter;)Lorg/jetbrains/kotlin/compilerRunner/JpsCompilerEnvironment; #171: goto
Reason:
Error exists in the bytecode
Bytecode:
0000000: bb03 fe59 b703 ff3a 0619 063a 0719 0713
0000010: 02d7 2cb6 0403 5719 0713 0405 bb04 0759
0000020: 2b3a 083a 093a 0a3a 0b3a 0c19 083a 0dbb
0000030: 0409 5919 08b9 040a 0100 b804 10b7 0411
0000040: c002 893a 0e19 0db9 028c 0100 c000 b03a
0000050: 0f19 0fb9 00b9 0100 3a10 1910 b900 be01
0000060: 0099 004d 1910 b900 c201 003a 1119 0e19
0000070: 11c0 028e 3a12 3a13 1912 b902 9101 00c0
0000080: 00c4 b804 173a 1419 1319 1419 11c0 028e
0000090: 3a15 3a16 3a17 1915 b902 9401 003a 1819
00000a0: 1719 1619 18b9 041b 0300 57a7 ffaf 190e
00000b0: 0000 3a13 190c 190b 190a 1909 1913 b704
00000c0: 1eb6 0403 5719 0713 0420 bb04 2259 2c2b
00000d0: 2db7 0425 b604 0357 1907 b604 283a 052a
00000e0: b704 2c3a 0619 06c6 0010 1906 b904 3101
00000f0: 00b6 013c 9a00 1319 04b2 0216 1304 3301
0000100: 0701 b801 fa01 b0bb 0262 5919 0619 05b2
0000110: 002e b604 3719 04c0 01c7 bb04 3959 b704
0000120: 3ab7 043d b0
Stackmap Table:
full_frame(#90,{Object[#2],Object[#649],Object[#727],Object[#98],Object[#428],Top,Object[#1022],Object[#1022],Object[#649],Uninitialized[#28],Uninitialized[#28],Object[#1005],Object[#1022],Object[#649],Object[#649],Object[#176],Object[#187]},{})
same_frame_extended(#174)
full_frame(#247,{Object[#2],Object[#649],Object[#727],Object[#98],Object[#428],Object[#1102],Object[#1070],Object[#1022],Object[#649],Object[#1031],Object[#1031],Object[#1005],Object[#1022],Object[#649],Object[#649],Object[#176],Object[#187],Top,Top,Object[#649]},{})
same_frame(#263)
java.lang.VerifyError: Uninitialized object exists on backward branch 90
Exception Details:
Location:
org/jetbrains/kotlin/jps/build/KotlinBuilder.createCompileEnvironment(Ljava/util/Map;Lorg/jetbrains/kotlin/incremental/components/LookupTracker;Lorg/jetbrains/jps/incremental/CompileContext;Lorg/jetbrains/kotlin/jps/build/KotlinBuilder$MessageCollectorAdapter;)Lorg/jetbrains/kotlin/compilerRunner/JpsCompilerEnvironment; #171: goto
Reason:
Error exists in the bytecode
Bytecode:
0000000: bb03 fe59 b703 ff3a 0619 063a 0719 0713
0000010: 02d7 2cb6 0403 5719 0713 0405 bb04 0759
0000020: 2b3a 083a 093a 0a3a 0b3a 0c19 083a 0dbb
0000030: 0409 5919 08b9 040a 0100 b804 10b7 0411
0000040: c002 893a 0e19 0db9 028c 0100 c000 b03a
0000050: 0f19 0fb9 00b9 0100 3a10 1910 b900 be01
0000060: 0099 004d 1910 b900 c201 003a 1119 0e19
0000070: 11c0 028e 3a12 3a13 1912 b902 9101 00c0
0000080: 00c4 b804 173a 1419 1319 1419 11c0 028e
0000090: 3a15 3a16 3a17 1915 b902 9401 003a 1819
00000a0: 1719 1619 18b9 041b 0300 57a7 ffaf 190e
00000b0: 0000 3a13 190c 190b 190a 1909 1913 b704
00000c0: 1eb6 0403 5719 0713 0420 bb04 2259 2c2b
00000d0: 2db7 0425 b604 0357 1907 b604 283a 052a
00000e0: b704 2c3a 0619 06c6 0010 1906 b904 3101
00000f0: 00b6 013c 9a00 1319 04b2 0216 1304 3301
0000100: 0701 b801 fa01 b0bb 0262 5919 0619 05b2
0000110: 002e b604 3719 04c0 01c7 bb04 3959 b704
0000120: 3ab7 043d b0
Stackmap Table:
full_frame(#90,{Object[#2],Object[#649],Object[#727],Object[#98],Object[#428],Top,Object[#1022],Object[#1022],Object[#649],Uninitialized[#28],Uninitialized[#28],Object[#1005],Object[#1022],Object[#649],Object[#649],Object[#176],Object[#187]},{})
same_frame_extended(#174)
full_frame(#247,{Object[#2],Object[#649],Object[#727],Object[#98],Object[#428],Object[#1102],Object[#1070],Object[#1022],Object[#649],Object[#1031],Object[#1031],Object[#1005],Object[#1022],Object[#649],Object[#649],Object[#176],Object[#187],Top,Top,Object[#649]},{})
same_frame(#263)
at org.jetbrains.kotlin.jps.build.KotlinBuilderService.createModuleLevelBuilders(KotlinBuilderService.java:30)
at org.jetbrains.jps.incremental.BuilderRegistry.<init>(BuilderRegistry.java:54)
at org.jetbrains.jps.incremental.BuilderRegistry.<init>(BuilderRegistry.java:33)
at org.jetbrains.jps.incremental.BuilderRegistry$Holder.<clinit>(BuilderRegistry.java:36)
at org.jetbrains.jps.incremental.BuilderRegistry.getInstance(BuilderRegistry.java:43)
at org.jetbrains.jps.cmdline.BuildRunner.runBuild(BuildRunner.java:133)
at org.jetbrains.jps.cmdline.BuildSession.runBuild(BuildSession.java:295)
at org.jetbrains.jps.cmdline.BuildSession.run(BuildSession.java:125)
at org.jetbrains.jps.cmdline.BuildMain$MyMessageHandler.lambda$channelRead0$0(BuildMain.java:236)
at org.jetbrains.jps.cmdline.BuildMain$MyMessageHandler$$Lambda$3/1147174008.run(Unknown Source)
at org.jetbrains.jps.service.impl.SharedThreadPoolImpl.lambda$executeOnPooledThread$0(SharedThreadPoolImpl.java:42)
at org.jetbrains.jps.service.impl.SharedThreadPoolImpl$$Lambda$1/684874119.run(Unknown Source)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
This is due to a bug in earlier JDK 8 versions. Open up the project structure for your project and change your project SDK to a more recent version.
Upgrading from JDK 1.8.0_11 to 1.80_72 solved the problem for me.
Just check "Use embedded JDK" in File>Project Structure>SDK Location> JDK Location

Different results on executing same stored procedure

I have a stored procedure
CREATE PROCEDURE [dbo].[Proc_SplitAndRemoveDuplicates]
#sep VARCHAR(32),
#s NVARCHAR(MAX),
#hcp NVARCHAR(MAX) OUTPUT
AS
BEGIN
DECLARE #t TABLE (val NVARCHAR(MAX))
SET #hcp = ''
DECLARE #xml XML
SET #xml = N'<root><r>' + REPLACE(#s, #sep, '</r><r>') + '</r></root>'
PRINT CAST (#xml AS NVARCHAR(MAX))
INSERT INTO #t(val)
SELECT RTRIM(LTRIM(r.value('.','NVARCHAR(MAX)'))) as Item
FROM #xml.nodes('//root/r') AS RECORDS(r)
;WITH cte AS
(
SELECT ROW_NUMBER() OVER (PARTITION BY val ORDER BY val desc) RN
FROM #t
)
DELETE FROM cte
WHERE RN > 1
SET #hcp = (SELECT SPACE(1) + val + ',' from #t WHERE val <> '' FOR XML PATH ('') )
END
Now when I pass the same values in arguments it gives me different results, any ideas why is this happening?
Below is the query that's giving different results:
DECLARE #hcp NVARCHAR(MAX)
EXEC [Proc_SplitAndRemoveDuplicates] ',', 'Marie-Louise Coenen, Christiaan Genbrugge, Kurt Geldof, Philippe Gilbert, Benoit Calcus, Michel Gijssels, Leon Ghyselinck, Ivan Ghillebert, Peter Chielens, Jozef Gevers, Bernard Gevenois, Paul Geusens, Jozef Geukens, Sabine Goolaerts, Yves Heeren, Val?rie Goffin, Pierro Fattizzo, Philippe Farr, Sophie Schyns, Jean-Pierre Falla, Jean-Michel Gobeaux, Marie-Annick G?tze, Pierre Firket, France Gosse, Johanna Gomez Tercero, Marianne Schoofs, Philippe Schockaert, Lieven De Norre, Val?rie Denef, Kathleen Geens, Walter Geeraerts, Fran?oise Gerard, Claudia Schomus, Ellen Schorkops, Bernard Gerbaux, Eveline Schleich, Micheline Demeyer, Brigitte Gadisseux, Brenda Laera, * GHERALDI, * VAUTHIER, . MARC, *THOMAS* RABERN, * BLANDIN, . BARON, A GUICHARD LEBRUN, A FRANCE VENTRE, A ILAH NOURY, A MARIE BONNERIC BRETON, A PAULE GIMENEZ ROQUEPLOT, A rakoto NIRHY LANTO, A sophie CHOQUET, A marie COURTEL, A MARIE HAOND, A sophie CALLOC H, A marie MAILLOTTE, AABDALLAH JOIDATE, AANYO KUZEAWU, ABBAS AL MAKKI, Abakar ABAKAR MAHAMAT, Ab nasser DOUMI, ABBAS SROUR, ABDAKA BELLOUTI, ABBOUD ABO, Abdallah MOUSTEAU, Marie-Louise Coenen, Christiaan Genbrugge, Kurt Geldof, Philippe Gilbert, Benoit Calcus, Michel Gijssels, Leon Ghyselinck, Ivan Ghillebert, Peter Chielens, Jozef Gevers, Bernard Gevenois, Paul Geusens, Jozef Geukens, Sabine Goolaerts, Yves Heeren, Val?rie Goffin, Pierro Fattizzo, Philippe Farr, Sophie Schyns, Jean-Pierre Falla, Jean-Michel Gobeaux, Marie-Annick G?tze, Pierre Firket, France Gosse, Johanna Gomez Tercero, Marianne Schoofs, Philippe Schockaert, Lieven De Norre, Val?rie Denef, Kathleen Geens, Walter Geeraerts, Fran?oise Gerard, Claudia Schomus, Ellen Schorkops, Bernard Gerbaux, Eveline Schleich, Micheline Demeyer, Brigitte Gadisseux, Brenda Laera, * GHERALDI, * VAUTHIER, . MARC, *THOMAS* RABERN, * BLANDIN, . BARON, A GUICHARD LEBRUN, A FRANCE VENTRE, A ILAH NOURY, A MARIE BONNERIC BRETON, A PAULE GIMENEZ ROQUEPLOT, A rakoto NIRHY LANTO, A sophie CHOQUET, A marie COURTEL, A MARIE HAOND, A sophie CALLOC H, A marie MAILLOTTE, AABDALLAH JOIDATE, AANYO KUZEAWU, ABBAS AL MAKKI, Abakar ABAKAR MAHAMAT, Ab nasser DOUMI, ABBAS SROUR, ABDAKA BELLOUTI, ABBOUD ABO, Abdallah MOUSTEAU, Marie-Louise Coenen, Christiaan Genbrugge, Kurt Geldof, Philippe Gilbert, Benoit Calcus, Michel Gijssels, Leon Ghyselinck, Ivan Ghillebert, Peter Chielens, Jozef Gevers, Bernard Gevenois, Paul Geusens, Jozef Geukens, Sabine Goolaerts, Yves Heeren, Val?rie Goffin, Pierro Fattizzo, Philippe Farr, Sophie Schyns, Jean-Pierre Falla, Jean-Michel Gobeaux, Marie-Annick G?tze, Pierre Firket, France Gosse, Johanna Gomez Tercero, Marianne Schoofs, Philippe Schockaert, Lieven De Norre, Val?rie Denef, Kathleen Geens, Walter Geeraerts, Fran?oise Gerard, Claudia Schomus, Ellen Schorkops, Bernard Gerbaux, Eveline Schleich, Micheline Demeyer, Brigitte Gadisseux, Brenda Laera, * GHERALDI, * VAUTHIER, . MARC, *THOMAS* RABERN, * BLANDIN, . BARON, A GUICHARD LEBRUN, A FRANCE VENTRE, A ILAH NOURY, A MARIE BONNERIC BRETON, A PAULE GIMENEZ ROQUEPLOT, A rakoto NIRHY LANTO, A sophie CHOQUET, A marie COURTEL, A MARIE HAOND, A sophie CALLOC H, A marie MAILLOTTE, AABDALLAH JOIDATE, AANYO KUZEAWU, ABBAS AL MAKKI, Abakar ABAKAR MAHAMAT, Ab nasser DOUMI, ABBAS SROUR, ABDAKA BELLOUTI, ABBOUD ABO, Abdallah MOUSTEAU, Marie-Louise Coenen, Christiaan Genbrugge, Kurt Geldof, Philippe Gilbert, Benoit Calcus, Michel Gijssels, Leon Ghyselinck, Ivan Ghillebert, Peter Chielens, Jozef Gevers, Bernard Gevenois, Paul Geusens, Jozef Geukens, Sabine Goolaerts, Yves Heeren, Val?rie Goffin, Pierro Fattizzo, Philippe Farr, Sophie Schyns, Jean-Pierre Falla, Jean-Michel Gobeaux, Marie-Annick G?tze, Pierre Firket, France Gosse, Johanna Gomez Tercero, Marianne Schoofs, Philippe Schockaert, Lieven De Norre, Val?rie Denef, Kathleen Geens, Walter Geeraerts, Fran?oise Gerard, Claudia Schomus, Ellen Schorkops, Bernard Gerbaux, Eveline Schleich, Micheline Demeyer, Brigitte Gadisseux, Brenda Laera, * GHERALDI, * VAUTHIER, . MARC, *THOMAS* RABERN, * BLANDIN, . BARON, A GUICHARD LEBRUN, A FRANCE VENTRE, A ILAH NOURY, A MARIE BONNERIC BRETON, A PAULE GIMENEZ ROQUEPLOT, A rakoto NIRHY LANTO, A sophie CHOQUET, A marie COURTEL, A MARIE HAOND, A sophie CALLOC H, A marie MAILLOTTE, AABDALLAH JOIDATE, AANYO KUZEAWU, ABBAS AL MAKKI, Abakar ABAKAR MAHAMAT, Ab nasser DOUMI, ABBAS SROUR, ABDAKA BELLOUTI, ABBOUD ABO, Abdallah MOUSTEAU, Marie-Louise Coenen, Christiaan Genbrugge, Kurt Geldof, Philippe Gilbert, Benoit Calcus, Michel Gijssels, Leon Ghyselinck, Ivan Ghillebert, Peter Chielens, Jozef Gevers, Bernard Gevenois, Paul Geusens, Jozef Geukens, Sabine Goolaerts, Yves Heeren, Val?rie Goffin, Pierro Fattizzo, Philippe Farr, Sophie Schyns, Jean-Pierre Falla, Jean-Michel Gobeaux, Marie-Annick G?tze, Pierre Firket, France Gosse, Johanna Gomez Tercero, Marianne Schoofs, Philippe Schockaert, Lieven De Norre, Val?rie Denef, Kathleen Geens, Walter Geeraerts, Fran?oise Gerard, Claudia Schomus, Ellen Schorkops, Bernard Gerbaux, Eveline Schleich, Micheline Demeyer, Brigitte Gadisseux, Brenda Laera, * GHERALDI, * VAUTHIER, . MARC, *THOMAS* RABERN, * BLANDIN, . BARON, A GUICHARD LEBRUN, A FRANCE VENTRE, A ILAH NOURY, A MARIE BONNERIC BRETON, A PAULE GIMENEZ ROQUEPLOT, A rakoto NIRHY LANTO, A sophie CHOQUET, A marie COURTEL, A MARIE HAOND, A sophie CALLOC H, A marie MAILLOTTE, AABDALLAH JOIDATE, AANYO KUZEAWU, ABBAS AL MAKKI, Abakar ABAKAR MAHAMAT, Ab nasser DOUMI, ABBAS SROUR, ABDAKA BELLOUTI, ABBOUD ABO, Abdallah MOUSTEAU, Marie-Louise Coenen, Christiaan Genbrugge, Kurt Geldof, Philippe Gilbert, Benoit Calcus, Michel Gijssels, Leon Ghyselinck, Ivan Ghillebert, Peter Chielens, Jozef Gevers, Bernard Gevenois, Paul Geusens, Jozef Geukens, Sabine Goolaerts, Yves Heeren, Val?rie Goffin, Pierro Fattizzo, Philippe Farr, Sophie Schyns, Jean-Pierre Falla, Jean-Michel Gobeaux, Marie-Annick G?tze, Pierre Firket, France Gosse, Johanna Gomez Tercero, Marianne Schoofs, Philippe Schockaert, Lieven De Norre, Val?rie Denef, Kathleen Geens, Walter Geeraerts, Fran?oise Gerard, Claudia Schomus, Ellen Schorkops, Bernard Gerbaux, Eveline Schleich, Micheline Demeyer, Brigitte Gadisseux, Brenda Laera, * GHERALDI, * VAUTHIER, . MARC, *THOMAS* RABERN, * BLANDIN, . BARON, A GUICHARD LEBRUN, A FRANCE VENTRE, A ILAH NOURY, A MARIE BONNERIC BRETON, A PAULE GIMENEZ ROQUEPLOT, A rakoto NIRHY LANTO, A sophie CHOQUET, A marie COURTEL, A MARIE HAOND, A sophie CALLOC H, A marie MAILLOTTE, AABDALLAH JOIDATE, AANYO KUZEAWU, ABBAS AL MAKKI, Abakar ABAKAR MAHAMAT, Ab nasser DOUMI, ABBAS SROUR, ABDAKA BELLOUTI, ABBOUD ABO, Abdallah MOUSTEAU, Marie-Louise Coenen, Christiaan Genbrugge, Kurt Geldof, Philippe Gilbert, Benoit Calcus, Michel Gijssels, Leon Ghyselinck, Ivan Ghillebert, Peter Chielens, Jozef Gevers, Bernard Gevenois, Paul Geusens, Jozef Geukens, Sabine Goolaerts, Yves Heeren, Val?rie Goffin, Pierro Fattizzo, Philippe Farr, Sophie Schyns, Jean-Pierre Falla, Jean-Michel Gobeaux, Marie-Annick G?tze, Pierre Firket, France Gosse, Johanna Gomez Tercero, Marianne Schoofs, Philippe Schockaert, Lieven De Norre, Val?rie Denef, Kathleen Geens, Walter Geeraerts, Fran?oise Gerard, Claudia Schomus, Ellen Schorkops, Bernard Gerbaux, Eveline Schleich, Micheline Demeyer, Brigitte Gadisseux, Brenda Laera, * GHERALDI, * VAUTHIER, . MARC, *THOMAS* RABERN, * BLANDIN, . BARON, A GUICHARD LEBRUN, A FRANCE VENTRE, A ILAH NOURY, A MARIE BONNERIC BRETON, A PAULE GIMENEZ ROQUEPLOT, A rakoto NIRHY LANTO, A sophie CHOQUET, A marie COURTEL, A MARIE HAOND, A sophie CALLOC H, A marie MAILLOTTE, AABDALLAH JOIDATE, AANYO KUZEAWU, ABBAS AL MAKKI, Abakar ABAKAR MAHAMAT, Ab nasser DOUMI, ABBAS SROUR, ABDAKA BELLOUTI, ABBOUD ABO, Abdallah MOUSTEAU, Marie-Louise Coenen, Christiaan Genbrugge, Kurt Geldof, Philippe Gilbert, Benoit Calcus, Michel Gijssels, Leon Ghyselinck, Ivan Ghillebert, Peter Chielens, Jozef Gevers, Bernard Gevenois, Paul Geusens, Jozef Geukens, Sabine Goolaerts, Yves Heeren, Val?rie Goffin, Pierro Fattizzo, Philippe Farr, Sophie Schyns, Jean-Pierre Falla, Jean-Michel Gobeaux, Marie-Annick G?tze, Pierre Firket, France Gosse, Johanna Gomez Tercero, Marianne Schoofs, Philippe Schockaert, Lieven De Norre, Val?rie Denef, Kathleen Geens, Walter Geeraerts, Fran?oise Gerard, Claudia Schomus, Ellen Schorkops, Bernard Gerbaux, Eveline Schleich, Micheline Demeyer, Brigitte Gadisseux, Brenda Laera, * GHERALDI, * VAUTHIER, . MARC, *THOMAS* RABERN, * BLANDIN, . BARON, A GUICHARD LEBRUN, A FRANCE VENTRE, A ILAH NOURY, A MARIE BONNERIC BRETON, A PAULE GIMENEZ ROQUEPLOT, A rakoto NIRHY LANTO, A sophie CHOQUET, A marie COURTEL, A MARIE HAOND, A sophie CALLOC H, A marie MAILLOTTE, AABDALLAH JOIDATE, AANYO KUZEAWU, ABBAS AL MAKKI, Abakar ABAKAR MAHAMAT, Ab nasser DOUMI, ABBAS SROUR, ABDAKA BELLOUTI, ABBOUD ABO, Abdallah MOUSTEAU, ', #hcp OUTPUT
SELECT #hcp
Any help would be really apreciated.
I notice two suspect things in your stored procedure. First is in this line:
(SELECT ROW_NUMBER() OVER (PARTITION BY val ORDER BY val desc) as RN
Sorting in SQL is unstable. That means that rows with the same key values can appear in any order -- and that order can change from one run to the next. That means that the specific row being deleted in indeterminate (although it would always have the correct val value).
Second, you have for xml path, but you have no order by. If the different results are simply in the "wrong" order, you can easily fix that by putting an order by into that statement.
These are just two issues that I spot. There may be other issues as well.

Use AWK on multi FASTA file to add new column based on contig header

I have a multi FASTA file that needs to be parsed so Glimmer multi-extract script can process it. It is composed of many contigs each with it's own header that starts with ">". What I need is to add each header as a new column, the problem is I don't know very much about the linux bash or awk for that matter.
>contig-7
orf00002 1741 461
orf00003 3381 1747
>Wcontig-7000023
>Wcontig-11112
orf00001 426 2648
orf00002 2710 4581
orf00003 4569 5480
orf00004 6990 6133
orf00006 9180 7108
orf00007 10201 9209
orf00008 11663 10203
orf00009 12489 11680
orf00010 13153 12473
orf00011 14382 13225
orf00013 14715 15968
orf00014 19868 16410
>Wcontig-1674000002
orf00001 2995 637
orf00002 2497 1166
orf00003 2984 2529
I need to have each contig header added as a first column along with a tab delimiter.
>contig-7
>contig-7 orf00002 1741 461
>contig-7 orf00003 3381 1747
>Wcontig-7000023
>Wcontig-11112
>Wcontig-11112 orf00001 426 2648
>Wcontig-11112 orf00002 2710 4581
>Wcontig-11112 orf00003 4569 5480
>Wcontig-11112 orf00004 6990 6133
>Wcontig-11112 orf00006 9180 7108
>Wcontig-11112 orf00007 10201 9209
>Wcontig-11112 orf00008 11663 10203
>Wcontig-11112 orf00009 12489 11680
>Wcontig-11112 orf00010 13153 12473
>Wcontig-11112 orf00011 14382 13225
>Wcontig-11112 orf00013 14715 15968
>Wcontig-11112 orf00014 19868 16410
>Wcontig-1674000002
>Wcontig-1674000002 orf00001 2995 637
>Wcontig-1674000002 orf00002 2497 1166
>Wcontig-1674000002 orf00003 2984 2529
Also, after adding the new column I have to erase all the headers, so it would end up looking like this
>contig-7 orf00002 1741 461
>contig-7 orf00003 3381 1747
>Wcontig-11112 orf00001 426 2648
>Wcontig-11112 orf00002 2710 4581
>Wcontig-11112 orf00003 4569 5480
>Wcontig-11112 orf00004 6990 6133
>Wcontig-11112 orf00006 9180 7108
>Wcontig-11112 orf00007 10201 9209
>Wcontig-11112 orf00008 11663 10203
>Wcontig-11112 orf00009 12489 11680
>Wcontig-11112 orf00010 13153 12473
>Wcontig-11112 orf00011 14382 13225
>Wcontig-11112 orf00013 14715 15968
>Wcontig-11112 orf00014 19868 16410
>Wcontig-1674000002 orf00001 2995 637
>Wcontig-1674000002 orf00002 2497 1166
>Wcontig-1674000002 orf00003 2984 2529
Awk can be really handy to solve this problem:
awk '{if($1 ~ /contig/){c=$1}else{print c"\t"$0}}' <yourfile>

Why do we need a constant time *single byte* comparison function?

Looking at Go standard library, there's a ConstantTimeByteEq function that looks like this:
func ConstantTimeByteEq(x, y uint8) int {
z := ^(x ^ y)
z &= z >> 4
z &= z >> 2
z &= z >> 1
return int(z)
}
Now, I understand the need for constant time string (array, etc.) comparison, as a regular algorithm could short-circuit after the first unequal element. But in this case, isn't a regular comparison of two fixed-sized integers a constant time operation at the CPU level already?
The point is likely to avoid branch mispredictions, in addition to having the result as 1 or 0 instead of true or false (allowing follow ups as bitwise operations).
Compare how this compiles:
var a, b, c, d byte
_ = a == b && c == d
=>
0017 (foo.go:15) MOVQ $0,BX
0018 (foo.go:15) MOVQ $0,DX
0019 (foo.go:15) MOVQ $0,CX
0020 (foo.go:15) MOVQ $0,AX
0021 (foo.go:16) JMP ,24
0022 (foo.go:16) MOVQ $1,AX
0023 (foo.go:16) JMP ,30
0024 (foo.go:16) CMPB BX,DX
0025 (foo.go:16) JNE ,29
0026 (foo.go:16) CMPB CX,AX
0027 (foo.go:16) JNE ,29
0028 (foo.go:16) JMP ,22
0029 (foo.go:16) MOVQ $0,AX
With this:
var a, b, c, d byte
_ = subtle.ConstantTimeByteEq(a, b) & subtle.ConstantTimeByteEq(c, d)
=>
0018 (foo.go:15) MOVQ $0,DX
0019 (foo.go:15) MOVQ $0,AX
0020 (foo.go:15) MOVQ $0,DI
0021 (foo.go:15) MOVQ $0,SI
0022 (foo.go:16) XORQ AX,DX
0023 (foo.go:16) XORQ $-1,DX
0024 (foo.go:16) MOVQ DX,BX
0025 (foo.go:16) SHRB $4,BX
0026 (foo.go:16) ANDQ BX,DX
0027 (foo.go:16) MOVQ DX,BX
0028 (foo.go:16) SHRB $2,BX
0029 (foo.go:16) ANDQ BX,DX
0030 (foo.go:16) MOVQ DX,AX
0031 (foo.go:16) SHRB $1,DX
0032 (foo.go:16) ANDQ DX,AX
0033 (foo.go:16) MOVBQZX AX,DX
0034 (foo.go:16) MOVQ DI,BX
0035 (foo.go:16) XORQ SI,BX
0036 (foo.go:16) XORQ $-1,BX
0037 (foo.go:16) MOVQ BX,AX
0038 (foo.go:16) SHRB $4,BX
0039 (foo.go:16) ANDQ BX,AX
0040 (foo.go:16) MOVQ AX,BX
0041 (foo.go:16) SHRB $2,BX
0042 (foo.go:16) ANDQ BX,AX
0043 (foo.go:16) MOVQ AX,BX
0044 (foo.go:16) SHRB $1,BX
0045 (foo.go:16) ANDQ BX,AX
0046 (foo.go:16) MOVBQZX AX,BX
Although the latter version is longer, it's also linear -- there are no branches.
Not necessarily. And it is hard to tell what the compiler will emit after doing its optimizations. You could end up with different machine code for the highlevel "compare one byte". Leaking just a tiny bit in a side channel might change your encryption from "basically unbreakable" to "hopefully not worth the money needed for a crack".
If the code which called the function were to immediately branch based upon the result, the use of the constant-time method wouldn't provide much extra security. On the other hand, if one were to call the function on a bunch of different pairs of bytes, keeping a running total of the results, and only branch based upon the final result, then an outside snooper might be able to determine whether that last branch was taken, but wouldn't know which of the previous byte comparisons was responsible for it.
That having been said, I'm not sure I see a whole lot of advantages in most usage cases for going through the trouble of distilling the method's output to a zero or one; simply keeping a running tally of notEqual = (A0 ^ B0); notEqual |= (A1 ^ B1); notEqual |= (A2 ^ B2); ... would achieve the same effect and be much faster.