teleren/devto huggingface dataset:
Advanced Debugging Trick
Tags: ios, swift, objectivec, debugging
Published: 2018-10-05 01:11:40

---
title: Advanced Debugging Trick
published: true
tags: ios,swift,objective-c,debugging
canonical_url: 
---

Debugging all those crash issues in Xcode is not always fun especially when you don’t receive very useful information in the console log. To help ourselves better, the trick is to enable the Exception Breakpoint. This can be found on the + located on the left hand bottom corner of Xcode.

![](https://cdn-images-1.medium.com/max/438/1*QBk8YoXfSR84U0Q-VHPXsA.png)<figcaption>Exception Breakpoint</figcaption>

Enable the Exception Breakpoint to break on all Objective-C exceptions. This is sufficient to catch all the ones from the Apple Foundation classes (UIKit, etc.) as they occur. I have used this plenty of time before to capture the line before my app crashes, but never realize I could make Xcode print out the actual exception error description before it halts the program completely. Notice the additional action to print the error message po $arg1. This is all we needed.

![](https://cdn-images-1.medium.com/max/932/1*HU_Afe6uoOZyfQ52q3TCPQ.png)<figcaption>Adding an action to print the error message</figcaption>

To further make this Exception Breakpoint setting available for all the Xcode projects, you can move the breakpoint to User.

![](https://cdn-images-1.medium.com/max/940/1*kNSP8ZX-6JrwwZfD-dgctg.png)

Try this out and let me know what exceptions this advanced trick helped you solve.

I learned this new trick from Paul Hudson at [https://www.hackingwithswift.com/](https://www.hackingwithswift.com/)
#RailsGirlsSummerOfCode Looking for a teammate in Vancouver, BC!
Tags: discuss, teammate, summerofcode, vancouver
Published: 2018-02-08 00:38:19

---
title: #RailsGirlsSummerOfCode Looking for a teammate in Vancouver, BC!
published: true
tags: discuss, teammate, summerofcode, vancouver
---

Hey, everyone!

I am looking for a teammate interested in the Rails Girls Summer of Code in Vancouver, BC area. There are a lot of cool projects and I would love to connect with other girls interested in applying to one of them. 

If you know someone that might fit here, please share my profile so we can get in touch?

Thanks!
入門自然言語処理 pp.215-225
Tags: nlp, python, reading
Published: 2018-02-07 22:56:21

---
title: 入門自然言語処理 pp.215-225
published: true
description: 
tags: nlp, python, reading
---

5.4 自動タグ付けの続き。「's」で終わる単語は所有格名詞、のような正規表現にタグ付けをする。タグ付けされたコーパスの頻出単語からルックアップテーブルを作る、残りはとりあえずよくあるタグである名詞としてタグ付けする。と、そこそこの精度でタグ付けができるようだ。もちろんルックアップテーブルや正規表現パターンを増やせば精度はあがるけど、ある程度からは向上しない。

たぶん、時事ニュース記事なのか、ある特定の分野の学術論文なのか、はあちゅうのブログなのか、とかがあらかじめ分かっていれば、より適切なタグ付けモデルを作ることがきるんだろう。

5.5 Nグラムタグ付け。直前の単語も考慮することで、文脈によるタグ付けが可能になる。未知語にもある程度対応できる。
Why doesn't the bookmark add things to my reading list?
Tags: meta
Published: 2018-02-07 22:01:11

---
title: Why doesn't the bookmark add things to my reading list?
published: true
tags: meta
---

I went through using the search and clicked the bookmark "add to reading list" icon, and it changed to purple, for several posts. Then, I clicked "DEV" at top left. 

Nothing in my reading list. 

How are you using the reading list?
How to serialize that $%*#ing Buffer
Tags: javascript, webdev
Published: 2018-02-07 21:44:08

---
title: "How to serialize that $%*#ing Buffer"
published: true
description: 
tags: #javascript, #webdev
---

I've been playing with [TextEncoder](https://developer.mozilla.org/en-US/docs/Web/API/TextEncoder/TextEncoder) and TextDecoder. Methods in the [Web Crypto API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API) work with a [BufferSource](https://developer.mozilla.org/en-US/docs/Web/API/BufferSource) which is fine but I need to encrypt some text, store it (actually send it, but it's stored), then decrypt it. For that, I needed to store and read the buffers. Encoding and decoding a buffer is simple, serializing and deserializing is simple AFTER you figure it out.

First, we need a buffer.

```javascript
const buffer = new TextEncoder().encode('banana');
```

Not a problem. But now I want to put that in JSON (probably with a bunch of other properties) and read it back in later.

```javascript
const testObj = {
    encodedText: buffer.toString()
};

const serializedTestObj = JSON.stringify(testObj);
```

If we log that out it looks pretty simple:

```
{"encodedText":"98,97,110,97,110,97"}
```

Getting an object is simple

```javascript
const deserializedTestObj = JSON.parse(serializedTestObj);
```

But how do we get the `encodedText` back into a buffer? This is the part that seems really simple once you stop thinking so hard. Split the string on the commas into an array and use the `from` method of the [TypedArray](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from) to get a `Uint8Array`.

```javascript
const deserializedBuffer = deserializedTestObj.encodedText.split(',');
const newBuffer = Uint8Array.from(deserializedBuffer);
```

Then it's a simple decode to get our string back

```javascript
const str = new TextDecoder().decode(newBuffer);
console.log(str); // banana
```
GitHub Markdown Tips
Tags: opensource, learning, github, markdown
Published: 2018-02-07 21:20:22

---
title: GitHub Markdown Tips
published: true
description: Nifty markdown stuff
tags: #opensource #learning #github #markdown
---

I posted earlier about Richard Kim's <a href="https://blog.cwrichardkim.com/how-to-get-hundreds-of-stars-on-your-github-project-345b065e20a2">blog post</a> that has some *great* tips for building an effective README.md page on GitHub.

A few of my own:

* It's not just README.md:
  * You can have any number of markdown pages.
  * They can be in any directories.
  * They can have filenames other than README.md.
  * The only 'requirement' is that for GH to render a markdown page properly, it must have the `.md` file extension.

* You can link to a *page* with a normal GitHub URL:
  * ht<i></i>tps://github.com/*user*/*project*/blob/*branch*/*file*.md.
  * This lands readers at the top of the page, where they see various project information.  (The actual markdown text will be farther down the page.)

* You can link to a title *in the markdown* on a page with an extended URL:
  * ht<i></i>tps://github.com/*user*/*project*/blob/*branch*/*file*.md#*title*.
  * This lands the browser (Firefox at least) exactly at the *title*, not at the top of the page.  (Get the exact URL from title's link icon.)
  * The target title can be any title on the page (not just the main one, identified with a single `#`.)


* This is especially useful for linking *among* markdown pages, so that the reader lands in the markdown text, instead of at the top of the page.

* I've done this with my project's <a href="https://github.com/BurdetteLamar/RubyTest/blob/master/examples/github/TesterTour.md#tester-tour">Tester Tour</a>, where each page in the tour has navigation links, forward and backward.

* I have a `MarkdownHelper` class that I use to:
  * Build the tour by adding the navigation links.
  * Include external files by inlining them.
  * Add text highlighting if the file is `.rb` or `.xml`.  (This can be extended to <a href="https://github.com/github/linguist/blob/master/lib/linguist/languages.yml">any language known to GitHub</a>).
  * Query:  Should this class be made into a Ruby gem?

* Linking from markdown to an HTML file:
  * If you link in the usual way, the HTML will not be rendered:  ht<i></i>tps://github.com/*user*/*project*/blob/*branch*/*file*.html
  * If you link in a special way, the HTML *will* be rendered:  ht<i></i>tps://htmlpreview.github.io/?ht<i></i>tps://github.com/*user*/*project*/*file*.html
  * I would illustrate, but from *here* opening neither type of link causes the HTML to be rendered.  The difference is seen only in GitHub markdown.
  * But you can see it work via the link at the foot of https://github.com/BurdetteLamar/RubyTest/blob/master/examples/changes_report/ChangesReport.md.
Building Modular JavaScript Application with ES6 Module System
Tags: beginners, javascript
Published: 2018-02-07 20:57:36

---
title:  Building Modular JavaScript Application with ES6 Module System
published: true
description: 
tags: beginner, JavaScript
---

Over time, JavaScript has been lacking module system. This led to "unofficial" community-based standards like CommonJs modules and Asynchronous Module Definition, the AMD, standards as well as coding patterns like the Immediately Invoked Function Expression(IIFE) playing key roles in packaging JavaScript code. Talking about a module, it is basically a way of organizing code into a single unit, making them consumable by other pieces of code. Having a single unit to handle a single responsibility of your entire project is a great way to go. It keeps things simple and easy to test. One of the key concepts that encouraged the adoption of previous modules systems and coding patterns is the ability to hide information by not publicly exposing implementation details and avoiding global variables. 

ES6 module feature helps to attain the same benefits as the previous module systems and patterns, just that we now have a native feature and standard. Let's write our first module.

{% gist https://gist.github.com/OMENSAH/991ed9c29741d73a8e15932f9f1eba3c %}

From the above code, we created a js file that exports a class. We can even export functions, values, objects. Also, we exported the class with the default keyword, which is one method. We can export without using the default keyword. Either of these has its own way of importing the exported information. Now let's import the information we exported. 


{% gist https://gist.github.com/OMENSAH/6b2800e652a427d89279f47cf6430620 %}

In case, we omit the default keyword, then, the syntax will differ. 

{% gist https://gist.github.com/OMENSAH/280234d976e3150ff8ea60b1e9043bf9 %}
{% gist https://gist.github.com/OMENSAH/62ac0b2e1016d19e126559a0b2f5d53d %}


Explore further on Js modules with [this section of explorejs](http://exploringjs.com/es6/ch_modules.html#sec_importing-exporting-details) and [a talk from Kent C. Dodds]
(https://www.youtube.com/watch?v=kTlcu16rSLc&feature=youtu.be&list=PLV5CVI1eNcJgNqzNwcs4UKrlJdhfDjshf);
Mockery: частичные двойники (mock'и)
Tags: php, webdev, testing, mockery
Published: 2018-02-27 17:11:28

---
title: "Mockery: частичные двойники (mock'и)"
published: true
tags: php, webdev, testing, mockery
canonical_url: http://phpprofi.ru/blogs/post/99
---

Работая со старым кодом, я часто сталкиваюсь с таким классом, который расширяет большой базовый абстрактный класс, а методы этого класса вызывают методы того большого базового абстрактного класса, который делает очень много вещей. Я сам писал такие классы и методы в прошлом. Век живи, век учись.

Одна из самых больших проблем с этим кодом заключается в том, что это довольно трудно тестировать. Методы из базового класса могут возвращать другие объекты, побочно затрагивают другие части кода (или вызывают сервисы), делают http-запросы...

----
Читать далее: http://phpprofi.ru/blogs/post/99

----
En: https://robertbasic.com/blog/mockery-partial-mocks/
What is the worst code you have ever seen/written?
Tags: discuss, challenge
Published: 2018-02-07 19:48:04

---
title: What is the worst code you have ever seen/written?
published: true
description: Remembering that one snippet that still gives you nightmares.
tags: discuss, challenge
---

Every day we talk about best practices, efficiency, and optimization. Other than from the depths of r/ProgrammerHumor, and more, we never really talk about bad code. But as I browse Twitter and Reddit I occasionally hear stories of just awful code. The snippets the still gives you nightmares because you know deep down you know it's still out there running in prod.

So in a moment of gaining perspective for all sides of software development, and jest, what are your stories?
Diary - 2018.02.07
Tags: career, productivity, learning, journey
Published: 2018-02-07 17:45:50

---
title: Diary - 2018.02.07
published: true
tags: career, productivity, learning, journey
series: Diary
---

* I am ill, but [no zero-day](https://medium.com/@fayadh56/the-concept-of-no-more-zero-days-and-why-motivation-is-fleeting-9c1c307f8948)
* I watched some [GaryVee](https://www.youtube.com/watch?v=qRj144Gd7EA)
* I worked on a dashboard using Grid and implemented a map using [mapkick](https://www.chartkick.com/mapkick)
* Therefore I re-trained my skills on [CSS Grid] (https://scrimba.com/g/gR8PTE)     and I am feeling really comfortable with its usage
* I repeated how to create users and drop and create databases in [postgresql](https://www.postgresql.org/docs/)
* I also wrote a tutorial on git for our new co-worker explaining our workflow
Test Coverage: Интеграция CodeClimate и Travis CI
Tags: php, testing, webdev, opensource
Published: 2018-02-21 18:01:39

---
title: "Test Coverage: Интеграция CodeClimate и Travis CI"
published: true
tags: php, testing, webdev, opensource
canonical_url: http://phpprofi.ru/blogs/post/98
---

Когда вы разрабатываете проект с открытым исходным кодом, считается хорошей практикой иметь высокое покрытие тестами, чтобы сообщество могло чувствовать себя в безопасности, используя ваш код в своих проектах. Существуют онлайн-сервисы, которые могут анализировать качество вашего кода и предоставляют отчёты и рекомендации. Одним из самых популярных является [Code Climate](http://codeclimate.com). Этот сервис не запускает ваши тесты, но вы можете использовать один из инструментов непрерывной интеграции(CI) для их запуска, а затем отправлять его результат в Code Climate. В этой статье будет показано, как использовать [Travis CI](https://travis-ci.org) для запуска тестов и данные о покрытии тестами в [CodeClimate](http://codeclimate.com).

![logo](http://sergeyzhuk.me/assets/images/posts/travisci-codeclimate/travis-loves-code-climate.png)

----
Читать далее: http://phpprofi.ru/blogs/post/98

----
En: http://sergeyzhuk.me/2018/01/11/travis-with-codeclimate/
How to animate box-shadows with transforms and opacity
Tags: css, animation
Published: 2018-02-07 15:51:11

---
title: How to animate box-shadows with transforms and opacity
published: true
description: It's long been recommended that we stick to transforms and opacity when it comes to animating elements with CSS. In this screencast I demonstrate how you can animate a box-shadow hover similar to what you see used in Material Design, with transforms and opacity.
tags: css, animation
---
{% youtube ZkDWCCHiPg4 %}

It's long been recommended that we stick to transforms and opacity when it comes to animating elements with CSS. In this screencast I demonstrate how you can animate a box-shadow hover similar to what you see used in Material Design, with transforms and opacity.

View the source files [here](https://github.com/alexcarpenter/screencasts/blob/master/11-animating-box-shadow/index.html).
What's your best dev pick-up line?
Tags: discuss, random
Published: 2018-02-07 15:24:42

---
title: What's your best dev pick-up line?
published: true
description: 
tags: discuss, random
---

With Valentine's Day around the corner, what's your best dev pick-up line? Can also be a pick-up line you've seen somewhere!

![Alt text of image](https://thepracticaldev.s3.amazonaws.com/i/450l6rsvf8c9t5uit9gc.gif)
Developer blog? Why not?
Tags: webdev, frontenddevelopment, epicosity
Published: 2019-02-26 15:38:55

---
title: Developer blog? Why not?
published: true
tags: web-development, front-end-development, epicosity
canonical_url: 
---

![](https://cdn-images-1.medium.com/max/1024/1*0Pz4IYlahikAfrdb8MZnbQ.jpeg)

Ug, who wants to read a blog about Web Development? I bet there’s a few of you out there. I can’t recall who pushed me in this direction but the premise was that: if you are looking for information on a web development topic and you aren’t finding what you’re looking for, write a blog. Even if there are 100 other blog posts about the same or similar topic, your take on the subject might be just different enough to satiate another dev’s relentless search for the answer to their specific situation.

So we’re writing a blog. There’s currently three active devs on our team and our experiences cover the gamut from old school, self taught, 2400 baud modem style dev to new school, fresh out of college, got all the new bells and whistles dev.

Now if we can come up with some super epic topics, we’ll be set.

Stay tuned …

* * *
About README.md on GitHub
Tags: github, learning, opensource
Published: 2018-02-07 14:00:00

---
title: About README.md on GitHub
published: true
description: Revelations about improving README.md
tags: github, learning, opensource
---
I ran across this wonderful <a href="https://blog.cwrichardkim.com/how-to-get-hundreds-of-stars-on-your-github-project-345b065e20a2">post</a> by Richard Kim, largely about doing a better job on GitHub README.md files.

Changed my life.  I'm doing major reworks.
Finding a master thesis topic - I need help!
Tags: discuss, helpme, advise
Published: 2018-02-07 12:07:21

---
title: Finding a master thesis topic - I need help!
published: true
description: 
tags: #discuss #helpme #advise
---
Hey everyone,

I'm getting straight to the point here, I need your help. I have to write a master thesis to finally complete my distance study program in computer science. But, I am having the hardest time to find a topic. 

So here is where I am at currently: I have written down what interests me the most in computer science and programming. What I am really passionate about is software architecture. I like to think about ways to structure code and microservices or how to handle a serverless architecture. The problem I'm having here is, that I cannot come up with anything scientific in that field that I could write about. The thesis can also **not** be written in a company context (a bit long and hard to explain why, but it just has to be independent). I don't want to go into too much detail, right now, on what topics I have already thought about, because I'd like to get some suggestions from you. 


Thank you all in advance, I know this is a great community here and I hope I can get some input from you people <3.
Obj-C — Swift — Obj-C
Tags: appdev, code, extension, functions
Published: 2018-04-11 06:55:37

---
title: Obj-C — Swift — Obj-C
published: true
tags: appdev,code,extension,functions
canonical_url: 
---

This is one of the rare scenarios one might get into, but the problem and its solution are unique and the simplest one here.

- Have you come across a scenario where you felt the need for an additional method in a class inside a framework (one of the Pods you added) to achieve your work?
- Is the library implemented in Objective-C?
- Is your legacy code in Objective-C and now you are strategically moving to Swift?

Today at work my friend, Vinodh, asked me this:

> “I have a pod framework which is in Objective-C, I need to add a functionality but needs to be used in Obj-C for now and may be used in Swift file in future. What is the best way to do this?

Let us say we have a class called Person inside one of your pod frameworks. This Person class has _name_, _age_ and _gender_ as properties, with a function to format the name.

```
// Objective-C header file of Person class #import typedef enum : NSUInteger { male, female } Gender; @interface Person : NSObject @property (nonatomic, strong) NSString \*name; @property (nonatomic, strong) Gender \*gender; @property (nonatomic, strong) NSUInteger \*age; - (NSString\*)formattedName; @end // Objective-C Implementation of Person class @implementation Person - (NSString\*)formattedName { return [NSString stringWithFormat:"This is %@",self.name]; } @end
```

When the formattedTitle method is called on a person object with value for name property ‘Vinodh’ it would print like “This is Vinodh”.

Now we need to extend this Person class with another method say a new format which tells the age along with the name.

In classic Objective-C style it would be adding a category to Person class, Importing this category wherever you need this new method. This would have been the best way before Swift was introduced.

But there is a disadvantage if new developer join unitl and unless (s)he imports the category header, code completion will not show the new method. Probably the new developer will end up writing the same method creating a new category again. This is a problem.

Swift to rescue. Do the following:

- Create a Person class extension and write the needed method
- Now create a protocol and declare the method signature
- Now prefix the protocol with `@objc` to make this available in Obj-C files

Here’s how you do it.

```
@objc protocol Formats { func getFormattedName(with ageHidden: Boolean) -\> String } extension Person: Formats { func formattedName(with ageHidden: Boolean) -\> String { let formattedString: String = ageHidden ? "This is \(self.name)" : "This is \(self.name) aged \(self.age) years." return formattedString } }
```

Now wherever you type `[personObject form`… in Obj-C or in `personObject.form`… in Swift the code complete will show you both the methods one Person class another from the extension we added.

Love to hear more stories from your side. Please do share in comments.

Happy Coding!
PROJECT IMGART
Tags: go, development, web, http
Published: 2018-02-06 09:40:12

---
title: PROJECT IMGART
published: true
description: IMGART consists is a HTTP Service for image processing based on filters and profiles
tags: go, development, web, http 
---

During my journey learning GO I found the following questions several times: `How do I struct GO applications?`, `There is any good project as example?`. 
Well, I also made this question!  Every example that I found they just simply put everything in the same package... So I decided to create IMGART project as an example of a real application.

IMGART consists is a HTTP Service for image processing based on filters and profiles: https://github.com/talento90/imgart

List of features that you can find in this project:

- HTTP API Middlewares (logging, serialization, error handling)
- Documentation using Swagger Specification
- Dockerfiles (Development and production)
- Multiple databases (Redis for image caching and MongoDB for profiles)
- Graceful Shutdown
- Healthcheck
- Debugging with Delve, VSCode and Docker
- Error Handling
- Make file

I am thinking about creating a blog post serie explaining my decisions... What do you think?

I would appreciate your feedback (negative/positive)

Happy coding :)
入門自然言語処理 pp.204-215
Tags: nlp, python, reading
Published: 2018-02-07 00:08:25

---
title: 入門自然言語処理 pp.204-215
published: true
description: 
tags: nlp, python, reading
---

5.3 は、Python の辞書に関する説明。nltk.defaultdict と collections.defaultdict は同じものらしい。たぶん標準ライブラリに defaultdict が追加される前に、nltk に defaultdict が入ってたのであろうと想像する。

```
>>> import collections
>>> collections.defaultdict
<class 'collections.defaultdict'>
>>> import nltk
>>> nltk.defaultdict
<class 'collections.defaultdict'>
>>> collections.defaultdict == nltk.defaultdict
True
```

5.4 は自動タグ付け。