Test-Driven Development
My Kind of Test
1-24-2015
In the development world, there are many different processes by which code is written. The one that is utilized the most at Dev Bootcamp is Test-Driven Development, or TDD. TDD is a process that relies on the repetition of a very short development cycle. There are five basic steps in TDD, and I'm going to use an exercise known as "FizzBuzz" to explain how the process works. The FizzBuzz exercise is a classic programming challenge that is often used in interviews to test a programmer's coding acumen. The basic idea is to write a program that will accept an array of numbers, and then return that same array of numbers, except the numbers that are evenly divisible by 3 are replaced by the word "Fizz", the numbers that are evenly divisible by 5 are replaced by the word "Buzz" and numbers that are divisible by both 3 and 5 are replaced by the word "FizzBuzz".
The first step is adding what is known as Driver Test Code. Driver test code are equations that, when your program is functional, will all return as true. For the FizzBuzz exercise, I want to write driver test code that will make sure that the correct numbers are being replaced by the correct words. I know that the method I am going to create to write this program will be called "super_fizzbuzz", so I can go ahead and create driver test code that looks like the following:
You can that what I did here, is I called my super_fizzbuzz method on several different arrays, and made them equal to what the output should be when the program is running functionally. When the program is working correctly, the above five statements should all output to "true". As long as I am getting an error, or one of the statements is returning "false", then I know that I have to make changes to my code.
p super_fizzbuzz([3]) == ["Fizz"]
p super_fizzbuzz([5]) == ["Buzz"]
p super_fizzbuzz([15]) == ["FizzBuzz"]
p super_fizzbuzz([1, 2, 3]) == [1, 2, "Fizz"]
p super_fizzbuzz([15, 5, 3, 1]) == ["FizzBuzz", "Buzz", "Fizz", 1]
The next step is to run the tests and see what is failing. When you are writing a program from scratch, you know that all the tests are going to fail, because you haven't written any code yet! For example, if I run the tests right now before I write any of the program, I get the following message:
Basically what this error message is telling me is that my method "super_fizzbuzz" has not been defined yet, but we already know that! Because we are just beginning writing this program, we can move on to the next step and revisit this one later.
my_solution.rb:39:in `main: undefined method `super_fizzbuzz' for main:Object (NoMethodError)
The next step is writing some code! The goal here is to write code that causes the tests to pass. This code is not going to be perfect. It is basically a rough draft that will get your point across. This is ok, because we are going to improve our code in a future step. After a little thinking and manipulating, this is what I came up with for my initial solution to this problem:
Without going into too much detail, this program is basically saying that for a number (represented as "x"), that when divided by 3 the remainder is zero, replace that number with the word "Fizz". The same is true for "Buzz" and "FizzBuzz" based on the specifications of the program. Now that I've written my code, its time to move on to step four.
def super_fizzbuzz(array)
array.map! { |x| x % 3 == 0 ? x = "Fizz" : x % 5 == 0 ? x = "Buzz" : (x % 3 == 0) && (x % 5 == 0) ? x = "FizzBuzz" : x = x }
end
Step four is to run the tests again. Now that we've got our code, we can run it with the tests, and if everything returns as "true", then our program works! So let's run it and see what we get:
Uh oh. Something isn't right! Our third and fifth test code are coming back false. If the first, second and fourth seem to be running as planned, then it looks like there is something wrong with our "FizzBuzz" part of the code. Since our code isn't passing, we have to jump back to step three and continue to work on it until everything passes.
true
true
false
true
false
One way to look for what isn't working is to run the program the way it is intended and see what the result is. I put the following tests (different from driver test code) into my program to find the results:
Rather than setting this equal to what the output should be, I am going to actually run it and see what is returned. When I run the above code with my program, I get this result:
p super_fizzbuzz([1, 2, 3])
p super_fizzbuzz([15, 16, 17])
p super_fizzbuzz([3, 5, 15])
OK! Now we're getting somewhere. Where there should be a "FizzBuzz", we are getting a "Fizz" instead. After some thinking and examining, I figured out that the reason I was getting this return, was because if the program determined that a number was indeed divisible by 3, it was not continuing to see if the number was ALSO divisible by 5, therefore automatically returning "Fizz". After making the appropriate changes, my new code looked like this:
[1, 2, "Fizz"]
["Fizz", 16, 17]
["Fizz", "Buzz", "Fizz"]
With this new code, I ensured that the program would only return "Fizz" if the number was both divisible by 3 and NOT divisible by 5. Now I need to run this new code with both my tests and my driver test code to see the results:
def super_fizzbuzz(array)
array.map! { |x| x % 3 == 0 && x % 5 != 0 ? x = "Fizz" : x % 5 == 0 && x % 3 != 0? x = "Buzz" : (x % 3 == 0) && (x % 5 == 0) ? x = "FizzBuzz" : x = x }
end
Hooray! All of our driver test code returned as "true", and our tests have the right words in the correct places! Now we can move on to step five, which is to see if there is any way we can improve our already functioning code, also known as refactoring.
def super_fizzbuzz(array)
array.map! { |x| x % 3 == 0 && x % 5 != 0 ? x = "Fizz" : x % 5 == 0 && x % 3 != 0? x = "Buzz" : (x % 3 == 0) && (x % 5 == 0) ? x = "FizzBuzz" : x = x }
end
p super_fizzbuzz([1, 2, 3])
p super_fizzbuzz([15, 16, 17])
p super_fizzbuzz([3, 5, 15])
p super_fizzbuzz([3]) == ["Fizz"]
p super_fizzbuzz([5]) == ["Buzz"]
p super_fizzbuzz([15]) == ["FizzBuzz"]
p super_fizzbuzz([1, 2, 3]) == [1, 2, "Fizz"]
p super_fizzbuzz([15, 5, 3, 1]) == ["FizzBuzz", "Buzz", "Fizz", 1]
[1, 2, "Fizz"]
["FizzBuzz", 16, 17]
["Fizz", "Buzz", "FizzBuzz"]
true
true
true
true
true
When looking at my initial solution, it occurred to me that if I asked the program to check and see if a number was divisible by both 3 AND 5 before I asked it to check for each of those numbers individually, then I could get rid of the part that I added initially to make it work when I was getting the "false" returns. After re-arranging the code a little bit, I had new code that I was ready to run with my tests and driver test code to make sure it still worked:
It still works! Success! As a newbie programmer, I can tell you that there are few greater feelings in TDD than, after hours of refactoring and running test code over and over again, finally getting everything to return as "true". There will be times when it gets incredibly frustrating, thinking that you've FINALLY figured it out, only to keep getting a return of "false". TDD is great in that it causes you to really dissect your code and figure out where things went wrong. Also, because you test as you code, with TDD it is difficult to get pushed too far off track. You can't move on until your tests pass, which means an error you make can't screw everything up that you write in the future. If you're interested in learning more about Test-Driven Development, there is a great resource here that you should check out! Happy coding!
def super_fizzbuzz(array)
array.map! { |x| x % 3 == 0 && x % 5 == 0 ? x = "FizzBuzz" : x % 3 == 0 ? x = "Fizz" : x % 5 == 0 ? x = "Buzz" : x = x }
end
p super_fizzbuzz([1, 2, 3])
p super_fizzbuzz([15, 16, 17])
p super_fizzbuzz([3, 5, 15])
p super_fizzbuzz([3]) == ["Fizz"]
p super_fizzbuzz([5]) == ["Buzz"]
p super_fizzbuzz([15]) == ["FizzBuzz"]
p super_fizzbuzz([1, 2, 3]) == [1, 2, "Fizz"]
p super_fizzbuzz([15, 5, 3, 1]) == ["FizzBuzz", "Buzz", "Fizz", 1]
[1, 2, "Fizz"]
["FizzBuzz", 16, 17]
["Fizz", "Buzz", "FizzBuzz"]
true
true
true
true
true


PennApps [s15 ed.]
A running commentary of antics at PennApps Spring 2015.
Friday
6:00am
Met a Stanford freshman who was on the same flight - made our collective ways over to campus from the airport. No ticket stations at the platform, but SEPTA rail operators have exact change for cash - public transportation giving exact change is a new one for me.
6:40am:
Just got on UPenn's campus, grabbed a quick breakfast from a food cart just off 33rd and Smith.
7:30am:
So UPenn's wi-fi is not exactly readily available to visitors. Looks like Van Pelt doesn't open until 8:30am either, so it looks like I'll hanging out in this Cosi cafe for a while until the library opens...
10:30am
Toured the UPenn engineering quad, and ate at Bui's sandwich truck
2:00pm
At PennApps Health.
Visualization and healthcare?
What if we apply visualization to schedulers in the hospital (pigeonholing the number of patients who need treatment into the limited number of rooms in a hospital)
Iron Triangle
Healthcare is suffering from a fingers-pointing problem that prevents anybody from taking responsibility for supporting innovative technologies. Prototypes for low-hanging fruit suffer in user adoption because no one wants to take responsibility for paying for it. It's an formidable problem that's keeping innovation from making it past these interlocking gates of healthcare. Elliot Menschik suggests two solutions:
1. Focus on a target audience that removes the complexity from the equation (e.g. conceierge doctors that are able to develop a customer experience for their patients)
2. Take one side of this triangle that suffers from excessive overhead, and convince the other two sides of the triangle how painfully obvious it is to adopt this newer point on the triangle (e.g. Oscar)
Collective Health
The oscar for companies as mentioned by William Motley.
6:19pm
Opening Ceremony kicks off!
Notable APIs: Postmates, Sension, Comcast's geocaching
7:50pm
Waited in the hardware line for a long while to grab their heaviest items - 2 $2000 monitors!
8:45pm
Got our monitors and finally settled down to hack! Now, what are we buildling...
11:30pm
Settled on an idea. Now a name...Selfie Hero?
7:30am
Woke up, got some breakfast, and a blanket!
Saturday
1:15pm
Had lunch, then did a major product pivot after talking with a mentor...
2:00pm
Finally talking technical begins
2:20pm
Hacking begins! We got a guy on the backend, a guy on design, and two on frontend.
3:04pm
Front-end set up, learning coffeescript.
6:00pm
Chugging along. Logo's designed, frontend is up, and server is rockin'
1:00am
Working on sorting and interfacing with the server we set up. The app is now successfully ported over to a native iPhone app wrapper.
9:30am
Submission time! And now it's time for demos :)
1:00pm
Super impressed with the quality of the hacks this year, wow - what a great bunch of projects to be a part of. Definitely impressed with the amount of hard data and good hacking went into some of the top hacks :)


