fabiochiu/medium-articles huggingface dataset:
March 6, 2018, Bangkok will host a major international conference dedicated to blockchain…
By: Lidiya Tsenenko
Tags: Bangkok, Thailand, Bitcoin, Blockchain, Conference

March 6, 2018, Bangkok will host a major international conference dedicated to blockchain, cryptocurrencies and ICOs — Blockchain & Bitcoin Conference Thailand.

The conference is aimed at cryptocurrency investors, blockchain startup representatives, developers, marketing specialists, lawmakers, lawyers, financial experts and advisors engaged in the cryptocurrency and ICO sector.

Participants will discover the current condition of the cryptocurrency market, blockchain trends, ICO aspects and investments in tokens.

The conference will reveal the following issues:

blockchain technology application in Fintech and Govtech sectors;

how to launch an ICO of your own project and attract investments;

technical features of blockchain-based solutions;

legal regulation of blockchain, cryptocurrencies and ICOs.

Blockchain & Bitcoin Conference Thailand is organized by Smile-Expo, an international company that has been holding blockchain and cryptocurrency events since 2014. Every conference brings together from 200 to 2500 participants.

Tickets can be bought on the official website. The earlier purchase, the more profitable price:

from February 6 till March 5–15 000 THB;

on the event day — 20 000 THB.

Registration details can be found on the website of Blockchain & Bitcoin Conference Thailand.
TOP 10 in Sergio’s rating spreadsheet!
By: Robert Herman
Tags: ICO, Review, Updates, Ethereum, Blockchain

TOP 10 in Sergio’s rating spreadsheet!

One of the few unbiased Blockchain project reviewers out there

We have been getting a lot of feedback from our community! The things we value the most, are the honest reviews from people that have put their time into researching the project thoroughly. That is why we are proud to announce that we have been featured in Sergio’s ICO rating spreadsheet with an 81% global score!

That makes us Rank #7 on his list.

You can find us featured in the Incoming ICO section, with further information about the project. Besides the main information, the spreadsheets include things like hype factor, competition or even if the projects have been hacked.

Sergio is an IT engineer and angel investor that has been working in internet development and SEO analysis for the last 8 years and is one of the only ICO reviewers not doing sponsored reviews.
Rampを統合して、Pundi X XPOSマーチャント加盟店向けのより優れたオンランプエクスペリエンスを構築
By: Japan - Nanna
Tags: Dai, Pundixjapan, Pundix, Apple Pay, Ramp

Pundi X is a leading developer of blockchain-powered devices, including the world’s first point-of-sale solution, the XPOS, which enables merchants and consumers to do transactions on the blockchain in physical stores.

Follow
Black teachers, please don’t tear down your black students
By: Shamontiel L. Vaughn
Tags: Children, Race, African American, Parenthood, Elementary School

Black teachers, please don’t tear down your black students

Contrary to popular belief, words do hurt

Photo credit: Create Her Stock

I looked from my classmate Kellz* to my favorite teacher. I couldn’t believe she had just said that to him. Kellz had come to class and kept talking during the teacher’s instructions. “Disrupting the class” is how report cards would’ve described it. But he and my teacher Mrs. Fossil** struggled to have a peaceful relationship from the very beginning of our fifth-grade class.

Apparently he’d gotten on her nerves one too many times that day and she blurted out, “Shut up, you little ignorant boy. You’re not going to be anything when you grow up anyway.”

And I sat there absolutely startled by this statement. By the time I’d heard Jay Z’s “So Ambitious” lyrics in 2009, I could relate to them personally — from Kellz’s perspective.

I felt so inspired by what my teacher said,

Said I’d either be dead or be a reefer head,

Not sure if that’s how adults should speak to kids,

Especially when the only thing I did was speak in class,

I’ll teach his ass.

Kellz and I were friendly enough that we could have our own little chats during recess, but I wouldn’t go so far as to say we were friends. However, up until that point, I’d admired and almost depended on that teacher as guidance both educationally and personally.

I could’ve easily been like any other student in the room and not internalized that attack as something sent my way. After all, that verbal weaponry was aimed at one particular student. But I decided from that moment forward that the whole class was collateral damage from her friendly fire. Why? His wrongdoing wasn’t worth telling my peer that he would not be “anything” when he grows up, simply from talking now. And if she’d say that to him, it was only a matter of time before she’d say it to someone else in our class.

Photo credit: Matthew Henry/Burst

Kellz took it like a champ though. He responded defiantly to Mrs. Fossil, “Yes, I will.” The class was silent for the rest of that day of class. And I was quiet around that teacher for the rest of the year.

Additionally, in seventh or eighth grade, a student named Ronald*** was told something similar by another teacher. Ronald, who was a friend of mine, laughed about it. He’d already grown a mustache, so we knew he definitely failed a grade (or two). He seemed to be content with people writing him off. I was not, and I kept insisting that he do his homework and helped where I could.
Are your crypto investment goals realistic?
By: Claudio Carnino
Tags: Cryptocurrency Investment, Stellar, Stellar Lumens, Bitcoin, Cryptocurrency

A while ago, I started to invest small sums in crypto currencies. Seeing it grow fast is exciting, so exciting that I started to dream big. I imagined turning that small investment in a number trailed by different (too many) zeroes.

As fantastic as it is to dream big, I wanted to understand how realistic it was to achieve these targets. What are the tools that can help us?

