Baynes rising from the NBA ashes with Phoenix
by Peter MitchellAron Baynes the NBA All-Star?
How about Aron Baynes the NBA's most-improved player award winner? Or Aron Baynes the $10 million ($A14.7m) plus per season man?
A month ago all of the above would seem like fantasy for the Australian big man but his sensational form with the Phoenix Suns has been one of the surprises of the NBA.
"Aron's been a stud all year," Suns coach Monty Williams said.
The Suns have also surprised with seven wins, four losses, placing them fifth in the talent-stacked Western Conference.
You could say Baynes has been a Phoenix rising from the ashes.
In June the 32-year-old Queenslander's career hit an unexpected speed bump when the Boston Celtics, looking to shed salary, traded Baynes to the then-dismal Suns.
Phoenix thought Baynes could add some defensive toughness and be a mentor to their elite young centre DeAndre Ayton.
The Australian opened the season on the bench but, when Ayton was suspended on October 24 for 25 games for testing positive for a diuretic, Baynes became the starter and his stats exploded.
Baynes has career averages during his eight NBA seasons of 5.7 points, 4.4 rebounds and 0.7 assists per game.
This year with the Suns he is averaging 15 points, 5.5 rebounds and 2.9 assists.
Baynes, with his red Ned Kelly beard and huge 208cm tall, 118kg frame, was known for his brutish blue-collar play - rebounding, setting screens and putting his body on the line protecting the rim.
Today, he is one of the NBA's best three-point shooters after devoting hundreds of hours in the gym practising the shot.
He has sunk 22 of 47 three-point attempts this season - a 46.8 per cent success rate that places him 14th among the NBA's best long-range shooters.
It is a stunning turnaround from his first five seasons with the San Antonio Spurs and Detroit Pistons when he only took seven three-pointers and did not make any.
Baynes is also one of the most effective scorers around the basket.
He is in the NBA's top five for most efficient scorers in the pick and roll, on the post and other statistics.
Williams also points to the leadership of Baynes on the court, particularly on defence where he is vocal directing his younger teammates.
"Aron usually calls that stuff out," Williams said.
"He's like a middle linebacker."
All-Star selection might be a stretch although Baynes is a legitimate candidate for most improved.
He becomes a free agent at the end of the season and his price tag is expected to be a substantial upgrade on the $5.5m ($A8.1m) he will earn this season.
"[Baynes] is positioning himself for well over $US10 million per year," an NBA team executive told The Athletic.
AAP


There are no zones configured.
{{ elem.zone_nickname }}
Note: Nickname can only contain letters and numbers and cannot exceed more than 15 characters.


--- layout: post title: "@edelvil Rock Wall Climbing" date: 2010-07-03 22:31:28.000000000 -07:00 type: post published: true status: publish categories: [] tags: [] meta: {} author: ---


Poke Face - Quality Assurance
Here at Poke Face we strive on serving the freshest ingredients with great customer service to match it. Quality assurance is very important to us and we have a team dedicated to making sure we meet these high standards.
Cold Chain
We gurantee that our products stay cold all the way from harvest to consumption to uphold our high quality standards. Recevied shipments with any temperatures that are outside the acceptable limits are rejected and returned immediately. Every half hour we check and record the temperatrues for all of our produce and perishable products stored in freezers and refrigerators.
Recall Plan and System
Our receiving department has a strict plan and set of guidelines to follow in the event of the recall of any of our produce or invetory items. We have also created a communications system which tracks company recall notices in real time and sends alerts to our receiving department supervisor immeditately. Our strict recall plan and communications systems ensure that our customers receive the freshest ingredients and are protected from consuming recalled produce.
Quality Issues
Any detected or reported product, customer, or employee issues are recorded through either internal audits, internal communications, and/or online reviews.
Certifications and records
- Pest Control Records
- History of Food Safety Issues
- Product Recall Plans
- Third party audits


Preparation time
less than 30 mins
Cooking time
10 to 30 mins
Serves
Serves 1
Preheat the oven to 200C/400F/Gas 6.
For the tomatoes, heat the oil over a low heat in an ovenproof frying pan. Add the tomatoes and the sugar and place into the oven for 10-12 minutes. Remove from the oven and set aside.
Meanwhile, for the sea bass, season the fillet with salt and freshly ground black pepper, and score the skin-side with a knife.
Heat the oil and the butter in a large frying pan over a medium heat. Add the sea bass fillet, skin-side down and cook for two minutes.
Turn the fillet over and cook for a further 30 seconds, or until cooked through, then remove from the pan and set aside in a warm place.
Tear the rocket leaves and add to the same pan with the balsamic vinegar. Cook for five minutes to reduce the balsamic vinegar to a thick sauce.
For the salad, place the rocket in a bowl and drizzle with olive oil.
To serve, place the rocket salad onto a large plate and top with the sea bass. Drizzle the sea bass with the balsamic and rocket pan juices and sprinkle with chives. Place the roasted tomatoes around the plate.


The growth rate of metropoles has, in general, declined markedly since 1994. Between 1994 and 2001 the annual growth rate of metros was 3.4%. During the 2011-2016 period this had halved to 1.7% per annum. Although the rate of growth is declining the absolute increase in population is substantial - particularly in Gauteng. Thus while the cities are experiencing massive population growth the tempo at which that population is growing is abating. These changes are shown below.
Metro |
1996-2001 |
2001-2011 |
2011-2016 |
|---|---|---|---|
Johannesburg |
4.7 |
3.7 |
2.3 |
Cape Town |
3.5 |
2.9 |
1.4 |
eThekwini |
2.7 |
2.3 |
1.3 |
Tshwane |
4.1 |
3.6 |
2.4 |
Ekuruhleni |
4.7 |
2.8 |
1.3 |
Nelson Mandela Bay |
1.0 |
1.5 |
1.9 |
Buffalo City |
0.7 |
0.7 |
1.5 |
There are significant differences in the growth rate of the larger cities and the two smaller metros (NMA and BUF). The smaller cities enumerator areas currently show increasing rates of growth while the larger metros show declining growth rates. In Tshwane and Johannesburg the growth rate is declining more slowly than in other cities. In Cape Town and Ekuruhleni the drop in the growth rate has been more marked. The growth rate of enumerator areas Ekuruhleni the growth rate is currently one-quarter what it was during the 1996-2001 period. In Cape Town and Ekuruhleni the drop in population growth has been so rapid that these cities may see population stagnation before 2030.
The trend to population stabilisation conforms to the evidence that the South African population is no longer growing "naturally" and will, within the next decade, enter a phase (but for immigration) of decline. Internal migration has a markedly different dynamic and there is remains significant scope for ongoing urbanisation for some time to come.
Identifying the equation that best fits the observed population for each city in 1996, 2001, 2011 and 2016 is a the centre of making projections. In each instance a substantial improvement on a linear projection is obtained by using a linear projection based on a "second order polynomial". These curves correspond to the form y=ax + bx2 +c where y is the population in the year for which a projection is to be made, 'x' is the population observed in the past and parameters 'a' and 'b' show how the curve changes over time. For each of the cities that curve that a) best fits the four observed points and b) projects that trend to 2030 is shown in the graphic below.