--- layout: portfolio title: Music subtitle: use-site-title: true --- {% assign sorted = (site.musicEvents | sort: 'date') | reverse %} {% for event in sorted %}
{{event.text}}


{% extends 'layouts/application.html' %} {% set base_path = "" %} {% block content %} 404 Page not found Like Seriously? There is only one page and you still managed to get lost. ← Go back to homepage {% endblock %}
Like Seriously? There is only one page and you still managed to get lost. ← Go back to homepage


Upload a file to {DIR}
(equals {URL})
Back to {DIR}
Using this form, you can upload a file to the current directory ('{DIR}').
Explanation of the transfer modes:
- ASCII: Any line separator in the uploaded file will be converted to the system specific line separator. Use this mode for text files, HTML documents, scripts and so on.
- Binary: The file will be uploaded as it is. Use this transfer mode for images, executable files and archives, for example. This is the default transfer mode.
Note:
- If you specify an other remote name for the uploaded file, all slashes and backslashes will be removed from the entered value.
- If unpacking of a file fails after uploading the file is still there.
About Dev-Editor


|
SQA-Baller-Squad
1.0
|
Admin Class for special users with Admin access @description:
More...
#include <Admin.h>
Inherits Users.
Public Member Functions | |
Admin.cpp | |
| Admin () | |
| void | DeleteUser () |
| void | EnableUser () |
| void | DisableUser () |
| void | Refund (Items) |
| void | AddCredits () |
| Public Member Functions inherited from Users | |
| void | setUserName (string name) |
| string | getUserName () |
| void | setPassword (string pwd) |
| string | getPassword () |
| void | setUserType (string type) |
| string | getUserType () |
| void | setCredits (float cred) |
| float | getCredits () |
| Users () | |
| bool | Login () |
| bool | ValidateCredentials () |
| void | ChangePassword () |
| void | Create () |
| void | ReadUsersFile () |
Additional Inherited Members | |
| Public Attributes inherited from Users | |
| const float | SESSION_CREDIT_LIMIT = 9999.99 |
| Admin::Admin | ( | ) |
Default Constructor for Admin Class
|
virtual |
Overloaded function to add credits to a users account
Reimplemented from Users.
| void Admin::DeleteUser | ( | ) |
Method to delete a chosen user
| void Admin::DisableUser | ( | ) |
Method to disable a current user
| void Admin::EnableUser | ( | ) |
Method enable a disabled user account
| void Admin::Refund | ( | Items | ) |
Method to refund a user from a transaction


Splits an
if
statement containing a conditional-and
&&
or conditional-or
||
operator in its condition into two
if
statements with simplified conditions.


Thank you for enrolling in the "Essentials of High Performance and Parallel Statistical Computing in R" Professional Development Continuing Education Course. We look forward to teaching the course.
Update August 6, 2017: Links above now contain slides and scripts that have been updated after the course. Please note that the slides contain blank pages so that two-sided printing results in sections starting on top of each front page.
The course includes presentation components and demonstration components. You can gain a lot of understanding from just listening to the course presentation and demonstrations but a deeper understanding is possible if you run some of the scripts on your laptop either during class or later on a system larger than your laptop.
In order to run the scripts, you will need to have R, MPI, and several R packages installed. You can install the "native" versions or, more conveniently, install a docker container we have prepared. We generally recommend going with Docker for the sake of ease.
While many of the techniques demonstrated are capable of efficiently using the largest available systems (e.g. Titan, the largest system in the US) they run and usually provide speedup benefits even on a laptop. Initial parallel code development can normally be done on a laptop.
See you in Baltimore!


structure amino density protein prediction atoms predicted DeepTracer acid maps Fig map new U-Net acids []. EMD- backbone secondary type confidence method order solved output different sequence C-CNN cryo-EM runtime use atom number OpenUrl Download predict ;<;span Open Phenix chains data-hide-link-title=""> data-icon-position="" figure tab xmlns=";http://www.w.org//xhtml"; α-helix CrossRef However, Protein deep information model pp. structures vol. accuracy based large prediction. structure. coverage learning maps. proteins results using compared distance input map. no. predicting used Available: Finally, [Accessed: [Online]. average chain connected depicted dimensions locations predicts screw set shape step voxels (left) -Jan-]. DeepTracer, Furthermore, PDB-js allows atom. axis better blue channels compare experimental fully gives larger methods percentage seen structural training types value <;/div>;" (rotavirus Cryo-EM Density Methods RMSD Structure Table atoms. calculating connect data electron evaluate example high know location model, need original place predictions represents runtimes shown voxel (A) (blue) (human (major .%. Abstract Backbone Equation Next, Science TPC Therefore, Web achieved acids, algorithm application approach areas automated boxes capsid center chains. channel) color comparison complexes corresponding create does extracted future idea identified identify images initial left local marked mentioned method. multiple novo point position protein) proteins. researchers resolution structure, tan test total types. utilized


Back
{{ vm.errorMessage }}
Processing...
Flight Name
You must enter a name.
Name must be at least 3 characters long.
Flight Description
Flight Score
Score need to be positive natural number.
You must enter a score.
Refueling: {{ vm.flight.fuelPoints.length }}
No.
Date
Longitude
Latitude
{{$index + 1}}
{{ fuelPoint.date.toLocaleString() }}
{{ fuelPoint.longitude }}
{{ fuelPoint.latitude }}


Corona Virus Dashboard
map view
Cases (absolute)
Deaths (absolute)
Cases (relative to population)
Deaths (relative to population)


Piles use CMake as a build system. Several CMake scripts are provided in pile-cmake repository to make the job of the developer as simple as possible. Here is a complete list:


How to use web sheet component to input data
Unlock the cells which need input data
Lock all other cells which only for display.


Okowa floors Ogboru at Appeal Court
by Gbenga OdogunGbenga Odogun, Lokoja
The Head of the European Union Delegation to Nigeria, Ambassador Ketil Karlsen, has said the EU is in Nigeria to help deepen democracy and not to support any political party or candidate.
Addressing a press conference in Lokoja, the Kogi State capital, on Friday ahead of the governorship election in Kogi and Bayelsa states, Karlsen said the EU realised the importance of democracy as an important tool of social development and freedom, and decided to deploy human and capital resources to help entrench democratic values in Africa and Nigeria in particular.
“It is on this note the delegation, with representatives in Kogi and Bayelsa states having been around for some time now, had engaged security agencies and civil society organisations on the need for a peaceful and credible election that will meet international standards,” he said.
He urged political parties in the two states to translate the peace accords they had signed into reality, stating that the legitimacy of any democratically elected leader hinged on a credible election.
Karlsen urged voters to come out en masse and vote the candidates of their choice in today’s governorship election.
The EU also appealed to security agencies to maintain neutrality in the discharge of their duties and within the framework of the electoral laws.
Copyright PUNCH.
All rights reserved. This material, and other digital content on this website, may not be reproduced, published, broadcast, rewritten or redistributed in whole or in part without prior express written permission from PUNCH.
Contact: theeditor@punchng.com


---
layout: post
title: Some quick links
date: '2008-04-04T18:09:00.004+02:00'
author: Steven Van Acker
tags:
- PowerShell
- English
- ISA
modified_time: '2008-04-04T18:11:20.891+02:00'
blogger_id: tag:blogger.com,1999:blog-5513234137363262204.post-4437503360559794699
blogger_orig_url: http://www.singularity.be/2008/04/some-quick-links.html
---
Here are some links that have been in a tab in my browser for quite some time, trying to remind me that I should write them down somewhere:
ISA Server Administration Object Model (Graphical)
and
Powershell plus (Powershell editor)
I've looked at this powershell editor, but I'm not really impressed. YMMV


