2018-10-22         Patrick

Rails App Precompiling Assets Failed Error When Pushing to Heroku

Before marking this as a duplicate--I have seen other threads with the same issue and the solution was always to include "config.assets.initialize_on_precompile = false"to my config/application.rb profile and I've done that but the error remains. Here's my application.rb file:require_relative 'boot'require 'rails/all'Bundler.require(*Rails.groups)module SampleApp class Application < Rails::Application config.load_defaults 5.2 config.assets.initialize_on_precompile = false endendAnd here's the full error message when I run $ git push heroku master:remote: !rem...

 ruby-on-rails                     1 answers                     42 view
 2018-10-22         Patrick

Modbus CRC calculation using VB.Net

I tried to calculate CRC using VB.Net but the value is different. Example if I use 05 03 0B D3 00 01 data CRC code should be 76 53 but I get B6 45This is my VB.Net code. Private Function CRC(data As Byte()) As Byte() Dim crcfull As UShort = &HFFFF Dim crchigh As Byte = &HF, crclow As Byte = &HFF Dim crclsb As Char Dim result As Byte() = New Byte(1) {} For i As Integer = 0 To (data.Length) - 3 crcfull = CUShort(crcfull Xor data(i)) For j As Integer = 0 To 7 crclsb = ChrW(crcfull And &H1) crcfull = CUShort((cr...

 vb.net                     2 answers                     9 view
 2018-10-22         Patrick

Dropdown menu not appearing in the form rendered by django in a template

I am trying to show a drop-down menu in a Django Template but it does not appear. Here is my code:Post Model:class Post(models.Model): category_choices = ( ('technology', 'Technology'), ('personal', 'Personal'), ('poetry', 'Poetry'), ('rants', 'Rants'), ('random', 'Random'), ) author = models.ForeignKey('auth.User', on_delete=models.CASCADE) title = models.CharField(max_length=70) body = models.TextField() summary = models.CharField(max_length=100) created_date = models.DateTimeField(default=timezone.now()) publishe...

 django                     1 answers                     80 view
 2018-10-22         Patrick

Detecting synonyms in rasa_nlu

I have a working installation of rasa_nlu, running Python 3.6.5 on macOS High Sierra. I was able to get the sample tutorial working. I'm running into trouble getting it to work with synonyms.Here's the relevant portion of my training file, first-model.md.## intent:select- what is the [max](operator) rating?## synonym:max- best- highest- maximumNow, rasa_nlu correctly detects the intent and entity for a question such as what is the max rating?{'intent': {'name': 'select', 'confidence': 0.9542820453643799}, 'entities': [{'start': 12, 'end': 15, 'value': 'max', 'entity':...

 python                     2 answers                     27 view
 2018-10-22         Patrick

Html code in codename one

I searching codename one API and found there is a HTMLElement, HTMLComponent and HTMLUtils class are there and under HTMLElemrent has fields like TAG_body etc... If i am not wrong using this we can write HTML code, please correct me if i am wrong. Also i want to know how i can use that TAG fields of HTMLElements i tried it with creating it's object but may be not doing in correct way. Please show me correct ways to implements of these classes and also share the core purpose of this classes.Regards,jeny You are wrong. HTMLComponent is an HTML viewer component used in olde...

 codenameone                     1 answers                     99 view
 2018-10-22         Patrick

How to obtain iOS device CPU architecture in Xamarin?

In my Xamarin iOS application, I can obtain many device characteristics such as model, system name, etc. from UIKit.UIDevice.CurrentDevice instance. However, I don't see any method to obtain CPU architecture (x86, arm, etc.) on the class. How can I get the iOS device CPU architecture in runtime shows a way to get this information using Objective C. I am wondering if there a way to get the CPU information in C# using any of the predefined Xamarin classes. Create a new file with this class on your iOS project:public static class DeviceInfo{ public const string HardwareS...

 xamarin.ios                     1 answers                     12 view
 2018-10-22         Patrick

Spinner background is not correct on Android 6.0+

I use Android project(old project) on Eclipse.I install ADT from here:https://dl-ssl.google.com/android/eclipse/In my manifest.xml<uses-sdk android:minSdkVersion="15" android:targetSdkVersion="15" />snippet of xml layout: <Spinner android:id="@+id/currencySpinner" style="@style/racommon_spinner_custom_style" android:layout_width="0dip" android:layout_height="40dip" android:layout_weight="0.3" android:prompt="@string/currency" />here styles.xml <style name="racommon_spinner_custom_style" parent="@android:style/...

 android                     2 answers                     36 view
 2018-10-22         Patrick

Foreign key which accepts only selected values

Say I have following tables:EMPLOYEE : ID(PrimaryKey) | NAME | DESIGNATION Let's say DESIGNATION can have these values:MANAGER ENGINEERetc etc..MANAGERS_DETAILS ID | NAME | SALARYID in MANAGERS_DETAILS is Foreign Key of EMPLOYEE table ID.i.e, CONSTRAINT managers_details$fk1 FOREIGN KEY (ID) REFERENCES EMPLOYEE(ID) ON DELETE CASCADEIs there anyway to restrict inserting the employees who are not MANAGERS? i.e. insert into the table only when designation employee is MANAGER? You can add a virtual column to the EMPLOYEE table that contains the id if the person i...

 sql                     3 answers                     93 view
 2018-10-22         Patrick

Converting Oracle date arithmetic to work in HSQLDB

I'm trying to spot-test an Oracle backed database with hsqldb and dbunit, but I've run into a snag.The problem is with the following EJB-QL (simplified a bit):SELECT o FROM Offer o WHERE :nowTime BETWEEN o.startDate AND o.startDate + 7This seems to only work in Oracle's version of SQL.What's the easiest way for me to convert this to work in both hsqldb and oracle? Assume that changing the two between arguments to named parameters is a very difficult refactor, so I'm going to favor answers that provides a more standardized analog to o.startdate + 7EDIT:After doing some mo...

 java                     3 answers                     8 view
 2018-10-22         Patrick

Checking for valid MySQL result resource

I have this code:$rows = array();$res = mysql_query($someQuery);if(!mysql_errno()) while($row = mysql_fetch_assoc($res)) $rows[] = $row;$someQuery is an arbitrary query that I write in to a form. The mysql_errno catches the case when I write a mysql query with errors in it. But, I just discovered that when I do a "Delete from table_name" query, it of course is not an error, but at the same time the mysql_fetch_assoc fails with a "Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /blah/blah/file.php on line x".I've tried to look f...

 php                     6 answers                     54 view
 2018-10-22         Patrick

Makefile:273: recipe for target 'install' failed make: *** [install] Error 1 in ubuntu16.04 in Docker container

I am using Docker container in which i install ubuntu16.04 , i tried to install setup of openvino toolkit so i got the following error when I Install Paho* MQTT C client libraries by following command given in https://github.com/intel-iot-devkit/people-counterroot@2fe5f8678637:~# cd paho.mqtt.croot@2fe5f8678637:~/paho.mqtt.c# ls -a. CODE_OF_CONDUCT.md .git src.. conanfile.py .gitignore testabout.html CONTRIBUTING.md .gitreview test_packageandroid .cproject LICENSE travis-build.shappveyor....

 docker                     1 answers                     15 view
 2018-10-22         Patrick

Utilising Stripe for ordering products with their Order API and variable shipping

I have been trying to implement Stripe and without having to worry about the shipping costs it's very very simple, I had this code that worked fine:<form action="payment.php" method="POST"> <script src="https://checkout.stripe.com/checkout.js" class="stripe-button" data-key="xxxxxxxxxxxxxxxxxxxxxxxxxxx" data-amount="2500" data-name="some name" data-description="some description" data-label="{{ order.button_name|e }}" data-locale="auto" data-zip-code="true" data-billing-addres...

 php                     1 answers                     85 view
 2018-10-22         Patrick

vagrant plugin vagrant-hostmanager Installation on windows 10

I am trying to set up a testing env after following description https://github.com/OXID-eSales/oxvm_eshopon a clean windows 10 pcWhen I try to install the vagrant hostmanager, it seems that he is installing it sucessfully but when I use vagrant up, it tells me again that the plugin is missing.Terminal:PS C:\projecte\oxvm_eshop> vagrant plugin install vagrant-hostmanagerInstalling the 'vagrant-hostmanager' plugin. This can take a few minutes...Installed the plugin 'vagrant-hostmanager (1.8.9)'!PS C:\projecte\oxvm_eshop> vagrant upPlugin 'vagrant-hostmanager' not found....

 plugins                     1 answers                     97 view
 2018-10-22         Patrick

Can't read Azure configuration settings from Node.js

I'm running a Node.js application in Azure and am trying to get configuration settings like this:var azure = require('azure');azure.RoleEnvironment.getConfigurationSettings(function(error, settings) { if (error) { console.log(error); return; } console.log('Settings: %s', settings);});But the output is always this:{ "code": "ENOENT", "errno": "ENOENT", "syscall": "connect", "fileName": "\\\\.\\pipe\\WindowsAzureRuntime" }I'm running Node.Js within IIS using IISNode using all the latest bits. I also get the same error if I run node manually on the Azure VM (i...

 javascript                     2 answers                     88 view
 2018-10-22         Patrick

Disturbing order of evaluation

When I work with my favorite containers, I tend to chain operations. For instance, in the well-known Erase–remove idiom:v.erase( std::remove_if(v.begin(), v.end(), is_odd), v.end() );From what I know of the order of evaluation, v.end() (on the rhs) might be evaluated before the call to std::remove_if. This is not a problem here since std::remove* only shuffle the vector without changing its end iterator.But it could lead to really surprising constructs, like for instance (demo):#include <iostream>struct Data{ int v; int value() const { return v; }};auto inc(Data...

 c++                     1 answers                     4 view
 2018-10-22         Patrick

android motion events not triggered with drag listener

ProblemSo I have a recycler view populated by card views all with drag listeners attached, the motion events work fine until I set a view to be dragged, so with the line commented out this works, all logs are printed perfectlyholder.handleView.setOnTouchListener(new View.OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { switch (MotionEventCompat.getActionMasked(event)){ case MotionEvent.ACTION_DOWN: Log.d("Adptr" , "ACTION_DOWN"); holder.cardView.setCardElevation(co...

 android                     1 answers                     76 view

Page 1 of 145  |  Show More Pages:  Top Prev Next Last