Dump your code and share it

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

How datetime.datetime.now() works without internet connection?

Python
In python, by importing datetime module and using various functions of class datetime.datetime we could get basic dates with formatting and even date ...
10 seconds ago

i got some errors in entering updating and fetching from mssql using php

PHP
i got some errors in entering updating and fetching from mssql using php.the php code is below. Warning: mssql_query() [function.mssql-query]: mes...
10 seconds ago

How to get Travis CI to build and test xcode projects hosted on Github?

Objective-C
I have some open source code hosted on github for adding a block based category to UITextField. I have added a .travis.yml file to get travis CI to bu...
1 minute ago

Sorted insert position

Java
Problem statement:Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it w...
1 minute ago

Tikz axis chart outer columns cut off

LaTeX
The outer columns of the following charts are cut off although the diagram is wide enough (axis line style). Setting the diagram's width does not help...
1 minute ago

Transforming a CSV from wide to long format

Python
I have a csv like this: col1,col2,col2_val,col3,col3_val A,1,3,5,6 B,2,3,4,5 and i want to transfer this csv like this : col1,col6,col7,col8 A,Col...
1 minute ago

Show warning message before close window in Java Script

Javascript
I've try this: <body onunload="LogoutNoAsk();"> </body> and the function is: function LogoutNoAsk() { alert("Please press the Logo...
1 minute ago

Put conditions on the php part of a page and display it using AJAX

PHP
I want to put conditions like word counter on the php part of my project and display it using AJAX. This is my code so far: <!DOCTYPE html> &lt...
2 minutes ago

Get text when enter is pressed in a text box in wxPython

Python
I have a (single line) TextCtrl. The user types data into this. When they press enter, the contents of the box need to be extracted so they can be pro...
2 minutes ago

HTTP ERROR 500 when using GET or POST

PHP
Here's my PHP: <?php $userTimeZone=$_GET('timezone'); //$userTimeZone=$_POST('timezone'); $date=gmdate(); $date=date_create($date, new DateTimeZon...
2 minutes ago

How to take two count result from second table using mysql JOIN

JSON
Here i have two table (trip_details & trip_member),my requirement is bassed on tripId i want take the employee present count and emplyee absent co...
2 minutes ago

Missing one line after each output while reading a .txt file

Java
After getting a list of installed programs I am writing all of them to a pro.txt file. String filename="C:\\Users\\Zeeshan\\Desktop\\pro.txt"; FileWr...
2 minutes ago

uiswipegesturerecognizerdirectionup and uinavigationcontroller not working?

iOS
I'm working with uiswipegesturerecognizerdirectionup and down. It's working properly but when i add UINavigationController swipe not working. This is ...
2 minutes ago

Getting data from the object, that uses NSURLConnection

Objective-C
I have a class, that gets some data using NSURLConnection. It's method getData creates a request to a server and when some data recieved, method conne...
2 minutes ago

Memory leak in Swift structures - How to fix this?

iOS
I'm developing an application in Swift 2 (Xcode 7 beta 3) and I'm trying to use value types (structs and enums) where possible. According to Apple's d...
3 minutes ago

See svn commit messages/comments when get sync source in eclipse

Java
I work with SVN as source control and commit my codes on it through eclipse. when I go to below path, I see Update/Commit files in Synchronization Tab...
3 minutes ago

Can't link iOS project with il2cpp and Unity

iOS
any of you know what is happening with my project ? There is this error: ld: symbol(s) not found for architecture arm64 Unity Player Settings is...
4 minutes ago

How to paste to terminal linux in virtual box with mac keyboard?

Linux
I'm using Mac and I've installed debian linux on virtual box. I want to copy a URL from my Mac to terminal linux in virtual box. How can I do that?
4 minutes ago

NiFi, flow with KafkaConsumer to write as json

JSON
currently I am stuck on the following problem: I am reading messages from a Kafka Topic using KafkaConsumer. The messages are strings and have the fol...
5 minutes ago

JSTL: Nested forEach loop. Contents not displaying in individual rows

HTML
<table> <c:forEach var="moviesFromAGenre" items="${moviesFromRandomGenres}"> <tr> <c:forEach ...
7 minutes ago

Counting variable name, which will get appended

Javascript
I have some trouble with my web project. I'm looking for a solution how I can count my variable upwards in a loop. So that the name of the variable wi...
7 minutes ago

Compiling Java with multiple classes with javac

Java
Until now I always used an IDE to write my java apps. Now for different reasons, mainly also to understand more about the language and the things the ...
7 minutes ago

How to prevent bold images with UIImageRenderingModeAlwaysTemplate

iOS
My application has a toolbar with image buttons on them (subclass of UIButton); when the user switches on the "Bold text" accessibility option, not on...
8 minutes ago

Bootstrap Navbar Collapsible menu in Mobile View Needs Different hover and active colors

HTML
HOVER AND FOCUS EFFECT NOT WORKING FOR MOBILE VIEW I am facing problems in selecting the hover color and a class kept active in navbar's collapsible ...
9 minutes ago

removeAllObjects crashes app

iOS
I want to clear my array, what i did is, I have tableview view in my app, first i am fetching data from server and loading it in tableView. -(void)v...
9 minutes ago

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