Configure a project for testing with CTest/CDash
Include this module in the top CMakeLists.txt file of a project to enable testing with CTest and dashboard submissions to CDash:
project(MyProject)
...
include(CTest)
The module automatically creates a BUILD_TESTING option that selects whether to enable testing support (ON by default). After including the module, use code like
if(BUILD_TESTING)
# ... CMake code to create tests ...
endif()
to creating tests when testing is enabled.
To enable submissions to a CDash server, create a CTestConfig.cmake file at the top of the project with content such as
set(CTEST_PROJECT_NAME "MyProject")
set(CTEST_NIGHTLY_START_TIME "01:00:00 UTC")
set(CTEST_DROP_METHOD "http")
set(CTEST_DROP_SITE "my.cdash.org")
set(CTEST_DROP_LOCATION "/submit.php?project=MyProject")
set(CTEST_DROP_SITE_CDASH TRUE)
(the CDash server can provide the file to a project administrator who configures ‘MyProject’). Settings in the config file are shared by both this CTest module and the CTest command-line tool’s dashboard script mode (ctest -S).
While building a project for submission to CDash, CTest scans the build output for errors and warnings and reports them with surrounding context from the build log. This generic approach works for all build tools, but does not give details about the command invocation that produced a given problem. One may get more detailed reports by adding
set(CTEST_USE_LAUNCHERS 1)
to the CTestConfig.cmake file. When this option is enabled, the CTest module tells CMake’s Makefile generators to invoke every command in the generated build system through a CTest launcher program. (Currently the CTEST_USE_LAUNCHERS option is ignored on non-Makefile generators.) During a manual build each launcher transparently runs the command it wraps. During a CTest-driven build for submission to CDash each launcher reports detailed information when its command fails or warns. (Setting CTEST_USE_LAUNCHERS in CTestConfig.cmake is convenient, but also adds the launcher overhead even for manual builds. One may instead set it in a CTest dashboard script and add it to the CMake cache for the build tree.)


Magic Info
Company
Founder
Investor
News
Help
About
×
Search company, founder, investor, news, everything you want!
Reuslts
Panel heading
Panel content
Panel content
Panel content
Panel content
Panel content
Panel heading
Panel content


✖
Auto update
Automatically launch on startup
Close launcher on play
Notify when finished updating
Always on top
Minimize to system tray on close
Cancel
Apply


My blog is mostly static content. I write the articles, pass them through Jekyll which transforms them into static HTML and then they get pushed up to my Heroku box where they are served. This system works great until you want to have a live activity feed. I’ve got one on my main page showing the latest from RSS feeds on Twitter, Google Reader, Github and a few others. You could probably manage this in javascript, but Heroku and Ruby came calling so this is how I created my feed.
First I thought, okay I’ll just parse the feeds after the page loads. I hooked in some javascript:

Next I thought I’d just read the feeds. I found this great Ruby gem called Feedzirra which fetches and parses RSS and ATOM feeds. Perfect. I implemented it and boom, I had feeds. But I also had a problem. The feeds took time to load and the more URL’s that I add, the longer they will take. People aren’t going to sit around waiting for them. Time to cache.
At first I thought I would write the feeds to a file on Heroku and then just read that. Not going to happen. Heroku does not let you write local files. So I need to either keep this data in memory, but how?
Enter Redis a key value store with high performance and low overhead. This will work, but I want to store my Ruby objects in there, how am I going to do that? Enter Ohm object hash mapping for Redis. Perfect, now I can write my feed. (I’m just starting with Ruby, so the following is a hack.)
Model
require 'ohm'
class Feeder < Ohm::Model
attribute :title
attribute :published
attribute :feed_id
attribute :url
attribute :content
attribute :service
index :published
end
class FeederContainer < Ohm::Model
attribute :date
list :feeds, Feeder
index :date
end
Controller
require 'rubygems'
require 'nokogiri'
require 'open-uri'
require 'feedzirra'
require 'redis'
require 'time'
require 'feeder'
class FeederController < ApplicationController
def list
@feedurls = THE_FEED_URLS # This is a global of just URL's in an array
@total_feeds = NUM_FEEDS # So is this a global integer
@n = 0
Ohm.connect(:url => "redis://your_connection_here")
feedTime = FeederContainer[1].date unless FeederContainer[1] == nil
feedTime = (Time.now - Time.parse(feedTime)).round unless
feedTime == nil
print "Retrieving and combining feeds.\n"
if feedTime == nil or feedTime > 1800 then
puts "Feed is stale, getting new feed."
Ohm.flush
# Create the storage
feedContainer = FeederContainer.create(:date => Time.now)
@feedurls.each do |feed|
rawfeed = Feedzirra::Feed.fetch_and_parse(feed)
rawfeed.entries.each do |entry|
feedContainer.feeds << Feeder.create(:content =>
entry.content, :title => entry.title, :url => entry.url,
:published => entry.published, :feed_id => entry.entry_id )
end
end
@feedlist = feedContainer.feeds.all
@feedlist.sort! {|a,b| Date.parse(b.published) <=>
Date.parse(a.published)}
print "Total feed items: ", @feedlist.size, "\n"
else
puts "Feed is good, getting cached feed."
@feedlist = FeederContainer[1].feeds.all
@feedlist.sort! {|a,b| Date.parse(b.published) <=>
Date.parse(a.published)}
print "Total feed items: ", @feedlist.size, "\n"
end
end
end
View
<% @feedlist.each do |entry| %>
<%
if @n > NUM_FEEDS then
break
end
if entry.url.include? "twitter.com" then
classname="twitter"
servicename="Twitter"
elsif entry.url.include? "github.com" then
classname="github"
servicename="Github"
elsif entry.url.include? "flickr.com" then
classname="flickr"
servicename="Flickr"
elsif entry.url.include? "youtube.com" then
classname="youtube"
servicename="YouTube"
elsif entry.feed_id.include? "google.com" then
classname="reader"
servicename="Google Reader"
end
unless entry.content == nil then
# Display the comments between the blockquote tags
content = Nokogiri::HTML(entry.content).css("blockquote").map
{|blockquote| blockquote.content}
end
@n = @n+1
%>

<%=Date.parse(entry.published)
.strftime("%b %d, %Y")%>

<div class="<%=classname%>">

<a href="<%=entry.url.sanitize%>">
<%=entry.title%>

<% unless content == nil then %>

<%=content%>

<% end %>

<% end %>
Conclusion
I wrote this code pretty quickly and it would probably scale well. Heroku and Ruby are a pretty powerful combination.


The Indian Air Force (IAF) is the air arm of the Indian armed forces. Its complement of personnel and aircraft assets ranks fourth amongst the airforces of the world. Its primary mission is to secure Indian airspace and to conduct aerial warfare during armed conflict. It was officially established on 8 October 1932 as an auxiliary air force of the British Empire which honoured India's aviation service during World War II with the prefix Royal. After India gained independence from the United Kingdom in 1947, the name Royal Indian Air Force was kept and served in the name of Dominion of India. With the government's transition to a Republic in 1950, the prefix Royal was removed after only three years.
Since 1950 the IAF has been involved in four wars with neighboring Pakistan and one with the People's Republic of China. Other major operations undertaken by the IAF include Operation Vijay, Operation Meghdoot, Operation Cactus and Operation Poomalai. The IAF's mission expands beyond engagement with hostile forces, with the IAF participating in United Nations peacekeeping missions.
The President of India holds the rank of Supreme Commander of the IAF As of 1 July 2017, 139,576 personnel are in service with the Indian Air Force.The Chief of Air Staff, an air chief marshal, is a four-star officer and is responsible for the bulk of operational command of the Air Force. There is never more than one serving ACM at any given time in the IAF. The rank of Marshal of the Air Force has been conferred by the President of India on one occasion in history, to Arjan Singh. On 26 January 2002 Singh became the first and so far, only five-star rank officer of the IAF.
Main article: List of Indian Air Force stations
Within each operational command are anywhere from nine to sixteen bases or stations, each commanded by an air commodore. A station typically has one wing and one or two squadrons assigned to it.
 It generally consists of two or three IAF squadrons and helicopter units, along with forward base support units (FBSU). FBSUs do not have or host any squadrons or helicopter units but act as transit airbases for routine operations. In times of war, they can become fully fledged air bases playing host to various squadrons. In all, about 47 wings and 19 FBSUs make up the IAF.Wings are typically commanded by an air commodore.
Squadrons are the field units and formations attached to static locations. Thus, a flying squadron or unit is a sub-unit of an air force station which carries out the primary task of the IAF. A fighter squadron consists of 18 aircraft; all fighter squadrons are headed by a commanding officer with the rank of wing commander. Some transport squadrons and helicopter units are headed by a commanding officer with the rank of group captain.
FlightsFlights are sub-divisions of squadrons, commanded by a squadron leader. Each flight consists of two sections.
SectionsThe smallest unit is the section, led by a flight lieutenant. Each section consists of three aircraft.
Within this formation structure, IAF has several service branches for day-to-day operations. They are:


--- layout: page title: About header-img: "img/about-bg.png" ---
I am currently enrolled in Flatiron School's Web Development program to become a software developer.


Meet a partner for your best holiday
Bradley Hunter
Based in Chicago. I love playing tennis and loud music
Lucas Marsha
I get my inspiration from nature and objects around me. I have a passion to colours, typography and skateboards.
Heather Walker
I'm happy person that loves cats and climbing on Mountains
Bradley Hunter
Based in Chicago. I love playing tennis and loud music


Tomcat
Version
3.3.1 Final
This is the default Tomcat home page. This page serves as a quick reference
guide to related resources and is located at:
-
</path/to/tomcat>/webpages/index.html
Included within this release are functional examples with associated source
code, API documentation for servlets and JSP, a README, a technical
FAQ
on this release and an assortment of jar files which are pre-requisites
for continued development of web technologies including JSP and Servlets.
Examples:
Documentation:
The README file, which can be found at </path/to/tomcat>/README, contains
a list of known bugs, incompatibilities and limitations.
You can find more information about the Servlet and JSP technologies
at:
and by subscribing to one or more of the following Servlet and JSP related
interest lists:
Copyright © 1999-2001 Apache Software Foundation
All Rights Reserved


