|
SPHinXsys
alpha version
|
Defining a mesh cell linked list for a body. The meshes for all bodies share the same global coordinates. More...
#include <cell_linked_list.h>
Inherits SPH::BaseCellLinkedList, and SPH::Mesh.
Public Member Functions | |
| CellLinkedList (BoundingBox tentative_bounds, Real grid_spacing, RealBody &real_body, SPHAdaptation &sph_adaptation) | |
| void | allocateMeshDataMatrix () |
| void | deleteMeshDataMatrix () |
| virtual void | assignBaseParticles (BaseParticles *base_particles) override |
| void | clearCellLists () |
| void | UpdateCellListData () |
| virtual void | UpdateCellLists () override |
| void | insertACellLinkedParticleIndex (size_t particle_index, const Vecd &particle_position) override |
| void | InsertACellLinkedListDataEntry (size_t particle_index, const Vecd &particle_position) override |
| virtual ListData | findNearestListDataEntry (const Vecd &position) override |
| virtual void | computingSequence (StdLargeVec< size_t > &sequence) override |
| virtual void | tagBodyPartByCell (CellLists &cell_lists, std::function< bool(Vecd, Real)> &check_included) override |
| virtual void | tagBodyDomainBoundingCells (StdVec< CellLists > &cell_lists, BoundingBox &body_domain_bounds, int axis) override |
| virtual void | tagMirrorBoundingCells (CellLists &cell_lists, BoundingBox &body_domain_bounds, int axis, bool positive) override |
| virtual void | writeMeshFieldToPlt (std::ofstream &output_file) override |
| template<typename GetParticleIndex , typename GetSearchDepth , typename GetNeighborRelation > | |
| void | searchNeighborsByParticles (size_t total_real_particles, BaseParticles &source_particles, ParticleConfiguration &particle_configuration, GetParticleIndex &get_particle_index, GetSearchDepth &get_search_depth, GetNeighborRelation &get_neighbor_relation) |
| template<typename GetParticleIndex , typename GetSearchDepth , typename GetNeighborRelation , typename PartParticleCheck > | |
| void | searchNeighborPartsByParticles (size_t total_real_particles, BaseParticles &source_particles, ParticleConfiguration &particle_configuration, GetParticleIndex &get_particle_index, GetSearchDepth &get_search_depth, GetNeighborRelation &get_neighbor_relation, PartParticleCheck &part_check) |
| MeshDataMatrix< CellList > | getCellLists () const |
| Public Member Functions inherited from SPH::BaseCellLinkedList | |
| BaseCellLinkedList (RealBody &real_body, SPHAdaptation &sph_adaptation) | |
| Public Member Functions inherited from SPH::BaseMeshField | |
| BaseMeshField (const std::string &name) | |
| std::string | Name () |
| Public Member Functions inherited from SPH::Mesh | |
| Mesh (BoundingBox tentative_bounds, Real grid_spacing, size_t buffer_width) | |
| Mesh (Vecd mesh_lower_bound, Vecu number_of_cells, Real grid_spacing) | |
| Vecu | NumberOfCells () |
| size_t | MeshBufferSize () |
| virtual Real | DataSpacing () |
| Public Member Functions inherited from SPH::BaseMesh | |
| BaseMesh (Vecu number_of_grid_points) | |
| BaseMesh (Vecd mesh_lower_bound, Real grid_spacing, Vecu number_of_grid_points) | |
| BaseMesh (BoundingBox tentative_bounds, Real grid_spacing, size_t buffer_width) | |
| Vecd | MeshLowerBound () |
| Real | GridSpacing () |
| Vecu | NumberOfGridPoints () |
| Vecu | NumberOfGridPointsFromNumberOfCells (const Vecu &number_of_cells) |
| Vecu | NumberOfCellsFromNumberOfGridPoints (const Vecu &number_of_grid_points) |
| Vecd | GridPositionFromCellPosition (const Vecd &cell_position) |
| Vecu | CellIndexFromPosition (const Vecd &position) |
| Vecd | CellPositionFromIndex (const Vecu &cell_index) |
| Vecd | GridPositionFromIndex (const Vecu &grid_index) |
| Vecu | transfer1DtoMeshIndex (const Vecu &number_of_mesh_indexes, size_t i) |
| size_t | transferMeshIndexTo1D (const Vecu &number_of_mesh_indexes, const Vecu &mesh_index) |
| size_t | MortonCode (const size_t &i) |
| size_t | transferMeshIndexToMortonOrder (const Vecu &mesh_index) |
Protected Member Functions | |
| virtual void | updateSplitCellLists (SplitCellLists &split_cell_lists) override |
| Protected Member Functions inherited from SPH::BaseCellLinkedList | |
| virtual void | clearSplitCellLists (SplitCellLists &split_cell_lists) |
| Protected Member Functions inherited from SPH::Mesh | |
| void | copyMeshProperties (Mesh *another_mesh) |
Protected Attributes | |
| MeshDataMatrix< CellList > | cell_linked_lists_ |
| Protected Attributes inherited from SPH::BaseCellLinkedList | |
| RealBody & | real_body_ |
| Kernel & | kernel_ |
| BaseParticles * | base_particles_ |
| Protected Attributes inherited from SPH::BaseMeshField | |
| std::string | name_ |
| Protected Attributes inherited from SPH::Mesh | |
| size_t | buffer_width_ |
| Vecu | number_of_cells_ |
| Protected Attributes inherited from SPH::BaseMesh | |
| Vecd | mesh_lower_bound_ |
| Real | grid_spacing_ |
| Vecu | number_of_grid_points_ |
Defining a mesh cell linked list for a body. The meshes for all bodies share the same global coordinates.
| void SPH::CellLinkedList::allocateMeshDataMatrix | ( | ) |
allocate memories for addresses of data packages.
|
overridevirtual |
Assign base particles to the mesh cell linked list, and is important because particles are not defined in the constructor.
Implements SPH::BaseCellLinkedList.
|
overridevirtual |
computing the sequence which indicate the order of sorted particle data
Implements SPH::BaseCellLinkedList.
| void SPH::CellLinkedList::deleteMeshDataMatrix | ( | ) |
delete memories for addresses of data packages.
|
overridevirtual |
find the nearest list data entry
Implements SPH::BaseCellLinkedList.
|
overridevirtual |
Insert a cell-linked_list entry of the index and particle position pair.
Implements SPH::BaseCellLinkedList.
|
overridevirtual |
Insert a cell-linked_list entry to the concurrent index list.
Implements SPH::BaseCellLinkedList.
| void SPH::CellLinkedList::searchNeighborPartsByParticles | ( | size_t | total_real_particles, |
| BaseParticles & | source_particles, | ||
| ParticleConfiguration & | particle_configuration, | ||
| GetParticleIndex & | get_particle_index, | ||
| GetSearchDepth & | get_search_depth, | ||
| GetNeighborRelation & | get_neighbor_relation, | ||
| PartParticleCheck & | part_check | ||
| ) |
generalized particle search algorithm for searching body part
| void SPH::CellLinkedList::searchNeighborsByParticles | ( | size_t | total_real_particles, |
| BaseParticles & | source_particles, | ||
| ParticleConfiguration & | particle_configuration, | ||
| GetParticleIndex & | get_particle_index, | ||
| GetSearchDepth & | get_search_depth, | ||
| GetNeighborRelation & | get_neighbor_relation | ||
| ) |
generalized particle search algorithm
|
overridevirtual |
Tag domain bounding cells in an axis direction, called by domain bounding classes
Implements SPH::BaseCellLinkedList.
|
overridevirtual |
Tag body part by cell, call by body part
Implements SPH::BaseCellLinkedList.
|
overridevirtual |
Tag mirror bounding cells, called by mirror boundary condition
Implements SPH::BaseCellLinkedList.
|
overridevirtual |
update the cell lists
Implements SPH::BaseCellLinkedList.
|
overrideprotectedvirtual |
update split particle list in this mesh
Implements SPH::BaseCellLinkedList.
|
overridevirtual |
output mesh data for Tecplot visualization
Implements SPH::BaseMeshField.
|
protected |
The array for of mesh cells, i.e. mesh data. Within each cell, a list is saved with the indexes of particles.


Sneaky Leaky Lambda Listeners
By Casey Gum
Sometimes, it can be very convenient to use lambda expressions as event handlers. If the event handler does something short and sweet, it can also be a lot easier to read than having to jump down to the method that implements the handler.
However, as with all events handlers, you really need to understand the lifetime of the instance that exposes the event or you can leak, leak, leak.
Let’s take a look at some code. The following is a typical way to hook up to an event using a method as an event handler.
This next block of code uses a lambda expression instead. As you can see, it is much more concise.
Interestingly, when you do this, behind the scenes, the compiler will actually add a method to your class. So, you’re really not making your class any smaller, you’re just making it easier to read. You can see this if you look at it using .Net Reflector.
Okay, so that’s all well and good, but now let’s consider the implementation of the Publisher class. For simplicity sake (normally I let my IoC container sort this out), I did a quick Singleton pattern implementation on it so that we can get a Publisher instance by calling the static .Instance property. When you see the “static” keyword, you should really think “immortal”. From the perspective of the GarbageCollector, once it has a value, it’s not going away unless you set it to null.
Now, consider this block of code.
If you haven’t had to deal much with memory leaks in the past, you might think that the code above would nuke all instances of Listener, but it does not. As a matter of fact, after making the call to this function, here’s what .Net Memory Profiler shows. We have 10 new instances and they are not going away.
The following image shows what it looks like to the GarbageCollector. The static instance of Publisher is rooted and will not go away. Its event variable is a MulticastDelegate. The MulticastDelegate holds a reference to a System.Action<string> delegate. And the Action delegate holds a reference to your Listener.  Incidentally, this is true whether you use a traditionally implemented event handler or a lambda expression.
What to do, what to do? Well, one thing we could do is to implement IDisposable and unhook our event handler in the Dispose() method. Of course, we will also need to actually call Dispose() after we are done with our listener.
This totally works and now here’s what the memory profiler reports:
Can you do the same thing with a lambda listeners? Unfortunately, no, you cannot, but we can give it a try just to see what happens. The following is our desperate attempt to unhook a lambda event handler in the Dispose() method.
So, why doesn’t that work? Well, because the compiler is creating a different method for each of our lambdas, one in the constructor and one in Dispose(). Again, this can be proven using .Net Reflector.
CONCLUSION
The C# language makes dealing with events very easy. Unfortunately, by hiding some of the implementation details from the developer, it may lull you into a false sense of security with respect to memory management. Whenever you are dealing with events, you need to carefully consider the lifetimes of both the publisher and the listener and make sure you unhook your event handlers or risk dealing with OutOfMemoryExecptions that are very difficult to diagnose. This is ESPECIALLY important if you are doing WPF, Silverlight or Metro development. If your View Model is listening for events on a long-lived object, and your View is listening to your View Model’s INotifyPropertyChanged.PropertyChanged event, and your View’s .Parent property holds a reference to its container, you can see that you can easily keep a very large object graph from being garbage collected.
If you are doing UI development, object graph teardown can get extremely complex. You can simplify these event/lifetime management headaches by using an Event Aggregator that uses weak reference eventing such as the one found in the Microsoft PRISM composite application framework.
I should probably cover that in a future post.
Until then, remember, you can be freaky, but try not to be leaky!


