Are you over 18 and want to see adult content?
More Annotations

A complete backup of xn--90acilohkgzki6e.xn--p1ai
Are you over 18 and want to see adult content?

A complete backup of soc-neuro-onc.org
Are you over 18 and want to see adult content?

A complete backup of monacochannel.mc
Are you over 18 and want to see adult content?

A complete backup of speicherstadtmuseum.de
Are you over 18 and want to see adult content?

A complete backup of modernartoxford.org.uk
Are you over 18 and want to see adult content?

A complete backup of institutoaware.com.br
Are you over 18 and want to see adult content?
Favourite Annotations

A complete backup of https://bridgford.com
Are you over 18 and want to see adult content?

A complete backup of https://simplemoneylyfe.com
Are you over 18 and want to see adult content?

A complete backup of https://embedgooglemap.org
Are you over 18 and want to see adult content?

A complete backup of https://cebutraveller.com
Are you over 18 and want to see adult content?

A complete backup of https://dotrust.org
Are you over 18 and want to see adult content?

A complete backup of https://medium.design
Are you over 18 and want to see adult content?

A complete backup of https://thetownofcicero.com
Are you over 18 and want to see adult content?

A complete backup of https://idea.gov.uk
Are you over 18 and want to see adult content?

A complete backup of https://detroitmi.gov
Are you over 18 and want to see adult content?

A complete backup of https://kissfaq.com
Are you over 18 and want to see adult content?

A complete backup of https://beastinblack.com
Are you over 18 and want to see adult content?