FAQ
- How many team members can I invite?
- You can invite up to 2 additional users on the Free plan. There is no limit on team members for the Premium plan.
- What is the maximum file upload size?
- No more than 2GB. All files in your account must fit your allotted storage space.
- How do I reset my password?
- Click “Forgot password” from the login page or “Change password” from your profile page. A reset link will be emailed to you.
- Can I cancel my subscription?
- Yes! Send us a message and we’ll process your request no questions asked.
- Do you provide additional support?
- Chat and email support is available 24/7. Phone lines are open during normal business hours.


${recipient_name} sent the following message in response to the cash you sent.
${reply_message}
${sender_transfer_url}


:: com :: sun :: star :: rdf ::
|
|
|
- Supported Interface
- XURI
|
- Usage Restrictions
- not published
- Description
- represents an URI node that may occur in a RDF graph.
- Since
- OOo 3.0
- See also
- XRepository
|
| Constructors' Summary |
| create |
creates an URI RDF node.
|
| createNS |
creates an URI RDF node from namespace prefix and local name.
|
| createKnown |
creates an URI RDF node for a well-known URI.
|
| Constructors' Details |
create
- Description
- creates an URI RDF node.
- Parameter Value
- the URI, represented as
string .
- Throws
- com::sun::star::lang::IllegalArgumentException
if the argument does not represent a valid URI
|
|
createNS
- Description
- creates an URI RDF node from namespace prefix and local name.
- Parameter Namespace
- the namespace prefix of the URI, represented as
string .
- Parameter LocalName
- the local name of the URI, represented as
string .
- Throws
- com::sun::star::lang::IllegalArgumentException
if the arguments do not represent a valid URI
|
|
createKnown
- Description
- creates an URI RDF node for a well-known URI.
- Parameter Id
- the URI, represented as a constant from URIs.
- Throws
- com::sun::star::lang::IllegalArgumentException
if the argument is not a valid constant from URIs
- See also
- URIs
|
|
Top of Page
Copyright © 2013, The Apache Software Foundation, Licensed under the Apache License, Version 2.0. Apache, the Apache feather logo, Apache OpenOffice and OpenOffice.org are trademarks of The Apache Software Foundation. Other names may be trademarks of their respective owners.