Reasons for me to make a blog
Today is 10 years after I’ve tried Ruby on Rails for the first time.
I have some experience of writing on Ruby on Rails. It’s been quite a long journey now. I’ve been working in an outsourcing company for more than a year. Then I tried in startups two times.
I’ve made a lot of mistakes and learned a few things. I want to share my experience with you.
I’ve met with Ruby on Rails in 2012 after I’ve read stories about Airbnb, Twitter, I’ve read blog posts from 37Signals.
My first professional contact with Ruby was in 2013. I was working in a company that was developing web applications for a client. I was a junior developer. I was working there with Ruby on Rails and JavaScript.
Then I had a tough but interesting experience in a startup. I was working as a full-stack developer there.
Then I had small break in development and I did a double-degree MSc in Ilmenau University. There I had a Master Thesis about deep learning and portfolio prediction.
Then I found a job in a Berlin startup. I was working there mostly as a backend developer but with multiple responsibilities. I’ve tried a trailblazer framework for Ruby on Rails first time there. Most of the fun there was to build an infrastructure in AWS with a whole pipeline of CI/CD and EC2 machines with auto-scaling. Auto-scaling based on load-distribution from CDN was a new thing for me. I’ve learned a lot about it. But it worked well! It was a great achievement for me and the company at that time.
Then I came to the current company and I am really happy to work here. I am working as a backend developer in a rapid-growing company. I don’t have such crazy things as DevOps in my responsibilities but I am still learning some cool stuff about development and I am really happy to work here.
It’s 2022 and it’s been quite a ride for these 10 years but I am still enjoying developing with Ruby on Rails.
I think I want to switch more to Mobile Development, and refresh some things about Deep Learning from University but I am still eager to try new things in backend development and Ruby on Rails in particular.