There’s a way to visualise how the world would look like in case your investements hit your growth targets. It’s simple, not rocket science, but it is still a useful exercise.

View courtesy of Decryptoray

Let’s say you have bought a 1000 Stellar’s Lumens XLM, which are currently worth $197.6. Then, let’s say I (enthusiastically) expect this investment to be worth $100,000 in few years. This would mean a growth if 505 times. If it becomes reality, the Market cap of Stellar would be about $1.9 trillions.

Goal analysis provided by Decryptoray.

It sounds big, but everything in crypto sounds big. So, I still don’t know if this is even the realm of “possible” outcomes.

Let’s then compare the future Stellar market cap with the one of the current top currencies. We discover that it would be 17 times Bitcoin and 81 times Ethereum’s current market caps. It means that Stellar currency, currently ranked no. 6, with a market cap which is 3% of Bitcoin’s, will become 17 times bigger than it one day.

Audacious…

Sure, Stellar could steal market share to other currencies. But let’s suppose for a moment the entire market grows 505 times. This would be a $56 trillions which is 7 times the worldwide Gold Reserves value ($8 trillions).

We expect the entire market to grow, but this much? It is a really bold target. Maybe, it’s better to lower our expectations.

Let me know how you would improve this technique.

PS: I am building a tool to help make this kind of analyses. It’s called Decryptoray and it has a investment growth goals analysis. Give it a try!
Bokeh 2.1 Released
Tags: Python, Bokeh, Data Science, Data Visualization, Open Source

Bokeh version 2.1 is out this week, with new plot tools and elements, performance improvements, and a handful of bug fixes. Some of the highlights include:

A new Line Edit tool, contributed by scaine1. This plot tool enables drag-and-drop manipulation of line glyphs to alter values in the data source, similar to PolyEditTool, and can be set to have one fixed dimension (e.g. the “x” or “y” values) and allow changes to the other. #9963

New scatter marker types, including dotted variants of the classic circle, diamond, hex, square, and triangle markers; “pincushion” variants of triangle and square markers; and a new “Y” marker to correspond to the existing “x” marker. #9890 #9863

The full range of Bokeh markers starting in version 2.1.

New selection tool configuration options, allowing the user to replace, append, intersect, or subtract a new selection from the current selection. #9994

New configuration options allow for different interactions between selected areas.

Some performance improvements, like caching widget measurements and BokehJS tweaks

The release also includes quite a few bug fixes, like:

TableColumns now correctly infer a title from their data field, instead of defaulting to null if title is not explicitly set #9871

from their data field, instead of defaulting to null if title is not explicitly set Text glyphs and associated HoverTools now handle null coordinate values better #9959

A bug affecting placement of subgroup labels on hbar plots has been corrected #10042

The ‘disabled’ property has been enabled across all widgets #10022

If you have questions after upgrading, we encourage you to stop by the Bokeh Discourse! Friendly project maintainers and a community of Bokeh users are there to help you navigate any issues that arise.

If you are using Anaconda, Bokeh can most easily be installed by executing conda install -c bokeh bokeh . Otherwise, use pip install bokeh .

Developers interested in contributing to the library can visit Bokeh’s Slack for guidance on best practices and technical considerations.

As always, we appreciate the thoughtful feedback from users and especially the work of our contributor community that make Bokeh better!
Chaos Engineering: A Shift in Mindset
By: Mathias Lafeldt
Tags: Resilience, Testing, Chaos Engineering

👉 This article has moved and is now available here.
I Am Only A Mirror
By: Jordin James
Tags: Inspiration, Blue Insights, Mental Health, Psychology, Poetry

Photo by Noah Buscher

I am only a mirror

An arrow

Pointing you back to yourself

When I see you

I grow big enough to hold you

I am no longer human

I am a container

Here to help you make sense of yourself

In this way

Dear friends, family, and lovers

The things you love in me

Are the very things I bring out in you

When you fall in love with me

You are really falling in love with yourself

In some ways I am here

But in most ways I am not

After all, who is the “I” that is here?

After all, I am only a mirror

An arrow

Pointing you back to yourself
Find the best API Endpoint for your EOS DApp
By: Vyacheslv Akhmetov
Tags: Eos, API, Eos Dapp, Blockchain, Dapps

My idea is to gather a list of all BP registered on EOS blockchain and find out all their API endpoints for further testing.

I wrote some script for this task, but i’m not ready to show it (if you’re interested, i’ll clean it and post someday =)), so i’ll just show you the results of gathering:

Now we need to find out endpoints with lowest latency, so we can have better performance (if BP have good node), but pinging hosts isn’t an option, because some endpoints are hiding behind CDN or load balancers.

API is dynamic service and caching it is bad idea, so we need to measure HTTP request-response time to find out closest (in terms of network) hosts.

For this task I will use get-closer (that I’ve written for such tasks).

Logic of the test is pretty simple, just measure HTTP request time and compare it with others.

For HTTP you can just run:

And you will get results like this:

For HTTPS:

Results: https://gist.github.com/akme/73c6826436968bb34a6edf2468da7d86

Conclusion

It’s pretty raw idea, but I’m interested in your feedback. What do you think about choosing endpoint based on measurements like this?
Creating Interactive PowerPoints on Zoom for the Grandkids You Miss
By: Diane Gillespie
Tags: Zoom, Relationships, Family, Grandparents, Grandchildren

