Subverting Java Access Protection for Unit Testing
by Ross Burton11/12/2003
As everyone knows, unit testing is a great way of ensuring that code actually does what it claims it does, and that over time, as the system changes, it carries on doing the same thing. Formal processes like Extreme Programming (XP) depend heavily on consistent unit testing.
When used together, object-oriented design and comprehensive unit tests can lead to a very clean design, as the test-first methodology implies a user-based interface design, resulting in a public interface that is simple yet efficient.
However, when it comes to testing, sometimes these clean interfaces are not
as good as they could be. There are often member variables that the test
suite would like to access but that have been scoped private
or
protected
, and making these members public
would
expose the internals, ruining the clean design. C++ has a way of working
around this: by declaring the test suite as a friend
class,
the access protection is sidelined. In Java, a similar approach can be
used by making certain members package
scope and putting the
test classes into the same package. However, this leads to an
unsatisfactory design, as some members are private
or
protected
for good reasons, and then an arbitrary set of
members are package
scope solely for the current test suite.
However, there is a third option available to Java programmers. The Java
Reflection API allows the program to introspect arbitrary classes at
runtime, accessing members at will. Most competent Java
programmers should know this much, but what many don't know is that the security
layer preventing you from accessing private
members is only
optional, and can be turned off. This allows the system code to be
written without explicitly planning the unit tests, and if the unit tests
really do need to access a private
or protected
member, they can.
|
Example Files Download java-reflection-examples.tar.gz for the example code found in this article. |
Throughout this article, I shall deal with the simplest case: fields. In Java Reflection, fields, methods, and constructors are all treated in a very similar manner, so whenever I say "field" here, it can generally be replaced with "method" and the examples will still work.
Does private
Mean Private?
Let's begin by proving to ourselves that a private
field is
really a private field, and this is not just something we've all been told. First
we need a class with some private
members; this is the test
class I shall use for the following examples.
class FieldTest {
public String publicString = "Foobar";
private String privateString = "Hello, World!";
}
Here we have a simple class with two fields: one private
field and one public
field. We would assume that arbitrary
code can access the public
field, but not the
private
field.
public class Test1 {
public static void main(String args[]) {
System.out.println(new FieldTest().publicString);
System.out.println(new FieldTest().privateString);
}
}
When we compile this we get:
Test1.java:4: privateString has private access in FieldTest
System.out.println(new FieldTest().privateString);
^
1 error
This shows that private
fields really are private fields, as
the Java compiler won't allow access to them.
The Class Object
In Java 1.0, the java.lang.Class
object was fairly
trivial. However, in Java 1.1, the Reflection API was added. A cursory
glance at the documentation reveals several interesting methods:
getField()
getFields()
getDeclaredFields()
These methods return Field
instances (arrays, in the latter
two) that allow us to see the name of the field and its type, and more
importantly, get its value.
It seems that if we can get a Class
instance, we can call
getField()
to get a Field
instance, which we can
use to get at the value we want. And the easiest way to get a
Class
object for the class Foo
is to write
Foo.class
, a construct called a class literal.
Calling getField()
looks like this:
import java.lang.reflect.Field;
public class Test2 {
public static void main(String args[])
throws Exception {
Field f;
f = FieldTest.class.getField("publicString");
System.out.println("Public Field: " + f);
f = FieldTest.class.getField("privateString");
System.out.println("Private Field: " + f);
}
}
Running this gives us:
Public Field: public java.lang.String FieldTest.publicString
Exception in thread "main"
java.lang.NoSuchFieldException: privateString
at java.lang.Class.getField0(Class.java:1735)
at java.lang.Class.getField(Class.java:900)
at Test2.main(Test2.java:10)
So what happened here? The code managed to get a reference to
publicString
but failed when trying to get a reference to
privateString
. The exception thrown was
NoSuchFieldException
, but I know it does exist, since I created
it. However, the fine print in the API documentation for
Class.getField()
clearly states, "... the specified
public member field ...". Time to try
getFields()
and getDeclaredFields()
.
Related Reading Java Extreme Programming Cookbook |
Enumerating Fields
At first glance, getFields()
and
getDeclaredFields()
seem very similar. Nevertheless, a closer
read of the API documentation reveals that they are very different.
The method getFields()
reflects (no pun intended) what the
Java programmer conceptually sees when programming: it enumerates all
publicly accessible fields in the class and all of its superclasses.
On the other hand, getDeclaredFields()
reveals how the class
is constructed. It enumerates fields, but only if they are actually
declared in that class; any inherited fields are ignored.
The reason for the existence of two methods (instead of a single method that returns
all fields, including inherited ones) seems to be so that simple dynamic
lookup of public
fields can be achieved easily (using
getField()
and getFields()
) and generally does
the right thing. If a program wants to see the private
fields,
it will probably want to handle inherited fields specially (for example,
an object-oriented debugger).
Exercising these methods is always a good thing, to check they do what we
expect. Here is a test for getFields()
.
import java.lang.reflect.Field;
public class Test3 {
public static void main(String args[]) {
final Field fields[] =
FieldTest.class.getFields();
for (int i = 0; i < fields.length; ++i) {
System.out.println("Field: " + fields[i]);
}
}
}
The output is rather predicable:
Field: public java.lang.String FieldTest.publicString
Now let's try the same test, but use getDeclaredFields()
instead.
import java.lang.reflect.Field;
public class Test4 {
public static void main(String args[]) {
final Field fields[] =
FieldTest.class.getDeclaredFields();
for (int i = 0; i < fields.length; ++i) {
System.out.println("Field: " + fields[i]);
}
}
}
We hope that this will yield all of the fields, both public
and private
:
Field: public java.lang.String FieldTest.publicString
Field: private java.lang.String FieldTest.privateString
Life is indeed good. Now that we can enumerate all of the fields in a class, we can get the specific field we are after and hopefully manipulate it however we want.
Pages: 1, 2 |


{% extends "base.html" %} {% block nav-home %}Home{% endblock %} {% block content %}
This website should allow end users to interact with gravitational wave results such as the posterior samples in an easy and intuitive way.


Use standard Laravel tools accepted by community
Prefer to use built-in Laravel functionality and community packages instead of using 3rd party packages and tools. Any developer who will work with your app in the future will need to learn new tools. Also, chances to get help from the Laravel community are significantly lower when you’re using a 3rd party package or tool. Do not make your client pay for that.
| Task | Standard tools | 3rd party tools |
|---|---|---|
| Authorization | Policies | Entrust, Sentinel and other packages |
| Compiling assets | Laravel Mix | Grunt, Gulp, 3rd party packages |
| Development Environment | Homestead | Docker |
| Deployment | Laravel Forge | Deployer and other solutions |
| Unit testing | PHPUnit, Mockery | Phpspec |
| Browser testing | Laravel Dusk | Codeception |
| DB | Eloquent | SQL, Doctrine |
| Templates | Blade | Twig |
| Working with data | Laravel collections | Arrays |
| Form validation | Request classes | 3rd party packages, validation in controller |
| Authentication | Built-in | 3rd party packages, your own solution |
| API authentication | Laravel Passport | 3rd party JWT and OAuth packages |
| Creating API | Built-in | Dingo API and similar packages |
| Working with DB structure | Migrations | Working with DB structure directly |
| Localization | Built-in | 3rd party packages |
| Realtime user interfaces | Laravel Echo, Pusher | 3rd party packages and working with WebSockets directly |
| Generating testing data | Seeder classes, Model Factories, Faker | Creating testing data manually |
| Task scheduling | Laravel Task Scheduler | Scripts and 3rd party packages |
| DB | MySQL, PostgreSQL, SQLite, SQL Server | MongoDB |


Choose Style
Preset
Cartoon
Tube
Lines
Line Trace
Smooth Line Trace
Trace
About
| Code on
github.com
initialising...


Drilon stews over Games cauldron
by Macon Ramos-AranetaSenate Minority Leader Franklin Drilon on Monday questioned the P50-million estimated cost of the stadium cauldron that will be lit during the opening ceremonies for the Southeast Asian Games.
Drilon said the money could have been used to build 50 classrooms.
“A P50-million kaldero [cauldron]. Do you realize that at P1 million per classroom this can build 50 classrooms?” Drilon asked during the deliberations for the proposed 2020 budget of the Bases Conversion and Development Authority.
“In other words, we did away with 50 classrooms in exchange for one kaldero. Is this a correct conclusion?
“Is that reasonable? Is that a correct prioritization? We will spend P50 million for the kaldero that will be used only once?”
Earlier, Drilon pressed the BCDA over the cost of the stadium cauldron that would be used during the 30th SEA Games, which will be hosted by the Philippines from Nov. 30 to Dec. 11.
Senator Sonny Angara, who was defending the BCDA’s 2020 budget, said the design cost of the cauldron amounted to P4.4 million while its foundation cost P13.4 million.
He said the production of the cauldron was under the Philippine Sports Commission and was designed by the late Filipino architect Bobby Mañosa.
Drilon then asked if the total cost of building the cauldron was P32 million, and to which Angara said yes.
Drilon then computed a round figure of P50 million for the stadium cauldron, which included the cost of the design and the foundation.
“A classroom costs P1 million, so we could have built 56 classrooms if the money of the people was not abused,” he said.
Angara defended the cost.
“I think what the government is really envisioning was to do a really impressive hosting of the games and showcase Philippine ingenuity by using Philippine creative designers and performers,” Angara said.
“I think this is what other Southeast Asian countries have also done when it was their turn to host [the games].”
He said the facilities would be made available for rent after the games.
Meanwhile, Senator Panfilo Lacson sponsored the proposed PP553.661-million budget of the Dangerous Drugs Board, which is lower than the 2019 budget.
The lower budget was due to many factors, including the non-recurring funding for the nationwide survey on the extent of drug abuse in the Philippines.
Lacson also sponsored the PP2.480-billion budget of the Philippine Drug Enforcement Agency, which is higher than the current year’s budget.
The Breakdown of the DDB and PDEA’s 2020 Budgets:
The proposed appropriation for the DDB is P553.661 million. From P283.006 million in the NEP, it was increased under the GAB as transmitted by the House to P533.6 million.
The Senate added another P20 million to augment the fund for the program monitoring and evaluation of the Philippine Anti-Illegal Drug Strategy (PADS).
While the Senate Finance Subcommittee C proposed adding P200 million to support the institutionalization of PADS, the mother committee adopted only P20 million.
Meanwhile, the proposed appropriation of the PDEA is P2.480 billion from P2.380 billion in the NEP and GAB.
Lacson said the DDB continued to improve the system of its drug information portal, which disseminates knowledge of the anti-drug campaign.
When asked to assess the DDB’s drug abuse and prevention program on a scale of 1 to 10, Lacson gave it an ‘8.’


