runtime-error

Why is this python code giving NZEC at HackerEarth?

狂风中的少年 提交于 2019-12-12 04:43:07
问题 T = int(raw_input()) for t in xrange(T): N = int(raw_input()) print N+1 print N*(N+1)/2 for x in range(0,N+1): print x, print '' I am getting NZEC for this code on HackerEarth. It is supposed to print the count, sum and nos between a range. Sample Input : 1 // T 12 // N Sample Output : 13 78 0 1 2 3 4 5 6 7 8 9 10 11 12 来源: https://stackoverflow.com/questions/33695107/why-is-this-python-code-giving-nzec-at-hackerearth

os.path.dirname(__file__) doesn't exist? [duplicate]

时光毁灭记忆、已成空白 提交于 2019-12-12 04:36:02
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: os.path.dirname(__file__) returns empty A user of a Python script of mine said they got the following error: Traceback (most recent call last): File "MCManager.py", line 7, in <module> os.chdir(os.path.dirname(__file__)) OSError: [Errno 2] No such file or directory: '' How could the directory the script is in not exist? Is it a compatibility issue? I use the same OS and version as the one with the error, and

Passing a folder location as an SQL parameter in python causes an error

六月ゝ 毕业季﹏ 提交于 2019-12-12 04:17:16
问题 I am fairly new to python and the only SQL I know is from this project so forgive the lack of technical knowledge: def importFolder(self): user = getuser() filename = askopenfilename(title = "Choose an image from the folder to import", initialdir='C:/Users/%s' % user) for i in range (0,len(filename) - 1): if filename[-i] == "/": folderLocation = filename[:len(filename) - i] break cnxn = pyodbc.connect('DRIVER={Microsoft Access Driver (*.mdb, *.accdb)};DBQ=C:\Users\Public

“undefined symbol: rb_Digest_MD5_Init” while running Rails

允我心安 提交于 2019-12-12 03:58:41
问题 I am trying to run Ruby On Rails, but every time I start it (even if I run rails without arguments, when it should display some help) it produces an error: serge1peshcoff@myLaptop:~$ rails /home/serge1peshcoff/.rvm/rubies/ruby-2.2.3/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require': /home/serge1peshcoff/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/x86_64-linux/digest/md5.so: undefined symbol: rb_Digest_MD5_Init - /home/serge1peshcoff/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0

Error when removing from ArrayList

六眼飞鱼酱① 提交于 2019-12-12 03:56:49
问题 I am getting this error when I am trying to remove an item from an arraylist after it collides with something else. Below is my AsyncTask and the logcat error that goes with it. Does anyone see where I am going wrong? Here is my AsyncTask: public class handleCollisions extends AsyncTask<String, Integer, String> { @Override protected String doInBackground(String... arg0) { Enemy tempE; for(int i = 0; i < enemies.size(); i++) { tempE = enemies.get(i); playerR = new Rect((int)x, (int)y, (int)x +

How do I get rid of this RunTimeError when trying some code out of Chapter 12 of the Beginning Ruby book?

吃可爱长大的小学妹 提交于 2019-12-12 03:55:01
问题 Sorry if this is a total newbie question, but I am not sure how to solve this problem. I'm currently getting these errors when I try to run the code below: bot.rb:58:in `rescue in initialize': Can't load bot data (RunTimeError) bot.rb:55:in `initialize' basic_client.rb:3:in `new' basic_client.rb:3:in `<top (required)>' Here is the source code for bot.rb, and the error appears to be at the "@data = YAML.load(File.open(options[:data_file]).read)" part. # A basic implementation of a chatterbot

Custom Python module not importing

守給你的承諾、 提交于 2019-12-12 03:44:24
问题 I can't seem to get past this and do not quite understand what is happening. I have a directory with two class files in it. Using the REPL from within that directory I can import both files and execute their logic. From their parent directory which main() is ran from however, only one class file is visible, pagetable. The project structure is currently, project/ src/ __init__.py # empty pagingsimulation.py # main() imports memory process.py memory/ __init__.py # imports pagetable.py pagetable

SSIS: Why won't my Text Delimiter work?

南笙酒味 提交于 2019-12-12 03:44:09
问题 Originally I had wrote the following: Environment: - SSIS 2012 , Microsoft Visual Studio Files Involved: Destination Manager: OLEDB SQL Server Table Source Manager: FLATFILE - CSV File FORMAT: Delimited HeadRowDelimiter: {CR}{LF} Column Delimiter: Comma {,} Text qualifier: " (manually set) Header rows to skip: 0 Column Width: 100 Column Type: DT_STR My File has the following columns: Year, Lg..., Div Finish, Playoffs, PF, PA...OSRS, DSRS I wish to only retrieve: Year, Lg..., Div Finish,

Android's Garbage Collector appear when trying to render 3D model with Opengl ES20

三世轮回 提交于 2019-12-12 03:35:04
问题 My app renders 3D models via opengl ES2, once at a time. When I enable textures in those model my app crashes. First, I thought that was because the texture images are large, but the truth is that they are not. For instance, in one of the models, I use four .png images of sizes 4kb, 38kb, 39kb, and 200kb respectively. Are they large? I don't think so, but reading the logcat it seems that everything comes from a memory problem: 08-26 02:08:13.574: I/art(10870): Background sticky concurrent

Java - Android SDK - Unfrotunately <project name> has crashed error

馋奶兔 提交于 2019-12-12 03:29:11
问题 I Have been working on a small app, which can calculate complex numbers for me (division, subtraction, multiplying etc.). I have no apparent compile errors, but when i run the program I get a bunch of run-time errors which I can't understand or know how to fix. Am i missing something obvious? This is my code: package complex.OliverV; import android.app.Activity; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.TextView; import android