Creating Interactive PowerPoints on Zoom for the Grandkids You Miss

This grandmother creates interactive adventures that turn sedate video chats into all-out romps—and tells you how to do it yourself.

Image credit: SbytovaMN

After seven months of being isolated and having these fleeting and fairly routine Zoom interactions with my three-year-old and five-year-old grandsons, I despaired. With COVID-19 numbers rising in the USA and in Italy, where they live, the reality of the pandemic set in. Would I ever see them again? Did I have to settle for these stilted moments on Zoom and FaceTime where the interactions felt incomplete?

They paraded dutifully in front of my son’s Zoom to say, “Hi, Grammie.” Then they took off, only to emerge several minutes later to make silly faces and disappear again. My husband and I read books to them for the first several months of lockdown, first by hand, showing the pictures, and then reading the text or by using an app that allows you to read a book (Caribu.com). But these solutions left me wanting something more substantial, so I set about to find a better way.

Now it’s different: I get two little faces glued to the screen for over 40 minutes. “Again, again!” they yell to a Grammie and Grandpa’s delight.

Another Grammie had come to my rescue with the idea. She said, “I did a Superheroes PowerPoint for my nephews and they loved it! I put pictures of them in it.”

Like a spark, that suggestion ignited ideas to connect me more meaningfully with my grandsons. I have now made three interactive PowerPoints and they ask for them each time we talk. This transformed the pattern of our interactions.

Here’s the process.
Introducing “Crypto Jobs” by Xpo.Network — Refer friends and earn Bitcoin
By: Ankit Kumar Singh
Tags: Freelancing, Bitcoin, Cryptocurrency, Blockchain, Jobs

In the past few years, we have seen a number of talented individuals leave their well settled jobs and go work at Blockchain startups. In fact, on Crypto Twitter, my feed usually contains at least one such post.

But, what is really driving this interest towards Blockchain and Cryptocurrencies?

We believe one of the main reasons behind this is that Crypto is standing at the forefront of becoming a mainstream technology.

Recently, Jesse Pollak, Head of Engineering for Consumer Products at Coinbase, sent out this tweet to hire people which will lead company to its first 100m users.

Similarly, there are multiple Blockchain Startups out there who are actively hiring in both technical and non-technical roles. Appreciating this market demand, at Prism Labs, today, we are launching Jobs by Xpo.Network, a curated jobs board for everyone who is looking for a job at a Blockchain / Crypto company.

Here are a few of our favorite projects and companies, who are hiring:
The oldest Old Masters are on the rise
By: Marina Viatkina
Tags: Art Collecting, Art Investment, Art Collectors, Art History, Art

This is my second list of Old Master sale highlights this December, this time coming from Christie’s Evening Sale that is about to happen in London, 3 Dec 2019.

See the Part I of this mini-series here.

I would like to share with you my selection of the forthcoming winter sales with my short commentary on side. Not to tell you what’s the best (or what you should go for, save the mark), yet to provoke you to look closer at high resolution images on the auction house websites and study great masterpieces, please your eyes and get to know art and artists a little better.

Part II. Christie’s Evening Sale, London, 3 Dec 2019

Well, seems like Christie’s have much weaker program and all the crème de la crème lots are waiting for the next evening at New Bond street Sotheby’s HQ.



However, here are my top picks:

Giovanni di Paolo, The Investiture of Saint Clare: the Saint receiving the clothes of her Order from Saint Francis, 15th century

No doubt, 15th century panels by sienese Early Renaissance master Giovanni di Paolo are there to make headlines. They may well follow the trend highlighted by another recent sensation when a painting by the so called Master of Vissy Brod (Prague gothic school of the middle of 14th century) made €6,2 mln on sale in Dijon where it was acquired by none other than the Metropolitan Museum from New York. Top it with another hot sale of Cimabue earlier this year and set your eyes on the divine market rarities of the Proto- and Early Renaissance ages.

This Maddona with a Child by Master of Vissy Brod was acquired by MET for more than $6 mln

2. Dutch still life stars are another strong point of the evening. In spite of having signature flower bouquet by Jan Brueghel the Velvet (the younger son of the very Pieter Bruegel the Elder) the same subject still life by his compatriot Ambrosius Bosshaert is the one to go all in for. An ambitious high estimate of GBP 2,5 mln is there for a reason.
Algorithms Explained: Diffie-Hellman
Tags: Programming, Learning, Security, Encryption, Algorithms

By arriving here you’ve taken part in a Diffie-Hellman key exchange! (Or at least a variant). Diffie-Hellman is a way of establishing a shared secret between two endpoints (parties).

The mathematics behind this algorithm is actually quite simple. I’m going to explain what we’re trying to do first, then I’ll explain how we achieve it.

Let’s say Alice and Bob want to communicate with each other without John knowing what they’re saying or sending. Anything Alice sends to Bob, John will receive, likewise, anything Bob sends to Alice, John will also receive. So how do Alice and Bob send anything to each other without John understanding? Well that’s where Diffie-Hellman comes in.

I’m going to dive straight into the mathematics of it but this can be explained quite visually and you can test this out yourself with some paints at home.

To start, Alice and Bob decide publicly (John will also get a copy) on two prime numbers, g and n. Generally g is a small prime number and n is quite large, usually 2000 or more commonly 4000 bits long. So now Alice, Bob and John all know these numbers.