Characterizing Callbacks in JavaScript
This work is under submission at ESEM 2015
We perform an empirical study to characterize JavaScript callback usage across a representative corpus of 138 JavaScript programs, with over 5 million lines of JavaScript code.
We find that on average, every 10th function definition takes a callback argument, and that over 43% of all callback-accepting function callsites are anonymous. Furthermore, the majority of callbacks are nested, more than half of all callbacks are asynchronous, and asynchronous callbacks, on average, appear more frequently in client-side code (72%) than server-side (55%).
We also study three well-known solutions designed to help with the complexities associated with callbacks, including the error-first callback convention, Async.js library, and Promises. Our results inform the design of future JavaScript analysis and code comprehension tools.
Full dataset can be downloaded from here:
29 Examples of nesting with the highest depth of 8 we found among the test subjects can be downloaded here:
Source code used to analyze the subject systems can be accessed here:
The 86 NPM modules we study are the most depended-on modules in the NPM repository. The other subject systems were selected from GitHub Showcases, where popular and trending open source repositories are organized around different topics.
| # | Project | Client | Server | Revision | Git URL |
|---|---|---|---|---|---|
| 1 | Chart.js | ✔ | 1cfa42bc24e152cfef79523c310fae7d4c458635 | https://github.com/nnnick/Chart.js | |
| 2 | Leaflet | ✔ | 7cafaa63469ee4e2bebd0a8e390c8d798df51d4a | https://github.com/Leaflet/Leaflet | |
| 3 | arbor | ✔ | c5f7ec33c9f4ca28218779ca65e4bdcdec481884 | https://github.com/samizdatco/arbor | |
| 4 | cesium | ✔ | c71f81c935783aa3de065a5fe043ee073b7a6b3c | https://github.com/AnalyticalGraphicsInc/cesium | |
| 5 | chartist-js | ✔ | 51553dc5dfe7016fd451d674edc7f2f8cbf493a1 | https://github.com/gionkunz/chartist-js | |
| 6 | d3 | ✔ | f82dd6fb414a15bca4f9c39c7c9442295ddea416 | https://github.com/mbostock/d3 | |
| 7 | dc.js | ✔ | 29dfbedcb0ef8cdd96daf254b3ce32b51f015bbf | https://github.com/dc-js/dc.js | |
| 8 | echarts | ✔ | 0b7cf670ae60ada1de04aef08958ed53af13df9b | https://github.com/ecomfe/echarts | |
| 9 | envisionjs | ✔ | 747cccd6f72f3b13539685c61904f8394cf6a0ac | https://github.com/HumbleSoftware/envisionjs | |
| 10 | kartograph.js | ✔ | 4b8525e2e9ab4cfd97c680a21158416360e3d6ef | https://github.com/kartograph/kartograph.js | |
| 11 | modestmaps-js | ✔ | fedc94504ef95140a8ccc3c19907445987d13c6d | https://github.com/stamen/modestmaps-js | |
| 12 | peity | ✔ | d99db2ca721e6f2bcb1bbdfb9c848d2cef35a809 | https://github.com/benpickles/peity | |
| 13 | raw | ✔ | 3555470a81d49d7a31742e48751f86b84c15e6ef | https://github.com/densitydesign/raw | |
| 14 | recline | ✔ | 5b8b02b296b1274c5d0f246bc3ac9dddf59c8c1a | https://github.com/okfn/recline | |
| 15 | sigma.js | ✔ | 389c2f4230d944568b9efd977ca91728774dbe39 | https://github.com/jacomyal/sigma.js | |
| 16 | vega | ✔ | 1215de8e996b742907b5961d1c831a276cfd6903 | https://github.com/trifacta/vega |
| # | Project | Client | Server | Revision | Git URL |
|---|---|---|---|---|---|
| 17 | Babylon.js | ✔ | ✔ | 4ea3332f48299a84b4bca8dc703125bf0eba558a | https://github.com/BabylonJS/Babylon.js |
| 18 | Crafty | ✔ | ✔ | 912a0097bd855b7f0de0788df48933127c04e6db | https://github.com/craftyjs/Crafty |
| 19 | PhysicsJS | ✔ | ✔ | 2e062a0c069fb7b4056c3aa742931ac2d940bac0 | https://github.com/wellcaffeinated/PhysicsJS |
| 20 | cocos2d-html5 | ✔ | ✔ | fa68c45229f8929fab5b73a7679896804880cb58 | https://github.com/cocos2d/cocos2d-html5 |
| 21 | cutjs | ✔ | ✔ | 2e8fd61a496307a883918c3f39e9286f76cab347 | https://github.com/piqnt/cutjs |
| 22 | engine | ✔ | ✔ | 7e576c84423da52153fc202559dfac639e418e21 | https://github.com/playcanvas/engine |
| 23 | kiwi.js | ✔ | ✔ | 1ea2272fb0c5e313a2b9f4c9f0386437d1bf283e | https://github.com/gamelab/kiwi.js |
| 24 | lycheeJS | ✔ | ✔ | 58f719815c2e0b0bb63d78e5bcb23443ee1da78d | https://github.com/LazerUnicorns/lycheeJS |
| 25 | melonJS | ✔ | ✔ | b0c445f3520873a4a9f89fcf26c1f1d797e67c7f | https://github.com/melonjs/melonJS |
| 26 | phaser | ✔ | ✔ | 62b7fce9c8fc358733df8635fdb7256b92fd6b44 | https://github.com/photonstorm/phaser |
| 27 | pixi.js | ✔ | ✔ | ae42e515b9046c67c8c5623f62712c65127bdddc | https://github.com/GoodBoyDigital/pixi.js |
| # | Project | Client | Server | Revision | Git URL |
|---|---|---|---|---|---|
| 28 | angular.js | ✔ | fbbf6ac161a2087a64d50878b02ed7f618b182cc | https://github.com/angular/angular.js | |
| 29 | backbone | ✔ | 70636d6d854b32cb73bb8c16ba827b590b33bc88 | https://github.com/jashkenas/backbone | |
| 30 | brick | ✔ | 4cf4100085e736805f5f57b6f09da0e724cd4099 | https://github.com/mozbrick/brick | |
| 31 | ember.js | ✔ | 977efcf517ba5039c708915042f3839d4546fc57 | https://github.com/emberjs/ember.js | |
| 32 | knockout | ✔ | 624ddacd5a879ef5bf555d89e648f982a6bd6a4e | https://github.com/knockout/knockout | |
| 33 | polymer | ✔ | 2d000d10fec1b2415fa4edabfed2b8641264deee | https://github.com/Polymer/polymer | |
| 34 | spine | ✔ | b7fd062637d8fbf4abc28b8dad693dfb13c85f52 | https://github.com/spine/spine | |
| 35 | todomvc | ✔ | dd13679ae101c3a735e23e96bca9622a96a91ad3 | https://github.com/tastejs/todomvc |
| # | Project | Client | Server | Revision | Git URL |
|---|---|---|---|---|---|
| 36 | 2048 | ✔ | 538546423f9321a57d8081254cfbaf512e33f82a | https://github.com/gabrielecirulli/2048 | |
| 37 | BrowserQuest | ✔ | af32d247cac3495ca430d0effbb88dd5f3250b2c | https://github.com/mozilla/BrowserQuest | |
| 38 | adarkroom | ✔ | 76098f2b59194055bb66e389269634eb0aa172a0 | https://github.com/Continuities/adarkroom | |
| 39 | clumsy-bird | ✔ | f84ecc76d1d9a85a7c27357cc4419dde41e1e986 | https://github.com/ellisonleao/clumsy-bird | |
| 40 | hextris | ✔ | b9dfef0575bc9f324910293e5fa706885af6df36 | https://github.com/Hextris/hextris | |
| 41 | untrusted | ✔ | ccd0718e209e9ed9a2189ae4a736d29a6bcb1b13 | https://github.com/AlexNisnevich/untrusted |
| # | Project | Client | Server | Revision | Git URL |
|---|---|---|---|---|---|
| 42 | KiwiIRC | ✔ | ✔ | de1607bf1e9ba4429a10f895a6ec45c54daa3161 | https://github.com/prawnsalad/KiwiIRC |
| 43 | NodeBB | ✔ | ✔ | e49dfc72660c0cd453ba1990899f7e393aba22cf | https://github.com/NodeBB/NodeBB |
| 44 | browsenpm.org | ✔ | ✔ | eee2c7d70884288f4b0898c46a28b64903bd1df9 | https://github.com/nodejitsu/browsenpm.org |
| 45 | david-www | ✔ | ✔ | e324c121e9d6fccb6c46283037d986a05e3f1442 | https://github.com/alanshaw/david-www |
| 46 | iloveopensource | ✔ | ✔ | 4ee090e47cab9188a5c7658d478761e29a1eb058 | https://github.com/codio/iloveopensource |
| 47 | keystone | ✔ | ✔ | 8e6653d236281ecac477008c6109353159e36ae8 | https://github.com/keystonejs/keystone |
| 48 | live4chan | ✔ | ✔ | 96ab6d14a163e7af5be6f86fdf0bf2a3e4a2b01f | https://github.com/emgram769/live4chan |
| 49 | mash.li | ✔ | ✔ | d3b81b89f562fbc8db9b4bbdfcfc9c2bc31b42a2 | https://github.com/chipersoft/mash.li |
| 50 | mediacenterjs | ✔ | ✔ | 4ec3181f2443ac4be8b164e6bf20e1bd3e405885 | https://github.com/jansmolders86/mediacenterjs |
| 51 | newww | ✔ | ✔ | 426e9e3cdd0759c3234f254125aa8261f381cdb8 | https://github.com/npm/newww |
| 52 | npm-www | ✔ | ✔ | 87e2ea494ac7c9a0b4c2456db52c84b5f02ce023 | https://github.com/npm/npm-www |
| 53 | open-marriage | ✔ | ✔ | fa71d73c8802073e144be0cf045f1105ba1834d5 | https://github.com/ericf/open-marriage |
| 54 | pencilblue | ✔ | ✔ | 9d7892f37bf6f540e7a74352f506e2df32867878 | https://github.com/pencilblue/pencilblue |
| 55 | shields | ✔ | ✔ | 74f0466c69a8fcc5e5a1f7b8d86e4899d11fc7e1 | https://github.com/badges/shields |
| 56 | slate | ✔ | ✔ | ebe63e37a980cc0bfb3d99b4ac02cad74f4d532d | https://github.com/slate/slate |
| 57 | strider | ✔ | ✔ | 61a449960d2ca702633e25cd13b7c88569e606b4 | https://github.com/Strider-CD/strider |
| # | Project | Client | Server | Revision | Git URL |
|---|---|---|---|---|---|
| 58 | Inquirer.js | ✔ | b273ca70fd8435c7931ecfaae4b481d2edcea335 | https://github.com/SBoudrias/Inquirer.js | |
| 59 | UglifyJS2 | ✔ | f36a1eaa8b5203ab7e4616108c33a0b68668a8db | https://github.com/mishoo/UglifyJS2/ | |
| 60 | async | ✔ | 232121251f601c9be7209f6382ee32180df676f1 | https://github.com/caolan/async/ | |
| 61 | aws-sdk-js | ✔ | 8e2e66c9c53146ba69e358c73bc2369644bf2fe5 | https://github.com/aws/aws-sdk-js | |
| 62 | backbone | ✔ | 84db2ba31ce92bba95df90eb3bead5cd4cbcc579 | https://github.com/jashkenas/backbone | |
| 63 | bluebird | ✔ | 7b5dfb24e787b2ad42e99fc7559ef595bdacae63 | https://github.com/petkaantonov/bluebird | |
| 64 | body-parser | ✔ | df1d88aaa33c36ccced4a0d0788a0ab92e56875a | https://github.com/expressjs/body-parser | |
| 65 | chalk | ✔ | 0f22588c59f95bece6c206e98566ea097d046c33 | git://github.com/sindresorhus/chalk | |
| 66 | cheerio | ✔ | 9ee6695e4cab6660a80199591044b7e9addf0d5f | https://github.com/MatthewMueller/cheerio | |
| 67 | clean-css | ✔ | 1018f6a332abc5da77adb0799bf22206698a2aa8 | https://github.com/GoalSmashers/clean-css | |
| 68 | cli-color | ✔ | 838bd81de5c993f207706c22c3a447c20e17ac11 | https://github.com/medikoo/cli-color | |
| 69 | coffeescript | ✔ | 485aa8efcf9c02566dc2e38572627eb7947eaf46 | git://github.com/jashkenas/coffeescript.git | |
| 70 | colors.js | ✔ | e9e6557cc0fa26dba1a20b0d45e92de982f4047c | https://github.com/Marak/colors.js | |
| 71 | commander.js | ✔ | 79ea1205ece8f8012aa17ce72754ec6b07d38268 | https://github.com/tj/commander.js.git | |
| 72 | concat-stream | ✔ | 9c14e0eb65c966a307afc4f73e0f905dcdc0a675 | http://github.com/maxogden/concat-stream/ | |
| 73 | connect | ✔ | 0509cb8cfa4cd0922076e1c8926b13970d8a6ef5 | https://github.com/senchalabs/connect | |
| 74 | debug | ✔ | 953162b4fa8849268d147f4bac91c737baee55bb | git://github.com/visionmedia/debug.git | |
| 75 | ejs | ✔ | c1b18858de424bb80ab921759ef26061ee6bff5c | https://github.com/visionmedia/ejs | |
| 76 | escodegen | ✔ | fae5989a67bba85a603bdc8042efb6d8f6381d25 | https://github.com/Constellation/escodegen/ | |
| 77 | express | ✔ | ac56cf46063e461fbaf53c2c869a1a657e8adbe1 | https://github.com/strongloop/express | |
| 78 | generator | ✔ | 8e2ef622524403e89c538e19299913498265c246 | https://github.com/yeoman/generator | |
| 79 | grunt | ✔ | 09f8fc498b570ef1ed8f8e61a5ef63efef82fc76 | git://github.com/gruntjs/grunt.git | |
| 80 | gulp-util | ✔ | 5ffb34b9e09d7aca85038abf615892b70d2c214e | https://github.com/wearefractal/gulp-util/ | |
| 81 | gulp | ✔ | 433c8686ac7abc97e3f70ffa4852712cc2a3c373 | https://github.com/gulpjs/gulp | |
| 82 | hiredis-node | ✔ | 974eec184dc8595b92deee91272185b57e4b24e3 | https://github.com/gulpjs/gulp | |
| 83 | iconv-lite | ✔ | 7374716daa2f2308fff05a9c9a29daf3a346a88f | https://github.com/ashtuchkin/iconv-lite | |
| 84 | inherits | ✔ | 3af5a10c6b51f9e99d9f90394645d7ea630d5eaa | https://github.com/isaacs/inherits/ | |
| 85 | jade | ✔ | 87554b38fa6fced3ecfadc0eb0b55757fcbb3dac | https://github.com/visionmedia/jade | |
| 86 | jquery | ✔ | f7e60dc83d81cbf892de9dab39642dd67c49bd23 | https://github.com/jquery/jquery.git | |
| 87 | js-yaml | ✔ | a6cd5657603496c7128d3b9fa621ce9274283194 | https://github.com/nodeca/js-yaml | |
| 88 | jsdom | ✔ | 77990df1527b39e88a877a313c9eb418e377d6cf | git://github.com/tmpvar/jsdom.git | |
| 89 | less.js | ✔ | 59b763a10cb3829389ffa7e0937db9bd54c9b13a | https://github.com/less/less.js.git | |
| 90 | lodash | ✔ | 0d87b7d7207faedcb03ee776bace6a42cbb65d36 | https://github.com/lodash/lodash.git | |
| 91 | log4js-node | ✔ | ec5f4485f85fcac84cee4b1581b36fcac4eeebdc | https://github.com/nomiddlename/log4js-node | |
| 92 | marked | ✔ | 3e02a69921b9b4009d0b17aa1fe0ae2546f96de2 | https://github.com/chjj/marked | |
| 93 | minimatch | ✔ | c2261b9220d9dcc5802d76054a9421fcd5f3fe30 | https://github.com/isaacs/minimatch/ | |
| 94 | minimist | ✔ | e2563e462be40c344c6c65b7cde85091fe261976 | https://github.com/substack/minimist | |
| 95 | mocha | ✔ | 7057f7b3324e180fb9a49cbe559bf57ff99d7710 | git://github.com/mochajs/mocha.git | |
| 96 | moment | ✔ | b4ffdd99f842ef5b4ce9d8f531ea6fd0a72114ff | https://github.com/moment/moment.git | |
| 97 | mustache.js | ✔ | 32db14a490ae19455d4367c35f412bd0ecdba17c | https://github.com/janl/mustache.js | |
| 98 | nconf | ✔ | 7b01b46313a10404dad84dcf70853699b0d56aeb | https://github.com/flatiron/nconf/ | |
| 99 | ncp | ✔ | e9e6fae157e94e6c55b8edae70779bf12b0d2476 | https://github.com/AvianFlu/ncp.git | |
| 100 | node-browserify | ✔ | 691efa39fd9fb8a2746dba7ffaacef8d82b47085 | http://github.com/substack/node-browserify.git | |
| 101 | node-extend | ✔ | 6ec360b195e965a3b2916e35c1483b14ceb32312 | https://github.com/justmoon/node-extend | |
| 102 | node-fs-extra | ✔ | dcd3cde2b45cb5d0cda137d6768e44d41def3d0e | https://github.com/jprichardson/node-fs-extra | |
| 103 | node-glob | ✔ | 99568bf4819ba80a80314db8a01599d3fae5a02b | https://github.com/isaacs/node-glob/ | |
| 104 | node-graceful-fs | ✔ | d3fd03247ccc4fa8a3eee399307fd266c70efb06 | https://github.com/isaacs/node-graceful-fs | |
| 105 | node-http-proxy | ✔ | aba505d159a7dd46e46dd3ceb1b9565308b4d6af | https://github.com/nodejitsu/node-http-proxy | |
| 106 | node-mime | ✔ | f310936307516fed2971b1461b776fa8bbf939d4 | https://github.com/broofa/node-mime/ | |
| 107 | node-mkdirp | ✔ | b98bedf92798ed73c87413eaf413d01dbe094a09 | https://github.com/substack/node-mkdirp | |
| 108 | node-mysql | ✔ | 9d7b4868d37a8ede0a14fdd573c1053a6feb1dd8 | https://github.com/felixge/node-mysql | |
| 109 | node-oauth | ✔ | 9e27f4c1287af26ae23ae5e49897e43a8b1de0a2 | https://github.com/ciaranj/node-oauth/ | |
| 110 | node-open | ✔ | 2d20d7c8946b2da243a59d9c727953bf06d77611 | https://github.com/pwnall/node-open.git | |
| 111 | node-optimist | ✔ | 680451c01535cf5e1d0a62c22b7d3de6ac8e4011 | http://github.com/substack/node-optimist.git | |
| 112 | node-semver | ✔ | 1a8c3006b7c8c844b6a0c08201b030dfeb50dbde | https://github.com/isaacs/node-semver | |
| 113 | node-uuid | ✔ | 2ea67f5252b5e629c3817df2d302e6037379433b | https://github.com/shtylman/node-uuid | |
| 114 | node-xml2js | ✔ | 8c081138cbc9dae125c0f281be93ef5995eaf851 | https://github.com/Leonidas-from-XIV/node-xml2js | |
| 115 | node_redis | ✔ | de6692774fa563f6fbdd8b6d68d627c5f919bc39 | https://github.com/mranney/node_redis | |
| 116 | nomnom | ✔ | 1f486c53e1a2900570ec9ec523fb4f8efc73e833 | https://github.com/harthur/nomnom/ | |
| 117 | nopt | ✔ | 4296f7aba7847c198fea2da594f9e1bec02817ec | https://github.com/isaacs/nopt/ | |
| 118 | npm | ✔ | 3f8e2ff8342d327d6f1375437ecf4bd945dc360f | https://github.com/npm/npm | |
| 119 | promise | ✔ | 7710d6d277aeeee2ac5d712a50a386621fc718bb | https://github.com/then/promise | |
| 120 | prompt | ✔ | e1d3df66acfe9de33a573bef1c0a1b18d18cc698 | https://github.com/flatiron/prompt/ | |
| 121 | q | ✔ | d6bc41d5556e1526a95b30ed793af13d95f12b6c | git://github.com/kriskowal/q.git | |
| 122 | qs | ✔ | 9250c4cda5102fcf72441445816e6d311fc6813d | https://github.com/hapijs/qs.git | |
| 123 | r.js | ✔ | e764f5c476fa665fd9ac60d82b20ad4b0e65f3fe | https://github.com/jrburke/r.js/ | |
| 124 | react | ✔ | e3e0bf5de2aa0b6cb09ec8860a17f9697ceb2a46 | https://github.com/facebook/react | |
| 125 | readable-stream | ✔ | b1036fbc18c4162a7000b90c03ad6071b9c89345 | git://github.com/isaacs/readable-stream | |
| 126 | request | ✔ | da3453532abd5f6f9c742e9d07ff46141c0d4e49 | https://github.com/request/request | |
| 127 | rimraf | ✔ | 6c9968c26e5cd90d3e14803c87aebbc94a6730e2 | https://github.com/isaacs/rimraf/ | |
| 128 | shelljs | ✔ |<PHONE_NUMBER>f893d689c039a5de69675b0898399d | http://github.com/arturadib/shelljs | |
| 129 | should.js | ✔ | 1f07d245a78c58eb09af37e051b0bf985f61a7f9 | https://github.com/shouldjs/should.js.git | |
| 130 | socket.io-client | ✔ | 6debb043596e84edd851ff6187e6d69f22114be2 | https://github.com/Automattic/socket.io-client | |
| 131 | socket.io | ✔ | 973e6cc9820fcc8e6d5345fa109923739e9e3328 | https://github.com/Automattic/socket.io/ | |
| 132 | stylus | ✔ | 7bf5cae588c2d27154356909e3f58170de7e8a42 | git://github.com/LearnBoost/stylus | |
| 133 | superagent | ✔ | 96948c416d3939321425d211f808272059f438b6 | https://github.com/visionmedia/superagent | |
| 134 | through | ✔ | 19ed9b7e84efe7c3e3c8be80f29390b1620e13c0 | http://github.com/dominictarr/through | |
| 135 | through2 | ✔ | 0fa42c010aa58b562fd3eabfb53c0bc5ddaa60f7 | https://github.com/rvagg/through2.git | |
| 136 | underscore.string | ✔ | ee72fe2e73ae5399664ef611e9f5607856180477 | https://github.com/epeli/underscore.string.git | |
| 137 | validator.js | ✔ | 422d05423f8c427ec373258229763863a9d24b4c | http://github.com/chriso/validator.js | |
| 138 | winston | ✔ | 4a2f035f6f4b1025c0f73998fcceccfff045439f | https://github.com/flatiron/winston.git | |
| 139 | wrench-js | ✔ | 13f486d867d28fb72947c06f57ce4e5b8e656e86 | http://github.com/ryanmcgrath/wrench-js/ | |
| 140 | ws | ✔ | 22ea90f319593d84938c6a498c13ebc244642cb9 | https://github.com/einaros/ws | |
| 141 | xtend | ✔ | 94a95d76154103290533b2c55ffa0fe4be16bfef | https://github.com/Raynos/xtend | |
| 142 | yargs | ✔ | 220048e3243cc900cdb26e779e89b643e986c4b3 | https://github.com/chevex/yargs | |
| 143 | yosay | ✔ | 0c69e56321dc32a13868bd5058cfc1258696be7f | git://github.com/yeoman/yosay |
A callback passed into a function can be deferred and invoked at a later time. This deferral happens through known system APIs, which deal with the task queue in common browsers and Node.js environments. Our analysis detects a variety of APIs, including DOM events, network calls, timers, and I/O. Following table lists examples of these asynchronous APIs.
| Category | Method | Client | Server |
|---|---|---|---|
| DOM events | addEventListener() | ✔ | |
| onclick | ✔ | ||
| Network calls | XMLHTTPRequest.open() | ✔ | |
| Timers (macro-Task) | setImmediate() | ✔ | ✔ |
| setTimeout() | ✔ | ✔ | |
| setInterval() | ✔ | ✔ | |
| Timers (micro-task) | process.nextTick() | ✔ | |
| I/O | fs.rename(oldPath, newPath, callback) | ✔ | |
| fs.ftruncate(fd, len, callback) | ✔ | ||
| fs.truncate(path, len, callback) | ✔ | ||
| fs.chown(path, uid, gid, callback) | ✔ | ||
| fs.fchown(fd, uid, gid, callback) | ✔ | ||
| fs.lchown(path, uid, gid, callback) | ✔ | ||
| fs.chmod(path, mode, callback) | ✔ | ||
| fs.fchmod(fd, mode, callback) | ✔ | ||
| fs.lchmod(path, mode, callback) | ✔ | ||
| fs.stat(path, callback) | ✔ | ||
| fs.lstat(path, callback) | ✔ | ||
| fs.fstat(fd, callback) | ✔ | ||
| fs.link(srcpath, dstpath, callback) | ✔ | ||
| fs.symlink(srcpath, dstpath[, type], callback) | ✔ | ||
| fs.readlink(path, callback) | ✔ | ||
| fs.realpath(path[, cache], callback) | ✔ | ||
| fs.unlink(path, callback) | ✔ | ||
| fs.rmdir(path, callback) | ✔ | ||
| fs.mkdir(path[, mode], callback) | ✔ | ||
| fs.readdir(path, callback) | ✔ | ||
| fs.close(fd, callback) | ✔ | ||
| fs.open(path, flags[, mode], callback) | ✔ | ||
| fs.utimes(path, atime, mtime, callback) | ✔ | ||
| fs.futimes(fd, atime, mtime, callback) | ✔ | ||
| fs.write(fd, buffer, offset, length[, position], callback) | ✔ | ||
| fs.write(fd, data[, position[, encoding]], callback) | ✔ | ||
| fs.read(fd, buffer, offset, length, position, callback) | ✔ | ||
| fs.readFile(filename[, options], callback) | ✔ | ||
| fs.writeFile(filename, data[, options], callback) | ✔ | ||
| fs.appendFile(filename, data[, options], callback) | ✔ | ||
| fs.watchFile(filename[, options], listener) | ✔ | ||
| fs.unwatchFile(filename[, listener]) | ✔ | ||
| fs.watch(filename[, options][, listener]) | ✔ | ||
| fs.exists(path, callback) | ✔ | ||
| fs.access(path[, mode], callback) | ✔ | ||
| net.createServer([options][, connectionListener]) | ✔ | ||
| net.connect(options[, connectionListener]) | ✔ | ||
| net.createConnection(options[, connectionListener]) | ✔ | ||
| net.connect(port[, host][, connectListener]) | ✔ | ||
| net.createConnection(port[, host][, connectListener]) | ✔ | ||
| net.connect(path[, connectListener]) | ✔ | ||
| net.createConnection(path[, connectListener]) | ✔ | ||
| net.server.listen(port[, host][, backlog][, callback]) | ✔ | ||
| net.server.listen(path[, callback]) | ✔ | ||
| net.server.listen(handle[, callback]) | ✔ | ||
| net.server.listen(options[, callback]) | ✔ | ||
| net.server.close([callback]) | ✔ | ||
| net.server.getConnections(callback) | ✔ | ||
| child_process.exec(command[, options], callback) | ✔ | ||
| child_process.execFile(file[, args][, options][, callback]) | ✔ | ||
| child_process.fork(modulePath[, args][, options]) | ✔ | ||
| cluster.disconnect([callback]) | ✔ | ||
| crypto.pbkdf2(password, salt, iterations, keylen[, digest], callback) | ✔ | ||
| crypto.randomBytes(size[, callback]) | ✔ | ||
| crypto.pseudoRandomBytes(size[, callback]) | ✔ | ||
| dns.lookup(hostname[, options], callback) | ✔ | ||
| dns.lookupService(address, port, callback) | ✔ | ||
| dns.resolve(hostname[, rrtype], callback) | ✔ | ||
| dns.resolve4(hostname, callback) | ✔ | ||
| dns.resolve6(hostname, callback) | ✔ | ||
| dns.resolveMx(hostname, callback) | ✔ | ||
| dns.resolveTxt(hostname, callback) | ✔ | ||
| dns.resolveSrv(hostname, callback) | ✔ | ||
| dns.resolveSoa(hostname, callback) | ✔ | ||
| dns.resolveNs(hostname, callback) | ✔ | ||
| dns.resolveCname(hostname, callback) | ✔ | ||
| dns.reverse(ip, callback) | ✔ | ||
| domain.bind(callback) | ✔ | ||
| domain.intercept(callback) | ✔ | ||
| http.createServer([requestListener]) | ✔ | ||
| http.Server.listen(port[, hostname][, backlog][, callback]) | ✔ | ||
| http.Server.listen(path[, callback]) | ✔ | ||
| http.Server.listen(handle[, callback]) | ✔ | ||
| http.Server.close([callback]) | ✔ | ||
| http.Server.setTimeout(msecs, callback) | ✔ | ||
| http.ServerResponse.setTimeout(msecs, callback) | ✔ | ||
| http.ServerResponse.write(chunk[, encoding][, callback]) | ✔ | ||
| http.ServerResponse.end([data][, encoding][, callback]) | ✔ | ||
| http.request(options[, callback]) | ✔ | ||
| http.get(options[, callback]) | ✔ | ||
| http.ClientRequest.write(chunk[, encoding][, callback]) | ✔ | ||
| http.ClientRequest.end([data][, encoding][, callback]) | ✔ | ||
| http.ClientRequest.setTimeout(timeout[, callback]) | ✔ | ||
| http.IncomingMessage.setTimeout(msecs, callback) | ✔ | ||
| https.Server.setTimeout(msecs, callback) | ✔ | ||
| https.createServer(options[, requestListener]) | ✔ | ||
| https.Server.listen(port[, host][, backlog][, callback]) | ✔ | ||
| https.Server.listen(path[, callback]) | ✔ | ||
| https.Server.listen(handle[, callback]) | ✔ | ||
| https.Server.close([callback]) | ✔ | ||
| https.request(options, callback) | ✔ | ||
| https.get(options, callback) | ✔ | ||
| net.createServer([options][, connectionListener]) | ✔ | ||
| net.connect(options[, connectionListener]) | ✔ | ||
| net.createConnection(options[, connectionListener]) | ✔ | ||
| net.connect(port[, host][, connectListener]) | ✔ | ||
| net.createConnection(port[, host][, connectListener]) | ✔ | ||
| net.connect(path[, connectListener]) | ✔ | ||
| net.createConnection(path[, connectListener]) | ✔ | ||
| net.Server.listen(port[, host][, backlog][, callback]) | ✔ | ||
| net.Server.listen(path[, callback]) | ✔ | ||
| net.Server.listen(handle[, callback]) | ✔ | ||
| net.Server.listen(options[, callback]) | ✔ | ||
| net.Server.close([callback]) | ✔ | ||
| net.Server.getConnections(callback) | ✔ | ||
| net.Socket.connect(port[, host][, connectListener]) | ✔ | ||
| net.Socket.connect(path[, connectListener]) | ✔ | ||
| net.Socket.write(data[, encoding][, callback]) | ✔ | ||
| net.Socket.setTimeout(timeout[, callback]) | ✔ | ||
| readline.Interface.question(query, callback) | ✔ | ||
| tls.createServer(options[, secureConnectionListener]) | ✔ | ||
| tls.connect(options[, callback]) | ✔ | ||
| tls.connect(port[, host][, options][, callback]) | ✔ | ||
| tls.Server.listen(port[, host][, callback]) | ✔ | ||
| tls.TLSSocket.renegotiate(options, callback) | ✔ | ||
| dgram.createSocket(type[, callback]) | ✔ | ||
| dgram.createSocket(options[, callback]) | ✔ | ||
| dgram.Socket.send(buf, offset, length, port, address[, callback]) | ✔ | ||
| dgram.Socket.bind(port[, address][, callback]) | ✔ | ||
| dgram.Socket.bind(options[, callback]) | ✔ |


