Dump your code and share it

Codedump.io let's you dump code and share it with anyone you'd like.

Looping over list of list division

If I have a list of lists, for example, [[1, 2, 3], [4, 5, 6], [7, 8, 9], [0,0,0]] How do I output a list of lists, such that each element is assi...
1 minute ago by Mat.S

dbus cannot find compiz service through python

Ok, just so you know, I haven't worked with dbus or perl much, so I might say some things that are off. I'm trying to use dbus to work with compiz pr...
1 minute ago by Jay

Django: ListView with post() method?

I am trying to process two forms in a Django class based view. The site contains a form called form (based on GET) for narrowing the list results of t...
1 minute ago by neurix

Combine $geoNear with Another Collection

I have 2 collections, resto and meal (each meal document has resto id to which it belongs to). I want to fetch nearby restos that have at least 1 meal...
5 minutes ago by John Lee

Queue Resque Jobs from NodeJS

I want to queue Resque jobs from NodeJS. Monitoring Redis commands I see: 1346127083.495055 "sadd" "resque:w:tasks:queues" "facebook" 1346127083.4954...
5 minutes ago by CamelCamelCamel

login returns no user but I have users in database

I am trying to create a user login system for a website and users can register but when I try to login it shows an error message that there is no user...
5 minutes ago by Asfawz

Eclipse: Failed to load the JNI shared library "C:\Program Files(x86)\Java\jdk1.7.0_15\bin\..\jre\bin\client\jvm.dll

I'm trying to install Eclipse. I have done the following in order to install. Installed JDK 7u15 64 bit (actual download name:jdk-7u15-windows-i586....
11 minutes ago by Alfred Bowley

UIScrollView - Need Constraints for x position/width, Need Constraints for y position/height

I have a view hierarchy that looks like this (based on other answers and Apple's advanced AutoLayout guide for working with UIScrollView): The 2 st...
13 minutes ago by Fourth

How to revert width:100% to just the length of the text?

The blue background is 100% width and I just want it to be as wide as the text. https://codepen.io/TylerL-uxai/pen/gRxMqG .ux { position: abs...
17 minutes ago by user6582640

Linker segmentation fault while compiling arduino in eclipse

I am trying to build arduino code in Eclipse. I was able to build ArduinoCore fine. But while building the application, I am getting a segmentation f...
19 minutes ago by harsh

Targeting .NET Core 2.0

I just create a simple ClassLibrary project with VS2017 preview 2.1. I create using .NET Core project template. When I check in project details, I se...
19 minutes ago by Robert II

Binding margin of a textbox in Usercontrol

I want to add a bunch of textbox by using a usercontrol with random margins in a datagrid. To do that I tried to bind margin in usercontrol and add t...
19 minutes ago by Mehrdad Kamali

GCC compiles with warning: unknown escape sequence: '\040'

I am new to c programming. Here is my code: int main() { char *loc = " E:\ "; return 0; } The program compiles successfully with a warn...
19 minutes ago by Dr.pK

DropDownList SelectedIndexChanged not firing (yes, AutoPostBack="true")

I hate to put another one of these up here, but the 20 other questions of this type have been answered with "set AutoPostBack="true"", which I've alre...
21 minutes ago by Logan Black

Set programatically the width of a specific number of datagridview columns in vb net

I have a datagridview with a number of columns that can be preset via a textbox. The first four columns have a determined width. I am trying to set th...
27 minutes ago by Dom

Add disabled to select field with reactjs proptype

React JSX
I'm trying to disable a select field by adding disabled to the select field as per the bootstrap documentation suggests. I'm using reactjs, so I want ...
33 minutes ago by bp123

boto3 start/stop RDS instance with AWS Lambda

While trying to start and stop RDS instances with boto3 on AWS Lambda, I am getting an interesting error - 'RDS' object has no attribute 'stop_db_inst...
35 minutes ago by Lech Migdal

Pandas : Getting indexes of a series providing multiple filters

I am iterating over a dataframe. In each iteration, I need to get indexes of the series where the value is equal 5 or 4. Following code gives me the i...
35 minutes ago by Malintha

Hi, I just want to know if it's okay to use require_once twice on the same page with a different file (of course). for example

<?php require_once 'db_connect'; require_once 'another_file'; ?> is this feasible? sorry... I'm just new. thanks for the answer in advance fo...
37 minutes ago by Christian Bringino

Creating Json Output Boto3

I have the code below: import boto3 import datetime import json now = datetime.datetime.now() cw = boto3.client('cloudwatch', region_name='sa-east-...
43 minutes ago by Leonardo Gialluisi

JavaScript functions and the new operator

What is the difference between adding a property to a function object vs, adding a property to the objects prototype. See code below. var foo = funct...
45 minutes ago by DarkFm

ReactJS - Passing an element of an array of Objects as props

I am building aReact Application.I have a state array which holds array of blogs. I am rendering each blog using a BlogDisplay component. Following is...
45 minutes ago by Varbi

Why we declare the nested public static class in java, even though its being used in some other places as well?

I was going through the legacy code base and observed that so many places they are using the public static class inside an outer class and nested publ...
45 minutes ago by user7851946

Integer.valueOf() Error ArrayIndexOutOfBoundsException:

String currentLine = reader.readLine(); while (currentLine != null) { String[] studentDetail = currentLine.split("...
45 minutes ago by Camila

Java long number too large error?

Why do I get an int number is too large where the long is assigned to min and max? /* long: The long data type is a 64-bit signed two's complement in...
45 minutes ago by Aaron

Want to see more codedumps? Browse the complete list or start to dump your own code.