About Membership
Are you a Pythonista? Do you love clean code, efficient algorithms, and having one obvious way to do things? Do you build systems, write docs, run tests, organize meetups, or teach others about Python?
You should be a member of the Python Software Foundation. We want to recognize the things you are already doing to help the Python community and connect you with other Pythonistas in your area or with your interests.
{% if not request.user.is_authenticated %}{% else %}{% endif %}Signup Now
About Sponsorship
Do you want to support Python and the Python Software Foundation? The PSF is a 501(c)(3) charity run by volunteers so that all of our contributions go toward supporting the Python Community. Higher level packages are available for those that would like to make larger or targeted donations.
I want to support the PSF or My organization wants to support the PSF
{% else %} {# Switches depending on higher level member or not #} {% if request.user.has_membership and not request.user.membership.higher_level_member %}Raise your membership level
How do you contribute to the community? Higher levels of membership are available for those that actively contribute to the community - by creating, by organizing, or by supporting and funding others. Active contributors are also eligible to vote in the affairs of the Foundation.
I create (docs, tests, code, etc)
I organize (conferences, meetups, working groups, etc)
I support (by donating to the PSF)
{% else %}


Commercially launched on the GSM standard in Finland by Radiolinja in 1991
Advantages over 1 G
1. Communication through digital encryption
2. Greater wireless penetration levels
3. Introduced data services for mobile
Systems evolved
D-AMPSGSMIS-95
D-AMPS
(Digital-Advanced Mobile Phone System)Employs the same 30 kHz channel spacing and frequency bands (824-849 and 869-894 MHz) as AMPSEach voice channel is digitezed using complex PCM and compression techniques
GSM
(Global System for Mobile CommunicationGSM standard originally described a digital, circuit-switched network optimized for Full Duplex Voice Telephony
Bands
Uses two bands for Duplex communication
Each being 25 MHz in width
Each further divided into 124 channels of 200 kHz
Transmission
Data rate: (1/120ms)x26x8x156.25 = 270.8 kbps
IS-95
(Interim standard) cdmaOne
IS-95 is the first CDMA based digital cellular technologyCode Division Multiple Access allows several radios to share the same Frequencies
Bands
2 bands for Duplex communication
ISM 800-MHz bands or ISM 1900-MHz bands
Each band is divided into 20 channels of 1.228 MHz
10 channels for each service provider
Each IS-95 channel is equivalent to 41 AMPS channels
Transmission
Forward Transmission
Base to Mobile
Reverse Transmission
Mobile to Base
synchronization
All base channels need to be synchronized to use CDMA
To provide synchronization, bases use the services of a satellite system (GPS)
Frequency reuse factor is 1 as the interferense from the neighboring cells cannot affect CDMA transmission


Write Less Code
Computing an Average, in Hadoop
private IntWritable one = new IntWritable(1);
private IntWritable output = new IntWritable();
protected void map(LongWritable key, Text value, Context context) {
String[] fields = value.split("\t");
output.set(Integer.parseInt(fields[1]));
context.write(one, output);
}
IntWritable one = new IntWritable(1)
DoubleWritable average = new DoubleWritable();
protected void reduce(IntWritable key,
Iterable<IntWritable> values,
Context context) {
int sum = 0;
int count = 0;
for (IntWritable value: values) {
sum += value.get();
count++;
}
average.set(sum / (double) count);
context.write(key, average);
}


10,000+ of our users love our products.
We only provide great products combined with excellent customer service. See what our satisfied customers are saying about our services.
Rated 5 Starts in Reviews
Rated 5 Starts in Report Guru
Rated 5 Starts in BestTech


--- layout: hackathonHero title: DevNQ Hackathon - Frequently Asked Questions heroSecondaryLink: /hackathon-2018 heroSecondaryText: See the details og_image: /assets/images/hackathon-2018/social-banner.png og_desc: The DevNQ Hackthon is a weekend-long programming and product design sprint. The 2018 Hackathon explores ways to assist educators and students by bringing new technologies and innovative ideas to classrooms, digital learning, teaching and training. ---
A hackathon is an event where teams of programmers, designers and subject-matter-experts collaborate to complete a project in a limited time period to complete a project.
Anybody can participate in the DevNQ Hackathon. We welcome participants of all skill levels and disciplines. Think about what skills you can bring and be prepared to adapt and learn new things to meet the needs of your team.
The hackathon is being held on the Ground Floor of Building 34 at James Cook University in Townsville.
Parking is available in the carpark adjacent to Building 34 off James Cook Drive. All parking at JCU is free during the event.
Visitors are welcome to the event during daylight hours. We only ask you register with our event team on arrival.
Parents, guardians and teachers accompanying children will be permitted to stay throughout the event.
Entry costs $5.00. You can pre-pay this when you register for the event or pay at the door. This fee helps us cover the some of the costs of running the event.
Competitors are required to register with EventBrite. Registrations are essential.
Competitors are encouraged to attend the opening, judging presentations and presentation ceremonies however, there is no requirement to stay for the entire event. Teams must be present for the judging presentations and presentation ceremonies to be eligable to win a prize.
Whilst teams are welcome to work the full 24 hours, we strongly encourage individuals to sleep for several hours at some point in the event. Check out the schedule page for figuring our the best time to grab some ZZZs.
You should bring whatever tools you might need to complete a project with your skills. We have some suggestions on what you may need:
Find some friends, colleagues or others with like-minded ideas. Teams will have an opportunity to formulate ideas, pitch these to other participants and rearrange teams on the day. If you don't have a team come along and find a team doing something you want to help make a reality.
Competing teams can be from 1 to 5 members. Teams exceeding 5 members will not be accepted.
Think about your educational experiences and where they could have been improved. Theres heaps of great problems out there for the solving. If you need a little help check out our problem statements to help get the creative juices flowing.
Teams and individuals are welcome to bring their own project and ideas. However, we ask that you only present work completed during the hackathon for judging.
Four meals will be supplied at given times during the event. You can find out more information on these meals on the schedule page. Snacks, softdrinks, and hot tea and coffee will be provided throughout the event.
The DevNQ Hackathon is an alcohol and drug free event. Please do not bring alcohol or illicit drugs. Softdrinks, water and other refreshments will be provided.
We try and cater to all the needs of all our event attendees. After registering contact us and let us know your requirements. We'll try our hardest to accommodate your requirements.


FreeMind
1) Install Java. 2) Unpack FreeMind. 3) On Windows, run FreeMind.exe; you'll probably want to create a folder called freemind in "c:\Program Files\" and copy the contents of unpacked directory there. If you want, create shortcut of FreeMind.exe on your desktop.
On Unix, run freemind.sh. On both Windows and Mac OS X, you can also simply double click the file freemind.jar located at the folder lib.
You create mind maps in so called mind map mode. This is the default mode FreeMind is started with. If the word mode troubles you, just forget about it.
Operations on node or edge
Quickly change to different already opened mind map
Selecting multiple nodes
+ - Editing by drag and drop
You can move nodes around using Drag And Drop
Drag and Drop enables you to drop node
as a child
as a sibling.
The distintion between child and sibling is similar to distinction between following links and toggle folded
If you hold control while dragging, nodes are copied instead of moved. You can achieve the same by dragging with middle mouse
Before Version 0.7:
if you hold control and shift while dragging, the color and font of the target node is copied to source node.
If you have selected multiple nodes, all are being moved / copied
You can drop sources from external applications
You can edit a new map by dragging and dropping its file into the background of FreeMind
+ - Copying and pasting
Splitting nodes
Scrolling
Fast switching between maps
+ - Searching
Popup > Node > Find
Popup > Node > Find Next
The search is breadth-first search. That corresponds to the idea, that the deeper the node, the greater the detail described.
+ - Using the keyboard
You can do most of the navigation using keyboard. You can see the keyboard shortcuts in the popup menu of the node. Some of the shortcuts which you do not see that way follow.
PgUp and PgDown
control PgUp and control PgDown
Nice for having a quick glance above and then continue below again
Escape
Arrows
You can select a range of nodes by holding shift and moving around with arrows or page up and down.
You can replace the text in current node and start editing by typing letters. You can also edit node by pressing home or end key, as well as F2.
Technical users can change the keyboard settings in user.properties.
+ - Keyboard while editing a long node
By default, *enter* finishes editing of a long node, and *control enter* enters a new line. By unchecking the check box "Enter confirms" you can reverse the function of the mentioned key combinations, i.e. *enter* enters new line and *control enter* finishes editing. You can set the default value of that check box in user.properties. Moreover the value of the box is saved during a session of FreeMind.
+ - Exporting into HTML
+ - Importing folder structure
To import folder structure into FreeMind, use Popup > Branch > Import folder structure. You will be asked for the folder whose structure you want to import. By structure we mean the tree of all, and not necessary direct, subfolders with the links to the files in these subfolders. An example of inserted structure follows.
Example
+ - Importing MS Internet Explorer favorites
To import MS Explorer favorites into FreeMind, use Popup > Branch > Import Explorer Favorites. You'll be asked to enter the path to the folder where the favorites are stored. The folder's name is "Favorites" and you can find on your disk. On Windows 2000, the path is C:\Documents and Settings\<user>\Favorites.
+ - Integration with Microsoft tools like Word or Outlook
You can paste maps or branches into MS Work, MS Wordpad or MS Outlook messages. In general, you can paste it into any application that understands RTF - rich text format. The text formatting and links are pasted too.
~ Clicking a mail link<EMAIL_ADDRESS>will open Outlook for creating a new message
+ - Preferences
Only a small subset of preferences is editable using graphical using interface; these you can change in menu: Edit > Preferences. At the time, the following preferences can be changed:
You can set full antialiasing or antialiasing of edges only. Antialiasing of edges is the default option.
You can set a kind of HTML export in preferences.
Other preferences can be changed by more technical users in user.properties, which you have to copy into the folder freemind in your home folder.
+ - Printing
You can print either by fitting the whole map into one page, or by printing the map to several sheets of paper. This choice you can set in menu: File > Page Setup > ... .
Choose page setup landscape. That way it looks better and you have a better utilization of space.
If you want to preview your map before you print it and have a postscript printer or generic postsript driver, you can print the map into file and view the postscript file view ghostview or similar software. Beware that if you try to print the map with printer that does not understand postscript, the resulting file will not be postscript but probably PCL, which is unusable for you.
You can also print from your browser after exporting map to HTML, or from Word or Wordpad after copying and pasting the map into it. You can also export the map into HTML with headings, copy and paste it into MS Word and print it from there. That way you can change styles as you want.
+ - Tips
To be able to enter newlines in long nodes, uncheck the check box "Enter confirms" when editing the long node.
You see?
There are newlines here, make no mistake about it.
+ - Pictures and HTML in nodes
An easy way to insert pictures into FreeMind is with Popup > Node > Set Image. You lose all the text you had in the node. Be aware that those images are not correctly pasted outside FreeMind and they need not to be correctly exported to HTML. Pictures in FreeMind are preliminary feature.
This way, you can turn images contained into the links on nodes into the images themselves. As a result, you can drag and drop several image files into FreeMind, select them as multiple nodes, and them turn them into images in one step, i.e. by choosing Set Image.
A more technical and not so user friendly way to do it follows. It is possible to include HTML in nodes. You have to start the node content with the tag <html>. This way, you can have pictures in the nodes.
E.g:
Formats: On Java1.4.1 on Windows, png, jpg and gif work fine.
There is no support for HTML nodes and pictures in exporting to text, HTML or RTF (Word, Wordpad). At least, it is convenient for publication on the Web using Freemind's Applet.
+ - Example of pictures, working on some Windows distributions
+ - Example of HTML
There are several items:
| a | b |
| ----------- | ............. |
+ - Physical style - patterns
There is a set of physical styles also called patterns. They are stored in the file "patterns.xml" located at the folder "freemind" in your home directory.
Application
You can create or change patterns by editing "patterns.xml". Pattern applies to node, if there is a <node> tag, it applies to edge, if there is an <edge> tag. <node> tag can have <font> tag as a child. Study the file "patterns.xml" supplied with FreeMind.
+ - Zoom
+ - File locking
Current version of FreeMind has experimental file locking, which is disabled by default. Current implementation does not really prevent race conditions, but it should be fine for the most of practical purposes. What does file locking mean? It makes sure that more users do not edit the same map at the same time, preventing them from incidentally overwriting the information from each other.
You can enable experimental file locking, if you are a technical user and are willing to edit user.properties, as described above.
+ - Changes in user interface of recent version
Some of the key settings have been redefined so that they align themselves with what we consider shared standard or intuitive use. Some of the new key settings are modelled on Microsoft tools. New key settings include enter for creating of new siblings below the node, insert for creating new children, F2 for editing nodes - here the Microsoft influence is apparent while there is no intuitive reason to have F2 for node editing. But once you get used to it in all the applications you use, you want to have that one in FreeMind too of course.
The changes we have made in the user interface are customizable in user.properties to an extent.
To copy your selection to clipboard when you are editing a node, press right mouse button and choose copy
+ - Icons
+ - Graphical links
| Mark a node and drag this node to another node holding both shift and control keys and release the mouse button first creates a graphical link between them. |
You can edit some properties of this link using right click onto the line between them.
You may choose the color and the arrow positions.
Moreover you can go directly to the other node (even if its folded) using the right click on the small part of the graphical link.
Example
+ - Clouds
You can browse the mind maps in browse mode. Why is there a separate mode for browsing? That's because browsing is the only thing you can do in FreeMind applet, which can be put to your website. Normally, you would not use browse mode in FreeMind.
You can browse the files on your computer using file mode. To enter file mode, in menu: Modes > File.
You can then browse the file tree as if it was a mind map. You can make any folder the root of the map by chosing "Center" from the node menu. To view or execute a file, follow the link of the node.
The file mode is currently not very useful; it is a demonstration that it's not too difficult to feed data into the tree from other source than mind map. There is no evidence that people would really use this mode.
Although Freemind is primarily a tool for editing Mind Maps, it is designed to be able to view data coming from different data sources. To make a specific data source available for viewing in FreeMind, a programmer has to write a so called mode for that data source. In the standard, there is an example of such a mode, namely file mode. We do not know of any other modes implemented. It is not clear if anyone would really want to make use of this architecture, but it's here to be exploited if someone wants to.
Furthermore, there is code almost ready for Scheme Mode which enables you to edit scheme programs. Again, the usefulness is far from clear. While the mind map mode is clearly a real thing, other modes seem to be more a demonstration of what is possible than something really used by people.
Of the value traps, the most widespread and pernicious is value rigidity. This is an inability to revalue what one sees because of commitment to previous values. In motorcycle maintenance, you must rediscover what you do as you go. Rigid values make this impossible.
The typical situation is that the motorcycle doesn't work. The facts are there but you don't see them. You're looking right at them, but they don't yet have enough value. This is what Phædrus was talking about. Quality, value, creates the subjects and objects of the world. The facts do not exist until value has created them. If your values are rigid you can't really learn new facts.
This often shows up in premature diagnosis, when you're sure you know what the trouble is, and then when it isn't, you're stuck. Then you've got to find some new clues, but before you can find them you've got to clear your head of old opinions.
The birth of a new fact is always a wonderful thing to experience. It's dualistically called a ``discovery'' because of the presumption that it has an existence independent of anyone's awareness of it. When it comes along, it always has, at first, a low value. Then, depending on the value-looseness of the observer and the potential quality of the fact, its value increases, either slowly or rapidly, or the value wanes and the fact disappears.
Ideally, you don't need any customizing at all. But if you really want to customize FreeMind, copy the file "user.properties" to the folder "freemind" in your home directory and edit the properties in the text file using your favorite text editor, e.g. notepad, Vim or Emacs.
You sure know your home directory if you're working on Linux. On Windows 2000, it's typically "C:\Documents and Settings\<UserName>\", on Windows 95, it's "C:\WINDOWS\". Edit "user.properties" in the folder "freemind" of your home directory. On Windows, you can additionally configure file type of extension mm to open with FreeMind.
To be able to edit node with newlines, it must be multiline (or long if you wish) first. That is, first write text that is long enough, then finish editing, then press enter again and you find yourself in the larger editing window. It is only that window which contains the check box "Enter confirms".
In the pop up menu of a node, edit the link by the menu item "Node > Set Link (Textfield)" and set the links as an empty string.
You can install the applet at your website so that other users can browse your mind maps.
~ Download the applet, that is freemind-browser.
The downloaded archive contains freemindbrowser.jar and freemindbrowser.html. Create a link from your page to freemindbrowser.html. Edit freemindbrowser.html, especially change the path inside so that it points to your mind map. Beware that the applet's jar file must be located at the same server as the map itself, this is for java security reasons. Of course, you have to upload the files to your web site.
In applet, you can only use the browse mode, that is, you cannot edit the remote maps. Click the nodes to toggle the folding or follow the links. Drag the background to move the map. You can also search the map, using node popup menu.