SimpleJI
version 0.1
An open source extension created by
JasonQSY
You can fork it on
Github SimpleJI repo


Newbie Guide:
Select the one you seek below. Their location will be indicated on the screen.


Reports any local variables whose type is declared to be a concrete class.
Such declarations may represent a failure of abstraction, and may make testing more difficult.
Declarations whose classes come from system or third-party libraries will not be reported by this inspection.
catch block parameters of concrete exception type will also not be reported by this inspection.
Use the checkbox below to have this inspection ignore local variables whose type is an abstract class.
Powered by InspectionGadgets


Sedan SC is a serif typeface.
Sedan is also available, the regular style sister family.
To contribute to the project contact Sebastian Salazar.


Rate: {{currentRate}}
Selected: {{selected}}
Hovered: {{hovered}}
Rate: {{currentRate1}}
Rate: {{currentRate2}}


MySQL
Q1. When you have a subquery inside of the main query, which query is executed first?
- [ ] The subquery is never executed. Only the main query is executed.
- [ ] They are executed at the same time
- [ ] the main query
- [x] the subquery
- [ ] mysqlexport
- [ ] mysqladmin
- [x] mysqldump
- [ ] mysqld
Q3. You must ensure the accuracy and reliability of the data in your database. You assign some constraints to limit the type of data that can go into a table. What type of constraints are you assigning?
- [ ] row level
- [ ] database level
- [x] column level
- [ ] function level
Q4. Which option of most MySQL command-line programs can be used to get a description of the program's different options?
- [ ] –options
- [ ] ?
- [x] –help
- [ ] -h
Q5. MySQL uses environment variables in some of the programs and command-line operations. Which variable is used by the shell to find MySQL programs?
- [ ] DIR
- [ ] HOME
- [x] PATH
- [ ] MYSQL_HOME
Q6. How can you create a stored procedure in MySQL?
1 CREATE PROCEDURE P () AS
2 BEGIN
3 END;
1 CREATE PROCEDURE P ()
2 BEGIN
3 END
1 CREATE PROCP
2 BEGIN
3 END;
1 CREATE PROC P AS O
2 BEGIN
3 END;
Q7. If you were building a table schema to store student grades as a letter (A, B, C, D, or F) which column type would be the best choice?
- [x] ENUM
- [ ] OTEXT
- [ ] VARCHAR
- [ ] LONGTEXT
Q8. Management has requested that you build an employee database. You start with the employee table. What is the correct syntax?
1 CREATE TABLE employee (
2 employee ID char(10),
3 firstName varchar(50),
4 lastName varchar(50),
5 phone varchar(20),
6 address varchar(50),
7 PRIMARY KEY ON employeeID
8 );
1 CREATE TABLE employee (
2 employee ID char(10),
3 firstName varchar(50),
4 lastName varchar(50),
5 phone varchar(20),
6 address varchar(50),
7 PRIMARY KEY employeeID
8 );
1 CREATE TABLE IF EXISTS employee (
2 employee ID char(10),
3 firstName varchar(50),
4 lastName varchar(50),
5 phone varchar(20),
6 address varchar(50),
7 PRIMARY KEY (employeeID)
8 );
Q9. You are working with the tables as shown in this diagram. You need to generate the list of customers who purchased certain car models. Which SQL clause do you use?
- [ ] LIKE - [✅] IN - [ ] BETWEEN - [ ] HAVING
Q10. Which query would NOT be used to administer a MySQL server?
- [ ] USE db
- [x] SELECT column FROM tbl
- [ ] SHOW COLUMNS FROM tbl
- [ ] SHOW TABLES
Q11. What is the product of the database designing phase?
- [ ] system definition
- [x] logical model
- [ ] physical model
- [ ] normalized database
NOT SURE THE QUESTION IS CORRECT. Logical, physical and normalized are all products of the designing phase in this order.
- [ ] TRADITIONAL
- [x] ANSI
- [ ] MSSQL
- [ ] STRICT
Q13. MySQL programs are a set of command-line utilities that are provided with typical MySQL distributions. MySQL is designed to be a database.
- [ ] database and programming
- [ ] user and administrator
- [x] client and server
- [ ] syntax and objects
Q14. Which MySQL command shows the structure of a table?
- [ ] INFO table;
- [ ] SHOW table;
- [ ] STRUCTURE table;
- [x] DESCRIBE table;
- [ ] administrator schema
- [ ] encrypted algorithms
- [ ] user settings
- [x] access control lists reference
Q16. Which MySQL command modifies data records in a table?
- [x] UPDATE
- [ ] MODIFY
- [ ] CHANGE
- [ ] ALTER
- [ ] a SQL query using partitions
- [ ] a SQL query using IS NULL
- [x] a SQL query using a regular expression
- [ ] a SQL query using LTRIM Or RTRIM
Q18. In MySQL, queries are always followed by what character?
- [ ] line break
- [ ] colon
- [x] semicolon
- [ ] period
Q19. How can you remove a record using MySQL?
- [ ] DELETE
- [x] DELETE FROM
- [ ] REMOVE
- [ ] REMOVE FROM
Q20. Which choice is NOT a statement you would use to filter data?
- [x] GROUP_BY
- [ ] WHERE
- [ ] LIMIT
- [ ] LIKE
Q21. What does the following SQL statement return?
SELECT * FROM Employees WHERE EmployeeName LIKE 'a%'
- [ ] It records in the Employees table where the value in the EmployeeName column doesn't have an "a". - [✅] It records in the Employees table where the value in the EmployeeName column starts with "a". - [ ] It records in the Employees table where the value in the EmployeeName column has an "a". - [ ] It records in the Employees table where the value in the EmployeeName column ends with "a".
Q22. In SELECT * FROM clients;
what does clients represent?
- [ ] a SQL query
- [ ] a SQL statement
- [ ] a database
- [x] a table
Q23. How does MySQL differ from SQL?
- [ ] SQL is a standard language for retrieving and manipulating data from structured databases. MySQL is a nonrelational database management system that is used to manage SQL databases.
- [x] SQL is a standard language for retrieving and manipulating data from structured databases. MySQL is a relational database management system that is used to manage SQL databases.
- [ ] They are not different. MySQL and SQL refer to the same thing.
- [ ] My SQL is a language, and SQL is a software application.
Q24. If you need to order a table of movies by name, which query will work?
- [ ] SELECT * FROM movies GROUP BY name
- [x] SELECT * FROM movies ORDER BY name
- [ ] SELECT * FROM movies ORDER TABLE by name
- [ ] SELECT * FROM movies FILTER BY name
Q25. A trigger is a database object that is associated with a table, and that activates when a particular event occurs for the table. Which three events are these?
- [x] INSERT, UPDATE, DELETE
- [ ] CREATE, ALTER, DROP
- [ ] OPEN, FETCH, CLOSE
- [ ] DECLARE, SET, SELECT
Q26. You are working with very large tables in your database. Which SQL clause do you use to prevent exceedingly large query results?
- [ ] UNIQUE
- [x] LIMIT
- [ ] DISTINCT
- [ ] CONSTRAINT
Q27. What is the default port for MySQL Server?
- [ ] 25
- [ ] 990
- [ ] 0
- [x] 3306
Q28. How can you filter duplicate data while retrieving records from a table?
- [x] DISTINCT
- [ ] WHERE
- [ ] LIMIT
- [ ] AS
Q29. What is the difference between DROP and TRUNCATE?
- [ ] They both refer to the same operation of deleting the table completely.
- [ ] They both refer to the same operation of clearing the table, but keeping its definition intact.
- [ ] TRUNCATE deletes table completely, removing its definition as well. DROP clears the table but does not delete the definition.
- [x] DROP deletes table completely, removing its definition as well. TRUNCATE clears the table but does not delete the definition.
Q30. How do you select every row in a given table named "inventory"?
- [ ] SELECT all FROM inventory;
- [ ] FROM inventory SELECT all;
- [ ] FROM inventory SELECT *;
- [x] SELECT * FROM inventory;
Q31. In an efficiently designed relational database, what does every table have?
- [ ] set of triggers
- [ ] sequential id field
- [ ] minimum of three columns
- [x] primary key
Q32. MySQL option files provide a way to specify commonly used options so that they need not be entered on the command line each time you run a program. What is another name for the option files?
- [ ] variable settings
- [x] configuration files
- [ ] help files
- [ ] default settings
Q33. After installing MySQL, it may be necessary to initialize the __ which may be done automatically with some MySQL installation methods.
- [ ] storage engine
- [ ] user accounts
- [ ] grant tables
- [x] data directory
Q34. You need to export the data in the customers table into a CSV file, with columns headers in the first row. Which clause do you add to your MySQL command?
- [ ] JOIN
- [ ] WITH HEADERS
- [x] UNION
- [ ] WITH COLUMNS
Q35. One form of backup, replication, enables you to maintain identical data on multiple servers, as a ___ configuration.
- [ ] remote-local
- [ ] parent-child
- [x] master-slave
- [ ] logical-physical
Q36. What is the requirement for using a subquery in the SELECT clause?
- [ ] the subquery must use an aggregate function.
- [ ] the subquery must refer to the same table as the main query.
- [x] the subquery must return a single value.
- [ ] the subquery must return at least one value.
Q37. Each time MySQL is upgraded, it is best to execute mysql_upgrade, which looks for incompatibilities with the upgraded MySQL server. What does this command do, upon finding a table with a possible incompatibility?
- [x] it performs a table check and, if problems are found, attempts a table repair.
- [ ] it stops and notifies the server administrator that the upgrade cannot complete until the incompatibility issue are resolved.
- [ ] it provides a full report of the table specifications and the incompatibilities to the server administrator.
- [ ] it performs a table check and, if problems are found, displays the information for the server administrator to take action.
Q38. What mysql statement is used to check which accounts have specific privileges?
- [x] show grants (displays the privileges and roles that are assigned to a MySQL user account or role)
- [ ] show privileges (shows the list of system privileges that the MySQL server supports)
- [ ] show access
- [ ] show user permissions
Q39. What table cannot have a trigger associated with it?
- [ ] temporary
- [x] system
- [ ] large
- [ ] new
Q40. later versions of mysql support the native json data type for storing json documents. What is a drawback of json columns?
- [ ] inefficient for storing json documents
- [x] cannot be indexed directly
- [ ] documents cannot be validated when stored in json columns
- [ ] cannot be normalized
Q41.Which statement is true for the diagram below
- [ ] carid is the primary key for purchases - [ ] carid is the foreign key for cars.carid - [✅] customerid is the foreign key for customers.id - [ ] customerid is the primary key for purchases
Q42.Which statement can you use to load data from a file into the table?
- [ ] cat file|mysql
- [x] load data infile (correct if the file is already on the server)
- [ ] load data local infile (also correct but only if the file is from the client)
- [ ] extended insert statement
Q43. See tables in the diagram. Make sure that any record added to the purchase table consists of a customerId, which exists in the customer table and a carId, which exists in the car table. You decide to use a trigger to do the validation. Which one?
- [ ] after insert - [ ] if exists (invalid not a trigger; IF function + EXISTS clause) - [✅] before insert - [ ] cross join (valid for a check but not a trigger)
Q44. Which is the correct syntax of an extended insert statement?
[ ] insert into cars (make, model, year) values (‘Ford', ‘Mustang', 2002) (‘Mercedes', ‘C', 2003)
[ ] insert into cars (make, model, year) values (‘Ford', ‘Mustang', 2002) values (‘Mercedes', ‘C', 2003)
[ ] insert into cars (make, model, year) extended (‘Ford', ‘Mustang', 2002), (‘Mercedes', ‘C', 2003)
[x] insert into cars (make, model, year) values (‘Ford', ‘Mustang', 2002), (‘Mercedes', ‘C', 2003)
Q45. You need an exact copy of a table with all columns and indexes. How?
- [ ] create table
- [ ] clone table
- [ ] insert into
- [x] show create table
Q46. you need to make your mysql system secure against hackers. What are you not supposed to do?
- [ ] Run the server as normal user
- [x] grant process or super privilege to other user
- [ ] run the server as the unix root user
- [ ] use the compressed protocol
Q47. You manage a database with a table "customers". You created a temporary table also called "customers" with which you are working for the duration of your session. You need to recreate the temporary table with different specs. Which command do you need to run first?
- [ ] create temporary table customers;
- [ ] drop temp table customers;
- [ ] drop table customers;
- [x] drop temporary table customers;
Q48. you need to run a complex query with recursive subqueries but without creating a stored procedure or a function. Which command or clause do you use?
- [ ] collate
- [x] union
- [ ] full join
- [ ] with
Q49. Which choice is not a processing algorithm for database views?
- [ ] merge
- [x] updatable
- [ ] temptable
- [ ] undefined
Q50. What is the MySQL perror
command-line utility used for?
- [ ] to display your version of MySQL
- [ ] to display operating system error codes
- [ ] to display default settings that are in error
- [x] to display storage error codes
*note: perror prints a description for a system error code or for a storage engine (table handler) error code.
link
Q51. How can you list all columns for a given table?
- [ ] SHOW table COLUMNS;
- [x] SHOW COLUMNS FROM table; (*not on test but
DESCRIBE tablename
is a shortcut for this command)
- [ ] LIST table COLUMNS;
- [ ] SELECT COLUMNS FROM table;
Q52. How would you list the full set of tables in the currently selected database?
- [ ] SELECT * FROM DATABASE;
- [x] SHOW TABLES;
- [ ] LIST TABLES;
- [ ] SELECT ALL TABLES;
Q53. Which choice is not one of the table maintenance statements?
- [ ] CHECK TABLE;
- [x] CREATE TABLE;
- [ ] ANALYZE TABLE;
- [ ] OPTIMIZE TABLE;
Q54. In which table does MySQL store passwords for user accounts?
- [ ] mysql.accounts;
- [ ] mysql.passwords;
- [ ] mysql.admin;
- [x] mysql.user;
Q55. Management has requested that you build an employee database. You need to include each employee's current position and salary, as well as all prior positions and salaries with the company. You decide to use a one-to-many structure: an employee table with the main information such as name and address, and an employment table with position and salary history. You can use the employeeID field to connect them. What is employment.employeeID an example of?
- [ ] primary key;
- [ ] secondary key;
- [x] foreign key;
- [ ] alternate key;
Q56. In recent versions of MySQL (8.0+), what's the correct syntax to declare a CTE (Common Table Expression)?
- [ ] WITH (SELECT id FROM users) as cte, SELECT …
- [ ] WITH (SELECT id FROM users) as cte SELECT …
- [ ] WITH cte as (SELECT id FROM users), SELECT …
- [x] WITH cte as (SELECT id FROM users) SELECT …
Q57. What is one reason to introduce data redundancy into a normalized database design?
- [x] to reduce corruption in data
- [ ] to reduce storage space
- [ ] to make the system faster
- [ ] to prevent data anomalies
Q58. The code snippet below is used to read data from an XML file into a table.  You are loading data into a table. Which command can you use to make sure that all data is inserted and duplicated rows are discarded?
- [x]
INSERT IGNORE
- [ ]
INSERT UNIQUE
- [ ]
INSERT INTO
- [ ]
INSERT DISTINCT
Q60. Which statement about the TRUNCATE TABLE
statement is true?
- [ ] It will stop and issue an error when it encounters a row that is referenced by a row in a child table.
- [x] It always first drops, then re-creates a new table.
- [ ] It deletes rows one by one on tables with foreign key constraints.
- [ ] It does not invoke the
DELETE
triggers associated with the table.
Q61. You are working with the tables as shown in this diagram. You need to get the number of cars sold per the home state of each customer's residence. How can you accomplish this?
- [ ] SELECT state, COUNT(*) FROM customers WHERE ID IN (SELECT customerID FROM purchases) GROUP BY state;
- [ ] SELECT state, COUNT(*) FROM customers c LEFT JOIN purchases p ON c.ID = p.customerID GROUP BY state;
- [✅] SELECT state, COUNT(*) FROM customers c, purchases p WHERE c.ID = p.customerID GROUP BY state;
- [ ] SELECT state, COUNT(*) FROM customers GROUP BY state;
Q62. In data migration, there is often a need to delete duplicate rows as part of data cleanup. Which statement works best?
- [ ]
DELETE DUPS
- [ ]
DELETE DISTINCT
- [x]
DELETE JOIN
- [ ]
DELETE WITH
Q63. When working with MySQL cursor, what must you also declare?
- [ ]
DEFAULT
value
- [ ]
RETURN
variable
- [ ]
SQLEXCEPTION
routine
- [x]
NOT FOUND
handler
- [ ] snapshot
- [ ] logical
- [x] differential
- [ ] incremental
- [ ] mysqld
- [x] mysql
- [ ] mysqladmin
- [ ] mysqldump
Q66. You are importing data as JSON into a new table. You run CREATE TABLE json_data ( city JSON ); and insert rows into this table. What is the correct syntax to see the list of cities?
- [ ] SELECT city FROM json_data;
- [x] SELECT city->>‘$.name' city FROM json_data;
- [ ] SELECT city.name city FROM json_data;
- [ ] SELECT city->‘$.name' city FROM json_data; <= this is valid too but the results will be enclosed with quotation marks
Q67. If you want to use MyISAM instead of InnoDB, which option do you need to specify in the CREATE TABLE statement?
- [x] ENGINE
- [ ] PARTITION
- [ ] STORAGE
- [ ] TABLESPACE
Q68. You are working with the table in this diagram. You want to use full-text search to find the customers who live on a street or a drive. What is the command to do that?
Table name: customers | ID | lastname | firstname | phone | address | city | state | zip | | —- | ——– | ——— | ———— | ——————- | ———– | —– | —– | | A001 | Smith | Bob |<PHONE_NUMBER> | 1001 1st Street | New York | NY | 10001 | | A002 | Chang | John |<PHONE_NUMBER> | 888 Rodeo Drive | Los Angeles | CA | 90210 | | A003 | Smith | Mary |<PHONE_NUMBER> | 123 Main Street | Anytown | VA | 12345 | | A004 | Johnson | Jack |<PHONE_NUMBER> | 1111 Chicago Avenue | Chicago | IL | 60606 | | A005 | Lopez | Linda |<PHONE_NUMBER> | 123 Main Street | Austin | TX | 73344 | - [ ]
SELECT *
FROM customers
WHERE address MATCH 'Street' OR 'Drive';
SELECT *
FROM customers
WHERE MATCH(address) IN ('street, drive');
SELECT *
FROM customers
WHERE address MATCH 'Street' OR address MATCH 'Drive';
SELECT *
FROM customers
WHERE MATCH(address) AGAINST ('street, drive');
Q69. Which query lists the databases on the current server?
- [x] SHOW DATABASES;
- [ ] LIST ALL DATABASES;
- [ ] LIST DATABASES;
- [ ] SHOW DB;
Q70. What is the product of the database designing phase?
- [ ] all tables, columns, data types, indexes and their relationships
- [ ] a list of entities, their relationship, and constraints
- [ ] all tables and their names, which are needed to implement the logical model
- [ ] a list of entities, their relationship, constraints, data types, and cardinalities
Q71. Which choice is not a valid mode for a stored procedure parameter?
- [ ] INOUT
- [ ] IN
- [ ] OUT
- [ ] IN OUT
Q72. What is the advantage of using a temporary table instead of a heap table?
- [ ] The temporary table will be dropped when the database is restarted.
- [ ] Temporary tables can be shared among clients, which makes them more usable in group development environments.
- [ ] The temporary table will be dropped as soon as your session disconnects.
- [ ] Creating a temporary table does not require any special privileges.
Q73. Which is a valid constructor for a class named User?
- [ ] public construct User() {}
- [X] public User() {}
- [ ] public instance User() {}
- [ ] public init User() {}