Now Alice decides secretly on another number, a. and Bob decides secretly on a number, b. Neither Alice nor Bob send these numbers, they are kept to themselves. Alice performs a calculation, g^a mod n, we’ll call this A, since it comes from a. Bob then performs g^b mod n which we’ll call B.

Alice sends Bob, A, and Bob sends Alice, B. Note John now has 4 numbers, A, B, g and n but not a or b. Finally, for the heart of the trick. Alice takes Bob’s B and performs B^a mod n. Similarly, Bob takes Alice’s A and performs A^b mod n. This results in the same number i.e. B^a mod n = A^b mod n. They now have a shared number. Notice how John can’t figure out what these numbers are from the numbers he’s got.

Actually he can and its given a name called solving the discrete log problem. If we make n very large this becomes an extremely computationally heavy problem to solve and simply isn’t worth the time to figure out. John would have to figure out a or b from A or B which is simply far too time consuming.

So what can Alice and Bob do with this key they’ve just created together? Well they can use it to start encrypting messages they send to each other. A very simple example that should not be used anywhere as it’s extremely insecure is in encrypting their messages with a shift cipher (Caesar cipher) where the shift value is determined by the newly generated key. Both Alice and Bob can encrypt and decrypt the messages as they know the shift value but John can’t as he doesn’t have the key.

Oh and if you do with to try this with paints, use a single colour instead of two for g and n and where ever calculations are performed just mix the paints.

If you were interested in this, check out www.pyler.io where we offer great online Python courses to take you from beginner in no time!
Ticket Stubs
By: Lise Colas
Tags: Life Lessons, Poetry On Medium, Relationships, Men, Poetry

Your starling head,

proud crest shed some time ago,

above the same white shirt pulled

over a banished Adam’s torso pounced

by Masaccio — shoulders sloping

to a schoolboy tuck,

black shoes scuffed.

I think how your waistline

must have fleshed out — the curved

armchair dip above the hips

with the requisite love handles,

yet still the sly whiff of cedarwood

and your name must be Paul.

~~

You are a ghost that stalks

the tumbling grey stone hills of Assisi.

Your name escapes me — Lorenzo?

A young waiter still sweaty from your shift

at a rustic pizzeria,

wide-eyed, gangly, famished — and we

toured the damp castle walls,

while I endured the sticky pearls of your

snail kisses. No doubt you are the father

of grown-ups now, while I — oh,

never mind.

~~~

You had a by-line in the paper and also

sported a beard for a while — but soon

shaved it off after you met me,

and I liked you because you made me laugh

in those fusty old vaults where renown

and grace had been leeched away.

We’ve lost touch now — but I’ll always

recall those drinks before the lunch

on the day of the races,

when you flipped a new pound coin

down the dip of my tapered white blouse

with cap sleeves —

and I was too naive to realise

you were flirting,

and that I was drifting into deep waters

while you just paddled. Yet when I came across

your fiancee’s love-knot hairband

cradled upon the bedside table,

I soon waded back to shore, thighs stinging.

~~~~
I Am a Superstar
By: Ijlal Saleem
Tags: Life Lessons, Self Improvement, Poetry, Self Realization, Life

I am a superstar

Yes, I lived in the dark

Until I let it shine, my underlying spark

Whether it took too long

Yes, I was dreaming hard

A castle, like of blowing cards

That exists for too short

Until I reach my clue

A castle build by glue

My dream no more an illusion

We are the dimmest stars

Have sealed our brains and hearts in the jars

Bidding them, but they have no price

The shine of money makes us roll like dice

We feel safe on earth

Despite giving Atom Bomb a birth

Getting ready for some more World Wars

Because we own a rugged land on Mars

It took too long for us

To realize our thirst

When we are two steps from the graveyard

When the body and the soul apart

I want my words so strong

To revolutionize what is wrong

I’d like to have a smoke in my hand

A state when minds don’t understand

But I have a different stand

Even call me a silly man

Whether I don’t possess Apple iPhone or any other brand

But a valuable Paper and Pen
This Is How I Would Invest If I Had …
By: Aldric Chen
Tags: Personal Development, Investment, Money, Self Improvement, Personal Finance

If I had $10 …

No kidding. A friend of mine, 30 years of age, asked me this question.

I thought about it. I will choose either stashing it away in the piggy bank or buying an electronic book to read and grow my brain.

If I had $50 …

Start building my writing portfolio on Medium.

Yes, we need not be a paying member to start earning. Take note — We need to be a paying member to read more and learn from others.

When we learn, we earn.

$50 is a worthy investment.

If I had $100 …

Invest $50 on the Medium subscription account and insert the remaining $50 bill into the piggy.

If I had $150 …

I would invest $50 on a Medium subscription and then $100 on a social media management manager application.

This allows me to disseminate my stories to my followers on various social media accounts.

Remember, more viewers equals higher readership gets higher earnings.

Note: Many social media management applications such as Hootsuite or Agorapulse charges $100 a month, not a year. Manage your budget accordingly.

If I had $500 …

A pile of books plus a Zoom account.

We write better as we read more. It improves our expression and enriches our content.

Zoom account allows us to share our work through Webinars. We can also do a self-recording of the story we wrote on Medium, take the recording in Music Player 4 (MP4) format, and upload it to YouTube.