|
| | Builder (TXmlReader component) |
| |
| virtual TBuilder | Record (string record) |
| | The DomQuery path to the repeated element which contains record information. More...
|
| |
| | Builder () |
| |
| | Builder (XmlReader component) |
| |
| | Builder (XmlReader.Config config) |
| |
| | Builder (TAbstractReader component) |
| |
| virtual TBuilder | GroupRootProperty (string groupRootProperty) |
| | Name of the property from which to retrieve remote grouping summary information. More...
|
| |
| virtual TBuilder | IDProperty (string iDProperty) |
| | Name of the property within a row object that contains a record identifier value. Defaults to The id of the model. If an idProperty is explicitly specified it will override that of the one specified on the model More...
|
| |
| virtual TBuilder | ImplicitIncludes (bool implicitIncludes) |
| | True to automatically parse models nested within other models in a response object. See the Ext.data.reader.Reader intro docs for full explanation. Defaults to true. More...
|
| |
| virtual TBuilder | KeepRawData (bool? keepRawData) |
| |
| virtual TBuilder | ReadRecordsOnFailure (bool readRecordsOnFailure) |
| | True to read extract the records from a data packet even if the success property returns false. Defaults to: true More...
|
| |
| virtual TBuilder | RootProperty (string rootProperty) |
| | The name of the property which contains the Array of row objects. For JSON reader it's dot-separated list of property names. For XML reader it's a CSS selector. For array reader it's not applicable. More...
|
| |
| virtual TBuilder | SuccessProperty (string successProperty) |
| | Name of the property from which to retrieve the success attribute. Defaults to success. See Ext.data.proxy.Proxy.exception for additional information. More...
|
| |
| virtual TBuilder | SummaryRootProperty (string summaryRootProperty) |
| | Name of the property from which to retrieve remote summary information. More...
|
| |
| virtual TBuilder | TotalProperty (string totalProperty) |
| | Name of the property from which to retrieve the total number of records in the dataset. This is only needed if the whole dataset is not passed in one go, but is being paged from the remote server. Defaults to total. More...
|
| |
| virtual TBuilder | Transform (Action< TransformFunction > action) |
| | If a transform function is set, it will be invoked just before readRecords executes. It is passed the raw (deserialized) data object. The transform function returns a data object, which can be a modified version of the original data object, or a completely new data object. The transform can be a function, or an object with a 'fn' key and an optional 'scope' key. More...
|
| |
| virtual TBuilder | TypeProperty (string typeProperty) |
| | The name of the property in a node raw data block which indicates the type of the model to be created from that raw data. Useful for heterogenous trees. More...
|
| |
| virtual TBuilder | MessageProperty (string messageProperty) |
| | The name of the property which contains a response message for exception handling. More...
|
| |
| virtual TBuilder | MessagePropertyFn (JFunction messagePropertyFn) |
| | The name of the property which contains a response message for exception handling. More...
|
| |
| virtual TBuilder | ModelName (string modelName) |
| | The Ext.data.Model associated with this reader More...
|
| |
| virtual TBuilder | SetGroupRootProperty (string groupRootProperty) |
| |
| virtual TBuilder | SetSummaryRootProperty (string summaryRootProperty) |
| |
| virtual TBuilder | SetMessageProperty (string messageProperty) |
| |
| virtual TBuilder | SetMessageProperty (JFunction messageProperty) |
| |


Create an input within your jQuery Mobile page. Input type is "text" in order to suppress native datepicker.
<input type="text" />
Apply Mobi Pick after jQuery Mobile page is created (basic configuration).
$( document ).on( "pagecreate", pageselector, function() {
var picker = $( "input[type='text']", this );
picker.mobipick();
});
Optionally handle date changes (works with native and mobipick datepicker)
picker.on( "change", function() {
// formatted date, like yyyy-mm-dd
var date = $( this ).val();
// JavaScript Date object
var dateObject = $( this ).mobipick( "option", "date" );
});
Created by Christoph Baudson. Feel free to check out my blog.


Tail Page will show a page action icon only for URLs that match the regular expressions and URLs below. Please separate each regex or URL with a newline.
Tail Page will show a page action icon only for URLs that match the regular expressions and URLs below. Please separate each regex or URL with a newline.


The debugger's window area located immediately under the menu bar and the toolbar displays the local variables (automatic variables that are visible in the current scope of execution).
To hide this area, select Locals in the View menu. To show it again, select the menu once more.
The local variables view is organized into three columns: one column for the variable name, another one for the value, and a third that displays the type.
Aggregated types such as structures and classes are shown in a hierarchical manner, in a tree
Right-clicking on a row in this window area pops up a menu with several options. You can toggle between hexadecimal and decimal representations for integers, view the variable as raw memory or set a watchpoint at the memory location that corresponds to the variable.
You can alter the value of a variable: double-click on it, then enter the new value in the edit field that pops up. Press Escape to abort, or Enter to accept the change.


Get to know Clarion Events!
Clarion is not just about social events, it is about acquaintances! Have a look at our wall to help youself know us better.
Clarion is not just about social events, it is about acquaintances! Have a look at our wall to help youself know us better.


Street level imagery search helper
Loading...
Find
Map data:
(C)OpenStreetMap contributors
Map:
(C)OpenStreetMap contributors
,
Mapillary
Display map:
Leaflet
Bug report at
Github


Leadership Experience
- Managed a summer intern from the University of Hartford during my work at MEA Mobile in New Haven, CT.
- Provided him guidance on Web development and prototype testing.
- Inculcated some of his suggestions into my application design.


Smile artifacts are hosted in Sonatype Nexus. You can add the following dependency into your pom.xml:
<dependency>
<groupId>com.github.haifengl</groupId>
<artifactId>smile-core</artifactId>
<version>1.5.3</version>
</dependency>
If you're using SBT, add the following line into your build file:
libraryDependencies += "com.github.haifengl" % "smile-core" % "1.5.3"
For Scala API,
libraryDependencies += "com.github.haifengl" %% "smile-scala" % "1.5.3"
To enable machine optimised matrix computation, the users should add the dependency of smile-netlib:
<dependency>
<groupId>com.github.haifengl</groupId>
<artifactId>smile-netlib</artifactId>
<version>1.5.3</version>
</dependency>
and also make their machine-optimised libblas3 (CBLAS) and liblapack3 (Fortran) available as shared libraries at runtime. This module employs the highly efficient netlib-java library.
Apple OS X requires no further setup as it ships with the veclib framework.
Generically-tuned ATLAS and OpenBLAS are available with most distributions and must be enabled explicitly using the package-manager. For example,
sudo apt-get install libatlas3-base libopenblas-base
sudo update-alternatives --config libblas.so
sudo update-alternatives --config libblas.so.3
sudo update-alternatives --config liblapack.so
sudo update-alternatives --config liblapack.so.3
However, these are only generic pre-tuned builds. If you have an Intel MKL licence, you could also create symbolic links from libblas.so.3 and liblapack.so.3 to libmkl_rt.so or use Debian's alternatives system.
The native_system builds expect to find libblas3.dll and liblapack3.dll on the %PATH% (or current working directory). Besides vendor-supplied implementations, OpenBLAS provide generically tuned binaries, and it is possible to build ATLAS.
To serialize a model, you may use
write(model, file)
This method is in the Scala API smile.write
object and serialize the model to Java
serialization format. This is handy if you want to use a model in Spark.
Alternatively, you can also use
write.xstream(model, file)
which uses XStream library to serialize the model (actually any objects) to XML file.
To read the model back, you can use read(file)
or read.xstream(file)
, correspondingly.
Most Smile algorithms take simple double[]
as input. So you can use your favorite methods
or library to import the data as long as the samples are in double arrays. Meanwhile, Smile provides
a couple of parsers for popular data formats, such as Weka's ARFF files, LibSVM's file format,
delimited text files, and binary sparse data. These classes are in the package smile.data.parser
and smile.io
provides high level operators on top of these parsers. The package
smile.data.parser.microarray
also provides several parsers for microarray gene expression datasets,
including GCT, PCL, RES, and TXT files.
We have moved to SBT to build packages. The maven pom.xml files were deprecated and were removed in v1.2.0.
Smile uses sbt-pgp plugin when
publishing to maven central repository. Although you will not publish the project,
you still have to set up sbt-pgp in order to build the packages. Fortunately, it is
very easy. Simply add the following to your ~/.sbt/0.13/plugins/gpg.sbt
file:
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.0.0")
In case that your environment does not have a display or you need to generate and save a lot of plots without showing them on the screen, you may run Smile in headless model.
bin/smile -Djava.awt.headless=true
The following example shows how to save a plot in the headless mode.
val toy = read.table("data/classification/toy/toy-train.txt",response = Some((new NominalAttribute("class"), 0)))
val (x, y) = toy.unzipInt
val canvas = ScatterPlot.plot(x, y, '*', Array(Color.RED, Color.BLUE))
val headless = new Headless(canvas);
headless.pack();
headless.setVisible(true);
canvas.save(new java.io.File("headless.png"))
This is a common question for stochastic algorithms like random forest.
In general, this is discouraged because people often choose bad seed due to the lack
of sufficient knowledge of random number generation. However, one may want the repeatable
result for testing purpose. In this case, the short answer is that set
-Dsmile.threads=1
for JVM and call smile.math.Math.setSeed
before
training the model. Again, if you just want repeatable result, the first step should be sufficient.
Note that we don't provide a method to set the seed for a particular algorithm. Many algorithms are multithreaded and each thread has their own random number generator. We choose this design because each random number generator maintains an internal state so that it is not multithread-safe. If multithreads share a random number generator, we have to use locks, which significant reduce the performance.
A method setSeed(double)
in the algorithm is also troublesome.
For algorithms like random forest, it is not right to initialize every thread
with the same seed. Otherwise, same decision trees will be created
and we lose the randomness of "random" forest. It is also complicated
to pass a sequence of random numbers because it is not clear
how many random number generators are needed for many algorithms. Even worse, it breaks
the encapsulation as the caller has to know the details of algorithms.