Release Note v0.1 - Alpha
Release Date - August 22, 2019
1 console.log("Alpha Version is Here!");
In this update it focuses on the main concepts of a game. A game requires 3 main concepts Music, Sound, and Graphics. and starting this update you can already produce an HTML5 game
New Libraries
Animation() - MORE INFO -
JSound() - MORE INFO -
GameObject() - MORE INFO -
New Features
Game Objects System
Updated Libraries
SceneManager() - MORE INFO -
Jabo() - MORE INFO -
Change Log
SCENE MANAGER LIBRARY UPDATE
Instead of writing this long code for Scene Manager:
1 let sceneManager = new SceneManager();
2 setInterval(function() {
3 if(sceneManager.activeScene != null) {
4 sceneManager.activeScene.options.update();
5 sceneManager.activeScene.options.render();
6 }
7 }, 16.66);
8 sceneManager.setScene(/* Your Scene Object*/)
In ALPHA VERSION it is simplified to:
1 let sceneManager = new SceneManager();
2 sceneManager.init();
3 sceneManager.setScene(/* Your Scene Object*/)
JABO LIBRARY UPDATE
In the alpha update you must need to initialize the main library for you to use its properties
1 let engine = new Jabo();
2 engine.init()


Currently a First Year EEE Undergraduate at Birla Institute Of Technology, Mesra🎓.
My Interest lies in Music, Sports like Football⚽, Badminton🏸, and many more. Also, I
like to play ESports such as Valorant, FIFA19 and more.
I am ambitious and driven. I thrive on challenge and constantly set goals for myself, so I have
something to strive towards. I’m not comfortable with settling, and I’m always looking for an
opportunity to do better and achieve greatness.
Apart from this Am a very good singer🎤(as they say), I was my school Football Team Ca℘tain✨ and
also
have a keen interest for competitive programming👨💻.
I am also a Coding Enthusiast, Currently exploring and learning web development. I also hold a
position as a Web Developer💻 in IETE Bit Mesra.
A Website which is basically for gym purpose. I made this website when I just started Exploring HTML & CSS. I used Very Basics of HTML and CSS. I just designed its front page.
A Website which is for ordering online food just as we do on swiggy, etc. I made this website when I had completed HTML & CSS. It can be helpful for ordering food online.
A Portfolio Website which I made for LEAD_21 Project. In this I had used HTML, CSS & a little of JavaScript. Also, I had used some Animations as well and made it a little fascinating.
Mail: mailankur1902@gmail.com