~ichidan~
食べる = たべる = to eat
見る = みる = to see/watch
寝る = ねる = to sleep
起きる = おきる = to wake up
~godan~
会う = あう = to meet
待つ = まつ = to wait
帰る = かえる = to return home
読む = よむ = to read
遊ぶ = あそぶ = to play
死ぬ = しぬ = to die
聞く = きく = to listen
行く = いく = to go
話す = はなす = to speak
irregular verbs
する = to do
やる = to do
~noun~
映画 = えいが = Movie
宿題 = しゅくだい = homework
勉強 = べんきょう = study
公園 = こうえん = park
学校 = がっこう = school
昨晩 = さくばん = last night
昨日 = きのう = yesterday
先週 = せんしゅう = last week
先月 = せんげつ = last month
去年 = きょねん = last year
今夜 = こんや = tonight
今日 = きょう = today
今週 = こんしゅう = this week
今月 = こんげつ = this month.
今年 = ことし = this year
明日 = あした = tommorow
来週 = らいしゅう = next week
来月 = らいげつ = next month
来年 = らいねん = next year
Introduction to japanese verb conjugation.
In Japanese language, verbs are devided into 3 categories: Ichidan, Godan and irregular.
In this page we're going to learn how to conjugate ichidan, godan, and irregular verb into negative form.
a single verb can only fall into 1 category, either they're ichidan or godan.
Ichidan verb negative form conjugation.
Ichidan verb include:
食べる = たべる = to eat
見る = みる = to see/watch
寝る = ねる = to sleep
起きる = おきる = to wake up
to turn ichidan verb into negative form, replace the る in the end with ない
Godan verbs include:
会う = あう = to meet
待つ = まつ = to wait
帰る = かえる = to return home
読む = よむ = to read
遊ぶ = あそぶ = to play
死ぬ = しぬ = to die
聞く = きく = to listen
行く = いく = to go
話す = はなす = to speak
All the verbs that ended other than る is godan.
Careful. 帰る and 見る both ended with る but 帰る is godan and 見る is ichidan.
you must remember which one is godan and which one is ichidan.
Godan verbs are devided into 4 categories.
Verb that ended with う・つ・る
会う・待つ・帰る
Verb that ended with む・ぶ・ぬ
読む・遊ぶ・死ぬ
Verb that ended with く
聞く・行く
Verb that ended with す
話す
conjugate う・つ・る to negative form.
to conjugate this category into negative form, replace the う・つ・る part。
う -> わない
つ -> たない
る -> らない
会う -> 会わない
meet -> (will) not meet
待つ -> 待たない
wait -> (will) not wait
帰る -> 帰らない
return home -> (will) not return home
conjugate む・ぶ・ぬ to to negative form.
to conjugate this category into negative form, replace the む・ぶ・ぬ part。
む -> まない
ぶ -> ばない
ぬ -> なない
読む -> 読まない
read -> (will) not read
遊ぶ -> 遊ばない
play -> (will) not play
死ぬ -> 死なない
die -> (will) not die
conjugate く into to negative form.
to conjugate く to negative form, replace く with かない
聞く -> 聞かない
hear -> (will) not hear
行く -> 行かない
go -> (will) not go
conjugate す into negative form.
to conjugate す to negative form, replace す with さない
田中 は 音楽 を 聞かない
Tanaka (doesn't/will not) listen to a music.
田中 は 来月、この学校に行かない
Tanaka (doesn't/will not) go to this school next next month.
Irregular verb negative form conjugation
irregular verb include:
する = to do
やる = to do
Even though irregular verbs can stand alone, they're usually attached to noun like:
テニス = tenis
ゲーム = game
勉強 = べんきょう = study
宿題 = しゅくだい = homework
料理 = りょうり = cooking
テニスをやる = tenis = to do tennis.
ゲームをやる = game = to do gamming.
勉強する = べんきょうする = to do study.
宿題する= しゅくだいをする = to do homework.
料理する = りょうりする = to do cooking.
Note:
- やる is only limited to physical action only.
- Using を is optional.
To conjuage irregular verb into negative form:
する -> しない
to do -> will not do
やる -> やらない (やる is also a part of godan verb)
to do -> will not do
Example:
ジュン は 今夜、勉強しない
jun (Doesn't/will not) tonight


Hacker Newz
comments
submit
Login
Logout
×
You're not authorized
Submit
Title
Url
... Or
Text
Leave url blank to submit a question for discussion. If there is no url, the text (if any) will appear at the top of the thread.
Submit
×
You have to specify both title and url. Please try again
×
Success! Successfully created post


My crypto-obsession from last year might have died down a little, but I still remain a long-term investor and a believer of decentralization. Moreover, it was predicting the crypto market’s next move that made dust off some of my old machine learning experiments and gave a fresh boost to my mission of becoming a data scientist. Though one could hardly hear me speak about this coin or that, I am still actively researching and building tools.
Tools like ShouldIHODL. It is an extremely simple website that does nothing else, but spit out a Yes or No to the question, of whether it is a good day to invest in Bitcoin or not. Emphasis on the word invest => buy for the longer term. I am not interested in sheer speculation, or the manipulated pump-and-dump schemes that flooded the markets last year. Also, it should go without saying that this is a simple side project built mainly for fun and learning purposes, and no financial advice of any kind. I don’t want to bear any responsibility for potential losses or missed opportunities on anyone’s behalf.
How does it work?
The raw data
There is a fair bit of machine learning involved into the decision. First, a few tens of thousands of data points get fetched through the open Poloniex API. Each data point represents a 30-min interval from Bitcoin’s price history, containing data known from common charting tools and APIs:
open
- price at the start of the intervalclose
- price at the end of the intervallow
- lowest price reached throughout the intervalhigh
- the highest price reached throughout the intervalquoteVolume
- volume movement expressed in units of the quote currency, a.k.a BTCbaseVolume
- volume movement expressed in units of the base currency, either USD, EUR, or as in our case USDT
The first four are better known to chart enthusiasts and traders as what describes a candlestick:
Photo: Investopedia
Cleaning up and extracting some features
The next step is taming the raw data into a Pandas DataFrame:
Having a few thousand candlesticks, one can use Pandas’ amazing rolling capabilities, in order to roll down HiLo ratios and moving averages normalized to the maximum in a given period:
num_periods_in_7d = 2 * 24 * 7 # Once, every 30 min
df['hilo_7d'] = df['low'].rolling(num_periods_in_7d).mean() /
df['high].rolling(num_periods_in_7d).mean()
# Still volatile, but less so than the current price
df['ma_30'] = df['avg_price'].rolling(30).mean()
# Reacting slowly to rapid changes. Can be used as a line of
# support / resistance
df['ma_6400'] = df['avg_price'].rolling(6400).mean()
# Gives an idea how far the average price is from a past peak,
# or if it is at the peak itself
df['ma_30_6400_ratio'] = df['ma_30'] /
df['avg_price'].rolling(6400).max()
Gather a few of those, and you will effectively have established a simple way of representing price patterns across a certain time window:
To save you further details, ratios like these are quite popular in technical analysis, and go under the name of “oscillators”. It has been proven that prices don’t just go wildly in one direction or another, but behave somewhat like forces in physics. An upward movement for instance, is caused by the force applied to the price by the buying group. It can’t go up indefinitely (even in crypto-land), but eventually faces a force of resistance which forces the price downward. That’s why after normalization, prices lines resemble sine waves and can be analyzed as such. For those of you interested in more technical analysis fundamentals, I would suggest getting familiar with the concepts of support and resistance.
Categorizing the cases
Based only on the inputs, how will our machine learning algorithm know which of them indicate a potential upward or downward movement? That’s right, we need to categorize them first. One simple way to do so, is to compare the price at any given time T
with a price some time in the future (say, a week) - T'
. If the price a week down the road is greater than the price at time T
, we label the case as 1 (uptrend), or alternatively, as -1 (downtrend). Using Pandas’ forwards-and-backwards shifting function, this is a piece of cake:
# negative shifting will pair
df['future_price'] = df['ma_6400'].shift(-1 * num_periods_in_7d)
df['future_price_chg'] = (df['future_price'] / df['ma_6400']) - 1
df.loc[df['future_price_chg'] >= 0, 'label'] = 1
df.loc[df['future_price_chg'] <= 0, 'label'] = -1
Choosing a machine learning algorithm
Having extracted the features and labeled the data, our input matrix starts looking like a bunch of gibberish, but to the trained eye, and hopefully, to our machine learning algorithm it will be more than enough.
In the world of machine learning, there are many algorithms, each of which serving a different purpose. As much as media want you to believe in, ML is not all about neural nets. In fact, for the purposes of this project, I will use a decision tree classifier instead. Designed well, decision trees can be just as effective, at a fraction of the size and complexity of a decent neural network.
class sklearn.tree.DecisionTreeClassifier(criterion=’gini’,
splitter=’best’,
max_depth=None,
min_samples_split=2,
min_samples_leaf=1,
min_weight_fraction_leaf=0.0,
max_features=None,
random_state=None,
max_leaf_nodes=None,
min_impurity_decrease=0.0,
min_impurity_split=None,
class_weight=None,
presort=False)
Unlike deep NNs, decision trees have the advantage that they can be visualized easily. A decision tree graph can be exported and presented to a human expert who could confirm, if the branching criteria selected by the algorithm seems logical.
One disadvantage of decision trees is that they easily overfit, i.e. learn to solve the problem with the particular inputs at hand, but fail to really generalize the solution. All types of machine learning algorithm suffer from this, and there is really no single answer as to how to cope with it. One way is having your input data shuffled and split into two subsets. One goes for training the classifier, the other one for testing the accuracy of the algorithm:
from sklearn.model_selection import train_test_split
from sklearn.tree import DecisionTreeClassifier
inputs_train, inputs_test, labels_train, labels_test = train_test_split(inputs, labels)
tree_classifier = DecisionTreeClassifier()
tree_classifier.fit(inputs_train, labels_train)
# The testing data has not been fed to the estimator before
score = tree_classifier.score(inputs_test, labels_test)
While training, you can also introduce epoch-wise fitting using something like input data folding. Folding is a fancy name for splitting the original data set into a number of subsets, and deriving training and testing data points from each one:
from sklearn.model_selection import KFold
from sklearn.tree import DecisionTreeClassifier
tree_classifier = DecisionTreeClassifier()
for train_index test_index in KFold(n_splits=10, random_state=None, shuffle=False):
X_train, Y_train = inputs.iloc[train_index], labels.iloc[train_index]
X_test, Y_test = inputs.iloc[test_index], labels.iloc[test_index]
tree_classifier.fit(inputs_train, labels_train)
# This score relates to the particular subset only
# You can yield it and average out the scores for all subsets
# at then end. You can also fit each subset into a new tree.
# When predicting the overall score, all trees need to be called,
# and the results of their scores averaged out.
score = tree_classifier.score(inputs_test, labels_test)
Note on Random Forests
Another, perhaps even better option is to use random forests. A random forest is a collection of trees, generated using randomized hyperparameters (max depth, min split count, max number of leaf nodes, etc), to each of which different inputs are fed. When predictions are derived, each tree is asked to predict a result separately, and the majority vote is taken:
Source: Wikimedia
A random forest is trained and tested in pretty much the same way as a single decision tree:
from sklearn.ensemble import RandomForestClassifier
from sklearn.model_selection import cross_val_score
# An important parameter here is the number of trees in the forest
tree_classifier = RandomForestClassifier(n_estimators=50)
# Cross-val-score combines folding, splitting, and scoring in one function
score = cross_val_score(tree_classifier, X=inputs, y=labels, cv=10).mean()
No matter how you approach it, once trained, the classifier can be used for predicting the outcome of a future event, by feeding it with current pricing data (transformed into input features, of course):
current_point_as_inputs = extract_inputs_from_data_frame(df.iloc[-1]))
# This call will return either `1` or `-1` (our labels)
end_class = tree_classifier.predict(current_point_as_inputs)
# This call will return an array of probabilities for each class to occur
class_probs = tree_classifier.predict_proba(current_point_as_inputs)
# class_probs => [0.23, 0,77]
Rendering the outputs and scheduling daily updates
Having made our classifier output a decision, it is time to display it to visitors of the website. Since this entire operation is being read from and hosted on GitHub, I am using the magic of Travis to fetch and transform historical data, feed it through a decision tree classifier, and render the output using a static site generator for Python, called Pelican. Travis supports scheduled corn rebuilds of a certain branch which are ideal for my purpose. So, in essence, I’m doing all of this using pretty much using only a crown job, and some GitHub disk space for storing the rendered outputs. Let’s talk about serverless architecture, shall we? 😀
What is in it for me?
Nothing. I am neither planning to profit from the website, nor to collect user data or track user behavior. At the moment, I am doing this only for learning, and personal development purposes. Everyone is allowed to check out the site, as well as the code, leave comments, posts suggestions and pull requests. As mentioned at the beginning of the article, this tool is not a professional trading advice, and basing your trading decisions solely on what it shows you, will be equal to spending your money on the national lottery (which many of you do, but still).
Enjoy, and don’t hesitate to leave me feedback, or share the word on Twitter with your friends.
Leave a comment


nike
@
nike
10
de
mar
Fail so hard, you can’t help but smile. Then do it again. Because trying something new is always a win.
Join us


|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.axis.description.TypeDesc
A TypeDesc represents a Java<->XML data binding. It is essentially a collection of FieldDescs describing how to map each field in a Java class to XML.
| Field Summary | |
static java.lang.Class[] |
noClasses
|
| Constructor Summary | |
TypeDesc()
|
| Method Summary | |
void |
addFieldDesc(FieldDesc field)
Add a new FieldDesc, keeping the convenience fields in sync. |
QName |
getAttributeNameForField(java.lang.String fieldName)
Get the QName associated with this field, but only if it's marked as an attribute. |
QName |
getElementNameForField(java.lang.String fieldName)
Get the QName associated with this field, but only if it's marked as an element. |
FieldDesc |
getFieldByName(java.lang.String name)
Get a FieldDesc by field name. |
java.lang.String |
getFieldNameForAttribute(QName qname)
Get the field name associated with this QName, but only if it's marked as an attribute. |
java.lang.String |
getFieldNameForElement(QName qname)
Get the field name associated with this QName, but only if it's marked as an element. |
FieldDesc[] |
getFields()
Obtain the current array of FieldDescs |
static TypeDesc |
getTypeDescForClass(java.lang.Class cls)
Static function for centralizing access to type metadata for a given class. |
boolean |
hasAttributes()
Do we have any FieldDescs marked as attributes? |
void |
setFields(FieldDesc[] newFields)
Replace the array of FieldDescs, making sure we keep our convenience caches in sync. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static java.lang.Class[] noClasses
| Constructor Detail |
public TypeDesc()
| Method Detail |
public static TypeDesc getTypeDescForClass(java.lang.Class cls)
public FieldDesc[] getFields()
public void setFields(FieldDesc[] newFields)
public void addFieldDesc(FieldDesc field)
public QName getElementNameForField(java.lang.String fieldName)
public QName getAttributeNameForField(java.lang.String fieldName)
public java.lang.String getFieldNameForElement(QName qname)
public java.lang.String getFieldNameForAttribute(QName qname)
public FieldDesc getFieldByName(java.lang.String name)
public boolean hasAttributes()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |


The PostgreSQL 8.3 Documentation provided the baseline for portions of this Oracle Compatibility Developer’s Guide that is common to PostgreSQL, and is hereby acknowledged:
Portions of this EnterpriseDB™ Software and Documentation may utilize the following copyrighted material, the use of which is hereby acknowledged.
PostgreSQL Documentation, Database Management System
PostgreSQL is Copyright © 1996-2007 by the PostgreSQL Global Development Group and is distributed under the terms of the license of the University of California below.
Postgres95 is Copyright © 1994-5 by the Regents of the University of California.
Permission to use, copy, modify, and distribute this software and its documentation for any purpose, without fee, and without a written agreement is hereby granted, provided that the above copyright notice and this paragraph and the following two paragraphs appear in all copies.
IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.


--- layout: post title: PButton Create button with effects in the right way categories: - iOS tags: - iOS - library - PButton status: publish type: post published: true meta: _edit_last: '1' ---
PButton *navigationButton = [[PButton alloc] init]; navigationButton.frame = CGRectMake(30, 100, 100, 30); navigationButton.buttonBorderPath = [PPath navigationBarItemPathArrowWidth:10 rect:CGRectMake(0, 0, 100, 28) radius:5]; [navigationButton setTitle:@"test" forState:UIControlStateNormal]; UIColor *topColor = [UIColor colorWithRed:166/255.0 green:162/255.0 blue:173/255.0 alpha:1.00f]; UIColor *bottomColor = [UIColor colorWithRed:88/255.0 green:95/255.0 blue:106/255.0 alpha:1.00f]; UIColor *borderColor = [UIColor colorWithRed:59/255.0f green:61/255.0f blue:63/255.0f alpha:1.00f]; [navigationButton.normalEffects addObjectsFromArray:@[ [PEffect border:navigationButton.buttonBorderPath.CGPath color:borderColor width:2], [PEffect gradientColor:@[topColor, bottomColor] locations:nil startPoint:CGPointMake(0, 0) endPoint:CGPointMake(0, 30)], [PEffect halfHighlight], [PEffect innerShadow], [PEffect outerShadow], ]]; [navigationButton.highlightEffects addObjectsFromArray:@[ [PEffect gradientColor:@[[UIColor redColor], [UIColor blueColor]] locations:nil startPoint:CGPointMake(0, 0) endPoint:CGPointMake(0, 30)], ]];Here is what the code does: 1. First create the button with PButton, give it the frame, and set the buttonBorderPath, which is the shape of the button. 2. Add the effects into normal state: border, gradient is straightforward. halfHighlight is the one which mimic ios button effect. Inner shadow can generate the shadow inside the path. Outer shadow can generate the shadow outside the path. Will talk some more later. Each of the predefined effect has a zIndex which can be overwrite. 3. Add the effects into highlighted state: the gradient for example. Then when click the button, its gradient will be shown. In the example, since the gradient has same zIndex, the highlighted gradient will cover the one defined in normal. 4. Add the button into view. How to achieve inner shadow: 1. Create one clip path PathA which contains an outer rect and the border path. 2. Clip the context use path. 3. Draw the PathA with EO rule. (EvenOdd rule, in short, it will draw the point if it is contains by Odd paths, but ignore it if even.) Then the shadow leaves, the filled area been clipped. For outer shadow, similar, but clip use context with PathA with EO rule, then draw the original path with shadow.


A PEEK INSIDE SABRINA'S KITCHEN
Click video to play.
SEASON 2 COMING VERY SOOON!
Catch one of Manila's most spirited food and entertaining enthusiasts, Sabrina Artadi as she opens the doors and invites you into her very own kitchen!
Sabrina's Kitchen Theme Song
Written and performed by Basti Artadi
DETOUR TO DELISH
Easy, inexpensive Mediterranean-inspired dishes that'll surely make every member of the family happy!
THE MARRAKESH COLLECTION
Outfit seen on Sabrina's Kitchen may be ordered through Marrakesh Collection.
All collection Click here
ORDER 5 pcs or more and GET 10% DISCOUNT!


Proogaming otaku
Home
About us
Contact us
Search
Some coding tips and tricks
and some amazing Programing projects and anime related content too and much more.
World
Featured post
Nov 12
This is a wider card with supporting text below as a natural lead-in to additional content.
Continue reading
Design
Post title
Nov 11
This is a wider card with supporting text below as a natural lead-in to additional content.
Continue reading


--- layout: post status: publish published: true title: WSE 3.0 BTS Adapter and AdapterWORX author: display_name: Tomas Restrepo login: tomasr email<EMAIL_ADDRESS>url: http://winterdom.com/ author_login: tomasr author_email<EMAIL_ADDRESS>author_url: http://winterdom.com/ wordpress_id: 533 wordpress_url: http://winterdom.com/2006/05/wse30btsadapterandadapterworx date: '2006-05-10 12:39:32 +0000' date_gmt: '2006-05-10 12:39:32 +0000' categories: - BizTalk tags: [] comments: [] ---
Jesús Rodriguez has posted the core pieces of a new sample about interoperating the recently released Two Connect WSE 3.0 Adapter for BizTalk Server 2006. It appears the adapter can be downloaded now for free if you register at the new AdapterWORX site. Seems pretty cool, and definitely look forward to checking it out!


--- caption: Skills href: skills visible: true position: 3 ---
* I have written in a few other languages, used a lot of other frameworks and technologies(python, elixir, react, sinatra, rack, docker, kubernetes and others) and I do wish to learn more new things. I don't list them as skills, as I don't consider them the best developed tools in my belt.
** Also I work primary with unix-based systems and probably won't soon switch to windows as my working machine any time soon.


This is the list where most landlords will use to assess your apartment condition by the end of your lease. We will make sure that you have everything documented and understand what you should tdo when you move into a new apartment.
Arguing with your landlord is a hassle and quite an emotional ride. With legal advice and documents, we would able to help you solve the problem that you had with your landlord.
Lost track of your apartment maintenance? We have ways to make sure that your landlord get stuff done on time.
Do you know that you could get tax credit out of your rental or lease? Don't worry, we have you covered.
Subleasing can be painful, especially isolating you from the damage caused during sublease period. We have the solution for you, approach us to know more.
As long as you are following every steps that being given to you by us, we ensure that you would certainly get your security deposit back.


dojox.form.FileUploader - FileInputFlash Test
Flash Mode -
Emulate
No Flash Plugin
Switch
to Multi-File mode
Switch
to Single-File mode
The following is an example of FileUploader trigger
FileInputFlash act's with the same APIs as FileInputOverlay, so you
can build your own file input. For the file to actually
upload, you'll need to have PHP enabled.
Multiple-file mode. You may choose multiple files
from the System Dialog.
Single-file mode. You may choose only one from the
System Dialog.
dojox.form.FileUploader - Degraded to FileInputOverlay
HTML Mode -
Normal
Flash Plugin Mode
Switch
to Multi-File mode
Switch
to Single-File mode
The following is an example of the user not having the Flash
plugin installed, and the FileUploader degrading to the
FileInputOverlay, except in Opera, which does not support the HTML
file input overlay.
Multiple-file mode. You may upload multiple files
by adding files to the upload list, one at a time.
Single-file mode. You may choose only one from the
System Dialog.


Winter Adventure in Railroad Park Returns Nov.22, features 100′ Ice Slide
by Birmingham TimesBrrrmingham Winter Adventure in Railroad Park returns Nov. 22 and will be transformed into the city’s winter adventure by adding a brand new, 100’ long ice slide, positioned in Railroad Park’s amphitheater near the 50’ x 80’ rink that sits on Railroad Park’s Regions Bank 17th Street Plaza.
The rink and slide will be open seven days a week through January 5, only closing on Thanksgiving Day and Christmas Day. Regular hours of operation for the rink are 11 a.m. to 9 p.m. Sunday through Thursday and 10 a.m. to 10 p.m. Friday and Saturday. Monday through Thursday from December 2 through December 17, the hours are 3 p.m. to 9 p.m., with regular hours Friday through Sunday.
The ice slide, a new attraction for 2019, is 100’ long and 15’ high. Ticket holders will slide on custom innertubes designed for the ice slide. As with the rink, ice slide tickets are valid for the entire day, so ticket holders can come and skate or slide, leave and then come back for more within the same calendar day.
“In the last few years we’ve worked to create a memorable wintertime experience at the park and make it come alive for visitors in new ways,” said Camille Spratling, Executive Director, Railroad Park Foundation. “And based on the looks on the faces of absolutely everyone we’ve told about the new ice slide, we’re doing that on a whole other level this year. For anyone who can’t skate or just isn’t inclined, they can still participate in the fun. The lighting and other elements we install make it magical, actually, and it’s still free for anyone to simply visit and absorb the atmosphere.”
This season Red Diamond Coffee & Tea is stocking the Boxcar Café with delicious coffee and a selection of hot teas, ready to help skaters and spectators warm up off the ice. The Boxcar Café will also serve tasty and toasty meals, with a winter menu to fuel patrons and spectators.
Brrrmingham Winter Adventure in Railroad Park presented by UAB Callahan Eye Hospital & Clinics.
Ticket prices include skate rental, tax, and unlimited time on the ice and/or slide. The discounted combo price offers the greatest discount.
Tickets are available online or at the rink. Skates are included in the ticket price, but individuals are welcome to bring their own skates.


THE BATTLE FOR WESNOTH:
If you're wondering where all these little lizards, dragons, and goblins are from then check out Battle for Wesnoth. It's the best game ever made and it's totally free. It's sort of like chess only way more fun. You should download and play it right now: The Battle for Wesnoth
© Copyright 2018 by laconiclizard


| BasisFunctionAggregation<T> |
|
| BasisFunctionGenerator |
Generator for a set of basis functions.
|
| BasisFunctionKnots |
Helper class to hold the knots and polynomial degree that specify a set of basis functions.
|
| BicubicSplineInterpolator |
Given a set of data (x0Values_i, x1Values_j, yValues_{ij}), derive the piecewise bicubic function,
f(x0,x1) = sum_{i=0}^{3} sum_{j=0}^{3} coefMat_{ij} (x0-x0Values_i)^{3-i} (x1-x1Values_j)^{3-j},
for the region x0Values_i < x0 < x0Values_{i+1}, x1Values_j < x1 < x1Values_{j+1} such that
f(x0Values_a, x1Values_b) = yValues_{ab} where a={i,i+1}, b={j,j+1}.
|
| ClampedPiecewisePolynomialInterpolator |
Piecewise polynomial interpolator clamped at specified points.
|
| ConstrainedCubicSplineInterpolator |
Cubic spline interpolation based on
C.J.C.
|
| CubicSplineClampedSolver |
Solves cubic spline problem with clamped endpoint conditions, where the first derivative is specified at endpoints.
|
| CubicSplineInterpolator |
C2 cubic spline interpolator with Clamped/Not-A-Knot endpoint conditions.
|
| CubicSplineNakSolver |
Solves cubic spline problem with Not-A-Knot endpoint conditions, where the third derivative
at the endpoints is the same as that of their adjacent points.
|
| CubicSplineNaturalSolver |
Solves cubic spline problem with natural endpoint conditions, where the second derivative at the endpoints is 0.
|
| HermiteCoefficientsProvider |
Hermite interpolation is determined if one specifies first derivatives for a cubic
interpolant and first and second derivatives for a quintic interpolant.
|
| LinearInterpolator |
Interpolate consecutive two points by a straight line.
|
| LogCubicSplineNaturalSolver |
For specific cubic spline interpolations, polynomial coefficients are determined by the tridiagonal algorithm.
|
| LogNaturalSplineHelper |
|
| MonotonicityPreservingCubicSplineInterpolator |
Filter for local monotonicity of cubic spline interpolation based on
R.
|
| NaturalSplineInterpolator |
Natural cubic spline interpolation.
|
| NonnegativityPreservingCubicSplineInterpolator |
Filter for nonnegativity of cubic spline interpolation based on
R.
|
| PenaltyMatrixGenerator |
The k^th order difference matrix will act on a vector to produce the k^th order difference series.
|
| PiecewiseCubicHermiteSplineInterpolator |
C1 cubic interpolation preserving monotonicity based on
Fritsch, F.
|
| PiecewiseCubicHermiteSplineInterpolatorWithSensitivity |
C1 cubic interpolation preserving monotonicity based on
Fritsch, F.
|
| PiecewisePolynomialInterpolator |
Abstract class for interpolations based on piecewise polynomial functions .
|
| PiecewisePolynomialInterpolator2D |
Abstract class for interpolations based on 2d piecewise polynomial functions .
|
| PiecewisePolynomialResult |
Result of interpolation by piecewise polynomial containing
_knots: Positions of knots
_coefMatrix: Coefficient matrix whose i-th row vector is { a_n, a_{n-1}, ...}
for the i-th interval, where a_n, a_{n-1},...
|
| PiecewisePolynomialResult2D |
Result of 2D interpolation.
|
| PiecewisePolynomialResultsWithSensitivity |
Result of interpolation by piecewise polynomial containing
knots: Positions of knots
coefMatrix: Coefficient matrix whose i-th row vector is { a_n, a_{n-1}, ...}
for the i-th interval, where a_n, a_{n-1},...
|
| PolynomialsLeastSquaresFitter |
Derive coefficients of n-degree polynomial that minimizes least squares error of fit by
using QR decomposition and back substitution.
|
| PolynomialsLeastSquaresFitterResult |
Contains the result of a least squares regression for polynomial.
|
| ProductPiecewisePolynomialInterpolator |
Given a data set {xValues[i], yValues[i]}, interpolate {xValues[i], xValues[i] * yValues[i]} by a piecewise polynomial function.
|
| PSplineFitter |
P-Spline fitter.
|
| SemiLocalCubicSplineInterpolator |
Cubic spline interpolation based on
H.
|
| SmithWilsonCurveFunction |
Smith-Wilson curve function.
|
| WeightingFunctions |
Constants and implementations for standard weighting functions.
|


{{ partial "header.html" . }} Hop Orchestration Platform The Hop Orchestration Platform aims to facilitate all aspects of data and metadata orchestration. Get started {{ .Content }} {{ partial "footer.html" . }}
The Hop Orchestration Platform aims to facilitate all aspects of data and metadata orchestration.


- Rank - Class in com.rcextract.minecord
-
- RankCreateEvent - Class in com.rcextract.minecord.event
-
- RankCreateEvent(Server, Rank) - Constructor for class com.rcextract.minecord.event.RankCreateEvent
-
- RankManager - Class in com.rcextract.minecord
-
The rank manager helps to manage permission of each user.
- RankManager(Rank...) - Constructor for class com.rcextract.minecord.RankManager
-
- ready() - Method in class com.rcextract.minecord.Channel
-
Determines if the channel is ready to join.
- ready() - Static method in class com.rcextract.minecord.Minecord
-
- record(MinecordEvent) - Method in class com.rcextract.minecord.InternalManager
-
- record(T) - Method in interface com.rcextract.minecord.Recordable
-
Writes a new record.
- Recordable<T> - Interface in com.rcextract.minecord
-
Represents a class that it records the action related to itself.
- RecordManager<T> - Interface in com.rcextract.minecord
-
- REGISTERED_IDENTIFIERS - Static variable in class com.rcextract.minecord.event.user.UserMessageEvent
-
Deprecated.
- registerPlayer(OfflinePlayer, Channel, Rank) - Method in class com.rcextract.minecord.InternalManager
-
Deprecated.
- registerPlayer(String, String, String, OfflinePlayer) - Method in class com.rcextract.minecord.InternalManager
-
Deprecated.
- registerPlayer(OfflinePlayer, Channel, Rank) - Method in interface com.rcextract.minecord.UserManager
-
Deprecated.
- registerPlayer(String, String, String, OfflinePlayer) - Method in interface com.rcextract.minecord.UserManager
-
Deprecated.
- registerPlayerIfAbsent(OfflinePlayer, Channel, Rank) - Method in class com.rcextract.minecord.InternalManager
-
Deprecated.
- registerPlayerIfAbsent(OfflinePlayer, Channel, Rank) - Method in interface com.rcextract.minecord.UserManager
-
Deprecated.
- reloadConfiguration() - Static method in class com.rcextract.minecord.Minecord
-
- remove(int) - Method in class com.rcextract.minecord.utils.ArrayMap
-
- remove(A, B, C) - Method in class com.rcextract.minecord.utils.Table
-
Removes an entry provided that all values are the same as provided.
- removeA(A) - Method in class com.rcextract.minecord.utils.Table
-
Removes all entries, provided that there value at column a is the same as
provided.
- removeAB(A, B) - Method in class com.rcextract.minecord.utils.Table
-
Removes all entries, provided that there value at column a and b is the same as
provided.
- removeAC(A, C) - Method in class com.rcextract.minecord.utils.Table
-
Removes all entries, provided that there value at column a and c is the same as
provided.
- removeAll(Object) - Method in class com.rcextract.minecord.utils.ArrayMap
-
- removeAll(int, int) - Method in class com.rcextract.minecord.utils.ArrayMap
-
- removeAll(Map<? extends K, ? extends V>) - Method in class com.rcextract.minecord.utils.ArrayMap
-
- removeB(B) - Method in class com.rcextract.minecord.utils.Table
-
Removes all entries, provided that there value at column b is the same as
provided.
- removeBC(B, C) - Method in class com.rcextract.minecord.utils.Table
-
Removes all entries, provided that there value at column b and c is the same as
provided.
- removeC(C) - Method in class com.rcextract.minecord.utils.Table
-
Removes all entries, provided that there value at column c is the same as
provided.
- removeIf(BiPredicate<? super K, ? super V>) - Method in class com.rcextract.minecord.utils.ArrayMap
-
- removeIf(Predicate<? super A>, Predicate<? super B>, Predicate<? super C>) - Method in class com.rcextract.minecord.utils.Table
-
Removes all entries, provided that all of their values match the requirements
provided.
- retainAll(Map<? extends K, ? extends V>) - Method in class com.rcextract.minecord.utils.ArrayMap
-
- retainIf(BiPredicate<? super K, ? super V>) - Method in class com.rcextract.minecord.utils.ArrayMap
-
- run() - Method in class com.rcextract.minecord.IncompatibleDetector
-
- runCommand(String) - Static method in class com.rcextract.minecord.JSONMessage.ClickEvent
-
Runs a command.
- runCommand(String) - Method in class com.rcextract.minecord.JSONMessage
-
Makes the text run a command.


Before Change
if xfer_state:
state = vals["final_state"]
total_loss += loss
iters += ts.nctx
step += 1
self.log.debug({"phase": phase, "time": time.time() - start})
metrics["avg_loss"] = total_loss / iters
metrics["perplexity"] = np.exp(total_loss / iters)
for reporting in reporting_fns:
reporting(metrics, epochs, phase)
return metrics
@register_training_func("lm")
After Change
vals = self.model.sess.run(fetches, feed_dict)
loss = vals["loss"]
toks = self._num_toks(batch_dict)
if xfer_state:
state = vals["final_state"]
total_loss += loss * toks
total_toks += toks
metrics = self.calc_metrics(total_loss, total_toks)
self.report(
epochs, metrics, start,
phase, "EPOCH", reporting_fns
)
return metrics
@register_training_func("lm")


## Packaging Code in C# ##
### Modularizing Programs ###
* Methods (functions or procedures) allow you to modularize an app by separating task into self-contained units
* Usually, **method** refers to a **function** associated with an object but for the most part **function** and **method** are interchangeable
* methods are essentially smaller programs inside a larger program that can be reused
### Calling Methods ###
* Methods are invoked by a method call
* When a method completes, it returns control and possibly a result to its caller
```[C#]
result = objectOne.Method1();
```
### `static` Methods ###
* Not all methods are reliant on an object's data to perform it's task
* These methods can be `static` methods meaning you can call them in their `class` rather than in an instantiated object from that `class`
```[C#]
ClassName.MethodName(arguments);
```
### `static` Variables ###
* `static` variables are variables that associated with a class and not to any instances of that class
* If you have a static variable in a class then instantiate an instance of that class, that static variable will have the same value for all instances of the class
```[C#]
MyClass myClass = new MyClass();
Debug.Assert(myClass.SomeStaticVariable == MyClass.SomeStaticVariable); // is true
```
### `static` Class ###
* `static` classes are classes that can't be instantiated
* They can only contain static data members and methods
* they sealed, meaning you cannot inherit a static class from another class
### C# `Math` Class ###
* `Math` is part of the `System` namespace
* Provides a collection of methods that perform mathematical calculations
```[C#]
double value = Math.Sqrt(900.0); // Static method call
```
Some Static Methods in `Math`
* `Abs(x)` absolute value
* `Ceiling(x)` Rounds up to next int
* `Floor(x)` Round down to next int
* `Cos(x)`, `Sin(x)`, `Tan(x)` Trigonmetric functions
* `Pow(x, y)` raise x to power of y
* `Log(x)` natural log
* and more...
### Static Variables ###
* Static variables are associated with the class they are in not any object instantiated from that class
* All instances of the class will share the static variables in it
* `Math` has two static `double` constants that are common math values:
* `Math.PI`
* `Math.E`
### `static` Main ###
Why is main declared static?
During app startup, no objects of the class have been created, the `Main` method must be called to begin program execution.
Declaring `Main` as `static` allows the execution environment to call `Main` without creating an instance of the class
### Three Ways to Call a Method ###
1. Using a method name by itself to call a method of the same class
2. Using a reference to an object, followed by the member-access operator (`.`) and the method name to call non-`static` method of referenced object
3. Using the class name and the `.` operator to call a `static` method of a class
### Maximum Method ###
```[C#]
class Maximum Finder
{
static void Main()
{
// static methods can directly call other static methods in the same clas
double result = Maximum(2.0, 4.1, 1.1);
Console.WriteLine(result); // prints 4.1
}
static double Maximum(double x, double y, double z)
{
double maximumValue = x;
if (y > maximumValue)
{
maximumValue = y;
}
if (z > maximumValue)
{
maximumValue = z;
}
return maximumValue
}
}
```
* LIFO - Last In First Out
* **Push** on top to add, **pop** off the top to remove
* Sometimes referred to as the program-execution stack
* Works behind the scenes to support the method call/return mechanism
* It holds each called method's local variables
### Stack Frames ###
* As a method is called it may call another method
* The last called method needs to return before the previously called method can finish
* When a method calls another method an entry is **pushed** on the stack
* This entry are called **stack frame** or **activation record**
* Contains the return address that the called method needs in order to return to the calling method
* When a method finishes the stack frame is **popped** and it transfers control to the return address in the popped stack frame
* A method always can find information it needs at the top of the call stack
### Local Variables and Stack Frames ###
* Stack frames contain local variables for the method
* Local variables only exist while a method is executing
* They persist on the stack when another method is called
* When a method finishes it's frame is **popped** and garbage collections reclaims the memory
### Stack Overflow ###
* You can run out of memory if too much is placed on the stack
* This is called **stack overflow**
## Method Overloading ##
* Methods of the same name in the same class, as long as they have different sets of parameters
```[c#]
// square method with int argument
static int Square(int intValue)
{
Console.WriteLine($"Called square with int argument: {intValue}");
return intValue * intValue;
}
// square method with double argument
static double Square(double doubleValue)
{
Console.WriteLine(
$"Called square with double argument: {doubleValue}");
return doubleValue * doubleValue;
}
```
* The compiler distiguishes overloaded methods by their **signature**.
* The signature is a combination of the method name and parameters (types and count).
* Its return type is not consider in distinguishing overloaded methods.
```[c#]
void Method1(int a, float b)
```
```[c#]
void Method1(float a, int b)
```
## Optional Parameters ##
* Allows a varying amount of arguments when calling a method
* Optional parameters have a default value that is assignged if the optional argument isn't passed in
```[C#]
static int Power(int baseValue, int exponentValue = 2)
```
### Named Parameters ###
```[C#]
public void SetTime(int hour = 0, int minute = 0, int second = 0)
```
* `t.SetTime() // SetTime(0, 0, 0)`
* `t.SetTime(12) // SetTime(12, 0, 0)`
* `t.SetTime(12, 30) // SetTime(12, 30, 0)`
* `t.SetTime(12, 30, 22) // SetTime 12, 30, 22`
How can you set just some of the arguments?
```[C#]
t.SetTime(12, , 22); // COMPILATION ERROR
```
* `t.SetTime(hour:12, second: 22) // SetTime(12, 0, 22)`
* `t.SetTime(minute: 30) // SetTime(0, 30, 0)`
## Expression Bodied Methods and Properties ##
```[C#]
static int Cube(int x)
{
return x * x * x;
}
```
to
```[C#]
static int Cube(int x) => x * x * x;
```
* This can be with `static` and non-`static` methods
* `return` types are not required either
```[C#]
static void PrintSomething(string something) => Console.WriteLine(something);
```
## Recursion ##
A **recursive method** is a method that calls itself
### Base Cases and Recursive Calls ###
* Only capable of solving only the simplest case(s) (**base cases**)
* Divides the problem in two coneptual pieces (**divide and conquer**)
* A piece that the method knows how to do and piece it doesn't know yet
* The later piece must resemble the original problem just simpler and smaller
* Because it resembles the problem the method can call itself to solve it
* This is called the **recursion step** or **recursive call**
### Recursive Factorial Calculation ###
* n! = `n * (n-1) * (n-2) * ... * 1`
* 1! is equal to 1
* 0! is equal to 1
* 5! is 5 \* 4 \* 3 \* 2 \* 1 = 120
Nonrecursive implemnation
```[C#]
long factorial = 1;
for (long counter = number; counter >= 1; --counter)
{
factorial *= counter;
}
```
```[C#]
static long Factorial(long number)
{
// base case
if (number <= 1)
{
return 1;
}
else // recursion step
{
return number * Factorial(number - 1);
}
}
```
### Passing Arguments ###
* Pass arguments to method using **pass-by-value** or **pass-by-reference**
* by value
* a copy of its value is made and passed into the called method
* changes made to the copy do not affect the original
* by reference
* the caller gives the method the ability to access and modify the original variable
* changes made affect the original
### Value vs Reference Types ###
* Value Types - `int`, `double` and `decimal`
* A variable of a value type contain a value of that type
* Reference Types - refers to an object
* A variable of a reference type contain a location where the data is stored
### `ref` and `out` Parameters ###
* `ref` keyword on a parameter declaration allows you to pass a varible by reference
* `out` creates an **output parameter** that allows the method to write to that variable
```[C#]
// x is passed as a reference
static void Square(ref int x) {
x = x * x;
}
// value of x is available to caller
static void Square(out int x) {
x = 6;
x = x * x;
}
// x value dies with the method
static void square(int x) {
x = x * x;
}
```
```[C#]
static void Main() {
// display original values of y and z
Console.WriteLine($"Original value of y: {y}");
Console.WriteLine("Original value of z: uninitialized\n");
// pass y and z by reference
SquareRef(ref y); // must use keyword ref
SquareOut(out z); // must use keyword out
// display values of y and z after they’re modified by
// methods SquareRef and SquareOut, respectively
Console.WriteLine($"Value of y after SquareRef: {y}");
Console.WriteLine($"Value of z after SquareOut: {z}\n");
// pass y and z by value
Square(y);
Square(z);
// display values of y and z after they’re passed to method Square
// to demonstrate that arguments passed by value are not modified
Console.WriteLine($"Value of y after Square: {y}");
Console.WriteLine($"Value of z after Square: {z}");
}
```
```[output]
Original value of y: 5
Original value of z: uninitialized
Value of y after SquareRef: 25
Value of z after SquareOut: 36
Value of y after Square: 25
Value of z after Square: 36
```


{% extends 'base.html' %} {% block title %} Password reset complete | AuS {% endblock %} {% block content %}
Your new password has been set. Go to welcome page.


Thu May 21, 2015
Humour has long been a staple of the Internet - in fact, you probably have some favourite delicious sites, such as the Onion or the Oatmeal, that you regularly check on for a fresh serving of laughs. But then there are those single-serving static sites that have been hosting the same joke for years and years and seem impervious to non-renewal. I wonder who keeps paying for these internet one-liners? They had their day in the sun years ago, but now languish in relative obscurity as faded internet legend. Here are three such sites that refuse to die (and a recent one that should have died weeks ago, but didn’t).
This parody of flash animation was created in 1999 and still manages to epitomize the weirdness of the internet in a way that no other site can. According to who you talk to, Zombo.com is either the best or most useless website in the world. Now that Flash is quickly becoming obsolete as HTML5 takes over, it will be interesting to see if future generations will find Zombo amusing at all, or just scratch their heads at the anachronistic humour of the 20th century.
 Not particularly funny anymore, sites like this are fading away from our collective memory - but aren’t in the grave yet.
“Let me Google that for you” is a 2008 site designed as a snarky response to questions asked online that can easily be answered by googling the answer. Although this site has been banned on some websites, the gentlemanly thing to do would be to put it to bed now that the meme is long past it’s prime.
Honourable mention: Havidol.com.
I first came across this satirical site back in 2007, but I was surprised to find that it’s still around. This parody campaign for a fictional medication actually fooled a number of people into thinking they had this disorder. I’m actually glad this site is still up because the concept is far cleverer than some of these other examples.
And now, I mentioned an internet gag that should have died weeks ago? Remember that mysterious button in Lost that had to be pushed every 108 minutes or the world would end? Reddit’s April Fool’s joke this year was to host a button with a sixty-second counter. Every Reddit user only has one click to reset the button to 60. Once the button counts down to zero…nobody know what will happen. Because it hasn’t happened yet. Yes, people are still clicking the button.
I must admit, I am curious, but am also a bit disturbed. This joke reminds me a lot of the cow-clicking game in this Wired article - a game that was supposed to be a Farmville satire, but ended up being a legitimate phenomenon in itself, much to the befuddlement of the developer. Still, there is an allure to such a long-running gag. I’ll be sure to update this post once if the button ever reaches zero.


--- title: data.seq2seq.translation keywords: fastai sidebar: home_sidebar summary: "This module contains the bits required to use the fastai DataBlock API and/or mid-level data processing pipelines to organize your data for translation tasks" description: "This module contains the bits required to use the fastai DataBlock API and/or mid-level data processing pipelines to organize your data for translation tasks" nb_path: "nbs/12_data-seq2seq-translation.ipynb" ---
ds = load_dataset('wmt16', 'de-en', split='train[:1%]')
path = Path('./')
wmt_df = pd.DataFrame(ds['translation'], columns=['de', 'en']); len(wmt_df)
wmt_df.head(2)
pretrained_model_name = "facebook/bart-large-cnn"
model_cls = AutoModelForSeq2SeqLM
hf_arch, hf_config, hf_tokenizer, hf_model = BLURR.get_hf_objects(pretrained_model_name, model_cls=model_cls)
hf_arch, type(hf_tokenizer), type(hf_config), type(hf_model)
blocks = (HF_Seq2SeqBlock(hf_arch, hf_config, hf_tokenizer, hf_model), noop)
dblock = DataBlock(blocks=blocks, get_x=ColReader('de'), get_y=ColReader('en'), splitter=RandomSplitter())
Two lines! Notice we pass in noop
for our targets (e.g. our summaries) because the batch transform will take care of both out inputs and targets.
dls = dblock.dataloaders(wmt_df, bs=4)
b = dls.one_batch()
len(b), b[0]['input_ids'].shape, b[1].shape
dls.show_batch(dataloaders=dls, max_n=2, input_trunc_at=250, target_trunc_at=250)
The purpose of the following tests is to ensure as much as possible, that the core DataBlock code above works for the pretrained translation models below. These tests are excluded from the CI workflow because of how long they would take to run and the amount of data that would be required to download.
Note: Feel free to modify the code below to test whatever pretrained translation models you are working with ... and if any of your pretrained summarization models fail, please submit a github issue (or a PR if you'd like to fix it yourself)
[ model_type for model_type in BLURR.get_models(task='ConditionalGeneration')
if (not model_type.startswith('TF')) ]
pretrained_model_names = [
'facebook/bart-base',
'facebook/wmt19-de-en', # FSMT
'Helsinki-NLP/opus-mt-de-en', # MarianMT
'sshleifer/tiny-mbart',
'google/mt5-small',
't5-small'
]
path = Path('./')
wmt_df = pd.DataFrame(ds['translation'], columns=['de', 'en'])
#hide_output
model_cls = AutoModelForSeq2SeqLM
bsz = 2
seq_sz = 128
trg_seq_sz = 128
test_results = []
for model_name in pretrained_model_names:
error=None
print(f'=== {model_name} ===\n')
hf_tok_kwargs = {}
if (model_name == 'sshleifer/tiny-mbart'):
hf_tok_kwargs['src_lang'], hf_tok_kwargs['tgt_lang'] = "de_DE", "en_XX"
hf_arch, hf_config, hf_tokenizer, hf_model = BLURR.get_hf_objects(model_name,
model_cls=model_cls,
tokenizer_kwargs=hf_tok_kwargs)
print(f'architecture:\t{hf_arch}\ntokenizer:\t{type(hf_tokenizer).__name__}\n')
# not all architectures include a native pad_token (e.g., gpt2, ctrl, etc...), so we add one here
if (hf_tokenizer.pad_token is None):
hf_tokenizer.add_special_tokens({'pad_token': '<pad>'})
hf_config.pad_token_id = hf_tokenizer.get_vocab()['<pad>']
hf_model.resize_token_embeddings(len(hf_tokenizer))
before_batch_tfm = HF_Seq2SeqBeforeBatchTransform(hf_arch, hf_config, hf_tokenizer, hf_model,
padding='max_length',
max_length=seq_sz,
max_target_length=trg_seq_sz)
def add_t5_prefix(inp): return f'translate German to English: {inp}' if (hf_arch == 't5') else inp
blocks = (HF_Seq2SeqBlock(before_batch_tfm=before_batch_tfm), noop)
dblock = DataBlock(blocks=blocks,
get_x=Pipeline([ColReader('de'), add_t5_prefix]),
get_y=ColReader('en'),
splitter=RandomSplitter())
dls = dblock.dataloaders(wmt_df, bs=bsz)
b = dls.one_batch()
try:
print('*** TESTING DataLoaders ***\n')
test_eq(len(b), 2)
test_eq(len(b[0]['input_ids']), bsz)
test_eq(b[0]['input_ids'].shape, torch.Size([bsz, seq_sz]))
test_eq(len(b[1]), bsz)
test_eq(b[1].shape, torch.Size([bsz, trg_seq_sz]))
if (hasattr(hf_tokenizer, 'add_prefix_space')):
test_eq(hf_tokenizer.add_prefix_space, True)
test_results.append((hf_arch, type(hf_tokenizer).__name__, model_name, 'PASSED', ''))
dls.show_batch(dataloaders=dls, max_n=2, input_trunc_at=1000)
except Exception as err:
test_results.append((hf_arch, type(hf_tokenizer).__name__, model_name, 'FAILED', err))
This module includes the fundamental data preprocessing bits to use Blurr for translation.


| Image | Name | Category | Where | When | Option |
|---|---|---|---|---|---|
|
|
Gucci Wallet | Money/Purse/Wallet | PUP Manila | nov 12, 2018 |
|
|
|
Gucci Wallet | Money/Purse/Wallet | PUP Manila | nov 12, 2018 |
|


|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object atg.payment.avs.GenericAddressVerificationInfo
This is an implementation of the AddressVerificationInfo interface. This class is used to submit information to the AddressVerificationProcessor.
AddressVerificationProcessor
,
Serialized Form| Field Summary | |
static java.lang.String |
CLASS_VERSION
Class version string |
| Constructor Summary | |
GenericAddressVerificationInfo()
|
| Method Summary | |
Address |
getAddress1()
Returns the address1 |
Address |
getAddress2()
Returns the address2 |
AddressVerificationItem |
getAddressVerificationItem(int i)
Returns an individual item in the shopping cart |
AddressVerificationItem[] |
getAddressVerificationItems()
Returns the addressVerificationItems |
java.lang.String |
getPaymentId()
Returns the paymentId |
void |
setAddress1(Address pAddress1)
Sets the address1 |
void |
setAddress2(Address pAddress2)
Sets the address2 |
void |
setAddressVerificationItems(AddressVerificationItem[] pAddressVerificationItems)
Sets the addressVerificationItems |
void |
setPaymentId(java.lang.String pPaymentId)
Sets the paymentId |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static java.lang.String CLASS_VERSION
| Constructor Detail |
public GenericAddressVerificationInfo()
| Method Detail |
public java.lang.String getPaymentId()
getPaymentId
in interface AddressVerificationInfo
public void setPaymentId(java.lang.String pPaymentId)
public Address getAddress1()
getAddress1
in interface AddressVerificationInfo
public void setAddress1(Address pAddress1)
public Address getAddress2()
getAddress2
in interface AddressVerificationInfo
public void setAddress2(Address pAddress2)
public AddressVerificationItem[] getAddressVerificationItems()
getAddressVerificationItems
in interface AddressVerificationInfo
public void setAddressVerificationItems(AddressVerificationItem[] pAddressVerificationItems)
public AddressVerificationItem getAddressVerificationItem(int i)
getAddressVerificationItem
in interface AddressVerificationInfo
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |


Buffalo Plains [au62], plain, in Imperia, peasants: 116
Last updated Turn #109
Buffalo Plains [au62], plain, in Imperia, peasants: 116
------------------------------------------------------------------------
7: Amanda [s7m], Imperial Empire, with two peasants, six soldiers,
7: 16 pikemen, seven wild horses, seven riding horses, arrived from the
7: west, accompanied by:
7: Dryeth [q4e], Imperial Empire, with six peasants, 21 lt. xbowmen
8: Amanda [s7m], Imperial Empire, with two peasants, six soldiers,
8: 16 pikemen, seven wild horses, seven riding horses, went east,
8: accompanied by:
8: Dryeth [q4e], Imperial Empire, with six peasants, 21 lt. xbowmen
10: Temuchin [k8z], refugee, with one worker, one skirmisher, arrived from
10: the east.
11: Band of thieves [hf8z], bandits, number: 34, arrived from the south.
12: Wild men [iv9i], savages, number: 36, arrived from the north.
13: Temuchin [k8z], refugee, with one worker, one skirmisher, went west.
13: Band of thieves [hf8z], bandits, number: 34, went north.
14: Ronjar [e8y], refugee, with one riding horse, went north.
14: Wild men [iv9i], savages, number: 36, went south.
23: Ronjar [e8y], refugee, with one riding horse, arrived from the north.
25: Ronjar [e8y], refugee, with one riding horse, went south.
30: It has stopped raining.
30: The population grows by one peasant.
Routes leaving Buffalo Plains:
North, plain, to Buffalo Plains [at62], 7 days
East, plain, to Buffalo Plains [au63], 7 days
South, plain, to Buffalo Plains [av62], 7 days
West, plain, to Buffalo Plains [au61], 7 days
Seen here:
Stack of nazgul [ge4j], nazgul, number: 5
Stack of giants [fx7k], giants, number: 10


Try it out!
Human-friendly? Duotrigesi-what?
32 digits, picked for the right balance of legibility, audibility, and information density. 0 or O? 1 or I? 5 or S? Doesn't matter; they're equivalent in Base32H. All the digits can be found on your typical keyboard, and are totally safe for URLs, filenames, and anything else that might not like special characters.
Rationale
Base32H is handy for all sorts of use cases, and stacks up pretty strong against other number systems:
- More compact than hexadecimal (a 40-bit number needs only 8 Base32H digits v. 10 hexadecimal digits)
- No case-sensitive letters or punctuation like in Base64 (you can use Base32H in filenames without worry)
- No un-decodable letters like in other base-32 systems (any letter or numeral on a US keyboard will decode to a Base32H digit)
- Easier to encode byte-aligned data than with non-power-of-two-radix number systems (no wasted bits)
These traits make it an excellent choice for any situation where people need to reliably read numeric identifiers -- asset tags, product keys, public key fingerprints, user IDs, etc. -- and especially if that situation entails reading an identifier aloud to someone else.
Implementations
Two official / reference implementations and counting (all free software under the ISC License). This site will of course track community-maintained implementations, too, for completeness' sake.
Digits
{% assign canonical = "0|1|2|3|4|5|6|7|8|9|A|B|C|D|E|F|G|H|J|K|L|M|N|P|Q|R|T|V|W|X|Y|Z" | split: "|" %} {% assign aliases = "O o|I i||||S s|||||a|b|c|d|e|f|g|h|j|k|l|m|n|p|q|r|t|v U u|w|x|y|z" | split: "|" %}| Value | Canonical | Aliases |
|---|---|---|
| {{i}} | {{canonical[i]}} | {{aliases[i]}} |


Adyen API Library for Java
The Checkout SDK service has the following methods:
Provides the data object that can be used to start the Checkout SDK. To set up the payment, pass its amount, currency, and other required parameters. We use this to optimise the payment flow and perform better risk assessment of the transaction.
Checkout checkout = new Checkout(client);
PaymentSessionRequest paymentSessionRequest = new PaymentSessionRequest();
paymentSessionRequest.setAmount(createAmountObject("EUR", 17408L));
paymentSessionRequest.setReference("Your order number");
paymentSessionRequest.returnUrl("https://www.yourshop.com/checkout/result");
paymentSessionRequest.merchantAccount("YOUR_MERCHANT_ACCOUNT");
paymentSessionRequest.setCountryCode("NL");
paymentSessionRequest.setSdkVersion("1.3.0");
PaymentSessionResponse paymentSessionResponse = checkout.paymentSession(paymentSessionRequest);
Verifies the payment result using the payload returned from the Checkout SDK.
Checkout checkout = new Checkout(client);
PaymentResultRequest paymentResultRequest = new PaymentResultRequest();
paymentResultRequest.setPayload("This is a test payload");
PaymentResultResponse paymentResultResponse = checkout.paymentResult(paymentResultRequest);


More than 70 nations pledge to reduce food waste
by CAIN BURDEAUROME (AP) - More than 70 countries have pledged to do more to cut down on the amount of food lost due to poor refrigeration.
The countries signed the pledge Saturday at an annual meeting of the Montreal Protocol where ministers, government officials and experts work on regulating man-made chemicals used in refrigeration and air-conditioning systems that are harmful to the ozone layer. The meeting took place at the United Nations’ Food and Agriculture Organization headquarters in Rome.
About one-third of the world’s food is lost or wasted and the hope is that developing better methods to keep food cold while it’s stored and transported will reduce waste.
Poor refrigeration leads to the loss of about 9% of perishable food in developed countries and about 23% in developing countries, where millions of people suffer from malnutrition.
Experts say better refrigeration would help reduce greenhouse gas emissions and the harmful gases used in refrigeration and air-conditioning systems.
The United States, China, European Union members and many nations in the Americas, Africa and Asia signed the pledge.
Sign up for Daily Newsletters
Copyright © 2019 The Washington Times, LLC.
Please read our comment policy before commenting.


Twilio Logo
Your Twilio Verify Application
Time-based one-time password (TOTP)
authentication with SMS or WhatsApp fallback.
Enter the code generated by your authenticator app:
Enter the code sent to your phone number:
Validate a code
or
Reset


Basic Angular Library
This is a library of basic functions using AngularJS. Click above menu items to continue.
Admin Panel - Blogs
Not logged in


An official website of the United States government.
We've made some changes to EPA.gov. If the information you are looking for is not here, you may be able to find it on the EPA Web Archive or the January 19, 2017 Web Snapshot.
Find them, get rid of them: An introduction to bed bugs


I wrote code for my arduino to use mysql and update a feeds mysql table to input values to monitor my gas, electricity and water usage
but when you directly update the database trough mysql from an arduino, this is not displayed in the emoncms feeds
why?
currently I'm using php scripts on my server running emoncms, the php script is triggered by the arduino, then reads the current value from the emoncms database, and then updates the value by using the feed API,
example for my gas usage
<?php
mysql_connect("<IP_ADDRESS>", "root", "tpassword") or die(mysql_error());
mysql_select_db("emoncms") or die(mysql_error());
$handle = mysql_query('SELECT time,data FROM feed_18 ORDER BY time DESC');
$row = mysql_fetch_row($handle);
$gas = $row[1]+0.01;
$gasprice = $row[1]*0.6296+229.95;
$url = 'http://someserver.com/emoncms/api/post?apikey=apikeyhere&json={gasusage:'.$gas.',gasprice:'.$gasprice.'}';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$contents = curl_exec ($ch);
curl_close ($ch);
?>
why is it not possible to put data directly into mysql? why doesn't the emoncms read data from the mysql database when data is stored in it directly? now I have to resort to using a php script that is triggered from the arduino, putting the data into mysql directly is more convenient, but the emoncms does not read this data directly from the mysql database.
arduino + mysql
Submitted by Guest on Fri, 28/03/2014 - 21:05I wrote code for my arduino to use mysql and update a feeds mysql table to input values to monitor my gas, electricity and water usage
but when you directly update the database trough mysql from an arduino, this is not displayed in the emoncms feeds
why?
currently I'm using php scripts on my server running emoncms, the php script is triggered by the arduino, then reads the current value from the emoncms database, and then updates the value by using the feed API,
example for my gas usage
<?php
mysql_connect("<IP_ADDRESS>", "root", "tpassword") or die(mysql_error());
mysql_select_db("emoncms") or die(mysql_error());
$handle = mysql_query('SELECT time,data FROM feed_18 ORDER BY time DESC');
$row = mysql_fetch_row($handle);
$gas = $row[1]+0.01;
$gasprice = $row[1]*0.6296+229.95;
$url = 'http://someserver.com/emoncms/api/post?apikey=apikeyhere&json={gasusage:'.$gas.',gasprice:'.$gasprice.'}';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$contents = curl_exec ($ch);
curl_close ($ch);
?>
why is it not possible to put data directly into mysql? why doesn't the emoncms read data from the mysql database when data is stored in it directly? now I have to resort to using a php script that is triggered from the arduino, putting the data into mysql directly is more convenient, but the emoncms does not read this data directly from the mysql database.


Wireshark Lab - UDP
- Select one UDP packet from your trace. From this packet, determine how many
fields there are in the UDP header. Name these fields.
There are 4 fields in a UDP packet: Source Port, Destination Port, Length, and Checksum.
- By consulting the displayed information in Wireshark's packet content field for
this packet, determine the length (in bytes) of each of the UDP header fields.
Each header field is 2 bytes, for a total of 8 bytes.
- The value in the Length field is the length of what? Verify your claim with your captured UDP packet.
The Length field is the length of all the packet's enclosed data plus the header length, so it will always be the length of the enclosed data + 8.
- What is the maximum number of bytes that can be included in a UDP payload?
As Length is a 16-bit (2-byte) number, a UDP packet must be 2^16-1 bytes at maximum. Because there are always 8 header bytes, a UDP payload must contain no more than 2^16-1-8, or 65,527 bytes.
- What is the largest possible source port number?
A port must also be a 16-bit number, so there will be 2^16 possible port numbers. Starting at port 0 gives us a maximum of 2^16-1, or 65535, as the maximum port number.
- What is the protocol number for UDP? Give your answer in both hexadecimal and
decimal notation. To answer this question, you'll need to look into the Protocol
field of the IP datagram containing this UDP segment.
The UDP protocol number is 17.
- Examine a pair of UDP packets in which your host sends the first UDP packet and
the second UDP packet is a reply to this first UDP packet.
Describe the relationship between the port numbers in the two packets.
The port numbers, like the Source & Destination addresses, have switched places.


Splits a local variable declaration with an initializer into separate declaration and assignment statements.
Multiple declarations in one statement will be split into separate declarations.


The National Fire Authority believes that the 55-year-old bed-ridden woman was alone in her three-bedroom corrugated iron and wooden house while her husband and her son were away when the fire started.
Firefighters were able to extinguish the fire and prevent it from spreading to other nearby houses.
Meanwhile, the National Fire Authority also attended to a fire at the Tavua Police Barracks.
The first unit in the housing barrack was engulfed in flames and firefighters managed to extinguish the fire, stopping its spread to the adjacent three units of the barrack.
Investigations continue.


A top-down interactive tree diagram clearly communicates the hierarchical structure of organizational units. View size metrics, search for specific OUs, or limit the number of layers being displayed through a streamlined sidebar. Create, update, and delete OUs in real-time with the provided Edit Console.
A zoomable circle-packing graph with informational hover cards provides an intuitive way to display all the groups in the domain and their direct and indirect parent-child relationships. Search and filter specific groups and toggle 4 different types of viewing options. Create, edit, and delete groups as well as modify their memberships with ease.
A zoomable tree-map uses rectangles to represent organizational units, each with a list of users. Each user's detail page displays their OU path and groups of membership, both of which can be edited in real-time. Search users by name or email, filter them by OUs or groups, and order them by first or last name. Directly add users under specific OUs, and delete or rename them with ease.
If you have already set up your account and followed all the instructions below, sign in.
1. Open up your terminal, we recommand Google Cloud Shell if you have a Google account, you can log in with your admin account.
2.  After seeing Dev app Server is now running, click the rectangle button left to three dots in top right -> Preview on port 8080, the project is not set up yet, but you need to copy your server url, i.e. https://8080-5686c74b-aced-4f8e-83f7-f129248a983f.us-east1.cloudshell.dev
7. ctrl + c to interrupt the running project.
In the Cloud Console, first login to your test account, then select create your own project groot. Then, APIs & Services -> OAuth consent screen
APIs & Services -> Dashboard -> ENABLE APIS AND SERVICES -> Search for Admin SDK -> ENABLE
1. APIs & Services -> OAuth consent screen
2. Select User Type to be Internal, then click Create.
3. Click Add scope, then enter the following scopes: https://www.googleapis.com/auth/admin.directory.orgunit, https://www.googleapis.com/auth/admin.directory.group, https://www.googleapis.com/auth/admin.directory.user
4. Under Authorized domains, add cloudshell.dev
5. Save the changes
1. APIs & Services -> Credentials -> Create Credentials -> OAuth Client ID -> Web client 1
2. Click the edit button
3. Under Authorized JavaScript origins -> URIs and Authorized redirect URIs -> URIs, add your server url, i.e. https://8080-5686c74b-aced-4f8e-83f7-f129248a983f.us-east1.cloudshell.dev
run $ mvn package appengine:run -DskipTests=true
or $ mvn package appengine:run
(the later command will run test cases)
 * This runs your localhost:8080 cloudshell server
 * Copy the URL from the browser search bar, i.e. https://8080-5686c74b-aced-4f8e-83f7-f129248a983f.us-east1.cloudshell.dev
Apps Core Admin SRE Team @ Sunnyvale, Summer 2020
CS @ UC Berkeley, Class of '22
Github profileHey! I'm currently based in the South Bay, where I'm cherishing quality time with family, going on adventurous treks to the local park, and watching a vast variety of movies and TV shows. In my free time, I enjoy playing sports, building aesthetic products, and analyzing/writing stories, usually inspired by the TV shows that I've watched.
CS @ UC Berkeley, Class of '22
Github profileHi! I currently work from home in the South Bay, enjoying the comfort of my sedentary lifestyle with a hint of Chloe Ting workouts and daily binge of Youtube. In my free time, I like working on passion projects, hanging out with my friends, and engaging in my unhealthy obsession with boba and addiction to yerba mates and chai lattes.
CS, Math @ Cornell, Class of '22
Github profile
Hi! I'm currently located in Ithaca, NY, enjoying gorgeous nature and trials
AC and snacks. My life now is boring because there's not a lot I can do. In my
free time, I like eating and sleeping. I hope everyone can eat and sleep well :).


How To Grow Ridge Gourd Crop
Introduction
Ridge gourd is an important Indian vegetable crop that can be grown all year. Ridge gourd is a member of the Cucurbitaceae family. The Ridge gourd vegetable is used as a vegetable in its green stage, and the leaves with stem are used as a vegetable. It is a well-known vegetable in southern and eastern India.
Soil and climate conditions
Climatic conditions –
Ridge gourd thrives in warm, humid climates; the ideal temperature range for Ridge gourd cultivation is 25° to 35° C.
Soil conditions –
The soil or main field should be thoroughly prepared with 4 to 5 ploughings, and a pH range of 6.5 to 7.5 is ideal for Ridge gourd cultivation. This vegetable crop necessitates adequate drainage. Applying organic matter or farmyard manure can increase vegetable yield and quality (FMY).
Cultivation –
Shallow cultivation is preferred during the early stages of plant growth. For better creeping, the plants should be given appropriate support in the form of bamboo sticks.
Sowing -
Ridge gourd seeds are planted by dibbling at 1.5 m to 2.0 m X 1.0 m to 1.5 m. In each pit, plant three seeds. Thin to 2 healthy seedlings after germination. Poly bags can also be used to sow the seeds. 2 seeds per bag are ideal, and 2 weeks after germination, they can be planted in the main field at 2 seedlings per pit.
Fertilizer
Manures and Fertilizers in Ridge Gourd Cultivation: Farm Yard 40 to 50 cartloads well decomposed Manure should be applied during the soil or field preparation process. Using the split application method, apply a fertiliser dose of 250:100:100 kg NPK / ha throughout the Ridge gourd cropping period.
Diseases occurred in crop:
| Name of Disease | Caused by | Symptoms | Management |
|---|---|---|---|
| Alternaria leaf blight | Fungus | Small, yellow-brown spots with a yellow or green halo which first appear on the oldest leaves; as the disease progresses, lesions expand and becone large necrotic patches, often with concentric patternation; lesions coalesce, leaves begin to curl and eventually die | Cucurbits should be rotated with another crop every 2 years to reduce levels of inoculum; crop debris should be removed from the field as quickly as possible after harvest or plowed deeply into the soil; applications of appropriate protective fungicides can help to slow the development of the disease; water plants from the base rather than from above to reduce periods of leaf wetness which are conducive to the development and spread of disease |
| Squash mosaic | Virus | Symptoms vary with variety being grown but plants can show symptoms which include include green veinbanding, mottled leaves, blisters, ring spots or potruding veins at leaf margins; some squash varieties may develop leaf enations; infected plants are often stunted and fruits may be malformed with mottled skin | Use only certified disease-free seed |
Ridge Gourd Harvest and Yielding
For the primary harvest, Ridge gourd normally takes 2 weeks after flowering or pollination. Ridge gourd vines want help for vertical increase except you select them to creep at the ground. Ridge gourd is in particular grown from seeds and calls for well-drained, humus-wealthy soil for immediate germination. Ridge gourd calls for an excellent quantity of sunlight (as a minimum 6 to eight hours in keeping with day). Ridge gourds are without difficulty grown withinside the pot, withinside the balcony, at the terrace, withinside the backyard. Growing Ridge gourds interior isn't always tough furnished you ensure that the developing necessities are furnished. The huge quantities of cucurbitacin in Ridge gourds cause them to sour in flavor. To develop the Ridge gourds a home, the best pit have to be dug and compost have to be introduced to the pit. you may immediately seed or can transplant the nursery-grown seedlings. The motive for Ridge gourd plant is flowering however NOT fruiting is because of all male plant life or calls for pollination. Ridge gourd plant life begin losing whilst there may be no enough water or overwatering. Sometimes it can appear because of nutrient and fertilizer deficiency withinside the soil. It calls for low funding and it may be grown yearlong with excessive yields in quick duration.


Current Weather
This app get data from
openweathermap.org
City name:
Enter city name and click the button.
Temperature:
Wind:
Pressure:
Humidity:
Sunrise:
Sunset: