Sign Up Now!

Sign up and get personalized intelligence briefing delivered daily.

Sign Up

Articles related to "code"

How I Created my First Plugin-System

  • To keep your code organized, it is a good idea to create a new folder called "events" to collect all event definitions in a central place.
  • Now the event dispatcher uses the internal register and calls all plugin-methods, that have subscribed to this event.
  • And this array looks exactly the same: The name of the event is on the left side and the name of the plugin-method is on the right side.
  • The Symfony EventDispatcher will simply check all classes for the existence of this method and use the array to build the internal register of events and subscribers.
  • But even if you don't want to create your own plugin system, then this kind of event driven programming is still a great way to decouple your code and to bring a bit more order into the chaos of a new code-project.

save | comments | report | share on

About “Difficult Conversations” (book recommended by Phil Haack)

  • In this episode, Phil Haack tells us why we need to be prepared to have difficult conversations and why this can help your career.
  • Phil also talks about the importance of taking care when writing code and why you should test your code carefully.
  • What amazing show!
  • In this interview, Phil recommended an excellent book: Difficult Conversations: How to Discuss What Matters Most.
  • I listened to the audio version of the book, and it is impressive.
  • I strongly recommend it.
  • I wish I had the opportunity to read (or listen) it some years ago.
  • For sure I would have less stressful moments.
  • Thanks Phil!
  • O post About “Difficult Conversations” (book recommended by Phil Haack) apareceu primeiro em Elemar JR.
  • I work in organizations, helping programmers, architects, and executives develop software that meets business needs.

save | comments | report | share on

N+1 Queries, Batch Loading & Active Model Serializers in Rails

  • If you’re comfortable with Rails, Active Model Serializers and already have a good idea about what our problem is going to be, then may be you can just jump straight into the code here.
  • Until now there’s absolutely nothing new for veterans.
  • Our essential problem remains that there’s no way to ‘join’ the users datastore with the posts table and get the response we want in a single query.
  • We’ve solved an advanced version of the n+1 queries problem while keeping our code clean and using Active Model Serializers the right way.
  • If you have a User serializer (Active Model Serializers work with Mongoid as well), that won’t be called for the lazily loaded author objects, unlike before.
  • To fix this we can use a Ruby block and serialize the author objects before they’re ‘assigned’ to the posts.

save | comments | report | share on

Taking Control of the Dialog Management State Machine

  • Dialog management is a great way to collect the set of required slots that your intent needs to perform a task for your customers, since it greatly reduces the necessary coding required to reprompt for missing slot values.
  • Your backend code can check the state and not only override prompts, but also perform complex logic that you might need to solve a particular edge case.
  • Each interaction between the customer and Alexa during dialog management allows to you hook into the state machine and perform your own logic.
  • Let's take a look at how you would set medium as the default value for size, and then ask the customer if the default is okay.
  • If you do nothing else here, dialog management will continue prompting for each required slot in the order that you specified in your interaction model.

save | comments | report | share on

Application environments

  • Most software companies have their product deployed to a few different environments, which have names like local, dev, test, stage, and production.
  • If you use a Continous Integration tool (like VSTS, Travis, GitLab, or my personal favorite, TeamCity), you probably have access to a tidy list of environments alongside buttons that build the latest version of the project and deploy it to them.
  • It's a good place for developers to test new features against mocked data and verify that their code works well with everyone else's.
  • If your product hasn't gone public yet and development speed is more urgent than application stability, you probably only need a couple of these.
  • Each environment is another place where the right pair of eyes could prevent a bug from reaching Production and affecting users.

save | comments | report | share on

Making WebAssembly better for Rust and for all languages

  • By targeting WebAssembly, Rust can run on the web just like JavaScript.
  • Web developers need to be able to use WebAssembly as if it were JavaScript.
  • If you add a few annotations to your Rust code, it will automatically create the code that’s needed (on both sides) to make more complex types work.
  • Plus, if we’ve added any npm dependencies, we need to put those into the package.json manifest file.
  • Make it easy to add the WebAssembly package as a dependency… to include it in JS module dependency graphs.
  • That’s because bundlers reduce the number of requests that you have to make for module files, which means it takes less time to download your code.
  • We’ll need to add some features to WebAssembly to make it easier for bundlers to emulate ES modules.

save | comments | report | share on

Using Google Analytics with Custom Dimensions and Metrics

  • Google has some great custom dimensions at our disposal, like Country, Age and other demographic details [ensuring that demographics reporting is enabled for the account] that they collect from global cookies, but what if we want our own qualitative data associated with our events, without having to rely on generic “event Labels” ,“event Values” and “Total events”?
  • Let’s make our event action, “Trailer Play”, into its own quantitative metric, and make a dimension for Video Name.
  • Along with creating a custom metric that describes the type of action (Trailer Play) and a dimension that will reflect the name of the video played, we will also create a dimension that will let us pass data regarding our user, namely, whether they are registered or not.
  • In the Google Analytics portal, click on Settings (Gear Icon), Custom Definitions (under Property column), Custom Metrics , and then New Custom Metric.

save | comments | report | share on

The Shoemaker's Children: A Developer Allegory

  • It was a simple plan: give my personal website a makeover and write a blog post about the process.
  • His post showed off an elegant developer landing page that he open-sourced, along with instructions on hosting it on GitHub pages.
  • I was initially reluctant to use his project, because I felt like I should build my own page, but ultimately I realized that it did exactly what I needed and would help me craft a much more interesting post than “here’s how I built my website”.
  • I just needed my code changes to be reflected on my website, which, as I learned from @flexdinesh 's post, is precisely what GitHub pages does.
  • I already have for blog posts, GitHub to showcase my projects, and LinkedIn and a resume to list qualifications and career experience.

save | comments | report | share on

Sequence Tagging with Tensorflow

  • This post’s ambition is to provide an example of how to use Tensorflow to build a sate-of-the art model (similar to this paper) for sequence tagging and share some exciting NLP knowledge!
  • We’re gonna build this vector as a concatenation of the word embeddings $ w_{glove} \in \mathbb{R}^{d_1} $ from GloVe and a vector containing features extracted from the character level $ w_{chars} \in \mathbb{R}^{d_2} $.
  • We run a bi-LSTM over the sequence of character embeddings and concatenate the final states to obtain a fixed-size vector $ w_{chars} \in \mathbb{R}^{d_2} $.
  • Computing Tags Scores At this stage, each word $ w $ is associated to a vector $ h $ that captures information from the meaning of the word, its characters and its context.

save | comments | report | share on

Assassination Attempt on AMD by Viceroy Research & CTS Labs, AMD "Should Be $0"

  • The big story today seemed to mirror Meltdown, except for AMD: CTS Labs, a research company supposedly started in 2017, has launched a report declaring glaring security flaws for AMD’s processors.
  • One of the experts we contacted pointed out that, with local admin access or the ability to flash BIOS, an attacker would probably be able to install malware on any system, AMD or not.
  • Contrasting the Meltdown and Spectre whitepapers, the CTS Labs whitepaper on claimed AMD vulnerabilities is bereft of any example code, and is written with a tone that attacks companies, rather than addressing the technology that is allegedly flawed.
  • When we first saw the press release, we reached-out to the listed Bevel PR phone number and publicly listed contact, Jessica Schaefer, to learn more about the CTS Labs research company.

save | comments | report | share on