That MP4 recording can then be uploaded directly to various Podcast platforms.

It allows us to extend our reach via audio and video formats. We get to reach out to a broader audience.

If I had $1,000 …

I will be committed to my savings.

A high yielding Fixed-Deposit will be my Go-To. A rainy-day fund is necessary.

If I had $10,000 …

Stash half away in a combination of Fixed Deposit and piggy bank.

Use $5,000 to invest in enlarging my network circle. I will go to attend conferences to meet people. It could be business-related or about personal growth.

Our network is our net worth.

If I had $100,000 …

Now I can start making investments in the financial markets.

A 2% annual stock yield on $100,000 brings $2,000 in cashflow.

I would keep the $100,000 in the market and reinvest the 2% annual yield.

Of course, make sure you know what you are doing.

I cannot emphasize enough.

If I had $1,000,000 …

Forget about it and keep working.

We get lazy when the string of digits in the bank balance gets longer.

We are young and can contribute to society. We should.

I want to.
Suiting Your Body
By: Francine Fallara
Tags: Health, One Line, Summer, Beauty, Poetry

Suiting Your Body

Mirror reflections winks, whispering the complexities of passion flowing through my physique, continuously convincing my youthful spirit to successively and perfectly slip my imperfect curves in my fashionista bathing suite.
Peach Pit
By: Moriah Rivera-Lawrence
Tags: Self Love, Self Acceptance, Queer, Poetry, Poem

i don’t know that you’ve tasted a peach

if you have, it came in a sticky bag that said

THANK YOU

THANK YOU

THANK YOU

because it knew

it was bruised and cracked

the fuzz stiffer than store-bought

chilled by fog

picked while hot

eaten in drips down the forearm

a silence

reserved for only prayers and peaches

broken by the steady buff of the pit

spit into the palm

and pressed to the sidewalk

i read that if I only sat long enough and ground the pit into the cement

i, too could make a peach pit necklace

precious

i tried every summer

came to the same curb, later tried a different square

tried over here, cried over there

scraped fingernails

rips tearing up keratin

skin split stone

fibers stretch and snap

broken collagen

cells weeping

interstitial wail

i did not understand how anyone was supposed to succeed at this

without ripping away their fingertips

until i realized that was the point

because how would any of this be possible

if i had never been told to find the

valuable

at the scraped worn center

of my eaten up heart

Moriah Rivera-Lawrence
Ruby Rails: How to Create a Like Button
By: Ariel V Grubbs
Tags: Ruby on Rails, Beginner, Programming

Step Three:

Now we’ll set up our controllers, our Posts controller doesn’t need anything special added to it, just the CRUD methods and functionality will allow it to work. However our Likes controller will need to be quite complex and not very routine, so let’s break it down:

First, we have our three before_action method calls, you can largely ignore the first one for the purposes of this tutorial as it pertains to Auth. and is somewhat outside the scope of this tutorial, all you need to know is that in this example application the user needs to be logged in in order to like a post. The second calls the helper method defined below “private” that sets an instance variable equal to the post that this like belongs to . The third sets another instance variable equal to the like that we the user has selected, and we’re only using this last before_action for the destroy method.

Now into our two main methods, create and destroy. Our like feature will be accompanied by an unlike feature that allows the user to remove their like in case they mistakenly clicked like or they are having second thoughts. The create method checks to make sure the user haven’t already liked this post and then uses the post instance variable to create a like that belongs to both that post and the current user. The current_user method that is being called there is a helper_method in the ApplicationController that simply returns the user instance that is associated with the current session, i.e. the user who is currently logged in. Then the user is redirected back to the page of the post, it will hopefully appear to them as if they never left. Destroy has a similar structure, with the key difference being that instead of using the post instance variable and the current_user method to create a new like, the destroy uses the like instance variable we found to destroy the like, or in other words, unlike the post.
清除日志的sql脚本(clear sql log)
By: Jin Weijie
Tags: Sql, Log

有时候我们使用虚拟主机上的sql，不能用企业管理器等工具直接对数据库进行操作，有时候为了节省空间，需要清楚数据库里的Log，以下的sql脚本是用来清除数据库的log

SET NOCOUNT ON

DECLARE @LogicalFileName sysname,

@MaxMinutes INT,

@NewSize INT

USE cms -- 要操作的数据库名

SELECT @LogicalFileName = 'cms_log', -- 日志文件名

@MaxMinutes = 10, -- Limit on time allowed to wrap log.

@NewSize = 100 -- 你想设定的日志文件的大小(M)

-- Setup / initialize

DECLARE @OriginalSize int

SELECT @OriginalSize = size

FROM sysfiles

WHERE name = @LogicalFileName

SELECT 'Original Size of ' + db_name() + ' LOG is ' +

CONVERT(VARCHAR(30),@OriginalSize) + ' 8K pages or ' +

CONVERT(VARCHAR(30),(@OriginalSize*8/1024)) + 'MB'

FROM sysfiles

WHERE name = @LogicalFileName

CREATE TABLE DummyTrans

(DummyColumn char (8000) not null)

DECLARE @Counter INT,

@StartTime DATETIME,

@TruncLog VARCHAR(255)

SELECT @StartTime = GETDATE(),

@TruncLog = 'BACKUP LOG ' + db_name() + ' WITH TRUNCATE_ONLY'

