2018-10-22         Devin

Having problems using haml and rails3

After installing rails3, I'm experiencing problems when trying to use haml with it.I have the updated gem installed, and after rails PROJECT_NAME , I did haml --rails in its root.It apparently had worked fine, since I have haml folder inside plugins, init.rb, as expected.But when I try to rake, or rails server, I get:rake aborted!no such file to load -- hamlWith --trace I get this:** Invoke default (first_time)** Invoke test (first_time)** Execute test** Invoke test:units (first_time)** Invoke db:test:prepare (first_time)** Invoke db:abort_if_pending_migrations (first_time)...

 ruby-on-rails                     2 answers                     99 view
 2018-10-22         Devin

how to use json rpc with curl on java

i set the private ethereum on my local computer and run asgeth --bootnodes="enode://b115ff8b97f67a6bd8294a4ea277930bf7825e755705e809442885aba85e397313e46528fb662a3828cd4356f600c10599b77822ebd192199b6e5b8cfdb530c4@127.0.0.1:30303" --networkid 15 console --datadir "private-data" --rpcport "8545" --rpc --rpccorsdomain "*" --rpcapi "eth,web3,personal" --rpcaddr 192.168.44.114and then i connect here with the remote computer's blockchain nodesi want to use ethereum json rpc with curl on java . i coded it as import java.io.BufferedReader;import java.io.InputStream;import java.io.I...

 curl                     1 answers                     7 view
 2018-10-22         Devin

My .yaml is not redirecting properly

app.yamlapplication: classscheduler9000version: 1runtime: pythonapi_version: 1handlers: - url: /static static_dir: static- url: /images static_dir: static/images- url: /stylesheets static_dir: static/stylesheets- url: /users\.html script: main.py- url: /.* script: login.pymain.pyimport hashlibfrom google.appengine.api import usersfrom google.appengine.ext import webappfrom google.appengine.ext.webapp.util import run_wsgi_appfrom google.appengine.ext import dbclass AccountHolder(db.Model): ...class MainPage(webapp.RequestHandler): def get(self): ...cl...

 python                     1 answers                     55 view
 2018-10-22         Devin

The channel provided must be a voice channel. error with move_member

import discordfrom discord.ext import commandsfrom discord.ext.commands import Botimport asyncioimport timebot = commands.Bot(command_prefix='$')@bot.eventasync def on_ready():print ("Ready")@bot.command(pass_context=True)async def Move(ctx): #channel to move to '414543063575429131' #user to move '192361974053470208' await bot.move_member('192361974053470208', '414543063575429131') print("done")bot.run("token_here")This is my code but I when I try to move the user it gives me the error "The channel provided must be a voice channel." I know the bot works because ...

 python                     1 answers                     8 view
 2018-10-22         Devin

C++ inheritance size with empty derived class object

#include<iostream>using namespace std;class base { int arr[10];};class b1: public base { };class b2: public base { };class derived: public b1, public b2 {};int main(void){ cout << sizeof(derived); return 0;}Since in c++ by default the members of class are private why does the sizeof derived class is 80. The access-specifier private is only related to the accessibility of the members of the base class in the derived class. The derived class contains the sub-objects of the classes it derives from. In this case, it contains b1 and b2 sub-objects. So its ...

 c++                     3 answers                     83 view
 2018-10-22         Devin

New directory or file is not getting created on running the scraper (scrapy) through cmd

this is the main filethis is the settings filepipelines.py fileitems.py fileWhenever I run the scraper, it is supposed to create a json file. The scraper works fine, but it just doesn't save the contents to the file. You need to define FEED_URI like below in settings.pyFEED_URI = 'file:///E:/python/venv/demo/temp/%(Name)s-%(time)s.json'%(Name)s will be replaced by the name of the spider and %(time)s will be replaced by the time when the crawler was run thus creating a new file every time. [XXX]

 python                     1 answers                     91 view
 2018-10-22         Devin

Automatically quits

I'm trying to write a snake game in python but my game automatically quites after inputing out of boundaries code.I don't understand how the coordinates of my rect are >= than the width of my game, because in the screen they are not. I think that's what happens because the game automatically quits.I'll post my code, below, to be even more clearerimport pygamefrom random import randintpygame.init()black = (0, 0, 0)white = (255, 255, 255)red = (255, 0, 0)class Game(): width, height = 800, 600 screen = pygame.display.set_mode((width, height)) pygame.display.set_captio...

 pygame                     1 answers                     85 view
 2018-10-22         Devin

Average Analytics Function On GA360 Visit ID for LatencyTracking

Looking to get the average latencyTracking for a visitid out of our GA 360 export. Setup the following query but getting the following error and I'm not sure why since all these are all aggregate functions: SELECT list expression references hits.latencyTracking.serverResponseTime which is neither grouped nor aggregated at [3:5]select TIMESTAMP_SECONDS(visitStartTime) as visitStartTime,AVG(hits.latencyTracking.serverResponseTime) OVER (PARTITION BY visitid) as avgServerResponseTime,AVG(hits.latencyTracking.serverConnectionTime) OVER (PARTITION BY visitid) as avgServerConnec...

 google-analytics                     2 answers                     64 view
 2018-10-22         Devin