Reservation
{% for x in deal %}
Making reservation for deal '{{ x.deal_name }}' at '{{ x.business_name }}'
This deal expires on {{ x.deal_expiry}}
Reservation with Match:
{% for item in matches %}
{{ item.user_name }}
{% endfor %}
Choose a start time for your reservation:
Please pick a date from today onwards
Choose a start time for your reservation:
Please pick a date from today onwards
Choose an end time for your reservation:
Business hours are 9am to 9pm
Make A Reservation!
{% endfor %}


{% include subscribe/sidebar-optin.html %}
{{ page.title }}
{{ content }}
{% include subscribe/optin.html %}
{% include comments.html %}
{% include previous-next_has-categories.html %}
--- layout: default ---


June 27, 2021
MIPS
assembly
book
asciidoctor
Over the last month and a half I've been working on a book on MIPS assembly programming targeted primarily at college students. I did this for two reasons. First
because MIPS is one of the most in-demand subjects in my tutoring (followed
by RISC-V which is growing). Secondly, because it was an excuse to learn
asciidoctor, a more powerful alternative to markdown.
The latest version will always be available here.
It also comes in pdf form.
Lastly, you can see the repo (which includes some example code that is referenced in the book)
here
June 16, 2021
OpenGL
C
libraries
So, it's only 9 months past when I initially released it, but I'm finally
posting it to my projects
page and writing this perfunctory blog post about it.
In a nutshell, it's a portable, single header library, written in clean-C
(ie C++ safe), implementing OpenGL 3.x ish. In other words, it runs
entirely on the CPU and its only dependency is C99, though all the
examples and demos use SDL2.
You can read more about it and look at the examples here.
September 10, 2020
general
LBRY
I've been using LBRY for a while now and it's made amazing proress in the last couple years in terms of the user experience both of the desktop app (which I use on linux), the android app, and of course lbry.tv which is how most people first experience lbry. If you haven't heard of LBRY or don't know what it is, I recommend you read their answer, but in a nutshell it's both a protocol for sharing files (not just videos, that's just what most use it for) in a decentralized way and also the open source applications built by the company to access those files on the network.
The reason I'm talking about it (besides the fact that it's awesome and I want it to continue to grow and want more creators to post to it in addition, or even instead of Youtube), is that I've been experimenting with posting blog posts there. Their markdown syntax is slightly different than the python library I use to generate my static site and it renders a little differently (most annoyingly paragraphs have to be all on one line, at least in the desktop app, the result looks better on lbry.tv) but it's worth the minor changes to get the automatic handling of light and dark modes. If I posted a raw html file one or the other would not look good since there's no way to detect the mode and change css dynamically afaik.
Eventually, I may even start posting videos or other content on LBRY, but for now I'll just try to mirror blog posts and maybe some project READMEs.
June 25, 2020
C
libraries
game
A few days ago I added created 4 new repls of 4 of my C projects. I added repls
for:
These join the one I had for my Goodreads SQLite database. So you can now try
all of these out in the browser here
June 15, 2020
C
libraries
I recently finished some relatively major changes and improvements to CVector.
Since the most recent changes involved actual changes to the API, both adding new functions and modifing a few existing ones,
I've bumped the version up to 4.0.
Since I've never done an update post like this, and you can look at the main project page and documentation
etc. for all the details I'll just sum up some changes from about the last year (since about 3.1.0 give or take):
- Changing elem_init to return an int to indicate failure/success (and adding that checking where it's called)
- Renaming copy functions to match type-as-suffix convention
- Adding a copyc function that does initialization first, ie copy constructor
- Adding a CVEC_STRDUP macro wrapper which defaults to internal cvec_strdup if user doesn't set it
- Adding "move" function varieties (m suffix) for non-POD vectors that do not call elem_init/elem_free or CVEC_STRDUP/free.
- Adding a remove function that doesn't call elem_free/free (predates "move" functions... should I add an m even though the normal
"remove" is called erase? Or rename remove to erasem for consistency?)
- Fixing several bugs and semi-bugs/QOL issues
- Adding lots of new tests to cover most if not all new functionality
- probably more that I'm forgetting
Renaming remove to erasem occurred to me briefly, and I do appreciate the consistency, but I already had remove and theoretically
not breaking existing code (even if it's just mine) is a worthy goal and I feel the english connotations of erase vs remove are
appropriate here. Sigh, now I've pretty much talked myself into adding an erasem wrapper macro that calls remove.
January 12, 2020
books
reading
SQL
I've been learning SQL (and particularly SQLite) slowly and casually over the
last couple months and as I mentioned in my New Year's post, I want to continue
that and use it in more ways and in more projects. Thus far I've read through
a lot of SQLite documentation, done a decent number of Hackerrank problems, gone
through the W3Schools questions, and more importantly used SQLite in some random
Python scripts and added a SQLite based implementation to
CPIM2.
I realized soon after starting with SQL that one dataset that would be fun to play with
would be my Goodreads library.  Since I had
another few books I wanted to read before the end of the year and plenty more SQL exercises
and such to occupy me I decided to wait so I could have all of 2019 available for analysis
and statistics, and finally it's time.
I've been using Goodreads for several years now and while I've probably missed a book
here and there, I've been reasonably consistent about adding books since I first created
an account. When I first started I added 100's of books immediately in a futile attempt
to create a definitive list of every book (or at least every fictional one) I've ever read.
Given that, take my ratings for the first couple hundred or so books with a grain of salt.
I have gone back and adjusted some occasionally to be more inline with my current ratings
but even if I remembered all of them it's impossible to rate things perfectly, especially
years or decades after you experienced it.
There are a few multi-book items in there, so items is not quite equivalent to books.
One last thing; unfortunately the goodreads export system is not perfect and for some reason
does not export date_read reliably at all (just leaves it blank most of the time) so that
precludes some more interesting analysis I wanted to do for the last few years.
Without further ado, here are some statistics:
| Statistic |
Result |
| total_items |
515 |
| total_pages |
197367.0 |
| avg(pages) |
383.982490272374 |
And here is a break down by binding (aka format):
| binding |
count(binding) |
| Paperback |
211 |
| Kindle Edition |
152 |
| Hardcover |
70 |
| Mass Market Paperback |
58 |
| ebook |
20 |
| Audible Audio |
3 |
|
1 |
If you want to see the data and perform some SQL queries of your own (in the browser!),
I put the project up on REPL so you can see it here. Just
select which repl "Goodreads + SQL".
January 5, 2020
general
So it's that time of year again and I figured I'd publicly join in and hope that helps
keep me honest. I've split the goals into Primary and Secondary. Secondary is a catchall for
things that would be cool but I'm not super motivated to do and for things that I'll do
naturally and really shouldn't count (like reading fiction).
Primary
- Get in running shape, run 2-4x/week, bike ~1x/week
- Calisthenics 3x/week, weight lifting ~1/week
- Program 20+ hours a week (not counting paid work)
- Update website at least once a week (not necessarily a blog post)
- Continue to learn SQL and Scheme/Racket, use in/for several projects and possible paid work
- #ProjectEuler100 Challenge
Secondary
- Learn and do some projects in Rust and Javascript
- Finish at least 12 fiction books
- Finish 12 non-fiction books
- Get 500+ stars on one of my Github repos
- Get a project into the Debian repos (and maybe the AUR?)
Obviously some are very broad, there's some overlap and there are a lot more specific goals I have
that will be covered/accomplished through say Primary 1-3.
This is kind of the whole Systems vs. Goals thing that Scott Adams and others have been on
for several years. I think it's a false dichotomy; a system is a goal and most goals are systems.
More than that, there's a chain for large, long term goals. For example, say my goal is to run a
marathon. I'd start a year before the race with a plan to run 4-5 times a week working
in a speed every other week. I'd do 5Ks, then 10Ks, and finally half-marathons every other month.
Those are all systems, or (sub)goals in their own right. Even finer grained, I'd have systems for
sleeping and eating right in service of those systems/goals. Basically until you get down to things
that can be accomplished in a day or 2, every goal has systems. Even something done in a weekend like
a game jam benefitted from goals and systems that came before (learning the tools, general experience
and prior game jams) and you might have your diet and sleep specifically calibrated for a 48-72 hour
develoment marathon as another system.
Sorry, that was a tangent, but it's always bothered me the whole Systems > Goals. It's just semantics
and perception.
December 6, 2017
OpenGL
C
C++
Web
So a little over a month ago, I thought it would be cool to try out emscripten and
WebAssembly with one of my students. We had previously done some "hello world"
type graphics programs and a simple game port and I thought it'd be fun to see
how easy (or not) it was to get those to run in the browser.
While I think it was a good exercise, and emscripten is much better than it was a
couple years ago, I don't think it's ready for primetime yet. You cannot simply
compile your existing graphics/game code and expect it to work. If you're lucky
you only have to make a few minor changes and with an #ifdef you can use the same
code for your regular executable to. If you're not, you might have to re-do your
whole program because of the limitations emscripten (which are really the limitations
of the browser/DOM rendering model. These include turning infinite loops into callback
functions and restricting yourself to OpenGL ES 2/3 which gets translated to WebGL 1/2.
In any case, here are our results:
For some reason we could not get file loading to work and the movement in sdl2_interactive is very
inconsistent for no reason that we could determine. We originally wanted to port simulate
which we had previously already ported to C but due to the mainloop callback requirement, it would have required a complete redesign.
Useful links:
March 7, 2016
OpenGL
C
C++
I've posted a new project, opengl_reference.
As it says, it's going to be a growing repo of small to medium OpenGL programs.
Some will be very simple examples, almost tutorial type programs. Some will
demonstrate 1 or 2 specific features of OpenGL. Some will show specific aspects/behavior
of OpenGL (like it's left-handed canonical coordinate system or what happens when you draw
lines on the exact edges of the view volume). Finally, a couple will be template
programs, meant to be copy-pasted to start new projects of a certain type.
In the course of developing these, I'll be building my OpenGL helper libraries
(math, mesh/buffer/texture/shader management etc.) and refining/improving them. I'll
also be using/learning glm but I prefer using/writing my own for various reasons.
February 4, 2016
python
pysdl2
So I updated my website yesterday(I know it still needs a lot of work I'm not
a web developer) and I added several project pages including a new one.
I've been wanting to learn PySDL2 for a while now and a couple months ago I finally
had the motivation to start. To learn it I decided to port all the games (and other
programs) from "Making Games with Python & Pygame"
by Al Sweigart.
Al Sweigart, if you haven't heard of him, has 4 python books
and all of them are available for free online along with the source code.
I encourage you to check them out,
I got a little less than half way done before I felt comfortable enough to move on,
starting my own simple games. Soon after I was on vacation with family for about
10 days during the holidays so by the time I got back it was even less on my mind
and I haven't touched it since.
I've added a README and released what I have to Github/Bitbucket because
I think it'll be useful to people. I'm thinking about starting a small
crowdfunding campaign, probably on indiegogo, to motivate me to finish
it if there's enough interest.
Anyway the project page is here for those
interested.
September 26, 2015
sorting
C
So I've resolved once again to try to post to this blog once
a week or so. Hopefully it'll help motivate me to make more
progress on my programming projects so I'll have something
to say. In addition, maybe I'll eventually make this site
look like it wasn't built in the 90's.
STATUS UPDATE 2/4/16: epic failure, recommitting.
Anyway, I've been tinkering with my collection of sorting algorithms
and the benchmarking program I wrote for them years ago. I've
also been looking at how to display the timing results in a pretty
graph. For now I'm playing with matplotlib in python.
On to the coding! I wanted to see how my algorithms stacked up against
the C stdlib qsort function (and C++'s std::sort but I only made a graph
for C). Since it uses a C style generic quicksort I decided to write
my own version with the same interface and compare all my quicksort
variations.
- qsort, standard recursive implementation
- qsortlib, C's qsort function
- genericqsort, my version of above
- iterqsort, iterative version of qsort
- qinssort, same as 1 but switches to insertion sort <=25 elements
As you can see, the 3 non-generic implementations 1, 4 and 5 all
perform roughly the same, especially at higher N, while the 2
generic versions are about half as fast due to the extra overhead
involved. My generic version is a tad slower but I think I'll try
adding insertion sort for smaller groups and see if that makes the
difference.
You can see the code I used here.
I compiled it as is but am only talking about main.c, or benchmark, not cppbenchmark.
Running this from the build directry (after build and running benchmark)
will generate the graph. I had to expand and save it manually ...
I need to figure out sizing the whole image programmatically.
python3 ../plotbarchart.py
November 6, 2009
C
C++
I know there are a million lists of common programming mistakes (for almost every language) but I thought I'd do one myself. Hopefully in writing about my most common mistakes I'll quit making them or at least remember to check for them first when my code doesn't work. So . . .
1.) Forgetting a semi-colon.
I know it's the most obvious mistake in C/C++. Whether it's at the end of a class, struct, do-while loop or just a normal statement, I always seem to forget at least one semi-colon the first time I compile something.
2.) Adding a semi-colon to the end of an if statement.
I think one time I made this mistake was in my Watering Lawn project. I think I had the following (lines 100-104 in wateringlawn.cpp):
if(temp1==temp2);
{
minsprinks=0;
break;
}
which of course drove me crazy because my program was compiling and I knew I had written it right but it wasn't doing what I wanted. Weird how your eyes can travel over the same place over and over again and you just get used to the semi-colon and totally ignore it. Unconsciously you just accept that it should be there. Fortunately I figured it out without too much head banging.
3.) Putting one equal sign in an if statement.
Yes I recently commited this mistake for I think the first time ever. I was just typing too quickly and without really focusing. I realize that there may be some edge cases where you might actually want an equal sign in if statement but I can't think of any and I haven't had any so far.
4.) Not looking at the entire line.
This is especially annoying if I've spent quite a bit of time staring at the line trying to figure it out after already having spent time isolating which line it is. I had the following line and of course was getting an error. Thing is I had already fixed the quotes (double to single) for the '('. I was so focused and frustrated that the compiler was complaining about something I'd already fixed I didn't notice the ones around the A.
if(x=='(') mystack.push("A");
5.) Using double quotes when I need single quotes.
See above. Sometimes I'm just not paying attention and typing to fast.
6.) Using gcc when I'm coding in C++.
Duh.
7.) Not keep track of exactly where my pointers are pointing.
(and realizing when things are pointing at the same thing instead of different things passing C strings around etc.)
8.) Not using sizeof when using memory functions in C.
(I know you can leave it out for primitives like char and int but I should just always use it so I won't forget for the complex structures).
9.) Forgetting a break statement.
10.) Forgetting to increment a counter.
Or similarly forgetting to set the pointer to the next one while looping through a linked list.
Most of these (especially 7-10) I made while writing C PIM. Hopefully I can use these as a self checklist or something.
EDIT: 11.) Forgetting to close a file stream.
EDIT 2: 12.) Allocating the wrong amount of memory.
EDIT 3: 14.) Type problems (wrong conversions, underflow and overflow in arithmetic both integer and real).
August 25, 2009
C
#include <stdio.h>
int main()
{
printf("Hello World");
return 0;
}
August 15, 2009
untagged
blah blah blah
March 10, 2000
untagged
Testing testing just putting some content here
March 6, 2000
untagged
Testing testing just putting some content here


Lessons learned as a class rep
Always look at the big picture
I read somewhere - when you love it, set it free. If it is yours, it will come back else it was never yours. This isn’t true for your dreams. The dreams are kind of self responsibility which cannot be compromised. A responsibility to achieve. It requires courage and determination to go with your dreams. A dream is achieved after a long struggle - that one tear when you see the finish line. So be brave and never quit!
Do things which support the big vision. One of my fellow told me - big goals are difficult. Do one thing. Every day just do one very small task in the direction of your vision. The theory behind - we may not cut a mountain in one piece, cut it in pieces.
Maintain the balance
Everything needs to be properly balanced. When you focus too much on one thing, you lose share in other areas. When you are holding several guns, shoot all of them at least one shot each - one by one.
A few text read during graduation:
The key to substantial improvement is a balanced attack across several interrelated dimensions.
The best administrators are those who strike the right balance between maximum productivity and maximum safety.
In one of the sessions, the speaker asked - “Can we let it go for the sake of harmony?”. So we don’t hold on always, yes we don’t…
I see this as the rule of maintaining balance - when you lose something, you gain something else but when you sacrifice - you don’t lose anything. Here I’m trying to emphasize the importance of taking risks (in the form of committing to sacrifices).
Be a visionary executive
Most important - be a visionary. Make long term win-win strategies. The coolest task is to make them happen. So why don’t I brag less and do more.
Be confirmed
One of the most important lessons learned so far is that we can always be wrong. What we see, hear or speak and whatever we understand can be wrong. So be very careful and confirmed. Keep doing research. Keep learning. Keep asking. Keep knowing.
A cool guide is knowledgeable and without doubts.
Be always true, no worries if you are
Even if we keep things to us with a good intention and work over it. Also we know that it won’t hurt anyone, still we might be wrong. You are not necessarily need to become a saint to be true, so do not worry too much.
One of my mentors told me - when things looks so complex, just do your best and leave the rest.
Emotional disturbance is not allowed
In life, we go through many situations. Some make us smile, some bring tears to us. When we have lost something so important, we feel a little frustrated. Even so wise can lose control. Spoiling relations and themselves. A lost soul will only kill itself and others around
It’s great to move with love. It’s good to move with support. It is easy to move in opposition and when there is hate - you become more humble.
Because sometimes what matters most is not what you have gained but what you have lost…
The statement may be very confusing. I wanted to keep it that way only.
 Never intermix too much personal life in work and too much professionalism in relations.
