Posts

http - How to integrate nock-vcr-recorder-mocha with Meteor? -

i need mock http calls when testing meteor app using https://github.com/mad-eye/meteor-mocha-web i found https://github.com/poetic/nock-vcr-recorder-mocha including in app using https://github.com/meteorhacks/npm , following test code gives me error... vcr = meteor.npmrequire('nock-vcr-recorder-mocha') log "vcr!",vcr describe "interpret data", -> vcr.it "should work", -> chai.expect(-> # http call ).not.to.throw() w20150327-17:25:33.820(1)? (stderr) typeerror: cannot read property 'test' of undefined w20150327-17:25:33.821(1)? (stderr) @ getcassettename (/users/fredrikbranstrom/sites/kaus/.meteor/local/isopacks/npm-container/npm/node_modules/nock-vcr-recorder-mocha/lib/it.js:30:24) w20150327-17:25:33.821(1)? (stderr) @ /users/fredrikbranstrom/sites/kaus/.meteor/local/isopacks/npm-container/npm/node_modules/n

plsql - PL/SQL: trigger error on altering insert data -

i'm trying write trigger table of books. table, create table books ( isbn varchar(13) check (length (isbn) = 10 or length (isbn) = 13), ... primary key (isbn) ); i want write trigger when isbn of length 10 inserted, change format 13-digit 1 according following rules: last digit removed added 978 front added check bit calculated formula check_bit = (10 - (x1 + 3*x2 + x3 + 3*x4 + ... + x11 + 3*x12) mod 10) mod 10 code: create or replace trigger isbnformatchange before insert on books each row begin if (length (:new.isbn) = 10) :new.isbn := substr (:new.isbn, 1, 9); :new.isbn := concat (978, :new.isbn); :new.isbn := concat (:new.isbn, mod ((10 - mod ((to_number (substr (:new.isbn, 1, 1)) + 3 * to_number (substr (:new.isbn, 2, 1)) + to_number (substr (:new.isbn, 3, 1)) + 3 * to_number (substr (:new.isbn, 4, 1)) + to_number (substr (:new.isbn, 5, 1)) + 3 * to_number (substr (:new.isbn, 6, 1)) + to_number (substr (:new.isbn, 7, 1)) + 3 * to_n...

c# - Automapper , Linq and Localizaton -

recently have been playing automapper tool populate our dtos . cool thing automapper project().to() let map queryable can select fields want according our map. but here have scenario too.we want able translate of values of entity other representation. suppose have string field value in db 'apparatment' , want translate language while selecting our dtos . i think if want write in sql : select case buidlingtype when 'appartment' 'apparatment in langaure' when 'flat' 'flat in languate' end buildingtype buildings i know can define value resolvers in automapper. question ask ,can use these resolvers in project().to() scenario ? if answer yes how should use them (to return expression instead of value) , if not , there other alternative approach able translate dto on fly ? no can't use resolvers in linq projections. i guess i'm little confused - translations little difficult in sql have. translations stored in databa...

java - Which method is looked first by Compiler , Static or instance method when ClassName.staticMethod() is used? -

this question has answer here: which method looked first compiler , static or instance method when classname.method() used? 4 answers i want proper understanding why below compilation error? per understanding if use test.xyz() compiler static method not instance method why below compilation fail? class test { public static void main(string arg[]) { test.xyz(10); // compilation fail } public void xyz(int i) { } public static void xyz(integer i) { } } every 1 please suggest why compilation fail rather other suggestions , how use , i know basic thing autoboxing etc . this question asked me which method looked first compiler , static or instance method when classname.method() used? in question of people go in wrong direction due mistake in question moved question new question. you wrong in assumption: compiler ...

php - How to add properly one-to-many relationship in Doctrine 2? -

i have 2 files(tables) in entity, , want join like table comment table.i used 1 many can connect comment.id like.comment_id , can comments likes 1 selection.when doing , dumping $comment->getlikes() i'm getting object of type object(doctrine\orm\persistentcollection) when try $comment->getlikes()->first() getting undefined index:commentid so cant likes database, doing wrong?and if possible explain why working such way? here comment entity. <?php namespace app\entity; use app\entity; use doctrine\orm\mapping; /** * @entity * @table(name="comments") */ class comment extends entity { /** * * /** * @column(type="string", length=255) * @var string */ protected $url; /** * @column(type="string", length=255) * @var string */ protected $description; /** * @column(name="userid", type="integer") * @var int */ protect...

android - Navigation Drawer not occure on Status Bar -

actually trying navigation drawer want on status bar not below put kind of code make transparent still don't work xml layout like <android.support.v4.widget.drawerlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent" android:fitssystemwindows="true" android:elevation="7dp"> <linearlayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <android.support.v7.widget.toolbar xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/tool_bar" android:layout_width="match_parent" android...

ruby - rails rbenv: rails: command not found -

i have moved rvm rbenv , when attempting execute rails getting error 1 below pauls-air:~ $ rails rbenv: rails: command not found `rails' command exists in these ruby versions: 2.1.2 after installing gem via command line in ruby version have execute rbenv rehash described in docs here , here for example: $ rbenv install 2.2.0 $ gem install bundler $ rbenv rehash $ gem install rails $ rbenv rehash