DB connection fails (System.Data.Sqlclient.SqlException)

I am programming a Weatherstation which gets the data from an API.This works fine, but I want to store it in a database to draw a graph with it.But my code does not seem to work. I tried debugging it and it fails on the line where I want to open the database. It runs through the line where I create the DB. These are the failing lines:databaseCon = new SqlConnection(@"Data Source=(LocalDB)\v10.0;AttachDbFilename=C:\Users\JeroenLaptop\Desktop\Eindopdrachten\WeatherStation\Eindopdracht\Weather.mdf;Integrated Security=True;");databaseCon.Open();Error message in the console:A fi...

 c#                     3 answers                     28 view
 2018-10-22         Devin

Spark only working with python 2

Beginner to Spark here.uname -aLinux debian 3.2.0-4-amd64 #1 SMP Debian 3.2.82-1 x86_64 GNU/LinuxI've downloaded the default Spark at http://spark.apache.org/downloads.htmlI want to use it with Python3.I've added followings lines to my .bashrc:export SPRK_HOME=/home/rictus/spark-2.0.2-bin-hadoop2.7export PATH=$SPARK_HOME/bin:$PATHexport PYSPARK_PYTHON=python3And just to test, I've launched python examples at /home/rictus/spark-2.0.2-bin-hadoop2.7/examples/src/main/pythonusing following command lines . /home/rictus/.bashrccd /home/rictus/spark-2.0.2-bin-hadoop2.7/example...

 linux                     1 answers                     45 view
 2018-10-22         Devin

How to resolve System.Net.Http.WinHttpException: A connection with the server could not be established?

In my .Net core API project, when calling another API (which is stopped), I'm getting below error. System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.Http.WinHttpException: A connection with the server could not be establishedInstead of getting this error, I think it should return status code 503 (service unavailable) or 404 (not found), but I'm getting above exception. Please advice how to resolve this? My code is:HttpClient httpClient = new HttpClient();httpClient.BaseAddress = new Uri("apiBaseUrl");HttpResponseMessage respo...

 c#                     1 answers                     29 view
 2018-10-22         Devin

Did you maybe forget to add a "use" statement for this annotation?

Exception thrown when handling an exception (Symfony\Component\Config\Exception\FileLoaderLoadException: [Semantical Error] The annotation "@Roote" in method App\Controller\BlogController::show() was never imported. Did you maybe forget to add a "use" statement for this annotation? in C:\Users\younes\Desktop\demo\config/routes../../src/Controller/ (which is being imported from "C:\Users\younes\Desktop\demo\config/routes/annotations.yaml"). Make sure annotations are installed and enabled.)the image link down Change your annotation:@RooteTo:@Route [XXX]

 symfony                     1 answers                     27 view
 2018-10-22         Devin

Why odata parameters are not working in office graph to get Planner Taks?

I'm trying to get my tasks on Planner using beta/tasks but I am having trouble trying to add filters, I have tried the following structure:https://graph.microsoft.com/beta/me/tasks?$filter=percentComplete eq 100ORhttps://graph.microsoft.com/beta/tasks?$filter=assignedTo eq 'me' and percentComplete eq 100but the results are always the task assigned to me, ignoring the part about the percent completed and bringing me all.I would like your help to get the right request or to know if this filter is not supported.Thanks! The tasks APIs does not yet support filtering. It's a ...

 sharepoint-online                     1 answers                     53 view
 2018-10-22         Devin

How to make active services highly available?

I know that with Network Load Balancing and Failover Clusteringwe can make passive services highly available. But what about active apps?Example: One of my apps retrieves some content from a external resource in a fixed interval. I have imagined the following scenarios:Run it in a single machine. Problem: if this instance falls, the content won't be retrievedRun it in each machine of the cluster. Problem: the content will be retrieved multiple timesHave it in each machine of the cluster, but run it only in one of them. Each instance will have to check some sort of common re...

 .net                     6 answers                     50 view
 2018-10-22         Devin

SQL duplicate counting headache

I have a problem that I’m not sure how to overcome and would really appreciate some direction.Example dataDevice Project statusa111 101 Readya222 102 Finisheda333 103 Readya444 104 Readya555 105 Readya111 106 Starteda111 107 Readya555 108 StartedI’m looking for a way to count the number of devices at ‘Ready’ status. However, when it comes to ‘Ready’ I only want to count it once AND don’t count it if that device has a status of anything other than ‘Ready’ in another projectLogicIf ready in one or multiple projects ...

 sql                     4 answers                     28 view
 2018-10-22         Devin

Parsing JSON, data turns Nil in API Service Using Alamofire

I was about to get data from API, when I tried to print the response from the API, it printed successfully, and when I tried to print the data from an Object, it also printed successfully, but when I checked the variable attendees in my APIService, the value is always nil,that's why when passing the value in UI it also turns into nil. How can I get the data from JSON to reflect to attendess in Api Service. I am too puzzled regarding this. Please help me. Thank you.getParticipant Function in API Service func getParticipants(passcode: String, participan...

 ios                     1 answers                     76 view

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