At the same time emotions are what makes a leader look human - being able to understand his people. An unbiased mind is a powerful tool for making decisions and taking actions.
You have to stand strong
When something stop working, it is thrown in waste. We certainly cannot keep lamenting for whatsoever reason. Sometimes recovery is very urgent. The most important thing is to keep learning and moving. Everyday we are meant to become better than our past, not others. Feedback from your people can help.
When you look weak, people behind lose their faith. If you ask people to join you, you have to anyways look integrated. If not, then go out of the ring.
Understand different kind of people
Someone love something but there is someone who hate it. We need to put ourselves in their shoes. We need to become blind for our own selves and see from their eyes. Sometimes you have to take tough decisions and your people may oppose it. The greatest adventure is to merge all objectives in one direction, keeping win-win for everyone.
People need someone to listen them, not to make them listen. When you listen, you say them:
“Hey! I’m listening you. You are important to me and I’m humble towards you!”
Having a soft tone is sometimes better than having a sharp brain. A sharp mind and interested ears enhance your abilities to learn people. The best way to be with your team is to understand them. Give them what they like. Ask a few questions to make them feel that they are being given importance. This requires intuition and empathy. The cores of a powerful communication strategy.
The most distinguishing factor - take risks, initiatives and their responsibility. This require you to always keep your own self behind your duties. You will automatically be pushed forward- just wait and see it happening.
The best revenge is to forgive. Collaboration and cooperation add plus to it. Forgive people if they fall weak, because you need them. If you are a leader, that’s because of the people who follow you. Position can make a manager, but never a leader.
 Admit mistakes and quickly correct them. If bending a little helps a big vision, break your icy ego.
Invest in relationships
What if you reach where you want. Is it worth alone? Really not! I remember, when my colleagues at Next Services helped me raise funds to pay my educational expenses. The trust factor is very important. So, take time and effort to build your relations.
*** Exposure is one of the best teachers. Like any skill, leadership skills cannot be learned by reading or writing. The best way to learn it is to... just do it. Above is a series of lessons I learned as the class rep at NMIMS, MU and AUHS. I'll keep updating this list as and when I go back in flashback. This role helped me transform myself in many ways - both professionally as well as personally.


Learning to subnet fast and accurately is key to computer networking. As the name suggests, networking is all about connecting different computing devices to one another. Without this there would be no Internet. The Internet is simply a huge network of networks all connected together.
Any type of networking career is going to be based on a strong understanding of subnetting. If you cannot do the practice questions on this site, then you are going to be in a lot of trouble when it comes to finding a career that goes beyond basic desktop support.
Even if you do not want to go into computer networking, but are interested in system administration, or even programing an understanding of subnetting will be important. System administrators manage devices, and these days almost all devices connect to other devices. they do this using networking. When setting up a server, VPS, computer, or even a network printer you will have to know how to assign an IP address and network mask. And if there are connection problems you will be responsible for noticing network configuration errors. Even certain programmers will need to be concerned with how TCP/IP works. Programmers who work on applications which use networking will need to have at least a basic understanding of how devices connect to one another.
The CCNA (Cisco Certified Network Associate) is one of the most respected IT certifications. Without any other degree or schooling, if you hold the CCNA there is a good chance you will find a networking career. Because the CCNA is a timed test being able to quickly and efficiently subnet is key to passing the exam. If you are able to blaze through the subnetting questions (which are especially present on the ICND1 exam) you will have more time for the more complex questions. Without a firm understanding of subnetting you will not be able to attain the CCNA and all the perks that come with it.
Still not convinced that you need to have a mastery of subnetting? According to indeed.com, those who hold a CCNA certificate make an average of $81,000 per year. That should be reason enough to practice your subnetting!


About
Syllabus
People
Code
Readings
People
Rob Phillips
Instructor
California Institute of Technology
phillips [at] pboc [dot] caltech [dot] edu
Hernan Garcia
Instructor
University of Calfifornia - Berkeley
hggarcia [at] berkeley [dot] edu
Madhav Mani
Instructor
Northwestern University
madhav [dot] mani [at] northwestern [dot] edu
Aleksandra Walczak
Instructor
Centre Nationnal de la Recherche Scientifique
awalczak [at] lpt [dot] ens [dot] fr
Jané Kondev
Instructor
Brandeis University
kondev [at] brandeis [dot] edu
Muir Morrison
Teaching Assistant
California Institute of Technology
muir [at] caltech [dot] edu


Austin Powers: The Spy Who Shagged Me A review by Joe Chamberlain
Starring Mike Myers; Heather Graham; Michael York; Robert Wagner & Rob Lowe
I'll have to say that I thought that Austin Powers: The Spy Who Shagged Me was better than the first one. Although, to the credit of the original, it seems to be getting funnier each time I see it. I'm guessing that this one might play the same way. Austin Powers (Mike Myers) is still adjusting to the 90's when something evil happens. Dr. Evil, that is. Evil (Mike Myers) and Mr. Bigglesworth (Evil's hairless cat) return to Earth from their cryogenic sleep chamber on board their Big Boy satellite. Evil now has a plan to stop Austin Powers for good. His right hand man, Number 2 (Robert Wagner) has had a time machine built for Dr. Evil. Evil plans to use it to return to the 1960's and steal Austin Powers' mojo. And he is taking along some help. While Dr. Evil was in cryogenic sleep, his henchmen have cloned him. His clone is not quite the perfect match -- he is only 1/3 Evil's size. But even with his short stature, Mini Me (Verne Troyer) is a force to be reckoned with. So Evil and Mini Me go back in time where they hook up with a much younger Number 2 (Rob Lowe) and steal the mojo with the help of a disgruntled Scotsman by the name of Fat Bastard (Mike Myers). Austin must then return to the '60's to retrieve his mojo with the help of '60's secret agent Felicity Shagwell (Heather Graham).
I was very disappointed in the somewhat cheesy way that Elizabeth Hurley was dealt with in this movie. I'm not sure if it was supposed to be funny but it really didn't work for me. She had about two minutes of screen time and her scenes were pretty much the weakest points of the movie through no fault of her own. As in the first one, Dr. Evil steals the show. Although, Fat Bastard is pretty good too. Felicity Shagwell comes a close second to the two evil Myers characters. Heather Graham is a very groovy, and a more than adequate replacement for Hurley in both the looks and talent departments. Also, like the first one, Robert Wagner does a great job. As does Rob Lowe, playing Wagner's younger self. I wouldn't be surprised if this performance by Lowe resurrects his career.
My sense is that fans of the old James Bond films will catch a few more of the jokes here than the rest of the audience. There are a lot of very subtle little things geared towards them that I really appreciated.  But I must admit that it was among the funniest in the film, and I laughed along with everyone else in the theater.
At times I get the impression that Myers finds something that works and milks it a bit too much. The strategically placed object to disguise nudity worked really well in the first film. So instead of coming up with something more inventive, he based to whole opening sequence around the hidden nudity. It was funny, but just a bit of a cop-out in my opinion. Especially considering how much thought was put into the trailers spoofing the other movie of the summer of '99 -- The Phantom Menace.
One sequence that I really enjoyed has a scene involving Dr. Evil' spaceship, which was in the shape of a part of the male anatomy. The descriptions used by people on the ground as they looked up at it flying through the sky were hilarious. Then of course, we have Mini Me (Vern Troyer), Dr. Evil's clone. He combined with Evil to come up with some great scenes. The interaction between Evil and his son Scott (Seth Green) also worked just as well in this film as it did in the original. As with the first, the writers played off the fact that Evil was just slightly behind on the progress that has been made during his 30 years of hibernation. But this time they added to it by having Evil screw up in the '60's by using '90's expressions with the 60's characters that he was trying to interact with.
The movie was stolen by Myers playing Evil as he tried to be the hip villain but just usually ended up showing how square he really was. Austin Powers: The Spy Who Shagged should easily rank as one of the funnier films of the year. The movie was groovy baby, yeah!
8/10
Visit The Movie Guy http://movieguy.tripod.com
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


Add to Pinboard
Home
Title
Tags
Suggested
Url
Add Description
Private Bookmark
Search my bookmarks
About


Augmented Sociality
New to AR?
News
Teams
Projects
Project 1
Project 2
Project 3
Project 4
Contact
Login
Team
Alessandro Soro
Project Lead
Member of
Capstone AR
Joel Harman
Placeholder
Member of
Capstone AR
Ross Brown
Placeholder
Member of
Capstone AR
Selen Turkay
Placeholder
Member of
Capstone AR
Aloha Ambe
Placeholder
Member of
Capstone AR
Michael Hunter
Placeholder
Member of
Capstone AR