A complete backup of https://wasatchacademy.org
Are you over 18 and want to see adult content?
Text
LET'S TALK DATA
Loading the game. To load the game, we basically have to do the same process in reverse. So we’ll check to see if the save files exist, and if they do, transform the data into the game objects. Since we need to handle new games and saved games, I renamed the play method to game_loop and created a MODIFYING A TIFF IMAGE IN-PLACE USING JAVA Modifying a TIFF Image In-Place using Java. TIFF files can be notoriously large, mostly due to their ability to store multiple images in one file. A standard TIFF can be up to 4GB in size, but the BigTiff goes beyond that supporting absurdly large amounts of data. I needed to modify the header metadata of a TIFF file, but the librariesI found
HOW TO WRITE A TEXT ADVENTURE IN PYTHON Phillip March 1, 2015 at 11:29 am. I have a strong feeling you are trying to run this using Python 2. The super() method was introduced in Python 3. Depending on how you have Python installed, running python at the command line could open a 2.x.x version and running python3 could open a 3.x.x version. It really depends on how you havethings configured.
HOW TO WRITE A TEXT ADVENTURE IN PYTHON PART 3: PLAYER The player can move in four directions: north, south, east, and west. To avoid repeating ourselves, we have a basic move method that takes care of actually changing the player’s position and then we have four convenience methods that use the common move method. Now we can simply refer to move_south without specifically trying to remember if y should be positive or negative, for example. HOW TO WRITE A TEXT ADVENTURE IN PYTHON PART 1: ITEMS AND Start by creating a new directory called adventuretutorial and create a blank file called __init__.py. This tells the Python compiler that adventuretutorial is a Python package which contains modules. Go ahead and create your first module in this same directory called items.py. The first class we are going to create is the Item class. HOW TO COMBINE SCALA PATTERN MATCHING WITH REGEX Scala’s pattern matching is arguably one of its most powerful features and is straight-forward to use when matching on patterns like x::xs vs. x vs. Nil, but you can also use it to match regular expressions.This short tutorial will show you how to use pattern matching and regex to parse a simple DSL for filtering search results. JAVA BUILD TOOLS: ANT VS. MAVEN VS. GRADLE Summary. Gradle brings a lot of flexibility and power to the Java build ecosystem. Of course, there is always some danger with highly customizable tools--suddenly you have to be aware of code quality in your build file. This is not necessarily bad, but worth considering when evaluating how your team will use the HOW TO USE PYTHON GENERATORS TO SAVE MEMORY It was a pretty short script, but it contained the following function: 1. 2. 3. def generate (): charlist = "abcdefghijklmnopqrstuvwxyz".return
Needless to say, I think I found the memory problem. This functionreturns
N-QUEENS PART 1: STEEPEST HILL CLIMBING N-Queens Part 1: Steepest Hill Climbing. The n-queens problem was first invented in the mid 1800s as a puzzle for people to solve in their spare time, but now serves as a good tool for discussing computer search algorithms. In chess, a queen is the only piece that can attack in any direction. POSTGRESQL GENERATE_SERIES() TRICKS Before my current job, I actually had not heard of PostgreSQL. But it turns out to actually be a pretty prominent SQL server.. There are some weird quirks to Postgres and the management tools are pretty meh compared to SQL Server Management Studio, but there are a lot of neat features I keep bumping into. One such feature is the generate_series() function.LET'S TALK DATA
Loading the game. To load the game, we basically have to do the same process in reverse. So we’ll check to see if the save files exist, and if they do, transform the data into the game objects. Since we need to handle new games and saved games, I renamed the play method to game_loop and created a MODIFYING A TIFF IMAGE IN-PLACE USING JAVA Modifying a TIFF Image In-Place using Java. TIFF files can be notoriously large, mostly due to their ability to store multiple images in one file. A standard TIFF can be up to 4GB in size, but the BigTiff goes beyond that supporting absurdly large amounts of data. I needed to modify the header metadata of a TIFF file, but the librariesI found
HOW TO WRITE A TEXT ADVENTURE IN PYTHON Phillip March 1, 2015 at 11:29 am. I have a strong feeling you are trying to run this using Python 2. The super() method was introduced in Python 3. Depending on how you have Python installed, running python at the command line could open a 2.x.x version and running python3 could open a 3.x.x version. It really depends on how you havethings configured.
HOW TO WRITE A TEXT ADVENTURE IN PYTHON PART 3: PLAYER The player can move in four directions: north, south, east, and west. To avoid repeating ourselves, we have a basic move method that takes care of actually changing the player’s position and then we have four convenience methods that use the common move method. Now we can simply refer to move_south without specifically trying to remember if y should be positive or negative, for example. HOW TO WRITE A TEXT ADVENTURE IN PYTHON PART 1: ITEMS AND Start by creating a new directory called adventuretutorial and create a blank file called __init__.py. This tells the Python compiler that adventuretutorial is a Python package which contains modules. Go ahead and create your first module in this same directory called items.py. The first class we are going to create is the Item class. HOW TO COMBINE SCALA PATTERN MATCHING WITH REGEX Scala’s pattern matching is arguably one of its most powerful features and is straight-forward to use when matching on patterns like x::xs vs. x vs. Nil, but you can also use it to match regular expressions.This short tutorial will show you how to use pattern matching and regex to parse a simple DSL for filtering search results. JAVA BUILD TOOLS: ANT VS. MAVEN VS. GRADLE Summary. Gradle brings a lot of flexibility and power to the Java build ecosystem. Of course, there is always some danger with highly customizable tools--suddenly you have to be aware of code quality in your build file. This is not necessarily bad, but worth considering when evaluating how your team will use the HOW TO USE PYTHON GENERATORS TO SAVE MEMORY It was a pretty short script, but it contained the following function: 1. 2. 3. def generate (): charlist = "abcdefghijklmnopqrstuvwxyz".return
Needless to say, I think I found the memory problem. This functionreturns
N-QUEENS PART 1: STEEPEST HILL CLIMBING N-Queens Part 1: Steepest Hill Climbing. The n-queens problem was first invented in the mid 1800s as a puzzle for people to solve in their spare time, but now serves as a good tool for discussing computer search algorithms. In chess, a queen is the only piece that can attack in any direction. POSTGRESQL GENERATE_SERIES() TRICKS Before my current job, I actually had not heard of PostgreSQL. But it turns out to actually be a pretty prominent SQL server.. There are some weird quirks to Postgres and the management tools are pretty meh compared to SQL Server Management Studio, but there are a lot of neat features I keep bumping into. One such feature is the generate_series() function. ABOUT – LET'S TALK DATA About. Data is everywhere and is becoming increasingly easier to access, but there are still challenges to making sense of it and putting it to use. Part of what I do for a living is translate data into actionable information, but my interests often lead me to exploring and analyzing data on my own. Data analysis intersects withstatistics
RECOMMENDED MATERIALS Considered the premiere statistical software by many, R is a complete environment for data analysis, statistical modeling, and visualization. Additionally, it is free, open-source, and has a very active community. The learning curve is steep, but worth it. ggplot2. Although it is just an R library, I feel the need to mention it. HOW TO WRITE A TEXT ADVENTURE IN PYTHON APPENDIX A: SAVING The pickle.dump method converts an object to a binary format for Python. The first parameter is the object to save and the second parameter specifies where to save the object. We need to create a save for both the world itself (tiles) and the player. HOW TO WRITE A TEXT ADVENTURE IN PYTHON PART 4: THE GAME This is an abbreviated version of the book Make Your Own Python Text Adventure.. The end is near, we’re almost ready to play the game! We’ll finish this series by implementing the game loop and receiving input from the human player. HOW TO WRITE A TEXT ADVENTURE IN PYTHON PART 1: ITEMS AND Start by creating a new directory called adventuretutorial and create a blank file called __init__.py. This tells the Python compiler that adventuretutorial is a Python package which contains modules. Go ahead and create your first module in this same directory called items.py. The first class we are going to create is the Item class. CREATING VORONOI DIAGRAMS WITH GGPLOT A Voronoi diagram (or tessellation) is neat way of visualizing spatial data. It essentially allows us to see the areas that are closest to a set of locations. For example, this map shows all of the Criagslist localities and the regions closest to each Craigslist locality. More JAVA BUILD TOOLS: ANT VS. MAVEN VS. GRADLE Summary. Gradle brings a lot of flexibility and power to the Java build ecosystem. Of course, there is always some danger with highly customizable tools--suddenly you have to be aware of code quality in your build file. This is not necessarily bad, but worth considering when evaluating how your team will use the HOW TO WRITE A TEXT ADVENTURE IN PYTHON PART 2: THE WORLD This is an abbreviated version of the book Make Your Own Python Text Adventure.. All games take place in some sort of world. The world can be as simple as a chess board or as complex as the Mass Effect universe and provides the foundation for the game as a whole. All elements of a game reside in the world and some elements interact withthe world.
GETTING GPS DATA FROM ANDROID Because Android’s source code is open, there are a lot of goodies that anyone with an Android device and Google’s development kit can explore. I was digging through the API section regarding location services when I found the method getSatellites().How can you resist a method that sounds that cool? BACH AND MOZART BY THE NOTES Bach’s pieces often modulate through different keys even from one measure to the next so we see more instances of D♯ and G♯, for example. Mozart on the other hand sticks more closely to the notes of the title key (G major). However, Mozart makes a lot more use of E which can be a major sixth or a relative minor first depending on howit
LET'S TALK DATA
Loading the game. To load the game, we basically have to do the same process in reverse. So we’ll check to see if the save files exist, and if they do, transform the data into the game objects. Since we need to handle new games and saved games, I renamed the play method to game_loop and created a BOOKS – LET'S TALK DATA Java for the Real World. Java for the Real World is the perfect book for anyone starting their Java career. Learning the language was easy, but now you need to learn the ecosystem. Whether you are a recent graduate or a professional starting a new project, this book will MODIFYING A TIFF IMAGE IN-PLACE USING JAVA Modifying a TIFF Image In-Place using Java. TIFF files can be notoriously large, mostly due to their ability to store multiple images in one file. A standard TIFF can be up to 4GB in size, but the BigTiff goes beyond that supporting absurdly large amounts of data. I needed to modify the header metadata of a TIFF file, but the librariesI found
HOW TO WRITE A TEXT ADVENTURE IN PYTHON Phillip March 1, 2015 at 11:29 am. I have a strong feeling you are trying to run this using Python 2. The super() method was introduced in Python 3. Depending on how you have Python installed, running python at the command line could open a 2.x.x version and running python3 could open a 3.x.x version. It really depends on how you havethings configured.
HOW TO COMBINE SCALA PATTERN MATCHING WITH REGEX Scala’s pattern matching is arguably one of its most powerful features and is straight-forward to use when matching on patterns like x::xs vs. x vs. Nil, but you can also use it to match regular expressions.This short tutorial will show you how to use pattern matching and regex to parse a simple DSL for filtering search results. HOW TO WRITE A TEXT ADVENTURE IN PYTHON PART 3: PLAYER The player can move in four directions: north, south, east, and west. To avoid repeating ourselves, we have a basic move method that takes care of actually changing the player’s position and then we have four convenience methods that use the common move method. Now we can simply refer to move_south without specifically trying to remember if y should be positive or negative, for example. HOW TO WRITE A TEXT ADVENTURE IN PYTHON PART 1: ITEMS AND Start by creating a new directory called adventuretutorial and create a blank file called __init__.py. This tells the Python compiler that adventuretutorial is a Python package which contains modules. Go ahead and create your first module in this same directory called items.py. The first class we are going to create is the Item class. JAVA BUILD TOOLS: ANT VS. MAVEN VS. GRADLE Summary. Gradle brings a lot of flexibility and power to the Java build ecosystem. Of course, there is always some danger with highly customizable tools--suddenly you have to be aware of code quality in your build file. This is not necessarily bad, but worth considering when evaluating how your team will use the HOW TO USE PYTHON GENERATORS TO SAVE MEMORY It was a pretty short script, but it contained the following function: 1. 2. 3. def generate (): charlist = "abcdefghijklmnopqrstuvwxyz".return
Needless to say, I think I found the memory problem. This functionreturns
N-QUEENS PART 1: STEEPEST HILL CLIMBING N-Queens Part 1: Steepest Hill Climbing. The n-queens problem was first invented in the mid 1800s as a puzzle for people to solve in their spare time, but now serves as a good tool for discussing computer search algorithms. In chess, a queen is the only piece that can attack in any direction.LET'S TALK DATA
Loading the game. To load the game, we basically have to do the same process in reverse. So we’ll check to see if the save files exist, and if they do, transform the data into the game objects. Since we need to handle new games and saved games, I renamed the play method to game_loop and created a BOOKS – LET'S TALK DATA Java for the Real World. Java for the Real World is the perfect book for anyone starting their Java career. Learning the language was easy, but now you need to learn the ecosystem. Whether you are a recent graduate or a professional starting a new project, this book will MODIFYING A TIFF IMAGE IN-PLACE USING JAVA Modifying a TIFF Image In-Place using Java. TIFF files can be notoriously large, mostly due to their ability to store multiple images in one file. A standard TIFF can be up to 4GB in size, but the BigTiff goes beyond that supporting absurdly large amounts of data. I needed to modify the header metadata of a TIFF file, but the librariesI found
HOW TO WRITE A TEXT ADVENTURE IN PYTHON Phillip March 1, 2015 at 11:29 am. I have a strong feeling you are trying to run this using Python 2. The super() method was introduced in Python 3. Depending on how you have Python installed, running python at the command line could open a 2.x.x version and running python3 could open a 3.x.x version. It really depends on how you havethings configured.
HOW TO COMBINE SCALA PATTERN MATCHING WITH REGEX Scala’s pattern matching is arguably one of its most powerful features and is straight-forward to use when matching on patterns like x::xs vs. x vs. Nil, but you can also use it to match regular expressions.This short tutorial will show you how to use pattern matching and regex to parse a simple DSL for filtering search results. HOW TO WRITE A TEXT ADVENTURE IN PYTHON PART 3: PLAYER The player can move in four directions: north, south, east, and west. To avoid repeating ourselves, we have a basic move method that takes care of actually changing the player’s position and then we have four convenience methods that use the common move method. Now we can simply refer to move_south without specifically trying to remember if y should be positive or negative, for example. HOW TO WRITE A TEXT ADVENTURE IN PYTHON PART 1: ITEMS AND Start by creating a new directory called adventuretutorial and create a blank file called __init__.py. This tells the Python compiler that adventuretutorial is a Python package which contains modules. Go ahead and create your first module in this same directory called items.py. The first class we are going to create is the Item class. JAVA BUILD TOOLS: ANT VS. MAVEN VS. GRADLE Summary. Gradle brings a lot of flexibility and power to the Java build ecosystem. Of course, there is always some danger with highly customizable tools--suddenly you have to be aware of code quality in your build file. This is not necessarily bad, but worth considering when evaluating how your team will use the HOW TO USE PYTHON GENERATORS TO SAVE MEMORY It was a pretty short script, but it contained the following function: 1. 2. 3. def generate (): charlist = "abcdefghijklmnopqrstuvwxyz".return
Needless to say, I think I found the memory problem. This functionreturns
N-QUEENS PART 1: STEEPEST HILL CLIMBING N-Queens Part 1: Steepest Hill Climbing. The n-queens problem was first invented in the mid 1800s as a puzzle for people to solve in their spare time, but now serves as a good tool for discussing computer search algorithms. In chess, a queen is the only piece that can attack in any direction. BOOKS – LET'S TALK DATA Java for the Real World. Java for the Real World is the perfect book for anyone starting their Java career. Learning the language was easy, but now you need to learn the ecosystem. Whether you are a recent graduate or a professional starting a new project, this book will ABOUT – LET'S TALK DATA About. Data is everywhere and is becoming increasingly easier to access, but there are still challenges to making sense of it and putting it to use. Part of what I do for a living is translate data into actionable information, but my interests often lead me to exploring and analyzing data on my own. Data analysis intersects withstatistics
RECOMMENDED MATERIALS Considered the premiere statistical software by many, R is a complete environment for data analysis, statistical modeling, and visualization. Additionally, it is free, open-source, and has a very active community. The learning curve is steep, but worth it. ggplot2. Although it is just an R library, I feel the need to mention it. HOW TO WRITE A TEXT ADVENTURE IN PYTHON APPENDIX A: SAVING The pickle.dump method converts an object to a binary format for Python. The first parameter is the object to save and the second parameter specifies where to save the object. We need to create a save for both the world itself (tiles) and the player. HOW TO WRITE A TEXT ADVENTURE IN PYTHON PART 1: ITEMS AND Start by creating a new directory called adventuretutorial and create a blank file called __init__.py. This tells the Python compiler that adventuretutorial is a Python package which contains modules. Go ahead and create your first module in this same directory called items.py. The first class we are going to create is the Item class. POSTGRESQL GENERATE_SERIES() TRICKS Before my current job, I actually had not heard of PostgreSQL. But it turns out to actually be a pretty prominent SQL server.. There are some weird quirks to Postgres and the management tools are pretty meh compared to SQL Server Management Studio, but there are a lot of neat features I keep bumping into. One such feature is the generate_series() function. N-QUEENS PART 3: SUCCESS N-Queens Part 3: Success. In the last two posts we explored three different algorithms for solving the n-queens problem. If we wanted to actually implement one of them, we would need to consider which one performs the best. However, performance can be measured in a number ofways.
GETTING GPS DATA FROM ANDROID Because Android’s source code is open, there are a lot of goodies that anyone with an Android device and Google’s development kit can explore. I was digging through the API section regarding location services when I found the method getSatellites().How can you resist a method that sounds that cool? HOW TO HIDE TEXT IN A BMP USING PYTHON First we need to be able to break down the text data into bits: Then we need a method that will alter an arbitrary byte by setting its last bit to 1 or 0, given a parameter. To extract the “D” from the image, we simply reverse the process. First we extract the final bit from each byte in the image. BACH AND MOZART BY THE NOTES Bach’s pieces often modulate through different keys even from one measure to the next so we see more instances of D♯ and G♯, for example. Mozart on the other hand sticks more closely to the notes of the title key (G major). However, Mozart makes a lot more use of E which can be a major sixth or a relative minor first depending on howit
LET'S TALK DATA
The pickle.dump method converts an object to a binary format for Python. The first parameter is the object to save and the second parameter specifies where to save the object. We need to create a save for both the world itself (tiles) and the player. BOOKS – LET'S TALK DATA Java for the Real World is the perfect book for anyone starting their Java career. Learning the language was easy, but now you need to learnthe ecosystem.
MODIFYING A TIFF IMAGE IN-PLACE USING JAVA TIFF files can be notoriously large, mostly due to their ability to store multiple images in one file. A standard TIFF can be up to 4GB in size, but the BigTiff goes beyond that HOW TO WRITE A TEXT ADVENTURE IN PYTHON Phillip March 1, 2015 at 11:29 am. I have a strong feeling you are trying to run this using Python 2. The super() method was introduced in Python 3. Depending on how you have Python installed, running python at the command line could open a 2.x.x version and running python3 could open a 3.x.x version. It really depends on how you havethings configured.
HOW TO COMBINE SCALA PATTERN MATCHING WITH REGEX Scala’s pattern matching is arguably one of its most powerful features and is straight-forward to use when matching on patterns like x::xs vs. x vs. Nil, but you can also use it to match regular expressions.This short tutorial will show you how to use pattern matching and regex to parse a simple DSL for filtering search results. JAVA BUILD TOOLS: ANT VS. MAVEN VS. GRADLE This is an abbreviated chapter from my book Java for the Real World.Want more content like this? Click here to get the book!. For anything but the most trivial applications, compiling Java from the command line is an exercise in masochism. HOW TO WRITE A TEXT ADVENTURE IN PYTHON PART 1: ITEMS AND This class has just two methods, but we’re going to see them pop up a lot. The __init__ method is the constructor and it is called whenever a new object is created. The __str__ method is usually a convenience for programmers as it allows us to print an object and see some useful information. Without a __str__ method, calling print() on an object will display something unhelpful like N-QUEENS PART 1: STEEPEST HILL CLIMBING Phillip August 26, 2015 at 9:42 pm. Thanks, I’ve updated the diagram to show a correct solution. Thankfully, this was just a diagram and doesn’t have any bearing on the code in the post. HOW TO WRITE A TEXT ADVENTURE IN PYTHON PART 3: PLAYER The player can move in four directions: north, south, east, and west. To avoid repeating ourselves, we have a basic move method that takes care of actually changing the player’s position and then we have four convenience methods that use the common move method. Now we can simply refer to move_south without specifically trying to remember if y should be positive or negative, for example. HOW TO USE PYTHON GENERATORS TO SAVE MEMORY I recently saw a Reddit thread where someone was asking for help managing memory in Python. It was a pretty short script, but it contained the following function:LET'S TALK DATA
The pickle.dump method converts an object to a binary format for Python. The first parameter is the object to save and the second parameter specifies where to save the object. We need to create a save for both the world itself (tiles) and the player. BOOKS – LET'S TALK DATA Java for the Real World is the perfect book for anyone starting their Java career. Learning the language was easy, but now you need to learnthe ecosystem.
MODIFYING A TIFF IMAGE IN-PLACE USING JAVA TIFF files can be notoriously large, mostly due to their ability to store multiple images in one file. A standard TIFF can be up to 4GB in size, but the BigTiff goes beyond that HOW TO WRITE A TEXT ADVENTURE IN PYTHON Phillip March 1, 2015 at 11:29 am. I have a strong feeling you are trying to run this using Python 2. The super() method was introduced in Python 3. Depending on how you have Python installed, running python at the command line could open a 2.x.x version and running python3 could open a 3.x.x version. It really depends on how you havethings configured.
HOW TO COMBINE SCALA PATTERN MATCHING WITH REGEX Scala’s pattern matching is arguably one of its most powerful features and is straight-forward to use when matching on patterns like x::xs vs. x vs. Nil, but you can also use it to match regular expressions.This short tutorial will show you how to use pattern matching and regex to parse a simple DSL for filtering search results. JAVA BUILD TOOLS: ANT VS. MAVEN VS. GRADLE This is an abbreviated chapter from my book Java for the Real World.Want more content like this? Click here to get the book!. For anything but the most trivial applications, compiling Java from the command line is an exercise in masochism. HOW TO WRITE A TEXT ADVENTURE IN PYTHON PART 1: ITEMS AND This class has just two methods, but we’re going to see them pop up a lot. The __init__ method is the constructor and it is called whenever a new object is created. The __str__ method is usually a convenience for programmers as it allows us to print an object and see some useful information. Without a __str__ method, calling print() on an object will display something unhelpful like N-QUEENS PART 1: STEEPEST HILL CLIMBING Phillip August 26, 2015 at 9:42 pm. Thanks, I’ve updated the diagram to show a correct solution. Thankfully, this was just a diagram and doesn’t have any bearing on the code in the post. HOW TO WRITE A TEXT ADVENTURE IN PYTHON PART 3: PLAYER The player can move in four directions: north, south, east, and west. To avoid repeating ourselves, we have a basic move method that takes care of actually changing the player’s position and then we have four convenience methods that use the common move method. Now we can simply refer to move_south without specifically trying to remember if y should be positive or negative, for example. HOW TO USE PYTHON GENERATORS TO SAVE MEMORY I recently saw a Reddit thread where someone was asking for help managing memory in Python. It was a pretty short script, but it contained the following function: BOOKS – LET'S TALK DATA Java for the Real World is the perfect book for anyone starting their Java career. Learning the language was easy, but now you need to learnthe ecosystem.
ABOUT – LET'S TALK DATA Data is everywhere and is becoming increasingly easier to access, but there are still challenges to making sense of it and putting it to use. Part of what I do for a living is translate data into actionable information, but my interests often lead me to exploring and analyzing data on my own.. Data analysis intersects with statistics, visualization, programming, and other fields. RECOMMENDED MATERIALS This is a non-exhaustive list of materials that I have used to learn about statistics, programming, and visualization. I’m always trying to learn new things, so this list will be HOW TO WRITE A TEXT ADVENTURE IN PYTHON APPENDIX A: SAVING The pickle.dump method converts an object to a binary format for Python. The first parameter is the object to save and the second parameter specifies where to save the object. We need to create a save for both the world itself (tiles) and the player. HOW TO WRITE A TEXT ADVENTURE IN PYTHON PART 1: ITEMS AND This class has just two methods, but we’re going to see them pop up a lot. The __init__ method is the constructor and it is called whenever a new object is created. The __str__ method is usually a convenience for programmers as it allows us to print an object and see some useful information. Without a __str__ method, calling print() on an object will display something unhelpful like POSTGRESQL GENERATE_SERIES() TRICKS Before my current job, I actually had not heard of PostgreSQL. But it turns out to actually be a pretty prominent SQL server.. There are some weird quirks to Postgres and the management tools are pretty meh compared to SQL Server Management Studio, but there are a lot of neat features I keep bumping into. One such feature is the generate_series() function. N-QUEENS PART 3: SUCCESS In the last two posts we explored three different algorithms for solving the n-queens problem. If we wanted to actually implement one of them, we would need to consider which one performs the best. However, performance can be measured in a number of ways. HOW TO HIDE TEXT IN A BMP USING PYTHON This picture of presidential cat Socks is not what it seems. In addition to being a cat, it also contains the text of the Declaration of the Rights of Man and of the Citizen.. By manipulating the image data and the text data at the bit level, we can tweak the image to include information that is GETTING GPS DATA FROM ANDROID Because Android’s source code is open, there are a lot of goodies that anyone with an Android device and Google’s development kit can explore. I was digging through the API section regarding location services when I found the method getSatellites().How can you resist a method that sounds that cool? BACH AND MOZART BY THE NOTES I am a big fan of classical music and while listening to Bach the other day, I wondered if it would be possible to get numerical data on the actual notes used by a particular composer.Responsive Menu
* Home
* Books
* Recommended Materials* About
JAVA FOR THE REAL WORLD VIDEO COURSE Since I published my Java for the Real World eBoo k, I’ve received several inquires about providing the learning material via video. I will admit I am still skeptical in general about video, but I finally decided to bite the bullet and make a video course. I’ve published the courseat Udemy , a
site I’ve used and enjoyed in the past. The content of the video course is very similar to the book. We cover:* The JVM
* Build tools
* Testing
* Spring
* Web Application Frameworks * Web Application Deployment* Data Access
* Logging
I walk through the code examples projects that are on GitHub and describe how to use the various tools in the application. I hope that the combination of an eBook and a video course will help get the knowledge out to more people. The world of Java is intimidating, so get started today! Click here to learn Java for the Real World! By Phillip Johnson |September 27, 2019
| Uncategorized |
No Comments
|
VAADIN FLOW TREPIDATION I started using Vaadin about a year ago and was really happy with the results. I got a nice looking web application written almost entirely in Java. I also found being able to work around the traditional MVC pattern refreshing. So, I was naturally interested to see what they would do for their version 10 release. (Side note: What’s the fear about the number nine? Windows 9, iPhone 9, Vaadin 9…all missing.) I got notice a few months ago that the new version–branded Vaadin Flow–was released along with a new website. But when I clicked through, I was a bit confused to see Vaadin Components being proffered alongside the Java framework. As it turns out, their entire lineup pivoted to the Google Polymer JavaScript framework. It certainly feels like the company is trying to position themselves to be a competitor in the already-dense JavaScript world, with the Java framework playingsecond fiddle.
Now of course the party line is that Vaadin Flow is still a first-rate product, but peel back the marketing and you’ll see that it is severely lacking in features. The
product was released without support for a ComboBox (it’s since been added) and Checkbox Groups, and the suggestion was to manually useHTML tags.
Several more components are listed as “Not Planned” with the most passive aggressive one being MenuBar: “A menu bar is a desktop pattern that is typically not suitable in a world of mobile firstapplications.”
The new framework isn’t without improvements. In particular, I liked the simplicity of using a @Route annotation on a component to expose it as a view. It’s also much easier include custom CSS, eliminating the annoying cycle of making a CSS change, compiling the CSS, and relaunching the application.1
2
3
4
5
6
// Simple!
@HtmlImport("frontend://styles/shared-styles.html")@Route("")
public class MyView extends Div {}
I’m hoping that this direction is just a temporary misjudgement on the part of the Vaadin team. I have no problems with Vaadin moving from GWT to Polymer, but worry that developing the JavaScript components at the expense of dropping features from Vaadin Flow is going to make the product much less appealing. The conspiracy theorist in me fears that this was planned to make Vaadin Flow so unused that they can justify dropping it completely. But hopefully there will be enough community feedback to make them reconsider their decision to drop features and make Vaadin Flow just as usable as Vaadin 8. By Phillip Johnson |September 20, 2018
|
Programming | No
Comments
|
JAVA FOR THE REAL WORLD UPDATED FOR JAVA 11 With Java 11 being released in just over a week , I have decided to push out a significant update to Java for the Real World.
FOR A LIMITED TIME, YOU CAN GET THE BOOK FOR ONLY $11.11IN CELEBRATION OF
JDK 11!
The major updates include: * Updated syntax for all code examples to take advantage of the improvements in recent JDK releases. * A new project and section about Vaadin Flow * Updated dependency versions * Additional discussion about the various JDKs available * New guidance about running Java applications in Docker containers OpenJDK 11 will be a long term support version, so it is definitely worth taking a look at the new featuresand upgrading when
possible.
By Phillip Johnson |September 15, 2018
| Programming | No
Comments
|
JAVA BUILD TOOLS: ANT VS. MAVEN VS. GRADLE _This is an abbreviated chapter from my book _Java for the Real World _. Want more content like this? Click here to get thebook!_
For anything but the most trivial applications, compiling Java from the command line is an exercise in masochism. The difficulty including dependencies and making executable .jar files is why build tools werecreated.
For this example, we will be compiling this trivial application:Application.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
package com.example.iscream; import com.example.iscream.service.DailySpecialService; import java.util.List; public class Application { public static void main(String args) { System.out.println("Starting store!\n\n==============\n"); DailySpecialService dailySpecialService = new DailySpecialService(); Lists));
}
}
DailySpecialService.java1
2
3
4
5
6
7
8
9
10
11
package com.example.iscream.service; import com.google.common.collect.Lists; import java.util.List; public class DailySpecialService { public List}
}
ANT
The program make has been used for over forty years to compile source code into applications. As such, it was the natural choice in Java’s early years. Unfortunately, a lot of the assumptions and conventions with C programs don’t translate well to the Java ecosystem. To make (har) building the Java Tomcat application easier, James Duncan Davidson wrote Ant. Soon, other open source projects started using Ant, and from there it quickly spread throughout the community.BUILD FILES
Ant build files are written in XML and are called build.xml by convention. I know even the word “XML” makes some people shudder, but in small doses it isn’t too painful. I promise. Ant calls the different phases of the build process “targets”. Targets that are defined in the build file can then be invoked using the ant TARGET command where TARGET is the name of the target. Here’s the complete build file with the defined targets:build.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
classname="com.example.iscream.Application">
location="build/jar/IScream.jar"/>
location="build/jar/IScream.jar"/>
, and it’s
possible to define custom tasks too. A typical build might move around files, assemble documentation, run tests, publish build artifacts, etc. If you are lucky and are working on a well-maintained project, the build file should “just work”. If not, you may have to make tweaks for your specific computer. Keep an eye out for .properties files referenced by the build file that may contain configurable filepaths, environments, etc.SUMMARY
While setting up a build script takes some time up front, hopefully you can see the benefit of using one over passing commands manually to Java. Of course, Ant isn’t without its own problems. First, there are few enforced standards in an Ant script. This provides flexibility, but at the cost of every build file being entirely different. In the same way that knowing Java doesn’t mean you can jump into any codebase, knowing Ant doesn’t mean you can jump into any Ant file–you need to take time to understand it. Second, the imperative nature of Ant means build scripts can get very, very long. One example I found is over 2000 lines long!
Finally, we learned Ant has no built-in capability for dependency management, although it can be supplemented with Ivy. These limitations along with some other build script annoyances led to the creation of Maven in the early 2000s.MAVEN
Maven is really two tools in one: a dependency manager and a build tool. Like Ant it is XML-based, but unlike Ant, it outlines fairly rigid standards. Furthermore, Maven is declarative allowing you to define _what_ your build should do and less about _how_ to do it. These advantages make Maven appealing; build files are much more standard across projects and developers spend less time tailoring the files. As such, Maven has become somewhat of a de facto standard inthe Java world.
MAVEN PHASES
The most common build phases are included in Maven and can be executed by running mvn PHASE (where PHASE is the phase name). The most common phase you will invoke is install because it will fully build and test the project, then create a build artifact. Although it isn’t actually a phase, the command mvn clean deserves a mention. Running that command will “clean” your local build directory (i.e. /target), and remove compiled classes, resources, packages, etc. In theory, you should just be able to run mvn install and your build directory will be updated automatically. However, it seems that enough developers (including myself) have been burned by this not working that we habitually run mvn clean install to force the project to build from scratch. PROJECT OBJECT MODEL (POM) FILES Maven’s build files are called Project Object Model files, usually just abbreviated to POM, and are saved as pom.xml in the root directory of a project. In order for Maven to work out of the box, it’s important to follow this directory structure:.
├── pom.xml
└── src
├── main
│ ├── java │ │ <-- Your Java code goes here │ ├── resources │ │ <-- Non-code files that your app/library needs└── test
├── java
│ <-- Java tests ├── resources │ <-- Non-code files that your tests need As mentioned previously, Maven has dependency management built in. The easiest way to find the correct values are from the project's website or the MVNRepository site. For our build, we also need to use one of Apache's official plugins--the Shade plugin. This plugin is used to build fat .jar files. Here's the complete POM file:pom.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
shade
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> com.example.iscream.Application
SUMMARY
Although Maven has made considerable strides in making builds easier, all Maven users have found themselves banging their head against the wall with a tricky Maven problem at one time or another. I've already mentioned some usability problems with plugins, but there's also the problem of "The Maven Way". Anytime a build deviates from what Maven expects, it can be difficult to put in a work-around. Many projects are "normal...except for that one weird thing we have to do". And the more "weird things" in the build, the harder it can be to bend Maven to your will. Wouldn't it be great if we could combine the flexibility of Ant with the features of Maven? That's exactly what Gradle istrying to do.
GRADLE
The first thing you will notice about a Gradle build script is that it is not XML! In fact, Gradle uses a domain specific language (DSL) based on Groovy, which is another programming language that can run onthe JVM.
The DSL defines both the core parts of the build file and specific build steps called "tasks". It is also extensible making it very easy to define your own tasks. And of course, Gradle also has a rich third-party plugin library. Let's dive in.BUILD FILES
Gradle build files are appropriately named build.gradle and start out by configuring the build. For our project we need to take advantage of a fat jar plugin, so we will add the Shadow plugin to the build scriptconfiguration.
In order for Gradle to download the plugin, it has to look in a repository, which is an index for artifacts. Some repositories are known to Gradle and can be referred to simply as mavenCentral() or jcenter(). The Gradle team decided to not reinvent the wheel when it comes to repositories and instead relies on the existing Maven and Ivy dependency ecosystems.TASKS
Finally after Ant's obscure "target" and Maven's confusing "phase", Gradle gave a reasonable name to their build steps: "tasks". We use Gradle's apply to give access to certain tasks. (The java plugin is built in to Gradle which is why we did not need to declare it in the build's dependencies.) The java plugin will give you common tasks such as clean, compileJava, test, etc. The shadow plugin will give you the shadowJar task which builds a fat jar. To see a complete list of the available tasks, you can run gradle -q tasks. DEPENDENCY MANAGEMENT We've already discussed how a build script can rely on a plugin dependency, likewise the build script can define the dependencies for your project. Here's the complete build file:build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
buildscript {
repositories {
jcenter()
}
dependencies {
classpath
'com.github.jengelman.gradle.plugins:shadow:1.2.4'}
}
apply plugin: 'java' apply plugin: 'com.github.johnrengelman.shadow' group = 'com.example' version = '0.0.1-SNAPSHOT' sourceCompatibility = 1.8 targetCompatibility = 1.8repositories {
mavenCentral()
}
dependencies {
compile group: 'com.google.guava', name: 'guava', version:'21.0'
}
shadowJar {
baseName = 'iscream'manifest {
attributes 'Main-Class': 'com.example.iscream.Application'}
}
Now that the build knows how to find the project's dependencies, we can run gradle shawdowJar to create a fat jar that includes the Guava dependency. After it completes, you should see /build/lib/iscream-0.0.1-SNAPSHOT-all.jar, which can be ran in the usual way (java -jar ...).SUMMARY
Gradle brings a lot of flexibility and power to the Java build ecosystem. Of course, there is always some danger with highly customizable tools--suddenly you have to be aware of code quality in your build file. This is not necessarily bad, but worth considering when evaluating how your team will use the tool. Furthermore, much of Gradle's power comes from third-party plugins. And since it is relatively new, it still sometimes feels like you are using a bunch of plugins developed by SomeRandomPerson. You may find yourself comparing three plugins that ostensibly do the same thing, each have a few dozen GitHub stars, and little documentation to boot. Despite these downsides, Gradle is gaining popularity and is particularly appealing to developers who like to have more control over their builds. For a more in-depth comparison and other practical advice about the Java ecosystem, check out my book _Java for the Real World_.
Click here to get Java for the Real World! By Phillip Johnson | April28, 2017
| Programming | No
Comments
|
ANNOUNCING JAVA FOR THE REAL WORLD When I started my first Java job, I was immediately overwhelmed by my knowledge gaps of the Java ecosystem. I knew how to write decent code and had a good understanding of the Java language, but I had never used Hibernate or “deployed a war to Tomcat” …and what’s a “pom”? I soon found that answers to these questions were less than straightforward. Wading through pages of dense documentation and poorly written tutorials often left me just as confused as when Istarted.
That’s why I decided to write _Java for the Real World _. Having lived through the pain of learning the Java ecosystem, I wanted to create a resource for anyone else in their first Java job to quickly become aware of all the ancillary technologies that Java uses. I intentionally do not provide deep tutorials in the book. Not only would that be an insurmountable task (nearly all of these technologies have books of their own), but I have found that companies use the tools in such different ways that tutorials only go so far. Instead, I provide an overview of the most common tools you are likely to encounter, example code to see the technology in action, and suggested resources for more in-depth study. I’m also trying something new with this book. Instead of waiting to finish it, I am making the in-progress version available TODAY for 50% off the suggested price. If you purchase today, you will get immediate access to everything I have already written and updates as more chapters are completed! Click here to save 50%! By Phillip Johnson | April25, 2017
| Other | No Comments|
* « Previous
*
SEARCH
Search
RECENT POSTS
* Java for the Real World Video Course * Vaadin Flow Trepidation * Java for the Real World Updated for Java 11 * Java Build Tools: Ant vs. Maven vs. Gradle * Announcing Java for the Real WorldMOST POPULAR POSTS
* How to Write a Text Adventure in Python * How to Write a Text Adventure in Python Part 1:… * How to Write a Text Adventure in Python Part 2: The… * How to Write a Text Adventure in Python Part 3:… * How to Write a Text Adventure in Python Part 4: The… * PostgreSQL generate_series() Tricks * How to use the Yelp API in Python * N-Queens Part 1: Steepest Hill Climbing * Creating Voronoi Diagrams with ggplot * Java Build Tools: Ant vs. Maven vs. GradleRECENT TWEETS
RECENT COMMENTS
* Don Stott on How to Write a Text Adventure in Python Part 4: TheGame Loop
* speedstriker on How to Write a Text Adventure in Python Part 2: TheWorld Space
* Phillip Johnson on How to Write a Text Adventure in Python Part 4: The Game Loop * joeby on How to Write a Text Adventure in Python Part 4: The GameLoop
* Phillip Johnson on How to Write a Text Adventure in Python Part 4: The Game LoopCATEGORIES
* Exploratory
* Other
* Portfolio
* Probability
* Programming
* Statistics
* Uncategorized
* Viz
META
* Log in
* Entries feed
* Comments feed
* WordPress.org
Copyright ©2020 Let's Talk Data | Theme by: Theme Horse | Powered by: WordPressDetails
Copyright © 2023 ArchiveBay.com. All rights reserved. Terms of Use | Privacy Policy | DMCA | 2021 | Feedback | Advertising | RSS 2.0