DBCC SHRINKFILE (@LogicalFileName, @NewSize)

EXEC (@TruncLog)

-- Wrap the log if necessary.

WHILE @MaxMinutes > DATEDIFF (mi, @StartTime, GETDATE()) -- time has not expired

AND @OriginalSize = (SELECT size FROM sysfiles WHERE name = @LogicalFileName)

AND (@OriginalSize * 8 /1024) > @NewSize

BEGIN -- Outer loop.

SELECT @Counter = 0

WHILE ((@Counter < @OriginalSize / 16) AND (@Counter < 50000))

BEGIN -- update

INSERT DummyTrans VALUES ('Fill Log')

DELETE DummyTrans

SELECT @Counter = @Counter + 1

END

EXEC (@TruncLog)

END

SELECT 'Final Size of ' + db_name() + ' LOG is ' +

CONVERT(VARCHAR(30),size) + ' 8K pages or ' +

CONVERT(VARCHAR(30),(size*8/1024)) + 'MB'

FROM sysfiles

WHERE name = @LogicalFileName

DROP TABLE DummyTrans

SET NOCOUNT OFF
Why is React Declarative? A Story About Function Components
By: Asís García
Tags: Declarative Programming, JavaScript, React, Rendering, Components

Photo by Lou Brassard on Unsplash

React is declarative. It’s almost the first thing you are told about the library in its home page:

But, what does it mean? “Declarative”, at least in the programming sense, is usually defined as “telling what to do instead of how to do it”. When we talk about React being declarative, the most common explanation revolves around how when you write a component, you just tell React what do you want the DOM to look like, and just let React handle it from there. You don’t have to worry about how the different elements currently in the web page have to change, or which ones have to be removed or inserted. You just say “I want a button there, and I want it disabled”, and React makes it happen. “Now I want the button to be enabled”. No problem, React’s got your back.

So that’s one way of looking at it: React applications are declarative regarding the DOM manipulation. I like to think about this as the first declarative layer of React. Because there is a second layer: React components are also declarative regarding their own rendering.

Components Rendering is Declarative

Have you ever wondered what makes React function components different from plain JavaScript functions? Is there any difference?

No, there isn’t. “React function component” is just a fancy name for a JavaScript function. That’s clear when you define a React function component: you just define a JavaScript function. The real difference lies in the way you use that function.

Forget React for a second. What do you use functions for when programming plain JavaScript (or any other language for that matter)? A function is just a bunch of statements grouped as a unit, which you define with a single purpose: invoking it.

Now back to React: when do you invoke your component functions? Exactly! Never. React is the one invoking them. You use React elements to tell React which functions to invoke when rendering each component, but the library decides when to invoke them. That makes the rendering of components declarative.

Imperative vs Declarative Rendering: an Example

To better grasp the implications of declarative rendering, take a look at this example:
When Food is Your Best Friend
By: Zach J. Payne
Tags: Health, Food, Fitness, Self, Life

Looking at me, you probably wouldn’t be surprised to think that I have some kind of strange mental hangup with food. I definitely look the part.

Honestly, trying to unravel the learned behaviors from the immutable genetics is difficult. There is definitely a genetic element to my weight — I’ve been overweight from the time I was one year old, long before I could ever develop an unhealthy relationship with food.

But for now, for the space of this blog post, I’m going to put away the very real genetic component aside, and focus on the mental aspect.

There’s some really weird shit here that I’ve been trying to dissect.
019 | スマートコントラクト（Smart contract）
Tags: Blockchain, Ethereum, Smartcontract, 日本語

in Both Sides of the Table
Southwest Airlines, Santa Claus, and Windows Live
By: Francine Hardaway
Tags: Herb Kelleher, Christmas, Apple

After weeks of reading about bad airport experiences, I finally get to write about a good one.

Texas-based Southwest Airlines is known for its singular corporate culture. Unlike any other airline, Southwest seems to think it can be successful in business and still have fun. It might be nice if more businesses learned this. Nothing the airline does violates its brand — which was established many years ago by straight-talking, bourbon-drinking, chain smoking Herb Kelleher, its first CEO.

Kelleher is out of sight now, but obviously not out of mind, as I found out this morning at the airport after my customary enhanced patdown.

In Terminal 4 of Sky Harbor Airport, just beyond the groping and poking stations, there’s an eye-catching holiday promotion courtesy of Southwest and, of all non-fun-loving companies, Microsoft. For Microsoft, it’s a laptop promotion; for Southwest, it’s probably a way to reinforce the brand story.

Passengers with a minute to spare and a willingness to fill out a short survey about the computer they use and what they know about Windows 7 have a chance to be photographed with Santa (I sat on his lap, which I never had a chance to do as a child) and get “control” of that photo for Christmas use. It was during the week, and there were no kids on the line.

I try anything once. When it was my turn, the photographer took three shots of me, uploaded them to the network, and gave me a choice which of the three facial expressions did I want superimposed on my body in the final photo? I could also choose which Santa face I wanted.

The software to do this is part of Windows Live (I had no idea), and is called Photo Fuse. I suppose it’s a Photoshop competitor for idiots. I don’t spend much time switching faces out on my photos, so I have no idea what else Photo Fuse competes with, but I know it looked very cool to me. It looked like something I would really use.

