Posts

Showing posts from August, 2010

To find difference between two integer fields and check it falls under a specific range, using scripts in elasticsearch -

i have 2 fields,let name them "fielda" , "fieldb" in documents , need find difference between them , check if value falls under specific range "rangea" or " rangeb" , return documents matches criteria. schema data shown below: { "fielda": 45 "fieldb":13 } i need find document have difference between "fielda" , "fieldb" in between 30 , 35. how can using scripting in elasticsearch? this can done using aggregations , scripts below: { "aggregations": { "age_diff": { "range": { "script": "doc[\"fielda\"].value - doc[\"fieldb\"].value", "ranges": [ { "from": 30, "to": 35 } ] } } } } this way can check how many documents falls under specified range.but if want

Android Custom Dialog Display -

my custom dialog layout has 2 edit text fields. <edittext android:id="@+id/e2" android:inputtype="none" android:longclickable="false" android:selectallonfocus="true" android:textisselectable="true" /> <edittext android:id="@+id/e2" android:inputtype="none" android:longclickable="false" android:selectallonfocus="true" android:textisselectable="true" /> i implement class using onfocuschangelistener . my idea when click text field, 1 custom popup dialog appears select pre-defined value. it work correctly have minor problem. if click editext 1 => dialog apear (i select button dismisses) => click editext 2 => dialig appear (i select button dismisses). however, if if click editext 1 => dialog appears (i select button dismisses), click on editext 1 again (even many times try), dialog not show (in expectation, shoul

C++ overloading of << or >> example and explanation -

this question has answer here: what basic rules , idioms operator overloading? 7 answers i learning c++ , don't understand how << , >> operator overloading works. can please provide example and/or explanation of method overloads either operator? class { int x; public: a(int _x) : x(_x){} friend ostream& operator<<(ostream& os, elem); }; ostream& operator<<(ostream& os, elem) { os << elem.x; return os; } then can call std::cout << a(5); //prints 5 explanation: you're doing in here, making friend function class. we're making friend because want refer private fields. if have struct, don't have declare friend. we're returning ostream& can "chaining" - cout << x << y wouldn't work if returned ostream . we're taking referen

Chrome not loading CSS source maps? -

Image
until recently, chrome browser loading css source map files correctly. now, not. the setting on: and css files have source mapping tag @ bottom: /*# sourcemappingurl=home.cshtml.css.map */ but network tab , fiddler2 show chrome not trying load source map file. is there i'm missing? sourcemappingurl syntax correct? i've toggled "enable css source maps" setting on , off. chrome version: 44.0.2403.30 beta-m sourcemap files generated web essentials in vs 2013. you can try following steps: 1- delete map file , regenerate again. 2- using chrome inspector, go settings > general , click on button "restore defaults , reload"

sql server - Composite Primary key vs. Auto-Increment Primary key -

i looking little advice on how proceed table have been importing case data department: id creationdate closeddate lastupdatedate name description de5838 2015-06-02 06:14:11.11 null 2015-06-02 06:19:33.33 : should updated ... description : not defect… de5834 2015-06-01 16:16:03.03 null 2015-06-01 16:24:19.19 sync error ultimate packages... getting error .... de5822 2015-06-01 10:37:10.10 null 2015-06-01 10:37:10.10 terminal subscription has expired... given terminal serial number… de5818 2015-06-01 09:53:44.44 null 2015-06-01 09:53:44.44 no option code… allie pulled report.... for quite time, (and without of data definition outside department), have been treating id field pk - starting see other department has been recycling these id numbers ( i know, know - really bad idea )

Understanding an error returned by stargazer in R -

i trying reproduce simplified version of r output described in this posting . more generally, related attempt use stargazer() function generate latex table lmer object. following author's posting, i've loaded appropriate libraries , created 2 lmer objects using following code: library(lme4) library(stargazer) data(cake) m1 <- lmer(angle ~ temp + (1 | replicate) + (1|recipe:replicate), cake, reml= false) m2 <- lmer(angle ~ factor(temperature) + (1 | replicate) + (1|recipe:replicate), cake, reml= false) when attempt following code, returns error below: stargazer(m1, m2, style="ajps", title="an illustrative model using cake data", dep.var.labels.include = false, covariate.labels=c( "temperature (continuous)", "temperature (factor $<$ 185)", "temperature (factor $<$ 195)", "temperature (factor $<$ 205)", "temperature (factor $<$ 215)", "temperature (factor $<$ 225

javascript - show nth-child number when click - turn nth-child number into a variable -

this question has answer here: get element's nth-child number in pure javascript 4 answers i need javascript show me nth-child number when click li. example if click "apple" console.log show me "2". want turn nth-child number variable. <!doctype html> <html> <head> <style type="text/css"> li:nth-child(1) b {color: #eeaa33;} li:nth-child(2) b {color: #0000ff;} li:nth-child(3) b {color: #ff3300;} </style> </head> <body> <ul class="menu"> <li><b>apple</b></li> <li><b>watermelon</b></li> <li><b>blueberry</b></li> </ul> <script> //i need javascript show me nth-child n

process - Powershell Delete Locked File But Keep In Memory -

until recently, we've been deploying .exe applications copying them manually destination folder on server. though, file running @ time of deployment (the file called sql server job)--sometimes multiple instances. don't want kill process while it's running. can't wait finish because keeps on being invoked, multiple times concurrently. as workaround, we've done "cut , paste" via windows explorer on .exe file folder. apparently, moves file (effectively delete) keeps in ram processes using can continue without issues. we'd put new files there called when later program call it. we've moved automated deploy tool , need automated way of doing this. stop-process -name someprocess in powershell kill process, don't want do. is there way this? (c# ok.) thanks, function moverunningprocess($process,$path) { if($path.substring($path.length-1,1) -eq "\") {$path=$path.substring(0,$path.length-1)} $fullpath=$path

How to get Prolog to explain your result beyond the true statement -

i have following facts , rules: flight(sea,msp). flight(msp,jfk). route(a,b) :- flight(a,b). route(b,a) :- flight(a,b). route(a,c) :- flight(a,b) , flight(b,c). when query route(sea,jfk) result true wish explination: sea-->msp-->jfk way can tell not it's true how it's true. you keep track of nodes in graph you've visited. need anyway, need detect cycles in graph lest fall rabbit hole of infinite recursion. and in prolog, use helper methods carry state around 1 or more arguments. used convention have "public" predicate — route/3 invokes "private" worker predicate having same name higher arity, route/4 . ought you: route( , b , r ) :- % find route r b route(a,b,[],r) % - invoking worker, seeding list of visited nodes empty list . % easy! route(b,b,v,r) :- % we've arrived @ destination (b) when origination node same destination node. reverse([b|v],r) % - reverse list of v

javascript - Blocked google map, unable to pan and zoom, JS error -

i unable pan , zoom on basic map, based on google maps api code sample. the map here . as can see in console, first error: uncaught typeerror: cannot read property 'getattribution' of undefined and after go on map mouse, lot of: uncaught typeerror: cannot read property 'offsetx' of undefined i able make zoom , pan working including this library . but in case controls wrong this capture .

javascript - Automatically call bind() on all instance methods in es6 during constructor -

how can (or possible to) make javascript base class automatically calls bind on each of instance methods during it's constructor? i tried, without success: class baseclass { constructor() { // (let in this.__proto__) { // <-- failed (let in this) { if (typeof this[i] === 'function') { this[i] = this[i].bind(this); } } } } class myclass extends baseclass { constructor() { super(); this.foo = 'bar'; } mymethod() { console.log(this.foo); } } when set break point in constructor, this.mymethod exists, , exists in this.__proto__ , doesn't in object.getownpropertynames(this) in neither class's constructor nor base class's constructor. essentially i'm trying bonus step in this blog post (after conclusion) without needing define or call _bind() manually. es6 class methods non-enumerable, you'd have walk prototype c

sql - Django Optimisation of a queryset with Q objects -

i'm using django 1.8. i have queryset requires logical "or" , "and". gives : mymodel.objects.filter( q(start__gt=today) | q(end__lte=today), active=true).update(active=false) as may understand it, should take every active mymodel instances shouldn't have started, , 1 have finished, , deactivate them. "start" , "end" datefields, , "active" boolean. it works, generates query far being optimised. i'd able start query filtering on "active" state, check other 2 fields, because in database, have thousands of entries, few of them have active=true. boolean test faster comparisons. i can't reorder arguments, because former 2 q() positioned argument while latter name argument, , can't chain multiple filter() because generates "or", , not "and". is there way this? first of all, sql command generated django orm won't have condition clauses in same order .filter

java - Getting the font metrics before the paint method id called -

hi creating news ticker/ text scroller. using following method: import java.awt.color; import java.awt.fontmetrics; import java.awt.graphics; import javax.swing.jframe; import javax.swing.jpanel; public class scroll1 extends jpanel{ private int x; private int x2; private int y; private string text; final int startx=-100; public scroll1(int startx) { x2=-650; x = 20; y=150; text= "some words , others, , must longer text takes whole panel/ frame test work "; } @override public void paint(graphics g) { g.setcolor(color.white); g.fillrect(0, 0, 400, 300); g.setcolor(color.black); g.drawstring(text, x, y); g.drawstring(text, x2, y); fontmetrics fm= g.getfontmetrics(); system.out.println(fm.stringwidth(text));; } public void start() throws interruptedexception{ while(true){ while(x<= 650){ x++

internet explorer - Works on IE but Chrome & Firefox not -

my javascript: var bossid = $('#bossid'); var date = $('#divdate'); var headdate = $('#headshipdate'); var select = '-- select --'; bossid.change(function () { if ( bossid.find(':selected').text() != select ) date.show(); else { date.hide(); headdate.val(''); } }); my view: @html.dropdownlist( "bossid", null, "-- select --", htmlattributes: new { @class = "form-control" } ) <div id="divdate" class="form-group" style="display:none"> @html.editorfor( model => model.headshipdate, new { htmlattributes = new { @class = "form-control" } } ) per title, script works fine on internet explorer, not in chrome & firefox. how can solve this?

android - binding a service to multiple activities -

my service correctly binded first activity when try bind second activity not work here code of onresume , on pause of first activity @override protected void onresume() { super.onresume(); connection = new serviceconnection() { @override public void onservicedisconnected(componentname name) { service = null; } @override public void onserviceconnected(componentname name, ibinder service) { shareinfos.this.service = (iservice) service; } }; bindservice(new intent(this, shareinfos.class), connection, context.bind_auto_create); } @override protected void onpause() { super.onpause(); if (service != null) { service = null; unbindservice(connection); } } i did same second activity when try use service null here code of second activity: @override protected void onresume() { super.onresume(); connection = new serviceconnection() { @overr

ruby on rails - Nginx (111: Connection refused) while connecting to upstream -

i'm try run rails apps on production (vps). i'm using rbenv, unicorn, nginx, os ubuntu server.. i have config unicorn , nginx : file : config/unicorn.rb app_dir = "/home/axx/apps/axx" working_directory "/home/axx/apps/axx" pid "/home/axx/apps/axx/tmp/pids/unicorn.pid" stderr_path "/home/axx/apps/axx/unicorn/unicorn.log" stdout_path "/home/axx/apps/axx/unicorn/unicorn.log" listen "/home/axx/apps/axx/tmp/sockets/unicorn.axx.sock" worker_processes 2 timeout 30 file : /etc/nginx/sites-available/default upstream app_server { server unix:/home/axx/apps/axx/tmp/sockets/unicorn.axx.sock fail_timeout=0; } server { listen 80; server_name localhost; root home/axx/apps/axx/public; location / { proxy_set_header x-real-ip $remote_addr; proxy_set_header x-forwarded-for $proxy_add_x_forwarded_for; proxy_set_header host $http_host; proxy_redirect off; if (-f $request_filename/index

c++ - Painted image is always black -

i'm trying draw image within popup windows. bitmap infos stream. part should ok, because if create file , save bitmap looks fine. the byte array stored follows: static byte* _bitampcontent; here how create window: static wchar name[] = l"bitmap display"; hinstance _instance = ::getmodulehandle(null); hwnd hwnd; msg msg; wndclass wndclass; wndclass.style = 0; wndclass.lpfnwndproc = class::_windowproc; wndclass.cbclsextra = 0; wndclass.cbwndextra = 0; wndclass.hbrbackground = (hbrush)getstockobject(gray_brush); wndclass.hicon = loadicon(null, idi_application); wndclass.hcursor = loadcursor(null, idc_arrow); wndclass.hinstance = _instance; wndclass.lpszmenuname = null; wndclass.lpszclassname = name; if (registerclass(&wndclass) == 0) { messagebox(0, l"the window not registered", l"message", mb_ok); return 0; } rect rc; g

MEAN.js - How do you insert sub-documents into a mongoose model before saving? -

danger! i'm new mean stack. may using wrong terms. have removed , refactored lot of code example make question clearer. i have schema multiple properties, 1 of of mixed type . mixed type array of subdocuments, defined schema. other schema has yet property of mixed type, containing yet array of subdocuments, defined yet schema. var subsubschema = new schema({ name: { type: string, required: true }, value: { type: number, required: true } }); var subschema = new schema({ name: { type: string, trim: true, default: '', required: "name required field." } values: { type: [subsubschema], required: "value updates must contain values!" } }) ; var mainschema = new schema({ name: { type: string, trim: true, default: '', required: "name required field.&quo

c# - IBM DB2 issue--System.BadImageFormatException: Could not load file or assembly IBM.DB2.DLL or one of its dependencies -

Image
i getting above mentioned error message. have made enough research , tried out various options still no luck. here arethe details below: os: windows 7 64 bit version visual studio version: 2013 premium .net framework version : 4.0.30319 asp.net version: 4.0.30319.34249 iis version: 7.0 db2 installed path: c:\program files (x86)\ibm dll path: c:\program files (x86)\ibm\sqllib\bin\netf40\ibm.db2.dll dll version: 9.7.4.4 i have changed solution configuration manager platform cpu , have changed settings in application pool setting property enable 32-bit application true . but still getting same error. there other workaround? please me suggestions. in case, happening windows server 2012 r2 standard, error caused package not installing in global cache assembly make sure check c:\windows\assembly ensure program installed under gac_32 , gac_64, should see if not had in order solve it. 1)i had check version had installed in order ensure

c++ - Creating custom or using built in types -

in projects people create custom types everything, , in others use ints , floats represent temperatures, lengths , angles. i can see advantages , draw backs both, , guess depends on type of project working on if idea or not create these kinds of types. here i'm thinking of: class someclass { physics::temperature temperatureonmoon(geometry::distance distancefromsun); geometry::area shadow(geometry::angle xangle, geometry::angle yangle, geometry::triangle triangle); }; the temperature type have fahrenheit() , celsius() method, area type have constructor takes 2 point types , on. this of gives great type safety , think increases readability, creates lot of dependencies. uses someclass has include these other headers , have lot more work when creating unit tests. takes time develop types. the approach using built in types simpler use , have fewer dependencies: class someclass { double temperatureonmoon(double distancefromsun); double shadow(double xa

mysql - use select under case statement -

i want use query allows me 2 differents results on depending on filtre. have tried 1 not work. case when filtre = 10 ( select sum(s.montant_creance_emp) creances_emp , s.annee annee sc01_emp s ) else ( select sum(s.nombre_creance) creances_emp , s.annee annee sc01_emp s ) end thanks all. try select case when filtre = 10 ( select sum(s.montant_creance_emp) creances_emp , s.annee annee sc01_emp s ) else ( select sum(s.nombre_creance) creances_emp , s.annee annee sc01_emp s ) end <table>

javascript - jquery address plugin issue -

i’m using jquery address plugin , have implemented plugin on listing page , when click on 1 of links , function pull data using ajax , content , overwrite current list html , page has ‘back’ button , use window.history.back() go listing page , work fine until point , after when click again on 1 of links again , jq address behavior lost . the open_ajax function used pull data , inserted in paginatedcontent html div $(document).ready(function(){ refreshjqaddress(); }); function refreshjqaddress(){ mainpath = ""; if($('.jqaddress').length > 0){ $.address.init(function(event) { $('.jqaddress').address(function() { return $(this).attr('href'); }); }).internalchange('change', function(event) { path = event.value; var ran=math.random(); urlpath = path; console.log(urlpath); alert(urlpath); open

.net - How to prevent Scan from running multiple times? -

for example var subject = new subject<int>(); var test = subject.scan(0, (x, y) => { console.writeline("scan"); return x + 1; }); test.subscribe(x => console.writeline("subscribe1")); //test.subscribe(x => console.writeline("subscribe2")); observable.range(0, 1).subscribe(subject); console.writeline("done"); console.read(); the output is scan subscribe1 done but if uncomment second subscribe output is scan subscribe1 scan subscribe2 done why scan run 2 times , how can prevent it? output should scan subscribe1 subscribe2 done i use subject accumulate different observables. use scan method update model , have different places need subscribe model updates. maybe there better solution without using subject? try using observable.publish iconnectableobservable<t> . var subject = new subject<int>(); var test = subject .scan(0, (x, y) => { console.writeline("scan"

model view controller - WebApi: Reading errors -

Image
i've got simple web api consumed mvc project, keep on getting 'response status code not indicate success' , wondering how response body error, can see error within rest viewer can't navigate through error. following code within mvc app public actionresult index() { try { var uri = "http://localhost:57089/api/values"; using (var client = new httpclient()) { task<string> response = client.getstringasync(uri); object result = jsonconvert.deserializeobject(response.result); return (actionresult) result; } } catch (exception ex) { return content(ex.tostring()); } return view(); } within api controller i'm sending bad request, here's code public ihttpactionresult get() { return badrequest("this bad request " + system.datetime.now.

regex - Using python to parse verilog inputs -

i have project need parse information verilog files. issue right files have various styles of inputs. example, explicitly declared so: input clk, reset, enable; input clk; where code looks like module name (a,b,c,d, etc); and inputs , outputs declared explicitly. however, of code has declarations so: module name ( input a, input b) etc. way have python regex right is: input_mod = re.search(r'.*?\binput\b(.*?\s+),|;', line) inputs.append(input_mod.group(1)) where line each line of document, , inputs list. think handles latter example , part of first example, have no idea how have pick 1 both commas , semicolons included. help?

java - Chrome project - Where is Blink engine source code? -

i'm looking rendering engine chrome open source, i've been googling long time still not able find blink engine's source code. i've heard, blink open source project still not able find it. can please me, is? kindly me, appreciated! update: that codebase has not been used in while , of have pointed out no longer used. as timoxley suggested : active development appears occuring in "third_party/webkit": it took 1 minute find codebase on blink homepage . update regarding 3gb size question in comment. you looking @ whole master branch. if @ tree notice various contents of master branch - lots of tests (layout,manual,performance etc.) the actual source code has 15mb .

java - Mule - Deployed project - Message payload is of type: String -

my current mule flow: http -> logger (asstring) -> soap service -> invoke -> logger <spring:beans> <spring:bean id="propertyconfigurer" class="org.springframework.beans.factory.config.propertyplaceholderconfigurer"> <spring:property name="locations"> <spring:list> <spring:value>info.properties</spring:value> </spring:list> </spring:property> </spring:bean> <spring:bean id="testintegration" class="x.x.x.testintegracion" init-method="init"> <spring:property name="url" value="${destiny.url}" /> <spring:property name="username" value="${message.username}" /> <spring:property name="password" value="${message.password}" /> </spring:bean> </spring:beans>

Issue Migrating magento from XAMPP to live server -

i attempted migrate magento store live server today , not appear working correctly http://66preview.co.uk/synthmusic/ the page content , menu bar have disappeared along few other issues i changed local.xml live db settings , changed core config table in db correct url path, im missing else? im totally stumped appreciated you have upload local database? , need truncate url rewrite table , clear cache.

Openshift how to create a table on ruby on rails application? via console -

openshift how create table on ruby on rails application? via console i'have gem installed called 'rhc', how can create table ruby on rails application via rhc command? https://www.openshift.com well looking @ documentation helps, there seems areas can at https://developers.openshift.com/en/ruby-getting-started.html https://developers.openshift.com/en/managing-adding-a-database.html these seem have info need if have started app, best provide code show have done can see how best you, poorly constructed question gets "poorly" constructed answer, if can provide more can more hope helps if using openshift rails (3/4) quickstart, automatically setup run rake db:migrate command when git push deploy code application ( https://github.com/openshift/rails4-example/blob/master/.openshift/action_hooks/deploy ). if trying manually, need ssh application, cd ~/app-root/repo directory, , run "raild_env={your_env} bundle exec rake db:migrate"

How to upload attachments to Yammer using rest api in php -

how upload attachments yammer using rest api in php. can give 1 example. have tried long , hard not able post attachments. using https://www.yammer.com/api/v1/messages.json in post able post messages , og objects. i think documentation in yammer not enough implement this. example code in php great.

c# - Parsin JSON with @ sign in key field -

i getting json follow: "name": { "@value": "foo" }, "lastname": { "@value": "bar" }, "birth": { "@value": "198701010000" } when try parse this, unable values 'foo', 'bar' , bday. rootobject deserializedproduct = jsonconvert.deserializeobject<rootobject>(obj); i m using code above parse it. how can parse properly? assuming have class rootobject looks this: public class rootobject { public item name { get; set; } public item lastname { get; set; } public item birth { get; set; } } you can define item this: public class item { [jsonproperty("@value")] public string value { get; set; } } and use jsonproperty attribute specify name of property you'd map item.value to.

MongoDB: Can't canonicalize query: BadValue unknown operator -

the data given follows: { "_id" : { "$oid" : "546b79a2e4b0f7bfbaa97cc7" }, "title" : "eyewitness: highlands, scotland", "description" : "photographs guardian eyewitness series", "timestamp" : "14/11/2014", "category" : "news", "url" : "http://www.theguardian.com/world/picture/2014/nov/14/1", "source" : "http://www.theguardian.com/", "mainstory" : "\n", "keywords" : [ "wildlife", "scotland" ] } but when use following command find something, error comes out db.guardian.find({ "_id": {"$oid": '546b79a2e4b0f7bfbaa97cc7'}}) how can find document specific $oid . you need convert id string objectid this: db.guardian.find({ "_id": objectid("546b79a2e4b0f7bfbaa97cc7") }) the reason be

opengl - How to rotate object using the 3D graphics pipeline ( Direct3D/GL )? -

i have problems trying animate rotation of mesh objects. if make rotation process once fine. meshes rotated , final image webgl buffer looks pretty fine. http://s22.postimg.org/nmzvt9zzl/311.png but if use rotation in loop (with each new frame record) meshes starting weird, next screenshot: http://s22.postimg.org/j2dpecga9/312.png i won't provide here programming code, because issue depend on incorrect 3d graphics handling. i think opengl/direct3d developers may give advice how fix it, because question relates 3d-programming subject , specific gl or d3d function/method. think way of work rotation same both in opengl , direct3d because of linear algebra , affine affine transformations. if interested i'm using, answer webgl . let me describe how use rotation of object. the simple rotation made using quaternions. mesh object define has quaternion property. if rotate object method rotate() doing next: // kind of pseudo-code function rotatemesh( vector, an

advanced custom fields - CKEditor: use ACF to filter source code -

how can enable filter filtered (h1, h2, h3 tags) when ckeditor in source mode? used button save content , close editor. if user use wysiwyge mode filter works, when user switch editor source mode , manually type h1, h2 etc. ckeditor won't filter text (code).

ios - set cursor position in contenteditable div in uiwebview -

i loading uiwebview html file. html file contains text in div tags. need set cursor position in div tag. html file contains different div tags.based on condition need locate cursor position. this helpful setting caret position. suppose html this: <div id="editable" contenteditable="true"> text text text<br>text text text<br>text text text<br> </div> <button id="button" onclick="setcaret()">focus</button> and javascript method is: function setcaret() { var el = document.getelementbyid("editable"); var range = document.createrange(); var sel = window.getselection(); range.setstart(el.childnodes[2], 5); range.collapse(true); sel.removeallranges(); sel.addrange(range); el.focus(); }

gruntjs - How to install Grunt plugin properly -

sorry, i'm newbie in npm-bower-grunt services. maybe question stupid, can't find solution in google. so, have installed single page app based on npm/bower/grunt/angular.js in root have gruntfile.js code module.exports = function(grunt) { var gtx = require('gruntfile-gtx').wrap(grunt); gtx.loadauto(); var gruntconfig = require('./grunt'); gruntconfig.package = require('./package.json'); gtx.config(gruntconfig); // need our bower components in order develop gtx.alias('build:standardversion', [ 'compass:standardversion', ... ]); gtx.finalise(); }; else have file grunt/compass.js with: module.exports = { standardversion: { options: { config: 'standard/master/config.rb' } } }; then in bower_components folder have gruntfiles each plugin code like: 'use strict'; module.exports = function(grunt) { grunt.initconfig({ pkg: grunt.file.readjson('package.json'

php - PHPMyAdmin How to do datatype set of relationships -

today decided little automate work in phpmyadmin, create many relationships, there 1 problem. example have 2 tables: foodraws , allergens. in foodraws table have columns name, tags, etc.. , allergens. created relationship between foodraws.allergens , allergens.id. now, when i'm editing or inserting foodraws, can directly select id allergens foodrws.allergens field. one? when have example selected allergen id 6 , want add id 7 replaces id 6. need create "6;7". create field datatype set ('1','2',...,'14'), working in same way, cannot select more 1 id field. have ideas how solve that? tables: create table if not exists `raws` ( `id` int(10) unsigned not null, `nameczech` varchar(50) collate utf8_czech_ci not null, `nameeng` varchar(50) collate utf8_czech_ci not null, `tags` varchar(100) collate utf8_czech_ci not null, `allergens` set('','1','2','3','4','5','6','7','8

`<main>': uninitialized constant RSpec (NameError) using when testing Ruby files -

i've looked @ several posts regarding issue , can't seem find fix it. i'm working through assignment in ruby on rails dev course , we've hit module on tdd/bdd rspec. i've had success far cannot figure out error: <main>': uninitialized constant rspec (nameerror) i have gone through expectations , code line line ensure it's correct. rspec capitalized in spec file, have class corresponding end typically cause rspec throw error. i'm still learning rspec, though. working on last expectation statement when error started popping up. code require_relative "entry.rb" class addressbook attr_accessor :entries def initialize @entries = [] end def add_entry(name, phone, email) index = 0 @entries.each |entry| if name < entry.name break end index += 1 end @entries.insert(index, entry.new(name, phone, email)) end def remove_entry end end rspec rspec.describe addressbook