I have a simple component that I would like to test with integration test (ember-cli-qunit 4.0.0). this.render(hbs`{{input value=record.value change=(action dynamicUpdate record.name)}}`);
sheepfilms
The Bowery Presents
almost home
RMH

Jar Jar Binks Fan Club
No title available
Xuebing Du

roma★
NASA
Today's Document

blake kathryn
Color Me Curious

No title available
Monterey Bay Aquarium
PUT YOUR BEARD IN MY MOUTH

Origami Around
Sade Olutola
todays bird
Not today Justin

pixel skylines
seen from Germany
seen from Hungary
seen from France
seen from United States

seen from Palestinian Territories

seen from Dominican Republic

seen from Laos
seen from Venezuela
seen from United States

seen from United States

seen from Germany
seen from Philippines
seen from United States

seen from Brazil
seen from United States

seen from Mexico

seen from Australia

seen from Germany
seen from Iraq
seen from United States
@marxsk-blog
I have a simple component that I would like to test with integration test (ember-cli-qunit 4.0.0). this.render(hbs`{{input value=record.value change=(action dynamicUpdate record.name)}}`);
Update) After my investigation, I’m not sure if what I want is possible at all. You have to depend on the fact that children records are returned (in included) in same order as they were entered. Then it should be possible to do it. I have tried to set ‘id’ of children record (using .set(“id”, value)) in store but it ends up with having two records with the same ID. I have tried to remove ‘included’ section at all. This looks promising but every relationship which is not included is fetched (_...
Unsolicited upgrade of Ember
On Monday, I wish to work on dynamic-fields component that I wish to extract from picus and on the ACL pages. Unfortunately, I had created quite a mess in my node_modules during development, so I have decided to remove node_modules and reinstall it.
It looked like a good idea but it was not. It was working before but it was not working any longer. I was not sure if I did not have any local changes in node_modules (I did not). The error message was really cryptic and Ember attempts to not break compatibility in minor releases (it looks like that happened).
Problem was that in my own createRecord() command I was resolving promise without returning any data what did not work any longer. First step was to find out that payload should be returned and second that object is required instead of “text” payload. Single line patch.
[bug] Ember & transitions with queryParams
I have found the quite important bug in Ember. When there is an attempt to transition from one route to another and queryparams (e.g. activeTab) is used it ends with stack trace (ember issue #15749). It looks like regression and I hope it will be fixed soon. If not, it looks like a simple patch that will help in my case only should be easy to do.
Ember’s computed properties are a great mechanism for encapsulating reactive logic and implementing consistent, auto-updating UIs. Since the past year or so though, there seems to be an increasing tendency in the community to use template helpers as the main tool for expressing this kind of logic right in the templates. Following up on a talk I gave at last year’s EmberFest, I’ll elaborate in this post why I think that is often not the best choice and what the drawbacks are.
Reading error messages
DEPRECATION: Addon files were detected in /Users/marx/GIT/javascript/picus/node_modules/ember-load-initializers/addon, but no JavaScript preprocessors were found for ember-load-initializers. Please make sure to add a preprocessor (most likely ember-cli-babel) to in dependencies (NOT devDependencies) in ember-load-initializers's package.json.
This looks like standard deprecation that should be fixed some day but it can be postponed for at least a version. This is what I hoped for. I plan to write a new helper today which I wish to properly set, so I wish to run ember test --server but I got a list of strange errors. All three of addons are already fixed so another upgrade of dependecies. I hope that we will have full test soon enough :)
Upgrading
I hate upgrading things because something is going wrong all the time. But I'm lazy, so sometimes it looks like the best way. Today, I have upgraded two modules in picus.
ember-cli-mirage (my branch): It allows me to remove all data models from mirage (17 simple files) but this would not be enough. The main feature is that relationships are now one-way so I can have resource being part of several resource groups at once. What was not possible in 0.2.x
jshint -> eslint: When I have started with picus, I have fixed majority of issues found by jshint. Later, I have started to use spread operator inside objects (what is not standard yet) and jshint does not support them. It would be okay, if it will be just one error but parsing of whole file was broken. eslint allows me to use experimental options.
Apiary vs Swagger
Our API needs a documentation, so I have watched few video, read articles about current projects. I have heard about Apiary before so it was my first target . Unfortunately, I did not find a way how to enter non-JSON input. With swagger, it is not an issue and it is possible to work also with cookies what we need.
Documentation is not yet priority but swagger is the tool that I will use.
Mocking constraint sets
On Wednesday, I was pretty sure that I will start to use ember-cli-mirage 0.3.x in the far future. Today, I was writing the mock, models and forms for constraint sets. As usual, I have found several problems but the largest one were in ember-cli-mirage where cluster contains 0+ constraint sets, this set contains 1+ resources set and each of this set has hasMany('resources').
1) How to add a resource to the existing resource set. I have found out that using push() is a bad idea because data are not updated. The issue is caused by redefining of set() which do a majority of real work. The correct answer is to create a new array, push and set result.
2) ember-cli-mirage 0.2.x defines inverse() relationship by default and if you don’t want them you should define it manually e.g. “unused”. Unfortunately, I had several “unused” already used and data were not linked correctly. The correct solution is to rename it to unused name e.g “unused99″. Be aware, that if there should be several belongsTo links, it will be rewritten. This issue is solved in 0.3.x where relationships are no longer two-way. So, I know what I will work on next week.
We’re heading towards the final fulfillment of the Industrial Revolution.
PR: Add support for arrays in the x-www-form-urlencoded for ember-cli-mirage
To support constraint sets in the picus, I have to send/accept encoded forms that look like field[]=value1&field[]=value2. These data should be decoded to the single array [value1, value2]. Previously, there was no support for that in native normalization function in ember-cli-mirage. Patch and tests are part of PR, so I hope for approval.
Unfortunately, I will not be ready for upgrading to 0.3.x before picus tests will be ready :/
PS: I was quite surprised that ‘const’ should not be used in functions even when the value shouldn’t change.
Parameters for application template
In order to give parameters for application.hbs it is required to set data for application’s controller. Hacky solution is to add to your route:
setupController(controller, model) { this._super(controller, model); this.controllerFor('application').set('navigation', ["nav1", "nav2"]); }
Nice solution, is to use service and inject it into application controller.
queryParams and replaceState
Although queryParams have to be set in controllers:
queryParams: [x,y,z]
Other parts of configuration (alias, replace) has to be written in route’s queryParams.
queryParams: { x: { replace: true} }
I've installed the virt-manager on one of my servers (RHEL/Centos/SL) and tried to access the virt-manager via X forwarding but I just got following
Issue of the day. X11 Forwarding (Mac->Linux) with symbols instead of fonts in virt-manager.
Ember.js: Šablóny
Prvý súboj s Ember.js mám za sebou. Chcel som do šablóny (.hbs) dostať trochu viac logiky než je (?) vhodné.
var forminfo = { structure : [ "label", "text", "label" ], data : [ ["Hugo", "123", "Boss"], ["Captain", "222", "America"], ], }
Z tejto štruktúry by som chcel vytvárať formuláre tak, aby mali políčka správny obsah a správny typ. Takže naivne tvorím:
{{#each model.data as |record| }} {{#each record as |item idx|}} model.structure.[1] model.structure.idx {{ get model structure }} {{/each}} {{/each}
V tele cyklu sú hneď tri spôsoby ako pristupovať ku konkrétnemu indexu v pole. Prvá možnosť funguje pre prípad, že dopredu vieme presný index. Druhá možnosť nefunguje vôbec, pretože idx sa nevyhodnocuje ako premenná, ale je použitá pre kľúč s týmto menom. Tretia možnosť (relatívne nová) je super, ale funguje len s reťazcami a nie s indexami poľa.
A správne riešenie? Ember nás tlačí k tomu, aby sa takéto konštrukcie nepoužívali. Môžeme si nadefinovať vlastnú premmennú s tým správnym obsahom, vytvoriť helper, ... alebo si povedať, že informácie tohoto typu by mali byť v slovníku a potom k nim môžeme pristupovať cez get.
Báječný chaos - skrytý pôvab neporiadku
Tento semester som čítal asi tretinu z bežného počtu diplomiek. A aj preto mi zostal čas na niečo iné. Zvládol som znovu-prečítať %subj%, ktorá sa venuje chaosu v rozličných podobách. Základná idea spočíva v tom, že prirodzený stav mnohých vecí nie je logické, čisté usporiadanie, ale chaos. Nie totálny, ale rozumne orezaný.
Páčil sa mi aj jednoduchý príklad s balíčkom kariet. Vyhľadanie karty v usporiadanom balíčku je rýchlejšie ako v neusporiadanom. Ale vrátenie karty do balíčku je už výrazne drahšia operácia. Naviac, treba počítať s úvodným utriedením kariet. Takže, vyhľadávať v neusporiadanom balíčku môže byť vo finálne efektívnejšie
Intel AMT na Lenovo X220
Vzdialené vypínanie počítačov cez IPMI je už takmer história a štafetu najlacnejšieho (a najmenej spoľahlivého) riešenia preberá AMT. Ako ho spojazdniť?
Majme Lenovo X220 - naštartujeme, modré tlačítko, F1 (bežný BIOS). Zapneme AMT (nič viac netreba). Save / reboot. Modré tlačítko, CTRL+P, 1. Najskôr je potrebné nastaviť heslo (8-32 znakov, číslica, malé, veľké písmeno, divný znak - rozumné heslo je “W3@domena”. [Zabudnuté heslo -> vypnúť AMT, reštart, dokončí sa odkonfigurácia, zapnúť AMT. Štandarné heslo je ‘admin’ ].
Z menu zvoliť Intel AMT Configuration. Manageability Feature Selection - yes (factory settings). V Network setup obvykle DHCP pre IPv4 a Activate Network Access.
Od tohoto momentu by malo ísť pingať daný stroj. Ak je to DHCP, tak treba uhádnuť / pamätať si adresu z operačného systému. Overenie AMT na Fedore:
dnf install amtterm; export AMT_PASSWORD=‘???’; amttool IP info