I was given a print of the finished photo, but it was also emailed to me, so I could “experience” photo-email via Windows7. The people who demoed the software looked pretty happy with what they were doing. The experience, a way of killing time waiting for my flight, was fun.

Perhaps I’m too easy, but I was convinced to take a closer look at Windows 7; we Apple fan-boys need to have our eyes opened every once in a while. I just bought an Air for probably twice what it would have cost me to buy a Windows 7 laptop with greater power and capability. I never even made the comparison. I suppose that’s what Microsoft is up against as Apple surges ahead in the brand wars.

As for Southwest, its network for the promotion is called Elf4. Consistent with its brand. That’s an airline I will continue to fly.

Related articles
Coinbase Strikes Back Against Regulators. Irony Not Lost on the SEC.
By: Howard Marks
Tags: Bitcoin

Mike Lempres, Chief Legal and Risk Officer at Coinbase wallet and cryptocurrency exchange, is complaining to the capital markets congressional subcommittee that regulation is going to stifle innovation because of uncertainty. Last time I checked, Coinbase owns the GDAX so-called “exchange,” which is trading cryptocurrencies without any regulation.

It seems the strategy here is to scare lawmakers who will call the SEC and plead with them to ignore GDAX, which is not a broker-dealer and is trading securities without being registered with the SEC. Great plan if it works. But what if it fails?

A couple weeks ago, Circle, which is a startup lead by superstar Jeremy Allaire, purchased Poloniex for a whopping $400M. This sent shockwaves through the industry, allowing other “exchanges” to start licking their chops at sky high valuations. As I wrote in my post How to Get a Free Pass From the SEC, the merger documents were leaked, which explained that Circle got absolution from the SEC. This is shocking if true, but I have my doubts about this made-up statement.

But let’s go back to Mike and his Coinbase megacorporation. He, along with most CEOs in the blockchain marketplace, claims that the rules are not clear. The SEC should not enforce against violators because then our U.S. brain trust will evaporate and escape into foreign lands. This is just not true.

Our country is successful because of our culture of innovation and our democracy. Using this threat to conveniently escape the consequences of violating rules is just not part of our culture. We can only achieve progress when everybody plays by the same rules.

If there was ever any doubt about the rules, then call the great people at the SEC and ask questions. If those who violate the rules win, then it will discourage everyone else from trying to do things the right way, which creates an uneven playing field. Again, not part of our culture of entrepreneurship.

The SEC should make it clear, and I believe they are, that those who violate securities rules should face consequences, and those who invest in a culture of compliance should benefit from the elimination of the cheaters.
Improve your voters with the Open/Closed principle
By: Vincent Monjaret
Tags: PHP, Solid, Open Closed Principle, Symfony, Software Engineering

Improve your voters with the Open/Closed principle

Think about provided examples and improve them with some OOP concepts.

In software engineering one of the main challenges of an application is the maintainability… A lot of new developer tends to work on framework without the knowledge of concepts of OOP (Object Oriented Programming) as SOLID principle and others. In this article, we are going to refactor the voter example provided in the Symfony documentation by applying the Open/Closed principle in order to improve the maintainability.

Symfony’s voter example

As we can see this example works totally fine and is easy to understand… but if the project tends to grow over time we are going to have several problems:

This class will become longer each time we need to add a criterion, with 2 criteria this class has already 47 LoC (Line of Code). So imagine with 10…

When we will need to add criteria we are going to modify the switch case, which is a violation of the Open/Closed Principle.

So, how can we prevent these issues? We need to find a way to add an extra case without adding code, to do so we are going to use a an array, each time we need a new criterion we just need to add it to the array. The DI (Dependency Injection) component of Symfony allows us to easily create a list of services implementing an interface and this is the feature that will make our code easily extendable. Here you can find the interface we will use.

Now lets take a look at the DI’s configuration.To register our criteria, we do have to add a tag to each class implementing the interface. We will then inject the tagged services into our voter as a ServiceLocator.

And our brand new voter is now open to extension and does not have to be modified anymore, the voter will never change regardless the number of criteria we want to use.

Open/Closed voter

So now the criterion responsible for the edition now implement our interface and looks the same as the example provided in Symfony’s documentation.

CanEdit criterion

And the criterion responsible for the view action look like :

CanView criterion

And now to use those criteria we just replace the hard coded attribute by the full qualified name of the criterion, which also improve the autocompletion.

In conclusion, the main challenge with examples in a documentation is to make the code as simple as possible for people to understand the concept, but they don’t really suit for all project. Doing a copy/paste of the documentation will guarantee you have a working application, and it’s usually fine for simple projects. That said, you should always think twice when working on long living code base, and such patterns will help you in the long run.
SIREN News April 2017
Tags: Advertising, Marketing

Welcome to SIREN news for April 2017 where we are recapping the best stories, events and latest news from across Dentsu Aegis Network.
Is it Blasphemous for a Pagan to Love God?
By: Eraes Ellis
Tags: Paganism, Religion, Self, Christianity, Worship

Jesus is a swell dude, but what about God?

I’ve prayed to Him a few times since that day. I’ve asked for help from His people. Sometimes I ask for his blessings upon my faith. Sometimes I ask him about death.

He never answers — not directly. But through this development in my life, I’ve accepted that I do believe in God. I just don’t worship Him. I love His religion, but I don’t practice it. (Although I have entertained the idea of Christo-paganism.)

