runtime-error

Mapping over HList raises AbstractMethodError

旧时模样 提交于 2019-12-11 04:38:26
问题 I am trying a shapeless example in REPL and getting a runtime error: scala> import shapeless._ import shapeless._ scala> import shapeless.poly._ import shapeless.poly._ scala> object choose extends (Set ~> Option) { | def apply[T](set: Set[T]) = set.headOption | } defined object choose scala> val sets = Set(1) :: Set(0) :: HNil sets: shapeless.::[scala.collection.immutable.Set[Int],shapeless.::[scala.collection.immutable.Set[Int],shapeless.HNil]] = Set(1) :: Set(0) :: HNil scala> sets map

ClassCastException thrown when calling .asSubclass from separate jar

纵饮孤独 提交于 2019-12-11 04:33:46
问题 I have a program through which I have the following three classes. These first two are in jar1.jar : Main (uses the jar loading trick found here): package prob1; import java.io.IOException; import java.net.URL; import java.net.URLClassLoader; import java.util.ArrayList; import java.util.Enumeration; import java.util.List; import java.util.jar.JarEntry; import java.util.jar.JarFile; public class Main { static List<Class<?>> classes = new ArrayList<Class<?>>(); static String pathToJar = "/Users

Fatal error from incrementing loop

。_饼干妹妹 提交于 2019-12-11 03:38:39
问题 Currently, I'm trying to make a function that sorts a vector full of fighters in the function sortFighters in the Fighter.cpp file. It all seems to compile correctly; However, when it does run, I get a fatal error in one of the lines of the aformentioned .cpp file. I know exactly what the problem is, and put a comment there accordingly. So, what I'm asking here, is what I might do to fix this problem without adding any other functions and such. Here's my Fighter.h file: #ifndef FIGHTER_H

FLASK Import error with request module

允我心安 提交于 2019-12-11 03:36:50
问题 PREFACE Hello all I am getting a very strange error when I am trying to use the flask module for python... First let me explain that I first started writing the program and then it stopped working NO PROBLEM My last copy should work... Right? After I tried to revert back to 2 versions before the current versions code I was still getting the same error I have done everything I can think of doing now it is time to give it to the professionals Ok so what is happening is that when I try to run my

Segmentation fault when byte coding a function? [duplicate]

倾然丶 夕夏残阳落幕 提交于 2019-12-11 03:35:57
问题 This question already has answers here : How to call machine code stored in char array? (7 answers) Closed 3 years ago . I get a segmentation fault when I run the following C program (compiled with gcc in Ubuntu). #include <stdio.h> char f[] = "\x55\x48\x89\xe5\x48\x89\x7d\xf8\x48\x89\x75\xf0\x48\x8b\x45\xf8\x8b\x10\x48\x8b\x45\xf0\x8b\x00\x89\xd1\x29\xc1\x89\xc8\xc9\xc3"; int main() { int (*func)(); func = (int (*)()) f; int x=3,y=5; printf("%d\n",(int)(*func)(&x,&y)); return 0; } The string

Newbie Android Error: java.lang.NoClassDefFoundError: android.content.ClipboardManager

放肆的年华 提交于 2019-12-11 03:17:00
问题 In my Android app, I happen to use the following code to copy text from a TextView. buttonCopy.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { String copyText; copyText = textBox2.getText().toString(); myClip = ClipData.newPlainText("text", copyText); myClipboard.setPrimaryClip(myClip); Toast.makeText(getApplicationContext(), "Copied", Toast.LENGTH_SHORT).show(); } }); The minimum API level that I set for my app is API level 10. But I understand that

runtime error in Haskell

跟風遠走 提交于 2019-12-11 03:12:28
问题 My program is searching in list of tuples I wrote it as the following import List data BookInfo = Book Int String [String] deriving(Show) enter :: Int->String->[String]->BookInfo enter id name subject=Book id name subject bookId (Book id _ _ ) = id index :: BookInfo -> Int index (Book id name subject) = bookId (Book id name subject) arrayentering ::BookInfo->[BookInfo]->[BookInfo] arrayentering (Book id name subject) [] =[(Book id name subject)] arrayentering (Book _ " " [" "]) [] =[]

Python Import Error - Run unittest

。_饼干妹妹 提交于 2019-12-11 02:49:26
问题 Why am I getting import error for a module I have in the project. All the packages are under the project, they all have __init __.py and other scripts do not give the same error. Python version is 3.6. Code was written in Unix environment. Here is the import error I get. I am trying to run a test here. Ran 1 test in 0.001s FAILED (errors=1) Error Traceback (most recent call last): File "/usr/lib/python3.6/unittest/case.py", line 59, in testPartExecutor yield File "/usr/lib/python3.6/unittest

runtime error (NZEC) Java SPOJ

自古美人都是妖i 提交于 2019-12-11 02:48:21
问题 I'm trying to do a SPOJ problem called Prime Generator. Although the output works on my computer it doesn't work when I try to run it on SPOJ. The following error message occurs. Error: runtime error (NZEC) Can you help me find what it is? import java.util.BitSet; import java.util.Scanner; class Prime_generator { public static void main(String[] args) { Scanner input=new Scanner(System.in); int number_of_entries=input.nextInt(); int [] entries=new int[number_of_entries*2]; for(int i=0;i

Find text in PowerPoint and Replace with text from a cell in excel using VBA, but keep getting Run-time error '-2147024809 (80070057)'

大城市里の小女人 提交于 2019-12-11 02:46:29
问题 I'm trying to find and replace a list of words inside a PowerPoint slide with values from cells in an Excel file. I'm running the VBA on PowerPoint and it keeps giving this error Run-time error '-2147024809 (80070057)': The specified value is out of range. The code seems to stop at this line (the first one): Set ShpTxt = shp.TextFrame.TextRange Please help! I've been going through the other posts that have similar purposes and errors and tried about 20 different combinations, from both the