-
CONNECTING_STATES
-
States that represent the client connecting to a server.
Fields:
- connecting In the process of connecting to the server.
- acknowledging_connect
- connection_pending
- connection_succeeded
-
CONNECTION_STATES
-
All of the possible connection statuses for a client connection.
Fields:
- disconnected Disconnected from the server.
- connecting In the process of connecting to the server.
- acknowledging_connect
- connection_pending
- connection_succeeded
- connected Successfully connected to the server.
- disconnect_later Disconnecting, but only after sending all queued packets.
- disconnecting In the process of disconnecting from the server.
- acknowledging_disconnect
- zombie
- unknown
See also:
A Lua networking library for LÖVE games.
Usage:
sock = require "sock"
Table of Contents
Tables
| CONNECTING_STATES | States that represent the client connecting to a server. |
| CONNECTION_STATES | All of the possible connection statuses for a client connection. |
| DISCONNECTING_STATES | States that represent the client disconnecting from a server. |
| SEND_MODES | Valid modes for sending messages. |
Class Server
| Server:destroy() | Destroys the server and frees the port it is bound to. |
| Server:enableCompression() | Enables an adaptive order-2 PPM range coder for the transmitted data of all peers. |
| Server:getAddress() | Get the IP address or hostname that the server was created with. |
| Server:getClient(peer) | Gets the Client object associated with an enet peer. |
| Server:getClientByConnectId(connectId) | Gets the Client object that has the given connection id. |
| Server:getClientByIndex(index) | Get the Client object that has the given peer index. |
| Server:getClientCount() | Get the number of Clients that are currently connected to the server. |
| Server:getClients() | Get the table of Clients actively connected to the server. |
| Server:getDefaultSendMode() | Get the default send mode. |
| Server:getLastServiceTime() | Get the last time when network events were serviced. |
| Server:getMaxChannels() | Get the number of allocated channels. |
| Server:getMaxPeers() | Get the number of allocated slots for peers. |
| Server:getMessageTimeout() | Get the timeout for packets. |
| Server:getPeerByIndex(index) | Get the enet_peer that has the given index. |
| Server:getPort() | Get the port that the server is hosted on. |
| Server:getSendMode() | Get the current send mode. |
| Server:getSocketAddress() | Get the socket address of the host. |
| Server:getTotalReceivedData() | Get the total received data since the server was created. |
| Server:getTotalReceivedPackets() | Get the total number of packets (messages) received since the server was created. |
| Server:getTotalSentData() | Get the total sent data since the server was created. |
| Server:getTotalSentPackets() | Get the total number of packets (messages) sent since the server was created. |
| Server:log(event, data) | Log an event. |
| Server:on(event, callback) | Add a callback to an event. |
| Server:removeCallback(callback) | Remove a specific callback for an event. |
| Server:resetSendSettings() | Reset all send options to their default values. |
| Server:sendToAll(event, data) | Send a message to all clients. |
| Server:sendToAllBut(client, event, data) | Send a message to all clients, except one. |
| Server:sendToPeer(peer, event, data) | Send a message to a single peer. |
| Server:setBandwidthLimit(incoming, outgoing) | Set the incoming and outgoing bandwidth limits. |
| Server:setDefaultSendChannel(channel) | Set the default send channel for all future outgoing messages. |
| Server:setDefaultSendMode(mode) | Set the default send mode for all future outgoing messages. |
| Server:setMaxChannels(limit) | Set the maximum number of channels. |
| Server:setMessageTimeout(timeout) | Set the timeout to wait for packets. |
| Server:setSchema(event, schema) | Set the data schema for an event. |
| Server:setSendChannel(channel) | Set the send channel for the next outgoing message. |
| Server:setSendMode(mode) | Set the send mode for the next outgoing message. |
| Server:setSerialization(serialize, deserialize) | Set the serialization functions for sending and receiving data. |
| Server:update() | Check for network events and handle them. |
Class Client
| Client:connect(code) | Connect to the chosen server. |
| Client:disconnect(code) | Disconnect from the server, if connected. |
| Client:disconnectLater(code) | Disconnect from the server, if connected. |
| Client:disconnectNow(code) | Disconnect from the server, if connected. |
| Client:enableCompression() | Enables an adaptive order-2 PPM range coder for the transmitted data of all peers. |
| Client:getAddress() | Get the IP address or hostname that the client was created with. |
| Client:getConnectId() | Get the unique connection id, if connected. |
| Client:getDefaultSendMode() | Get the default send mode. |
| Client:getIndex() | Get the index of the enet peer. |
| Client:getLastServiceTime() | Get the last time when network events were serviced. |
| Client:getMaxChannels() | Get the number of allocated channels. |
| Client:getMessageTimeout() | Get the timeout for packets. |
| Client:getPeerByIndex(index) | Get the enet_peer that has the given index. |
| Client:getPort() | Get the port that the client is connecting to. |
| Client:getRoundTripTime() | Return the round trip time (RTT, or ping) to the server, if connected. |
| Client:getSendMode() | Get the current send mode. |
| Client:getSocketAddress() | Get the socket address of the host. |
| Client:getState() | Get the current connection state, if connected. |
| Client:getTotalReceivedData() | Get the total received data since the server was created. |
| Client:getTotalReceivedPackets() | Get the total number of packets (messages) received since the client was created. |
| Client:getTotalSentData() | Get the total sent data since the server was created. |
| Client:getTotalSentPackets() | Get the total number of packets (messages) sent since the client was created. |
| Client:isConnected() | Gets whether the client is connected to the server. |
| Client:isConnecting() | Gets whether the client is connecting to the server. |
| Client:isDisconnected() | Gets whether the client is disconnected from the server. |
| Client:isDisconnecting() | Gets whether the client is disconnecting from the server. |
| Client:log(event, data) | Log an event. |
| Client:on(event, callback) | Add a callback to an event. |
| Client:removeCallback(callback) | Remove a specific callback for an event. |
| Client:reset(client) | Forcefully disconnects the client. |
| Client:resetSendSettings() | Reset all send options to their default values. |
| Client:send(event, data) | Send a message to the server. |
| Client:setBandwidthLimit(incoming, outgoing) | Set the incoming and outgoing bandwidth limits. |
| Client:setDefaultSendChannel(channel) | Set the default send channel for all future outgoing messages. |
| Client:setDefaultSendMode(mode) | Set the default send mode for all future outgoing messages. |
| Client:setMaxChannels(limit) | Set the maximum number of channels. |
| Client:setMessageTimeout(timeout) | Set the timeout to wait for packets. |
| Client:setPingInterval(interval) | Set how frequently to ping the server. |
| Client:setSchema(event, schema) | Set the data schema for an event. |
| Client:setSendChannel(channel) | Set the send channel for the next outgoing message. |
| Client:setSendMode(mode) | Set the send mode for the next outgoing message. |
| Client:setSerialization(serialize, deserialize) | Set the serialization functions for sending and receiving data. |
| Client:setThrottle(interval, acceleration, deceleration) | Change the probability at which unreliable packets should not be dropped. |
| Client:setTimeout(limit, minimum, maximum) | Set the parameters for attempting to reconnect if a timeout is detected. |
| Client:update() | Check for network events and handle them. |
sock
| newClient(serverOrAddress, port, maxChannels) | Creates a new Client instance. |
| newServer(address, port, maxPeers, maxChannels, inBandwidth, outBandwidth) | Creates a new Server object. |
Tables
Class Server
-
Server:enableCompression()
-
Enables an adaptive order-2 PPM range coder for the transmitted data of all peers. Both the client and server must both either have compression enabled or disabled.
Note: lua-enet does not currently expose a way to disable the compression after it has been enabled.
-
Server:getAddress()
-
Get the IP address or hostname that the server was created with.
Returns:
- string
-
Server:getClient(peer)
-
Gets the Client object associated with an enet peer.
Parameters:
- peer peer An enet peer.
Returns:
- Client Object associated with the peer.
-
Server:getClientByConnectId(connectId)
-
Gets the Client object that has the given connection id.
Parameters:
- connectId number The unique client connection id.
Returns:
-
Server:getClientByIndex(index)
-
Get the Client object that has the given peer index.
Parameters:
- index
Returns:
-
Server:getClientCount()
-
Get the number of Clients that are currently connected to the server.
Returns:
- number The number of active clients.
-
Server:getClients()
-
Get the table of Clients actively connected to the server.
Returns:
- {Client,...}
-
Server:getLastServiceTime()
-
Get the last time when network events were serviced.
Returns:
- number Timestamp of the last time events were serviced.
-
Server:getMaxChannels()
-
Get the number of allocated channels. Channels are zero-indexed, e.g. 16 channels allocated means that the maximum channel that can be used is 15.
Returns:
- number Number of allocated channels.
-
Server:getMaxPeers()
-
Get the number of allocated slots for peers.
Returns:
- number Number of allocated slots.
-
Server:getMessageTimeout()
-
Get the timeout for packets.
Returns:
- number Time to wait for incoming packets in milliseconds. initial default is 0.
-
Server:getPeerByIndex(index)
-
Get the enet_peer that has the given index.
Parameters:
- index
Returns:
- enet_peer The underlying enet peer object.
-
Server:getSocketAddress()
-
Get the socket address of the host.
Returns:
- string A description of the socket address, in the format "A.B.C.D:port" where A.B.C.D is the IP address of the used socket.
-
Server:getTotalReceivedData()
-
Get the total received data since the server was created.
Returns:
- number The total received data in bytes.
-
Server:getTotalReceivedPackets()
-
Get the total number of packets (messages) received since the server was created.
Returns:
- number The total number of received packets.
See also:
-
Server:getTotalSentData()
-
Get the total sent data since the server was created.
Returns:
- number The total sent data in bytes.
-
Server:getTotalSentPackets()
-
Get the total number of packets (messages) sent since the server was created. Everytime a message is sent or received, the corresponding figure is incremented. Therefore, this is not necessarily an accurate indicator of how many packets were actually exchanged over the network.
Returns:
- number The total number of sent packets.
-
Server:log(event, data)
-
Log an event. Alias for Server.logger:log.
Parameters:
- event string The type of event that happened.
- data string The message to log.
Usage:
if somethingBadHappened then server:log("error", "Something bad happened!") end
-
Server:on(event, callback)
-
Add a callback to an event.
Parameters:
- event string The event that will trigger the callback.
- callback function The callback to be triggered.
Returns:
- function The callback that was passed in.
Usage:
server:on("connect", function(data, client) print("Client connected!") end)
-
Server:removeCallback(callback)
-
Remove a specific callback for an event.
Parameters:
- callback function The callback to remove.
Returns:
- boolean Whether or not the callback was removed.
Usage:
local callback = server:on("chatMessage", function(message) print(message) end) server:removeCallback(callback)
-
Server:sendToAll(event, data)
-
Send a message to all clients.
Parameters:
- event string The event to trigger with this message.
- data The data to send.
Usage:
server:sendToAll("gameStarting", true)
-
Server:sendToAllBut(client, event, data)
-
Send a message to all clients, except one. Useful for when the client does something locally, but other clients need to be updated at the same time. This way avoids duplicating objects by never sending its own event to itself in the first place.
Parameters:
- client Client The client to not receive the message.
- event string The event to trigger with this message.
- data The data to send.
-
Server:sendToPeer(peer, event, data)
-
Send a message to a single peer. Useful to send data to a newly connected player without sending to everyone who already received it.
Parameters:
- peer enet_peer The enet peer to receive the message.
- event string The event to trigger with this message.
- data data to send to the peer.
Usage:
server:sendToPeer(peer, "initialGameInfo", {...})
-
Server:setBandwidthLimit(incoming, outgoing)
-
Set the incoming and outgoing bandwidth limits.
Parameters:
- incoming number The maximum incoming bandwidth in bytes.
- outgoing number The maximum outgoing bandwidth in bytes.
-
Server:setDefaultSendChannel(channel)
-
Set the default send channel for all future outgoing messages. The initial default is 0.
Parameters:
- channel number Channel to send data on.
-
Server:setDefaultSendMode(mode)
-
Set the default send mode for all future outgoing messages.
The initial default is "reliable".Parameters:
- mode string A valid send mode.
See also:
-
Server:setMaxChannels(limit)
-
Set the maximum number of channels.
Parameters:
- limit number The maximum number of channels allowed. If it is 0, then the maximum number of channels available on the system will be used.
-
Server:setMessageTimeout(timeout)
-
Set the timeout to wait for packets.
Parameters:
- timeout number Time to wait for incoming packets in milliseconds. The initial default is 0.
-
Server:setSchema(event, schema)
-
Set the data schema for an event.
Schemas allow you to set a specific format that the data will be sent. If the client and server both know the format ahead of time, then the table keys do not have to be sent across the network, which saves bandwidth.
Parameters:
- event string The event to set the data schema for.
- schema {string,...} The data schema.
Usage:
server = sock.newServer(...) client = sock.newClient(...) -- Without schemas client:send("update", { x = 4, y = 100, vx = -4.5, vy = 23.1, rotation = 1.4365, }) server:on("update", function(data, client) -- data = { -- x = 4, -- y = 100, -- vx = -4.5, -- vy = 23.1, -- rotation = 1.4365, -- } end) -- With schemas server:setSchema("update", { "x", "y", "vx", "vy", "rotation", }) -- client no longer has to send the keys, saving bandwidth client:send("update", { 4, 100, -4.5, 23.1, 1.4365, }) server:on("update", function(data, client) -- data = { -- x = 4, -- y = 100, -- vx = -4.5, -- vy = 23.1, -- rotation = 1.4365, -- } end)
-
Server:setSendChannel(channel)
-
Set the send channel for the next outgoing message.
The channel will be reset after the next message. Channels are zero-indexed and cannot exceed the maximum number of channels allocated. The initial default is 0.Parameters:
- channel number Channel to send data on.
Usage:
server:setSendChannel(2) -- the third channel server:sendToAll("importantEvent", "The message")
-
Server:setSendMode(mode)
-
Set the send mode for the next outgoing message.
The mode will be reset after the next message is sent. The initial default is "reliable".Parameters:
- mode string A valid send mode.
See also:
Usage:
server:setSendMode("unreliable") server:sendToAll("playerState", {...})
-
Server:setSerialization(serialize, deserialize)
-
Set the serialization functions for sending and receiving data. Both the client and server must share the same serialization method.
Parameters:
- serialize function The serialization function to use.
- deserialize function The deserialization function to use.
Usage:
bitser = require "bitser" -- or any library you like server = sock.newServer("localhost", 22122) server:setSerialization(bitser.dumps, bitser.loads)
Class Client
-
Client:connect(code)
-
Connect to the chosen server. Connection will not actually occur until the next time Client:update is called.
Parameters:
- code optional number A number that can be associated with the connect event.
-
Client:disconnect(code)
-
Disconnect from the server, if connected. The client will disconnect the next time that network messages are sent.
Parameters:
- code optional number A code to associate with this disconnect event.
-
Client:disconnectLater(code)
-
Disconnect from the server, if connected. The client will disconnect after sending all queued packets.
Parameters:
- code optional number A code to associate with this disconnect event.
-
Client:disconnectNow(code)
-
Disconnect from the server, if connected. The client will disconnect immediately.
Parameters:
- code optional number A code to associate with this disconnect event.
-
Client:enableCompression()
-
Enables an adaptive order-2 PPM range coder for the transmitted data of all peers. Both the client and server must both either have compression enabled or disabled.
Note: lua-enet does not currently expose a way to disable the compression after it has been enabled.
-
Client:getAddress()
-
Get the IP address or hostname that the client was created with.
Returns:
- string
-
Client:getConnectId()
-
Get the unique connection id, if connected.
Returns:
- number The connection id.
-
Client:getIndex()
-
Get the index of the enet peer. All peers of an ENet host are kept in an array. This function finds and returns the index of the peer of its host structure.
Returns:
- number The index of the peer.
-
Client:getLastServiceTime()
-
Get the last time when network events were serviced.
Returns:
- number Timestamp of the last time events were serviced.
-
Client:getMaxChannels()
-
Get the number of allocated channels. Channels are zero-indexed, e.g. 16 channels allocated means that the maximum channel that can be used is 15.
Returns:
- number Number of allocated channels.
-
Client:getMessageTimeout()
-
Get the timeout for packets.
Returns:
- number Time to wait for incoming packets in milliseconds. initial default is 0.
-
Client:getPeerByIndex(index)
-
Get the enet_peer that has the given index.
Parameters:
- index
Returns:
- enet_peer The underlying enet peer object.
-
Client:getRoundTripTime()
-
Return the round trip time (RTT, or ping) to the server, if connected. It can take a few seconds for the time to approach an accurate value.
Returns:
- number The round trip time.
-
Client:getSocketAddress()
-
Get the socket address of the host.
Returns:
- string A description of the socket address, in the format "A.B.C.D:port" where A.B.C.D is the IP address of the used socket.
-
Client:getState()
-
Get the current connection state, if connected.
Returns:
- string The connection state.
See also:
-
Client:getTotalReceivedData()
-
Get the total received data since the server was created.
Returns:
- number The total received data in bytes.
-
Client:getTotalReceivedPackets()
-
Get the total number of packets (messages) received since the client was created.
Returns:
- number The total number of received packets.
See also:
-
Client:getTotalSentData()
-
Get the total sent data since the server was created.
Returns:
- number The total sent data in bytes.
-
Client:getTotalSentPackets()
-
Get the total number of packets (messages) sent since the client was created. Everytime a message is sent or received, the corresponding figure is incremented. Therefore, this is not necessarily an accurate indicator of how many packets were actually exchanged over the network.
Returns:
- number The total number of sent packets.
-
Client:isConnected()
-
Gets whether the client is connected to the server.
Returns:
- boolean Whether the client is connected to the server.
Usage:
client:connect() client:isConnected() -- false -- After a few client updates client:isConnected() -- true
-
Client:isConnecting()
-
Gets whether the client is connecting to the server.
Returns:
- boolean Whether the client is connected to the server.
Usage:
client:connect() client:isConnecting() -- true -- After a few client updates client:isConnecting() -- false client:isConnected() -- true
-
Client:isDisconnected()
-
Gets whether the client is disconnected from the server.
Returns:
- boolean Whether the client is connected to the server.
Usage:
client:disconnect() client:isDisconnected() -- false -- After a few client updates client:isDisconnected() -- true
-
Client:isDisconnecting()
-
Gets whether the client is disconnecting from the server.
Returns:
- boolean Whether the client is connected to the server.
Usage:
client:disconnect() client:isDisconnecting() -- true -- After a few client updates client:isDisconnecting() -- false client:isDisconnected() -- true
-
Client:log(event, data)
-
Log an event. Alias for Client.logger:log.
Parameters:
- event string The type of event that happened.
- data string The message to log.
Usage:
if somethingBadHappened then client:log("error", "Something bad happened!") end
-
Client:on(event, callback)
-
Add a callback to an event.
Parameters:
- event string The event that will trigger the callback.
- callback function The callback to be triggered.
Returns:
- function The callback that was passed in.
Usage:
client:on("connect", function(data) print("Connected to the server!") end)
-
Client:removeCallback(callback)
-
Remove a specific callback for an event.
Parameters:
- callback function The callback to remove.
Returns:
- boolean Whether or not the callback was removed.
Usage:
local callback = client:on("chatMessage", function(message) print(message) end) client:removeCallback(callback)
-
Client:reset(client)
-
Forcefully disconnects the client. The server is not notified of the disconnection.
Parameters:
- client Client The client to reset.
-
Client:send(event, data)
-
Send a message to the server.
Parameters:
- event string The event to trigger with this message.
- data The data to send.
-
Client:setBandwidthLimit(incoming, outgoing)
-
Set the incoming and outgoing bandwidth limits.
Parameters:
- incoming number The maximum incoming bandwidth in bytes.
- outgoing number The maximum outgoing bandwidth in bytes.
-
Client:setDefaultSendChannel(channel)
-
Set the default send channel for all future outgoing messages. The initial default is 0.
Parameters:
- channel number Channel to send data on.
-
Client:setDefaultSendMode(mode)
-
Set the default send mode for all future outgoing messages.
The initial default is "reliable".Parameters:
- mode string A valid send mode.
See also:
-
Client:setMaxChannels(limit)
-
Set the maximum number of channels.
Parameters:
- limit number The maximum number of channels allowed. If it is 0, then the maximum number of channels available on the system will be used.
-
Client:setMessageTimeout(timeout)
-
Set the timeout to wait for packets.
Parameters:
- timeout number Time to wait for incoming packets in milliseconds. The initial default is 0.
-
Client:setPingInterval(interval)
-
Set how frequently to ping the server. The round trip time is updated each time a ping is sent. The initial default is 500ms.
Parameters:
- interval number The interval, in milliseconds.
-
Client:setSchema(event, schema)
-
Set the data schema for an event.
Schemas allow you to set a specific format that the data will be sent. If the client and server both know the format ahead of time, then the table keys do not have to be sent across the network, which saves bandwidth.
Parameters:
- event string The event to set the data schema for.
- schema {string,...} The data schema.
Usage:
server = sock.newServer(...) client = sock.newClient(...) -- Without schemas server:send("update", { x = 4, y = 100, vx = -4.5, vy = 23.1, rotation = 1.4365, }) client:on("update", function(data) -- data = { -- x = 4, -- y = 100, -- vx = -4.5, -- vy = 23.1, -- rotation = 1.4365, -- } end) -- With schemas client:setSchema("update", { "x", "y", "vx", "vy", "rotation", }) -- client no longer has to send the keys, saving bandwidth server:send("update", { 4, 100, -4.5, 23.1, 1.4365, }) client:on("update", function(data) -- data = { -- x = 4, -- y = 100, -- vx = -4.5, -- vy = 23.1, -- rotation = 1.4365, -- } end)
-
Client:setSendChannel(channel)
-
Set the send channel for the next outgoing message.
The channel will be reset after the next message. Channels are zero-indexed and cannot exceed the maximum number of channels allocated. The initial default is 0.Parameters:
- channel number Channel to send data on.
Usage:
client:setSendChannel(2) -- the third channel client:send("important", "The message")
-
Client:setSendMode(mode)
-
Set the send mode for the next outgoing message.
The mode will be reset after the next message is sent. The initial default is "reliable".Parameters:
- mode string A valid send mode.
See also:
Usage:
client:setSendMode("unreliable") client:send("position", {...})
-
Client:setSerialization(serialize, deserialize)
-
Set the serialization functions for sending and receiving data. Both the client and server must share the same serialization method.
Parameters:
- serialize function The serialization function to use.
- deserialize function The deserialization function to use.
Usage:
bitser = require "bitser" -- or any library you like client = sock.newClient("localhost", 22122) client:setSerialization(bitser.dumps, bitser.loads)
-
Client:setThrottle(interval, acceleration, deceleration)
-
Change the probability at which unreliable packets should not be dropped.
Parameters:
- interval number Interval, in milliseconds, over which to measure lowest mean RTT. (default: 5000ms)
- acceleration number Rate at which to increase the throttle probability as mean RTT declines. (default: 2)
- deceleration number Rate at which to decrease the throttle probability as mean RTT increases.
-
Client:setTimeout(limit, minimum, maximum)
-
Set the parameters for attempting to reconnect if a timeout is detected.
Parameters:
- limit optional number A factor that is multiplied with a value that based on the average round trip time to compute the timeout limit. (default: 32)
- minimum optional number Timeout value in milliseconds that a reliable packet has to be acknowledged if the variable timeout limit was exceeded. (default: 5000)
- maximum optional number Fixed timeout in milliseconds for which any packet has to be acknowledged.
sock
-
newClient(serverOrAddress, port, maxChannels)
-
Creates a new Client instance.
Parameters:
- serverOrAddress optional string/peer Usually the IP address or hostname to connect to. It can also be an enet peer. (default: "localhost")
- port optional number Port number of the server to connect to. (default: 22122)
- maxChannels optional number Maximum channels available to send and receive data. (default: 1)
Returns:
- A new Client object.
See also:
Usage:
local sock = require "sock" -- Client that will connect to localhost:22122 (by default) client = sock.newClient() -- Client that will connect to localhost:1234 client = sock.newClient("localhost", 1234) -- Client that will connect to <IP_ADDRESS>:1234, using two channels -- NOTE: Server must also allocate two channels! client = sock.newClient("<IP_ADDRESS>", 1234, 2)
-
newServer(address, port, maxPeers, maxChannels, inBandwidth, outBandwidth)
-
Creates a new Server object.
Parameters:
- address optional string Hostname or IP address to bind to. (default: "localhost")
- port optional number Port to listen to for data. (default: 22122)
- maxPeers optional number Maximum peers that can connect to the server. (default: 64)
- maxChannels optional number Maximum channels available to send and receive data. (default: 1)
- inBandwidth optional number Maximum incoming bandwidth (default: 0)
- outBandwidth optional number Maximum outgoing bandwidth (default: 0)
Returns:
- A new Server object.
See also:
Usage:
local sock = require "sock" -- Local server hosted on localhost:22122 (by default) server = sock.newServer() -- Local server only, on port 1234 server = sock.newServer("localhost", 1234) -- Server hosted on static IP <IP_ADDRESS>, on port 22122 server = sock.newServer("<IP_ADDRESS>", 22122) -- Server hosted on any IP, on port 22122 server = sock.newServer("*", 22122) -- Limit peers to 10, channels to 2 server = sock.newServer("*", 22122, 10, 2) -- Limit incoming/outgoing bandwidth to 1kB/s (1000 bytes/s) server = sock.newServer("*", 22122, 10, 2, 1000, 1000)


{% extends "base.html" %} {% block title %}Address Index Login{% endblock %} {% block content %}
You must login to use this service.
Forgot password?
{{ error }}