Why does it matter, though? If I’m content in my path, why do I care about religious figures not connected to my own religion?

The truth is, sometimes I wish I were a Christian. Is that weird? This is a more recent development in my religious life, so even I’m not entirely sure. It feels weird to think about it. But deep down, I know that what I truly crave is stability and validation. Every time I find myself falling short with my faith, I wonder if I could perform it better as a Christian.

Have you ever been the outcast? Desperate to be “normal” so that everything was a little bit easier? Who cares about the hardships that come with it, so long as people stop pointing their finger at you?

I think that’s how I feel sometimes. I think that’s why I love God.

Even after a lifetime of paganism, I ache for it to be as ‘normal’ as monotheism in the Western World. Despite the mechanics of Christianity, I do find it to be a good, wholesome faith. One that paves a pretty path for people to live by.

I lay down the bricks of my worship as I go. Paganism is such a secular path that nobody can tell me how to do it the right way. I have to find out on my own, and I often become exhausted from the work I have to put into it.

For once, I think I’d like being told what to do. How to worship. Follow a ritual that I didn’t create. God could give me those things — He offers them to me.

But I refuse.

Such is my path, and I intend to keep it regardless of the circumstances and the exhausting work. So, I will continue to love Him — but from afar. I will continue to build my faith and struggle through my worship.

I have a lot to learn from God even if I’m not a Christian. I hope He continues to teach me.
Totality
By: Anna Rozwadowska
Tags: Poetry On Medium, Newness, Humanity, Poetry, Opportunity

Entry ways to the present discover opportunities of like minded souls,

the joining of skin in between lovers covers the sheets with preclusion,

adhesion is the satisfaction of co-existence, where,

one loves themselves fully, completely.

The adjustment of display around the hearth punctures nerve endings,

beginning the totality of losing oneself in the seascape of loneliness,

the imagery of the blind is held hostage to the sacred sacrament,

populous being adhered to, within it’s satisfaction of our condolence.
[Tutorial] How to claim your FREE UNI tokens and get $50 trading credit on Huobi.com!
By: Huobi Global
Tags: Uniswap, Claimuni, Free Cryptocurrency, Tradingcredit, Unitokens

🦄1.First, you need to connect your Metamask wallet to your web browser by typing in your password

🦄2. Next you need to add the token to your Metamask wallet!

Click “Add Token”

🦄3. Select Custom Token ,then input the contract address into the field

0x1f9840a85d5af5bf1d1762f925bdaddc4201f984

It should auto-populate everything else in the box , click Next!

🦄4. Next to claim your UNI you just need to make sure you have enough Ethereum in your wallet to pay the gas fees and then select Claim UNI on Uniswap.

After the transaction is complete just sent them over to Huobi.com!

🦄Full details of the $50 credit can be found here.🦄

👉No Huobi Account? Sign up here.
Meet DataBroker DAO at the Mobile World Congress in Barcelona
By: Frank Van Geertruyden
Tags: MWC, Mobile World Congress, Data Marketplace, Blockchain, IoT

With less than 2 weeks to go, the preparations for the Mobile World Congress, February 25–28, 2019 are in full swing!

DataBroker DAO, powered by SettleMint

In case you didn’t know yet, DataBroker DAO is a SettleMint venture built on Mint, SettleMint’s core product.

Mint is a Blockchain agnostic middleware solution supporting the most stable blockchain technologies available, thereby minimizing risk for obsolescence and vendor lock-in for clients. Using the API layer of Mint, clients are able to program in their native language, bypassing the need to become an expert in Blockchain protocols.

Blockchain is the key driver of the 4th Industrial Revolution. Indeed, Blockchain provides a single source of truth in a digital economy driven by Big Data and AI. The global adoption of IoT and 5G connectivity will propel a global blockchain market expected to be worth around 3 trillion USD annually by 2030.

SettleMint makes it easy to integrate Blockchain technologies in a matter of days. SettleMint licenses a suite of Blockchain based solutions which can be customized to meet the needs of specific client use cases.

4 reasons why our clients are making use of Blockchain technology to secure the exchange of big data

1. Trust empowered IoT by adding the single source of truth on Blockchain

* Time-stamp your IoT events

* Gain full multi-party transparency

* Authenticate all transactions and make them indisputable

2. Automated transactions by Blockchain based Smart Contracts

* Add immutable business logic into Smart Contracts

* Automate transactions in a trustworthy way

3. Asset transformation into digital tokens and smart currencies

* Increase your customer engagement by blockchain based loyalty points

4. Data sharing within communities and monetization of data

* Data is the new live stream for companies

* Keep your data under control and define with whom and under which conditions it can be accessed by business partners or publicly
Leetcode 1505: Minimum Possible Integer After at Most K Adjacent Swaps On Digits
By: Aaron Yan
Tags: Data Structures, Leetcode, Python, Bit, Algorithms

Given a string num representing the digits of a very large integer and an integer k .

You are allowed to swap any two adjacent digits of the integer at most k times.

Return the minimum integer you can obtain also as a string.

Example:

Input: num = "4321", k = 4

Output: "1342"

Explanation: The steps to obtain the minimum integer from 4321 with 4 adjacent swaps are shown.

- 1 <= num.length <= 30000

- num contains digits only and doesn't have leading zeros.

- 1 <= k <= 10^9