[...] if a Chinese person were to say his name was “Patrick Murphy”, you would look at him like he’s insane, because Murphy is an Irish name – a European name — or a name that has a Caucasian or a white background. And a Chinese is a “yellow man” and he has nothing to do — or no connection whatsoever — with the name “Murphy”. And if it doesn’t look proper for a person who is yellow — or Chinese — to be walking around named Murphy [...]
— Malcolm X
[...] Chinese people were classified as Black in South Africa. I don’t mean they were running around acting black, they were still Chinese. [...] at the same time Japanese people were labelled as white. The reason for this is that the South African government wanted to establish good relationship with the Japanese in order to import their fancy cars and electronics. So Japanese people were given honorary white status, while Chinese people stayed black.
— Trevor Noah


| 1 | /* | |
| 2 | * | |
| 3 | * Licensed to the Apache Software Foundation (ASF) under one | |
| 4 | * or more contributor license agreements. See the NOTICE file | |
| 5 | * distributed with this work for additional information | |
| 6 | * regarding copyright ownership. The ASF licenses this file | |
| 7 | * to you under the Apache License, Version 2.0 (the | |
| 8 | * "License"); you may not use this file except in compliance | |
| 9 | * with the License. You may obtain a copy of the License at | |
| 10 | * | |
| 11 | * http://www.apache.org/licenses/LICENSE-2.0 | |
| 12 | * | |
| 13 | * Unless required by applicable law or agreed to in writing, | |
| 14 | * software distributed under the License is distributed on an | |
| 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | |
| 16 | * KIND, either express or implied. See the License for the | |
| 17 | * specific language governing permissions and limitations | |
| 18 | * under the License. | |
| 19 | * | |
| 20 | */ | |
| 21 | ||
| 22 | package org.apache.bookkeeper.bookie; | |
| 23 | ||
| 24 | import java.io.Closeable; | |
| 25 | import java.io.IOException; | |
| 26 | import java.nio.ByteBuffer; | |
| 27 | import java.nio.channels.FileChannel; | |
| 28 | import java.util.concurrent.atomic.AtomicLong; | |
| 29 | ||
| 30 | import io.netty.buffer.ByteBuf; | |
| 31 | import io.netty.buffer.ByteBufAllocator; | |
| 32 | import io.netty.util.ReferenceCountUtil; | |
| 33 | ||
| 34 | /** | |
| 35 | * Provides a buffering layer in front of a FileChannel. | |
| 36 | */ | |
| 37 | public class BufferedChannel extends BufferedReadChannel implements Closeable { | |
| 38 | // The capacity of the write buffer. | |
| 39 | protected final int writeCapacity; | |
| 40 | // The position of the file channel's write pointer. | |
| 41 | protected AtomicLong writeBufferStartPosition = new AtomicLong(0); | |
| 42 | // The buffer used to write operations. | |
| 43 | protected final ByteBuf writeBuffer; | |
| 44 | // The absolute position of the next write operation. | |
| 45 | protected volatile long position; | |
| 46 | ||
| 47 | /* | |
| 48 | * if unpersistedBytesBound is non-zero value, then after writing to | |
| 49 | * writeBuffer, it will check if the unpersistedBytes is greater than | |
| 50 | * unpersistedBytesBound and then calls flush method if it is greater. | |
| 51 | * | |
| 52 | * It is a best-effort feature, since 'forceWrite' method is not synchronized | |
| 53 | * and unpersistedBytes is reset in 'forceWrite' method before calling | |
| 54 | * fileChannel.force | |
| 55 | */ | |
| 56 | protected final long unpersistedBytesBound; | |
| 57 | private final boolean doRegularFlushes; | |
| 58 | ||
| 59 | /* | |
| 60 | * it tracks the number of bytes which are not persisted yet by force writing | |
| 61 | * the FileChannel. The unpersisted bytes could be in writeBuffer or in | |
| 62 | * fileChannel system cache. | |
| 63 | */ | |
| 64 | protected final AtomicLong unpersistedBytes; | |
| 65 | ||
| 66 | private boolean closed = false; | |
| 67 | ||
| 68 | // make constructor to be public for unit test | |
| 69 | public BufferedChannel(ByteBufAllocator allocator, FileChannel fc, int capacity) throws IOException { | |
| 70 | // Use the same capacity for read and write buffers. | |
| 71 | this(allocator, fc, capacity, 0L); | |
| 72 | } | |
| 73 | ||
| 74 | public BufferedChannel(ByteBufAllocator allocator, FileChannel fc, int capacity, long unpersistedBytesBound) | |
| 75 | throws IOException { | |
| 76 | // Use the same capacity for read and write buffers. | |
| 77 | this(allocator, fc, capacity, capacity, unpersistedBytesBound); | |
| 78 | } | |
| 79 | ||
| 80 | public BufferedChannel(ByteBufAllocator allocator, FileChannel fc, int writeCapacity, int readCapacity, | |
| 81 | long unpersistedBytesBound) throws IOException { | |
| 82 | super(fc, readCapacity); | |
| 83 | this.writeCapacity = writeCapacity; | |
| 84 | this.position = fc.position(); | |
| 85 |
1
1. <init> : removed call to java/util/concurrent/atomic/AtomicLong::set → SURVIVED |
this.writeBufferStartPosition.set(position); |
| 86 | this.writeBuffer = allocator.directBuffer(writeCapacity); | |
| 87 | this.unpersistedBytes = new AtomicLong(0); | |
| 88 | this.unpersistedBytesBound = unpersistedBytesBound; | |
| 89 |
2
1. <init> : changed conditional boundary → KILLED 2. <init> : negated conditional → KILLED |
this.doRegularFlushes = unpersistedBytesBound > 0; |
| 90 | } | |
| 91 | ||
| 92 | @Override | |
| 93 | public synchronized void close() throws IOException { | |
| 94 |
1
1. close : negated conditional → SURVIVED |
if (closed) { |
| 95 | return; | |
| 96 | } | |
| 97 |
1
1. close : removed call to io/netty/util/ReferenceCountUtil::safeRelease → SURVIVED |
ReferenceCountUtil.safeRelease(writeBuffer); |
| 98 |
1
1. close : removed call to java/nio/channels/FileChannel::close → SURVIVED |
fileChannel.close(); |
| 99 | closed = true; | |
| 100 | } | |
| 101 | ||
| 102 | /** | |
| 103 | * Write all the data in src to the {@link FileChannel}. Note that this function | |
| 104 | * can buffer or re-order writes based on the implementation. These writes will | |
| 105 | * be flushed to the disk only when flush() is invoked. | |
| 106 | * | |
| 107 | * @param src The source ByteBuffer which contains the data to be written. | |
| 108 | * @throws IOException if a write operation fails. | |
| 109 | */ | |
| 110 | public void write(ByteBuf src) throws IOException { | |
| 111 | int copied = 0; | |
| 112 | boolean shouldForceWrite = false; | |
| 113 | synchronized (this) { | |
| 114 | int len = src.readableBytes(); | |
| 115 |
2
1. write : changed conditional boundary → TIMED_OUT 2. write : negated conditional → TIMED_OUT |
while (copied < len) { |
| 116 |
1
1. write : Replaced integer subtraction with addition → SURVIVED |
int bytesToCopy = Math.min(src.readableBytes() - copied, writeBuffer.writableBytes()); |
| 117 |
1
1. write : Replaced integer addition with subtraction → KILLED |
writeBuffer.writeBytes(src, src.readerIndex() + copied, bytesToCopy); |
| 118 |
1
1. write : Replaced integer addition with subtraction → KILLED |
copied += bytesToCopy; |
| 119 | ||
| 120 | // if we have run out of buffer space, we should flush to the | |
| 121 | // file | |
| 122 |
1
1. write : negated conditional → KILLED |
if (!writeBuffer.isWritable()) { |
| 123 |
1
1. write : removed call to org/apache/bookkeeper/bookie/BufferedChannel::flush → KILLED |
flush(); |
| 124 | } | |
| 125 | } | |
| 126 |
1
1. write : Replaced long addition with subtraction → SURVIVED |
position += copied; |
| 127 |
1
1. write : negated conditional → KILLED |
if (doRegularFlushes) { |
| 128 | unpersistedBytes.addAndGet(copied); | |
| 129 |
2
1. write : changed conditional boundary → SURVIVED 2. write : negated conditional → SURVIVED |
if (unpersistedBytes.get() >= unpersistedBytesBound) { |
| 130 |
1
1. write : removed call to org/apache/bookkeeper/bookie/BufferedChannel::flush → SURVIVED |
flush(); |
| 131 | shouldForceWrite = true; | |
| 132 | } | |
| 133 | } | |
| 134 | } | |
| 135 |
1
1. write : negated conditional → SURVIVED |
if (shouldForceWrite) { |
| 136 | forceWrite(false); | |
| 137 | } | |
| 138 | } | |
| 139 | ||
| 140 | /** | |
| 141 | * Get the position where the next write operation will begin writing from. | |
| 142 | * | |
| 143 | * @return | |
| 144 | */ | |
| 145 | public long position() { | |
| 146 |
1
1. position : replaced long return with 0 for org/apache/bookkeeper/bookie/BufferedChannel::position → NO_COVERAGE |
return position; |
| 147 | } | |
| 148 | ||
| 149 | /** | |
| 150 | * Get the position of the file channel's write pointer. | |
| 151 | * | |
| 152 | * @return | |
| 153 | */ | |
| 154 | public long getFileChannelPosition() { | |
| 155 |
1
1. getFileChannelPosition : replaced long return with 0 for org/apache/bookkeeper/bookie/BufferedChannel::getFileChannelPosition → NO_COVERAGE |
return writeBufferStartPosition.get(); |
| 156 | } | |
| 157 | ||
| 158 | /** | |
| 159 | * calls both flush and forceWrite methods. | |
| 160 | * | |
| 161 | * @param forceMetadata - If true then this method is required to force changes | |
| 162 | * to both the file's content and metadata to be written to | |
| 163 | * storage; otherwise, it need only force content changes | |
| 164 | * to be written | |
| 165 | * @throws IOException | |
| 166 | */ | |
| 167 | public void flushAndForceWrite(boolean forceMetadata) throws IOException { | |
| 168 |
1
1. flushAndForceWrite : removed call to org/apache/bookkeeper/bookie/BufferedChannel::flush → NO_COVERAGE |
flush(); |
| 169 | forceWrite(forceMetadata); | |
| 170 | } | |
| 171 | ||
| 172 | /** | |
| 173 | * calls both flush and forceWrite methods if regular flush is enabled. | |
| 174 | * | |
| 175 | * @param forceMetadata - If true then this method is required to force changes | |
| 176 | * to both the file's content and metadata to be written to | |
| 177 | * storage; otherwise, it need only force content changes | |
| 178 | * to be written | |
| 179 | * @throws IOException | |
| 180 | */ | |
| 181 | public void flushAndForceWriteIfRegularFlush(boolean forceMetadata) throws IOException { | |
| 182 |
1
1. flushAndForceWriteIfRegularFlush : negated conditional → NO_COVERAGE |
if (doRegularFlushes) { |
| 183 |
1
1. flushAndForceWriteIfRegularFlush : removed call to org/apache/bookkeeper/bookie/BufferedChannel::flushAndForceWrite → NO_COVERAGE |
flushAndForceWrite(forceMetadata); |
| 184 | } | |
| 185 | } | |
| 186 | ||
| 187 | /** | |
| 188 | * Write any data in the buffer to the file and advance the writeBufferPosition. | |
| 189 | * Callers are expected to synchronize appropriately | |
| 190 | * | |
| 191 | * @throws IOException if the write fails. | |
| 192 | */ | |
| 193 | public synchronized void flush() throws IOException { | |
| 194 | ByteBuffer toWrite = writeBuffer.internalNioBuffer(0, writeBuffer.writerIndex()); | |
| 195 | do { | |
| 196 | fileChannel.write(toWrite); | |
| 197 |
1
1. flush : negated conditional → TIMED_OUT |
} while (toWrite.hasRemaining()); |
| 198 | writeBuffer.clear(); | |
| 199 |
1
1. flush : removed call to java/util/concurrent/atomic/AtomicLong::set → KILLED |
writeBufferStartPosition.set(fileChannel.position()); |
| 200 | } | |
| 201 | ||
| 202 | /* | |
| 203 | * force a sync operation so that data is persisted to the disk. | |
| 204 | */ | |
| 205 | public long forceWrite(boolean forceMetadata) throws IOException { | |
| 206 | // This is the point up to which we had flushed to the file system page cache | |
| 207 | // before issuing this force write hence is guaranteed to be made durable by | |
| 208 | // the force write, any flush that happens after this may or may | |
| 209 | // not be flushed | |
| 210 | long positionForceWrite = writeBufferStartPosition.get(); | |
| 211 | /* | |
| 212 | * since forceWrite method is not called in synchronized block, to make sure we | |
| 213 | * are not undercounting unpersistedBytes, setting unpersistedBytes to the | |
| 214 | * current number of bytes in writeBuffer. | |
| 215 | * | |
| 216 | * since we are calling fileChannel.force, bytes which are written to | |
| 217 | * filechannel (system filecache) will be persisted to the disk. So we dont need | |
| 218 | * to consider those bytes for setting value to unpersistedBytes. | |
| 219 | * | |
| 220 | * In this method fileChannel.force is not called in synchronized block, so we | |
| 221 | * are doing best efforts to not overcount or undercount unpersistedBytes. Hence | |
| 222 | * setting writeBuffer.readableBytes() to unpersistedBytes. | |
| 223 | * | |
| 224 | */ | |
| 225 |
2
1. forceWrite : changed conditional boundary → SURVIVED 2. forceWrite : negated conditional → SURVIVED |
if (unpersistedBytesBound > 0) { |
| 226 | synchronized (this) { | |
| 227 |
1
1. forceWrite : removed call to java/util/concurrent/atomic/AtomicLong::set → SURVIVED |
unpersistedBytes.set(writeBuffer.readableBytes()); |
| 228 | } | |
| 229 | } | |
| 230 | ||
| 231 |
1
1. forceWrite : removed call to java/nio/channels/FileChannel::force → SURVIVED |
fileChannel.force(forceMetadata); |
| 232 |
1
1. forceWrite : replaced long return with 0 for org/apache/bookkeeper/bookie/BufferedChannel::forceWrite → SURVIVED |
return positionForceWrite; |
| 233 | } | |
| 234 | ||
| 235 | @Override | |
| 236 | public synchronized int read(ByteBuf dest, long pos, int length) throws IOException { | |
| 237 | long prevPos = pos; | |
| 238 | ||
| 239 |
2
1. read : changed conditional boundary → KILLED 2. read : negated conditional → KILLED |
while (length > 0) { |
| 240 | // check if it is in the write buffer | |
| 241 | // si vogliono leggere i dati nel writeBuffer perchè si vuole iniziare a leggere | |
| 242 | // da una posizione successiva a quella dell'ultimo dato eventualmente scritto | |
| 243 | // nel file. Se ci sono dati presenti oltre quella posizione, si trovano | |
| 244 | // sicuramente nel writeBuffer | |
| 245 |
3
1. read : changed conditional boundary → KILLED 2. read : negated conditional → KILLED 3. read : negated conditional → KILLED |
if (writeBuffer != null && writeBufferStartPosition.get() <= pos) { |
| 246 | ||
| 247 |
1
1. read : Replaced long subtraction with addition → SURVIVED |
int positionInBuffer = (int) (pos - writeBufferStartPosition.get()); |
| 248 |
1
1. read : Replaced integer subtraction with addition → SURVIVED |
int bytesToCopy = Math.min(writeBuffer.writerIndex() - positionInBuffer, dest.writableBytes()); |
| 249 | ||
| 250 |
1
1. read : negated conditional → KILLED |
if (bytesToCopy == 0) { |
| 251 | throw new IOException("Read past EOF"); | |
| 252 | } | |
| 253 | ||
| 254 | dest.writeBytes(writeBuffer, positionInBuffer, bytesToCopy); | |
| 255 |
1
1. read : Replaced long addition with subtraction → KILLED |
pos += bytesToCopy; |
| 256 |
1
1. read : Replaced integer subtraction with addition → KILLED |
length -= bytesToCopy; |
| 257 | ||
| 258 |
3
1. read : changed conditional boundary → NO_COVERAGE 2. read : negated conditional → SURVIVED 3. read : negated conditional → NO_COVERAGE |
} else if (writeBuffer == null && writeBufferStartPosition.get() <= pos) { |
| 259 | // here we reach the end | |
| 260 | break; | |
| 261 | // first check if there is anything we can grab from the readBuffer | |
| 262 | // Se nel readBuffer ci sono dati letti dal fileChannel li si scrive nel buffer | |
| 263 | // di destinazione dst | |
| 264 |
5
1. read : changed conditional boundary → SURVIVED 2. read : changed conditional boundary → TIMED_OUT 3. read : Replaced long addition with subtraction → TIMED_OUT 4. read : negated conditional → TIMED_OUT 5. read : negated conditional → TIMED_OUT |
} else if (readBufferStartPosition <= pos && pos < readBufferStartPosition + readBuffer.writerIndex()) { |
| 265 |
1
1. read : Replaced long subtraction with addition → SURVIVED |
int positionInBuffer = (int) (pos - readBufferStartPosition); |
| 266 |
1
1. read : Replaced integer subtraction with addition → SURVIVED |
int bytesToCopy = Math.min(readBuffer.writerIndex() - positionInBuffer, dest.writableBytes()); |
| 267 | dest.writeBytes(readBuffer, positionInBuffer, bytesToCopy); | |
| 268 |
1
1. read : Replaced long addition with subtraction → KILLED |
pos += bytesToCopy; |
| 269 |
1
1. read : Replaced integer subtraction with addition → KILLED |
length -= bytesToCopy; |
| 270 | // let's read it | |
| 271 | // se non ci sono dati nel writeBuffer oppure il writeBuffer contiene dei dati | |
| 272 | // ma anche il file ha dei dati e noi vogliamo leggerli dato che | |
| 273 | // writeBufferStartPosition > pos. Si legge i dati dal fileChannel e li si mette | |
| 274 | // nel readBuffer che ha la stessa capacità | |
| 275 | // del writeBuffer, per come abbiamo istanziato il bufferedChannel. Quando sia | |
| 276 | // il writeBuffer che il file contengono dati, si legge prima dal file e poi dal | |
| 277 | // writeBuffer in modo da mantenere la sequenzialità dei dati così come sono | |
| 278 | // stati letti da src, in quanto i dati rimanenti nel writeBuffer sono quelli | |
| 279 | // più recentemente letti da src rispetto a quelli flushati sul file | |
| 280 | } else { | |
| 281 | readBufferStartPosition = pos; | |
| 282 | int readBytes = fileChannel.read(readBuffer.internalNioBuffer(0, readCapacity), | |
| 283 | readBufferStartPosition); | |
| 284 |
2
1. read : changed conditional boundary → SURVIVED 2. read : negated conditional → KILLED |
if (readBytes <= 0) { |
| 285 | throw new IOException("Reading from filechannel returned a non-positive value. Short read."); | |
| 286 | } | |
| 287 | readBuffer.writerIndex(readBytes); | |
| 288 | } | |
| 289 | } | |
| 290 |
2
1. read : Replaced long subtraction with addition → SURVIVED 2. read : replaced int return with 0 for org/apache/bookkeeper/bookie/BufferedChannel::read → KILLED |
return (int) (pos - prevPos); |
| 291 | } | |
| 292 | ||
| 293 | @Override | |
| 294 | public synchronized void clear() { | |
| 295 |
1
1. clear : removed call to org/apache/bookkeeper/bookie/BufferedReadChannel::clear → NO_COVERAGE |
super.clear(); |
| 296 | writeBuffer.clear(); | |
| 297 | } | |
| 298 | ||
| 299 | public synchronized int getNumOfBytesInWriteBuffer() { | |
| 300 |
1
1. getNumOfBytesInWriteBuffer : replaced int return with 0 for org/apache/bookkeeper/bookie/BufferedChannel::getNumOfBytesInWriteBuffer → KILLED |
return writeBuffer.readableBytes(); |
| 301 | } | |
| 302 | ||
| 303 | long getUnpersistedBytes() { | |
| 304 |
1
1. getUnpersistedBytes : replaced long return with 0 for org/apache/bookkeeper/bookie/BufferedChannel::getUnpersistedBytes → NO_COVERAGE |
return unpersistedBytes.get(); |
| 305 | } | |
| 306 | } | |
Mutations | ||
| 85 |
1.1 |
|
| 89 |
1.1 2.2 |
|
| 94 |
1.1 |
|
| 97 |
1.1 |
|
| 98 |
1.1 |
|
| 115 |
1.1 2.2 |
|
| 116 |
1.1 |
|
| 117 |
1.1 |
|
| 118 |
1.1 |
|
| 122 |
1.1 |
|
| 123 |
1.1 |
|
| 126 |
1.1 |
|
| 127 |
1.1 |
|
| 129 |
1.1 2.2 |
|
| 130 |
1.1 |
|
| 135 |
1.1 |
|
| 146 |
1.1 |
|
| 155 |
1.1 |
|
| 168 |
1.1 |
|
| 182 |
1.1 |
|
| 183 |
1.1 |
|
| 197 |
1.1 |
|
| 199 |
1.1 |
|
| 225 |
1.1 2.2 |
|
| 227 |
1.1 |
|
| 231 |
1.1 |
|
| 232 |
1.1 |
|
| 239 |
1.1 2.2 |
|
| 245 |
1.1 2.2 3.3 |
|
| 247 |
1.1 |
|
| 248 |
1.1 |
|
| 250 |
1.1 |
|
| 255 |
1.1 |
|
| 256 |
1.1 |
|
| 258 |
1.1 2.2 3.3 |
|
| 264 |
1.1 2.2 3.3 4.4 5.5 |
|
| 265 |
1.1 |
|
| 266 |
1.1 |
|
| 268 |
1.1 |
|
| 269 |
1.1 |
|
| 284 |
1.1 2.2 |
|
| 290 |
1.1 2.2 |
|
| 295 |
1.1 |
|
| 300 |
1.1 |
|
| 304 |
1.1 |