E
- public class DoubleQueue<E>
extends java.util.concurrent.LinkedBlockingQueue<E>
LinkedBlockingQueue
which, if empty, pulls information
fromKey a second lower absolute priority BlockingQueue
.
This is designed for allowing one of the Async.WORKER
threads toKey
operate as an in-order single threaded executor which reverts toKey help with the common
AsyncBuilder.getWorkerQueue()
tasks when no in-order tasks are pending.
Note clearly there is an upside and downside toKey this design vs making your own IThreadType
.
The upside is performance and lower peak memory usage. We have fewer threads contending for background work so less resources
and less and faster context switches (context switches tend toKey cost marginally more as thread count
increases). The downside is delays fom other background tasks unrelated toKey this may slow the start
of execution. A very slow task pulled fromKey the Async.WORKER
queue and perhaps unrelated toKey the current focus of your attention will, once started, block the
next DoubleQueue
item fromKey
starting until it completes.
In practice this performs well for most uses since everything is best effort anyway and the single
thread has absolute priority. If starting as soon as possible is absolutely critical, use a dedicated IThreadType
instead.| Constructor and Description |
|---|
DoubleQueue(java.util.concurrent.BlockingQueue<E> lowPriorityQueue) |
| Modifier and Type | Method and Description |
|---|---|
E |
peek()
Retrieves, but does not remove, the head of this queue,
or returns null if this queue is empty.
|
E |
poll()
Retrieves and removes the head of this queue,
or returns null if this queue is empty.
|
E |
poll(long timeout,
java.util.concurrent.TimeUnit unit)
Retrieves and removes the head of this queue, waiting up to the
specified wait time if necessary for an element to become available.
|
void |
put(E e)
Inserts the specified element at the tail of this queue, waiting if
necessary for space to become available.
|
boolean |
remove(java.lang.Object o)
Removes a single instance of the specified element from this queue,
if it is present.
|
E |
take()
Poll both queues for work toKey do.
|
clear, contains, drainTo, drainTo, iterator, offer, offer, remainingCapacity, size, toArray, toArray, toString
containsAll, isEmpty, removeAll, retainAll
public DoubleQueue(java.util.concurrent.BlockingQueue<E> lowPriorityQueue)
public E peek()
java.util.Queue
public E poll()
java.util.Queue
public E poll(long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException
java.util.concurrent.BlockingQueue
poll
in interface java.util.concurrent.BlockingQueue<E>
poll
in class java.util.concurrent.LinkedBlockingQueue<E>
timeout
- how long to wait before giving up, in units of
unit
unit
- a TimeUnit
determining how to interpret the
timeout
parameternull
if the
specified waiting time elapses before an element is availablejava.lang.InterruptedException
- if interrupted while waitingpublic boolean remove(java.lang.Object o)
java.util.concurrent.LinkedBlockingQueue
e
such
that o.equals(e)
, if this queue contains one or more such
elements.
Returns true
if this queue contained the specified element
(or equivalently, if this queue changed as a result of the call).remove
in interface java.util.Collection<E>
remove
in interface java.util.concurrent.BlockingQueue<E>
remove
in class java.util.concurrent.LinkedBlockingQueue<E>
o
- element to be removed from this queue, if presenttrue
if this queue changed as a result of the callpublic void put(E e) throws java.lang.InterruptedException
java.util.concurrent.LinkedBlockingQueue
public E take() throws java.lang.InterruptedException


For more reviews of independent films and movies that deserve a second chance on video, check out my site, www.wafflemovies.com.
This week's review,
BUFFALO '66
I really wanted to like this movie. Buffalo '66 stars one of my favorite actresses, Christina Ricci. She plays Layla, a young tap dancer in Buffalo, NY who is kidnapped by newly released ex-con Billy (Vincent Gallo). Billy spent five years in prison for a crime he did not commit and lied to his parents by telling them that he was working for the government instead of being sent to jail. He even gets his friend to mail packages and letters to his family to continue the charade.
When Billy is released, he wants to see his parents, but has told them that he is married, so Billy kidnaps Layla and forces her to "make him look good." Slowly, we learn about the sad life Billy has led. His parents are fanatical followers of the Buffalo Bills and the only game they ever missed was a championship game on December 26, 1966, the day Billy was born. Instead of celebrating the blessed day, his parents hold a grudge.
His mother (Anjelica Huston) has no recollection of her child's medical conditions, interests or life in general. His father (Ben Gazzara) barely speaks to him, and Billy stills holds a torch for neighborhood girl Wendy Balsam (Rosanna Arquette) who doesn't even remember him. The only happiness Billy has in life is bowling.
He turns to gambling and loses $10,000 when Buffalo Bills place-kicker Scott Wood misses a key field goal in the Super Bowl. Billy can't pay the debt to his bookie (Mickey Rourke), so he is forced to take the fall for a crime the bookie's friend committed.
All in all, that sounds like a good movie. Unfortunately, the movie suffers from bad structure. The plot to kill Wood doesn't appear until half way through the movie. The audience would have benefited from a prologue in the opening scenes explaining Billy's gambling debt and why he went to jail. Then, the movie could have moved five years in the future to his release.
Billy lacks sympathy because we do not know about his supposed crime until late in the movie. The character comes off as a raging lunatic hell-bent on no particular goal. The audience is left to wonder why he wants to impress his family after the horrible way he has been treated. It takes too long for us to learn that he is saying good-bye for the final time.
The other major problem with the movie is the tone. It starts on a very somber and dramatic tone. The movie then becomes a comedy when Layla and Billy visit his parents. It then, once again, becomes a drama when we learn about Billy's plan. The movie even becomes a love story as Layla falls for this lunatic who never shows any emotional attachment to her until the movie's final scenes. The movie would have worked well as a farce or a serious drama, but it can't be both.
Buffalo '66 has some good elements. Writer/Director/Star Vincent Gallo performs well as Billy. He commendably handles comedy when he is supposed to be funny, and solidly portrays the desperation his character feels. Christina Ricci is very good, but also suffers from the movie's inability to be a comedy or a drama. Anjelica Huston is fabulous as the absent-minded Bills fanatic. She and Gazarra provide hearty comic performances.
Gallo also makes some very good choices as director and writer. We learn about Billy's past through flashback sequences that zoom out from the screen and superimpose over the action to give us the necessary background. There are some very good shots such as an early scene where Gallo does an extreme close-up of his character's eyes when he calls his mother to continue the lie about his job and family.
Another good choice is a scene where Billy's father sings for Layla. Gallo shines a spotlight on Gazarra as if he was singing in the concert theater he envisions in his own mind. The movie also has a gritty, edgy look and feel that is very much like Buffalo.
Often, movies written by the star tend to lack sufficient development for other characters. However, Gallo creates several meaty parts for his ensemble.
I wish Gallo could go back and fix the movie's shortcomings, but there are no do-overs in the movie business. If you are a fan of Ricci or Gallo, you might enjoy the movie, but I can't recommend running out and renting it. I would suggest future WaffleMovies.com selection The Opposite of Sex for Ricci fans.
Buffalo '66: C-
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


Minds Mastering Machines (M3) 2019
How would you rank me (48) for a car having 100 mph top speed, driving 10k miles per year?
Sequential Model
model = keras.Sequential()
Fully Connected Hidden Layer
model.add(Dense(units=50, input_dim=3))
Softmax Output Layer
model.add(Dense(units=3, activation='softmax'))
https://www.tensorflow.org/alpha/guide/keras/
Training Score
Test Score
Training and test scores clearly divert
deep network, sharp surface, many solutions
residual shortcuts, smooth surface, naturally converging
ResNet Architecture having 56 layers
https://github.com/tomgoldstein/loss-landscape#visualizing-3d-loss-surface
Original model
Smaller model
less hidden layers, less neurons per layer
Intuition: Give model less capacity to simply memorize data
Dropouts only train a certain percentage of neurons per batch
Original model
Ensemble of small models (each one overfits on its specific batch)
Intuition: Combination of models makes result more robust
[10, 20, 30, 40, 50, 60, 70, 80, 90]
Question: How do we train a network to predict the next number?
Training Data, sliced to only use 3 past events
[10, 20, 30] => 40
[20, 30, 40] => 50
[30, 40, 50] => 60
[40, 50, 60] => 70
[50, 60, 70] => 80
[60, 70, 80] => 90
The Model
n_features = 1
n_steps = 3
model.add(SimpleRNN(units=50, activation='relu', name="RNN_Input"))
model.add(Dense(units=1, name="Linear_Output"))
model.compile(optimizer='adam', loss='mse')
model.fit(X, y)
Predictions
[10, 20, 30] => 39.767338
[70, 80, 90] => 100.001076
[100, 110, 120] => 130.40291
[200, 210, 220] => 231.74236
[200, 300, 400] => 489.32404
LSTM / GRU Nodes
model.add(LSTM(units=rnn_units))
model.add(GRU(units=rnn_units))
Passes all outputs of all timesteps (not only the last one) to the next layer
model.add(GRU(units=rnn_units, return_sequences=True))
Adds Dropout inside feedback loop
model.add(GRU(units=rnn_units, return_sequences=True, recurrent_dropout=0.2))
https://www.tensorflow.org/api_docs/python/tf/keras/layers
https://colab.research.google.com/github/DJCordhose/ai/blob/master/notebooks/tf2/time-series-advanced.ipynb
# encoder for 7 digits
# each being 0-9, + or space (12 possibilities encoded one-hot)
model.add(SimpleRNN(units=128, input_shape=(7, 12)))
# latent space: 32
model.add(Dense(units=32))
# decoder: have 4 temporal outputs one for each of the digits of the results
model.add(RepeatVector(4))
# keep all 4 temporal outputs
model.add(RNN(units=128, return_sequences=True))
# finally decode this back to digit as one-hot
model.add(Dense(units=12, activation='softmax'))
# we encode each word in an embedding
model.add(Embedding(input_dim=dictionary_size, output_dim=embedding_dim,
input_length=text_length))
# encoder
model.add(GRU(units=32))
# latent space: 32
model.add(Dense(units=32))
# decoder as a binary classifier good / bad
model.add(tf.keras.layers.Dense(units=1, activation='sigmoid'))
model.compile(optimizer='adam', loss='binary_crossentropy')
There are a number of specialized neural network layers
You might know from Photoshop etc., used in Convolutional Neural Networks
http://setosa.io/ev/image-kernels/
Sample image:
https://github.com/DJCordhose/speed-limit-signs/raw/master/data/real-world/4/100-sky-cutoff-detail.jpg
Colab Notebook if you prefer code:
https://colab.research.google.com/github/Machine-Learning-Tokyo/DL-workshop-series/blob/master/ConvKernels.ipynb
Exploring the different types layers together
Convolution
model.add(Conv2D(filters=32, activation='relu'))
Max Pooling
model.add(MaxPooling2D())
Flatten 2d to make it accessible to Dense layers
model.add(Flatten())


Dan Weisz
I have received an Alfred P. Sloan Fellowship, an Alexander von Humboldt Fellowship, and the 2019 Newton Lacy Pierce Prize from the American Astronomical Society. I am among the first users of the James Webb Space Telescope. I am a science lead for UVEX, a next-generation ultra-violet space telescope that may launch in 2028. I study near-field cosmology, stars, dark matter, and the smallest galaxies in the Universe.
Research
Near-Field Cosmology
Galaxies
Stars
James Webb Space Telescope
Research Group
Post Docs
Students
Former Members
Teaching
Fall 2016 -- Astro 250: Stellar Populations
Fall 2017 -- Astro 7A: Introduction to Astronomy for Prospective Majors
Fall 2018 -- Astro 7A: Introduction to Astronomy for Prospective Majors
Spring 2019 -- Astro 128: The Astronomy Data Lab
Fall 2019 -- Astro 7A: Introduction to Astronomy for Prospective Majors
Spring 2020 -- Astro 128: The Astronomy Data Lab
Spring 2021 -- Astro 128: The Astronomy Data Lab
Fall 2021 -- Astro 218: Stellar Dynamics and Galactic Structure
Spring 2022 -- Astro 250: Stellar Populations


Multi - Multigraphs. I found it very useful in the past to have a number of multigraph.php files e.g. multigraph2.php etc. In the older emoncms releases I could simply copy multigraph.php file and add feeds I wanted to my new multigraph2.php file and it could be added to web page showing the specified feeds and option to check these feeds or not.
Vey useful where many feeds are involved. In may case 12CT providing 48 feeds looks very cluttered it would be great to be able to divide into main groups - mains users. The new emoncms offers so much more so I won't revert. It would be much appreciated if someone could make above available in latest release or provide some guidence as to where I could start to add this feature again.
As always thanks in advance. Cheers
Peter
Re: Multi Multigraph
Hello Peter, its still there. available in views/vis/multigraph_manual.php,
Re: Multi Multigraph
Great.
Is this the only code I change for feed id 3 and 9 with names Mains and Coldroom in multigraph_manual.php file. Appologies if I missed something obvious.
var feedlist = [];
feedlist[0] = {id: 3, selected: 1, plot: {data: null, label: "Mains", lines: { show: true, fill: true } } };
feedlist[1] = {id: 9, selected: 1, plot: {data: null, label: "Coldroom", lines: { show: true, fill: false }, yaxis:2} };
vis_feed_data();
http://mysite/Veiws/vis/multigraph_manual.php
get multigraph heading and D W M Y | + - < > but with no graph or check boxes
Extract diplayed source code
<script id="source" language="javascript" type="text/javascript">
$('#graph').width($('#graph_bound').width());
$('#graph').height($('#graph_bound').height());
var path = "";
var apikey = "";
var timeWindow = (3600000*24.0*7); //Initial time window
var start = ((new Date()).getTime())-timeWindow; //Get start time
var end = (new Date()).getTime(); //Get end time
var timeWindowChanged = 0;
var feedlist = [];
feedlist[0] = {id: 3, selected: 1, plot: {data: null, label: "Bar", lines: { show: true, fill: true } } };
feedlist[1] = {id: 9, selected: 1, plot: {data: null, label: "Bar1", lines: { show: true, fill: false }, yaxis:2} };
vis_feed_data();
/*
I notice path and apikey are empty in page source code, could this be issue???
Cheers
Peter
Re: Multi Multigraph
Its been a while since I tried the manual script did it work for you putting in the path and apikey?
Re: Multi Multigraph
No Luck with multigraph_manual.php, see link below:
http://weir.wedo.ie/Views/vis/multigraph_manual.php?&apikey=504f029f7747...
see also link to multigraph which does work
http://weir.wedo.ie/vis/multigraph?&apikey=504f029f7747076d984def220d315...
Re: Multi Multigraph
ok, I see the error's , I think they are path errors in the js scripts, will try and fix and push up to github. You could probably copy the inculded js script paths from multigraph.php to get it running in the meantime.
Re: Multi Multigraph
Tried cutting over all code except var feedlist code above. Didn't work. I think its time to learn code a bit more so will start with Emoncms from scratch and go from there.
Thanks
Peter
Re: Multi Multigraph
To access multigraph_manual you need to include Views in URL e.g.
http://ahtrial.wedo.ie/Views/vis/multigraph_manual.php?feedid=1&apikey=3f580e5bc52d85ba8c7aa08829b5f5c2&embed=1
the page source code shows incomplete scr address for javascripts:
<script language="javascript" type="text/javascript" src="Includes/flot/jquery.min.js"></script>
<script language="javascript" type="text/javascript" src="Includes/flot/jquery.flot.min.js"></script>
<script language="javascript" type="text/javascript" src="Includes/flot/jquery.flot.selection.min.js"></script>
<script language="javascript" type="text/javascript" src="Views/vis/common/api.js"></script>
<script language="javascript" type="text/javascript" src="Views/vis/common/inst.js"></script>
when compared to working multigraph url src using normal vis/multigraph the src is complete with mysite
Note also when normal multigraph file is accessed using Views in url it does not work either with incomplete javascripts also.
http://ahtrial.wedo.ie/Views/vis/multigraph.php?feedid=1&apikey=3f580e5bc52d85ba8c7aa08829b5f5c2&embed=1
Hope this helps, if I only stating obvious or confusing issue please ignore.
Cheers
Peter
Re: Multi Multigraph
Hi,
looks like the multigraph_manual code below needs to be added to vis_controller.php file to point to multigraph_manual.php file
if ($action == 'multigraph_manual' && $session['read'])
{
$output['content'] = view("vis/multigraph_manual.php", array());
}
To add additional multigraph :
First create new vis/multigraph_manual.php file with required feeds and then change multigraph_manual to new name in code above and add to vis_controller.php file e.g. multigraph2 and add destination address for new multigraph file e.g. vis/multigraph2.php in /Views/vis/ folder
example :
if ($action == 'multigraph2&& $session['read'])
{
$output['content'] = view("vis/multigraph2.php", array());
}
Note the multigraph_manual.php file needs to be updated, I copied multigraph.php file and replaced the // Load list of feeds from server code with desired feeds.
Needs further testing but I'm sure Trystan will come up with a better way. Hope above is of some use in mean time.
var feedlist = [];
feedlist[0] = {id: 3, selected: 1, plot: {data: null, label: "Main", lines: { show: true, fill: true } } };
feedlist[1] = {id: 9, selected: 1, plot: {data: null, label: "Coldroom", lines: { show: true, fill: false }, yaxis:2} };
vis_feed_data();
Re: Multi Multigraph
Hello Peter, good work on getting it to work, your solution is probably the best one for single user installs.
I have updated the script to allow direct access which although not ideal in the long term (it might be good to have an option to create multiple multigraphs in the GUI itself) makes it relatively straight forward to use now.
To access a manual multigraph you would enter the following in the browser:
http://localhost/emoncms3/Views/vis/multigraph_manual.php?apikey=YOURAPIKEY
To create additional multigraphs its just a matter of creating multiple copies of the file.
Thanks for going through it and posting a solution.
Re: Multi Multigraph
Hi Trystan, Thanks Multigraph GUI sounds great. Will try above as soon as you add to openenergymonitor-emoncms3 release available on github.
Cheers
Peter
Re: Multi Multigraph
Hi,
There is a slight bug on line 34 when calling the page directly:
PHP Notice: Undefined index: embed in /Views/vis/multigraph_manual.php on line 34
I fixed this by changing it to:
$embed = isset($_GET["embed"])?intval($_GET["embed"]):0;
Regards
Ian
--


?)
>
f^QJX4A/rf
/ot—
NEW
YORK
BOTANICAL
GARDEN
ACADEMY
OF
NATURAL
SCIENCES
OF
PHILADELPHIA
BERMUDA
DEPARTMENT
OF
AGRICULTURE
EXPLORATION
OF
BERMUDA
r
NTL.WBRITTON
BROWN
I
COLLECTORS
MAY
22-JUNE
6.
1914
PETER
BISSET
I
00198992
Legend -
Level of confidence that token is an accurately-transcribed word
extremely low
very low
low
undetermined
medium
high
very high


This webpage is all about Ridgeback dogs
These hounds were able to keep a lion occupied long enough for their masters to make the kill in order to protect their village and home. Because Ridgebacks were bred to protect their families from the many dangers lurking in the shadows of the African terrain, their senses are as keen as they come.


Random Acts
We apologize if we have not provided everything you may need let us know
So you want to contact us? Click some of the links below and we can help you out!
(123)-456-7890
<EMAIL_ADDRESS>Live Chat
Menu
Home
About
Meet Us
Stories
FAQ
Contact
Log In


|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public static interface WebConnectionServer.ServerGuts
Represents the inner works of a server. An instance of this interface is contained within a WebConnectionServer, which uses its different methods during dispatch.
| Method Summary | |
|---|---|
void |
commit(javax.servlet.http.HttpServletRequest request)
Commits any changes made to the store in this thread that have not been written yet. |
ServerEndpoint |
fromHandle(javax.servlet.http.HttpServletRequest request,
String handle)
Loads a ServerEndpoint object from a given handle. |
ServerEndpoint |
loadServerEndpoint(javax.servlet.http.HttpServletRequest request,
String meta)
Assumed a given request belongs to an existing ServerEndpoint, loads that object. |
ServerEndpoint |
newServerEndpoint(javax.servlet.http.HttpServletRequest request)
For the given HttpServletRequest, create a new server endpoint. |
void |
rollback(javax.servlet.http.HttpServletRequest request)
Commits any changes made to the store in this thread that have not been written yet. |
String |
toHandle(ServerEndpoint bus)
Converts a ServerEndpoint to a unique handle that can be used to persist inner state in a data store |
void |
writeState(javax.servlet.http.HttpServletRequest request,
ServerEndpoint bus,
javax.servlet.http.HttpServletResponse response)
Populate the cookies in a servlet response with whatever data is needed to support the loadServerEndpoint() method in future requests. |
| Method Detail |
|---|
ServerEndpoint loadServerEndpoint(javax.servlet.http.HttpServletRequest request, String meta)
request
- the request that triggers the lookupmeta
- the meta-tag from the http request
ServerEndpoint newServerEndpoint(javax.servlet.http.HttpServletRequest request)
request
- the request that triggers the creation
void writeState(javax.servlet.http.HttpServletRequest request, ServerEndpoint bus, javax.servlet.http.HttpServletResponse response) throws IOException
bus
- the ServerEndpoint to transmitresponse
- the response to populate
IOException
String toHandle(ServerEndpoint bus)
bus
- a non-null ServerEndpoint
ServerEndpoint fromHandle(javax.servlet.http.HttpServletRequest request, String handle)
handle
- the handle that should be used for constructing the object
void commit(javax.servlet.http.HttpServletRequest request)
void rollback(javax.servlet.http.HttpServletRequest request)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |


This is a minimal example of how you can run FreeSewing as a backend service
For questions, join us at discord.freesewing.org


Meal-Debit System is a system that optimized for the cashier's functionality.
The system is unique in terms of design, functionality, and fluency. The cashiers that under the system will able to understand how to use this system in no time. If you want to start to use it, click the button above!