Questions tagged [garbage]

Garbage, refers to objects, data, or other regions of the memory of a computer system (or other system resources), which will not be used in any future computation by the system, or by a program running on it.

From a programming point-of-view, garbage is data that has been placed in random access memory space obtained from the operating system that is no longer needed. Freeing the space for reuse is called "garbage collecting".

448 questions
4
votes
0 answers

python r+ read write read writes garbage to a file

Could anyone explain why the following problem occurs. In Python 2.7.12 when reading, writing and subsequently reading again from a file, python seems to write garbage. for example when running this in python IDLE: import os testPath =…
Jan
  • 91
  • 5
4
votes
1 answer

Removing Metatables from a table in Lua

I want to "unhook" a metatable from a table and was wondering if: tbl = setmetatable(tbl, false) -- or nil is the correct way to do this? I could not find any info about how to do it correctly. Do I need to use an assignment operator? Also, would…
Mayron
  • 2,146
  • 4
  • 25
  • 51
4
votes
4 answers

Roman numbers to decimal numbers, getting garbage value

I have to create a program for converting Roman numerals to decimal numbers for which I'm getting garbage value as an output. The fact is I have double checked my logic and it seems to be correct. How can I correct it? Here's my…
Sahil Dhawan
  • 91
  • 2
  • 14
4
votes
5 answers

iOS JSON Error: NSDebugDescription=Garbage at end

This is a really weird bug, when grabbing JSON from my server (which is produced via PHP), I get this error when calling: json = [NSJSONSerialization JSONObjectWithData:kivaData options:kNilOptions …
4
votes
1 answer

Python memory management - dictionary

I have a dictionary saved in a file. I load the dictionary into memory from a python interactive shell, and my system monitor says that the python process consumes 4GB. The following commands give the following outputs: size1 =…
tk66
  • 274
  • 7
  • 20
3
votes
1 answer

file_get_contents() with modified HTTP headers returning garbage html output

The following code is being used to extract html using SIMPLETHTMLDOM parser for php. include('simple_html_dom.php'); $context = stream_context_create(array( 'http'=>array( 'method'=>"GET", 'header'=>"Accept:…
Sandy505
  • 888
  • 3
  • 15
  • 26
3
votes
2 answers

Garbage collection None - del difference

Is there any logical difference between a = None and del a in python? The None keyword is used to define a null variable or an object. In python, None keyword is an object, and it is a data type of the class NoneType . The del keyword is used to…
3
votes
0 answers

Reference cycles when using inspect module

The documentation says: Note Keeping references to frame objects, as found in the first element of the frame records these functions return, can cause your program to create reference cycles. Once a reference cycle has been created, the lifespan of…
x-yuri
  • 16,722
  • 15
  • 114
  • 161
3
votes
1 answer

Getting roots for Mark Sweep Garbage Collector C++

My goal is to create simple mark-sweep garbage collector in C++ language. First step in mark phase is to get all roots(thread stacks, global variables ...). So, how can i get or find that roots in my c++ code?
branishko
  • 43
  • 3
3
votes
0 answers

Clojure error- GC overhead limit exceeded using reducer with lazy sequence

; Test 1 - Using Map Reduce (Successful) (ns example (:gen-class)) (require '[clojure.core.reducers :as r]) (def n 100000000000) (time (println "map: " (reduce + 0N (map inc (range n))))) I get: map: 5000000000050000000000N "Elapsed time:…
DarrylG
  • 16,732
  • 2
  • 17
  • 23
3
votes
3 answers

C - garbage characters even with null terminator, structures

So as part of a school assignment I have to create an application to handle the input of various fields using a structure. defined outside of main as following typedef struct stud { struct number { int studNum; } number; struct…
3
votes
1 answer

Finding source of garbage value

So I've made a custom code to remove spaces from a string. But when I ran it, if there's no input, the second string will give 3 garbage values, and if there are too many spaces, the code will sometimes add a space string on its own. I just can't…
3
votes
4 answers

PHP generated Excel file is different when downloaded

I have a PHP file that generates xls files using the module found at http://pear.php.net/package/Spreadsheet_Excel_Writer/ I can create the sample document just fine and when I open it, it looks fine. My next step it to turn it into a downloadable…
Matthew
  • 474
  • 1
  • 6
  • 12
3
votes
4 answers

Javascript Game - Waste Management between IIFEs

Overview Hi All! - I'm creating a side scroller space shooter (similar to games of old, still learning!) - and I'm wondering how to better manage my objects in order to prevent wasted resources! So, In my code, I have created an IIFE for the Player…
Lewis
  • 3,479
  • 25
  • 40
3
votes
5 answers

How to solve default garbage values in C?

If we declare a variable in the C programming as integer without defining value then printf prints some garbage value from buffer. Is there any method to prevent printing the garbage value? I want to check if something can be done at compile time?…
1 2
3
29 30