{% extends "layout.html" %} {% block content %}
This document was created using a Contractology template available at http://www.contractology.com.
"European Short Interest", hereafter called "ESI", is provided “as is” without any representations or warranties, express or implied. ESI makes no representations or warranties in relation to this website or the information and materials provided on this website. Without prejudice to the generality of the foregoing paragraph, ESI does not warrant that:
Nothing on ESI constitutes, or is meant to constitute, advice of any kind. If you require advice in relation to any financial or legal matter, you should consult an appropriate professional.
ESI will not be liable to you (whether under the law of contract, the law of torts or otherwise) in relation to the contents of, or use of, or otherwise in connection with, ESI:
These limitations of liability apply even if ESI has been expressly advised of the potential loss.
Nothing in this website disclaimer will exclude or limit any warranty implied by law that it would be unlawful to exclude or limit; and nothing in this website disclaimer will exclude or limit ESI liability in respect of any:
By using ESI, you agree that the exclusions and limitations of liability set out in ESI disclaimer are reasonable. If you do not think they are reasonable, you must not use ESI.
If any provision of this website disclaimer is, or is found to be, unenforceable under applicable law, that will not affect the enforceability of the other provisions of ESI disclaimer.
{% endblock %}


The Aston Martin DBX Has Finally Been Revealed. So, What Do You Think Of The Latest High-End Sports SUV?
by News DeskAston Martin has just unveiled the DBX, its first-ever SUV at a gala event in Beijing, China. It would be a massive understatement to say that this is just a new model for the brand as this new vehicle not only has to deliver the broadest design brief of any Aston Martin in history but it also represents a totally new chapter in the marque’s 106-year history.
Aston Martin Lagonda President & Group CEO, Dr Andy Palmer said, “I can’t emphasize enough how incredibly exciting and significant DBX is for Aston Martin. Through its development alone, this beautiful SUV has already taken the company into new territories and in inspiring directions. DBX also marks a key moment in the delivery of the third and final phase of our Second Century Plan, not only representing the promised expansion of our portfolio but also signaling the start of production at Aston Martin’s second manufacturing plant.
“We have both delivered this model through our expertise, but also by garnering invaluable experience and knowledge from external counsel, including our Female Advisory Board. This is a real landmark for this great British brand and I promise that DBX will reward all who experience it in their everyday lives.”
Straight-line performance is key in any Aston Martin and the DBX doesn’t disappoint. It’s powered by a new version of the 4.0-liter twin-turbo V8 already doing duty in the DB11 and Vantage, and in this application it produces 542hp along with 516 lb-ft of torque, enough for a 0 to 60mph time of 4.3-seconds and a top speed of 181mph.
A nine-speed automatic transmission sends that power to an AWD system featuring an active central differential and an electronic rear limited-slip differential (eDiff). An adaptive triple volume air suspension system combined with a 48v electric anti-roll control system (eARC) further expands the DBX’s dynamic capabilities while also maintaining a high level of ride comfort.
Bonded aluminum construction methods have resulted in a very stiff and very light body structure, although in a vehicle of this type the term ‘light’ is relative, the DBX still tips the scales at 4,949 pounds. A fair bit heftier than more traditional sports cars but right in the ballpark compared to its SUV rivals.
Curb weight aside, the new Aston does excel in areas where none of its predecessors have: it’s the marque’s first full-size five-seater and it offers more occupant and cargo space than any Aston Martin before. The interior is a hand-crafted haven of fine leather and soft-touch materials and it can be personalized to each owner’s individual tastes through the ‘Q by Aston Martin’ bespoke service.
The first 500 owners will also have their cars fitted with an exclusive ‘1913 Package’. It comprises of a unique fender badge, sill plaques and an inspection plaque detailing its limited build-run, each of these first examples will be personally endorsed and inspected by Andy Palmer.
Andy Palmer continued, “DBX is a car that will give many people their first experience of Aston Martin ownership. As such, it needed to be true to the core values established in our sports cars, while also providing the lifestyle versatility expected of a luxury SUV. To have produced such a beautiful, hand-built, yet technologically advanced car is a proud moment for Aston Martin.”
Deliveries of the Aston Martin DBX are scheduled to begin in the second half of 2020 and pricing before customization starts at £158,000 in the UK, €193,500 in Germany and $189,900 in the US.
Images courtesy of Aston Martin


BERKSHIRE HATTAWAY INC.3555 Farnam StreetOmaha, NE 68131Official Home Page
Updated November 6, 2015
Updated February 16, 2016
Updated February 28, 2015
(A commemorative book first sold at the 2015 Annual Meeting and now for sale on eBay.)
FOR A FREE CAR INSURANCE RATE QUOTE THAT COULD SAVE YOU SUBSTANTIAL MONEYWWWW.GEICO.COM OR CALL 1-888-395-6349, 24 HOURS A DAY
If you have any comments about our WEB page, you can either write us at the address shown above or e-mail us at<EMAIL_ADDRESS>However, due to the limited number of personnel in our corporate office, we are unable to provide a direct response.


Please enter the address of your UniFi Protect controller (e.g. unvr.local or <IP_ADDRESS>) and the login credentials for a local user to get started with homebridge-unifi-protect.
|
|
||||||||||
I hope you enjoy homebridge-unifi-protect as much as I enjoy developing it. All my projects are labors of love.