on-internet

Plotting a sphere mesh with Matplotlib

In Matplotlib, I want to draw a sphere with a mesh on its surface, divided into 30 degrees steps in spherical coordinates. The code: from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt import numpy as np fig = plt.figure() ax = fig.add_subplot(111, projection='3d') u = np.linspace(0, 2 * np.pi, 13) v = np.linspace(0, np.pi, 7) x = 10 * np.outer(np.cos(u), np.sin(v)) y = 10 * np.outer(np.sin(u), np.sin(v)) z = 10 * np.outer(np.ones(np.size(u)), np.cos(v)) ax.plot_surface(x, y, z, rstride=1, cstride=1, color='w', shade=0) plt.show() Produces the figure: However, I want the co

Join the discussion →

We're sorry, but something went wrong. If you are the application owner check the logs for more information

In localhost my projects works perfectly but every time I deploy to heroku I receive Something went wrong..... I also ran Heroku run rake db:migrate. Any idea what is going on here? 2015-11-01T23:27:52.203020+00:00 app[web.1]: bin/rails:8:in `require' 2015-11-01T23:27:52.203020+00:00 app[web.1]: bin/rails:8:in `<main>' 2015-11-01T23:27:52.203072+00:00 app[web.1]: [2015-11-01 23:27:52] INFO going to shutdown ... 2015-11-01T23:27:52.203127+00:00 app[web.1]: Exiting 2015-11-01T23:27:52.532296+00:00 heroku[web.1]: Starting process with command `bin/rails server -p 41390 -e production` 2015-11-01T2

Join the discussion →

How to turn off slf4j logging

I'm using third par .jar files in my project. When I start my application my standard output is full of log messages. I try to show some informaion to user, but now it's impossible. How can I disable logging?

Join the discussion →

Is there a directory, list, or other way to search for ocean crossing cruises from all cruise lines?

As an alternative to flying, I'm considering to cruise from the east coast of Australia or somewhere in New Zealand to anywhere in North America. The dates are flexible, but my preference is to depart in December 2016 or January 2017 and routes with island stops are superior. Most cruise line sites are pretty bad for searching and they don't really have an easy way to search for just ocean crossing cruises and each line is a bit different. Is there a directory, list, or other way to search all cruises departing around those dates across all cruise lines?

Join the discussion →

How to read value from daterangepicker?

I have this daterangepicker runs on my local PHP site. Here is the code for HTML part <form role="form" class="form-inline" method="post" action=""> <div id="reportrange" class="form-control"> <i class="fa fa-calendar"></i> <span></span> <b class="caret"></b> </div> <button class="btn btn-white" type="submit">Search</button> </form> Javascript part: $('input[name="daterange"]').daterangepicker(); $('#reportrange span').html(moment().subtract(29, 'days').format('MMMM D, YYYY') + ' - ' + moment().format('MMMM D, YYYY')); $('#reportrange').daterangepicker({ autoApply: true, format: 'MM/DD/YYYY',

Join the discussion →

How to execute .cmd file on a remote machine using WMI?

I need to execute a .cmd batch file on a remote machine using WMIC. I cannot use SSH or PowerShell. I tried executing the code below and following was printed on console: C:\>WMIC /node:"remote-server01" process call create "cmd.exe /c C:\test.cmd" Executing (Win32_Process)->Create() Method execution successful. Out Parameters: instance of __PARAMETERS { ReturnValue = 0; }; However, nothing is executed on the remote machine.

Join the discussion →

Expandable list view with nested json parsing

I have a working on a project in which we have to parse a nested json array and display it in a expandable listview with 2 level, now I have get only first item of group and their child item. I am new to Android development please help me achieve this. This is my code: import java.util.ArrayList; import java.util.HashMap; import java.util.List; import org.apache.http.NameValuePair; import org.apache.http.message.BasicNameValuePair; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import android.app.Activity; import android.app.ProgressDialog; import android

Join the discussion →

PySpark and PCA: How can I extract the eigenvectors of this PCA? How can I calculate how much variance they are explaining?

I am reducing the dimensionality of a Spark DataFrame with the PCA model with PySpark (using the spark ml library) as follows: pca = PCA(k=3, inputCol="features", outputCol="pca_features") model = pca.fit(data) where data is a Spark DataFrame with one column labeled features which is a DenseVector of three dimensions: data.take(1) Row(features=DenseVector([0.4536,-0.43218, 0.9876]), label=u'class1') After fitting, I transform the data: transformed = model.transform(data) transformed.first() Row(features=DenseVector([0.4536,-0.43218, 0.9876]), label=u'class1', pca_features=DenseVector([-0.33256

Join the discussion →

Move file only if it exists

I want to use mv to rename a file: mv src.txt dest.txt If the file doesn't exist, I get an error: mv: cannot stat ‘src.txt’: No such file or directory How do I use mv only if the file already exists? I don't want to redirect stderr to dev/null as I'd like to keep any other errors that occur

Join the discussion →

WebSocket connection to 'ws://..' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED

Pulling my hair searching from last 4 hours this simple code for socket connection and getting error. I have changed port as well but nothing works. //create a new WebSocket object. var wsUri = "ws://localhost:9000/demo/server.php"; websocket = new WebSocket(wsUri); websocket.onopen = function(ev) { // connection is open $('#message_box').append("<div class=\"system_msg\">Connected!</div>"); //notify user } $('#send-btn').click(function(){ //use clicks message send button var mymessage = $('#message').val(); //get message text var myname = $('#name').val(); //get user name if(myname == ""){ //

Join the discussion →

Does a high-level language support all of the assembly languages related to all hardware? [closed]

I know machine language and assembly are specific to the hardware and different hardware involves different machine and assembly code, so Higher-level languages were invented to solve of these problems. It might be very basic but i want to know, should a high-level language be translated to each assembly language to support it's related hardware?

Join the discussion →

PostgreSQL query with function gen_random_uuid() not working on Windows

I have the following query for creating a table, CREATE TABLE IF NOT EXISTS company ( id uuid CONSTRAINT companyid PRIMARY KEY DEFAULT gen_random_uuid(), name varchar(128) NOT NULL, db_uri varchar(255) NOT NULL, c_uri varchar(255) NOT NULL, date_c timestamp DEFAULT now(), date_m timestamp DEFAULT now() ) WITH (fillfactor=90); I am getting the following error when I run it through pgAdminIII. ERROR: function gen_random_uuid() does not exist HINT: No function matches the given name and argument types. You might need to add explicit type casts. ********** Error ********** ERROR: function gen_rand

Join the discussion →

HLS stream not working on Apple devices

I have a live RTSP stream that i have managed to transcode to HLS via VLC. Now it works perfect on Android and on desktop browsers (via flash). But not on Apple (i can test it on iPad and desktop Safari on my virtual machine). I can see the player but when i press the 'play' button all i see is a black rectangle inside the player. On desktop Safari there is also a text 'Loading...' near the play/pause button and nothing else happens. My HTML: <video id="player" controls style="width:100%; height:100%"> <source src="http://178.79.164.114/playlist.m3u8" type="application/x-mpegURL"> </video> The

Join the discussion →

0xC000041D: An unhandled exception was encountered during a user callback

I am encountering the error '0xC000041D: An unhandled exception was encountered during a user callback', when I run the OpenGL code. Th debugger indicates that the error occurs here: The function where the error occurs and calling functions are given below. Could you please help me identify the cause for this error. double maxDistance(Point_2D* bez, int deg) { int i; double maxheight; double height[30]; // Computing baseline vector and its magnitude Point_2D baselineVector; baselineVector.x = bez[deg].x - bez[0].x; baselineVector.y = bez[deg].y - bez[0].y; double baselineMag = sqrt((baselineVe

Join the discussion →

com.thoughtworks.xstream.converters.ConversionException while running Jmeter from Jenkins shell

While running Jmeter jmx script from Jenkins command line I am getting the below error. Error in NonGUIDriver java.lang.IllegalArgumentException: Problem loading XML from:'/Users/msn/apache-jmeter-2.13/bin/testMsn.jmx', conversion error com.thoughtworks.xstream.converters.ConversionException: org/apache/commons/lang3/CharUtils : org/apache/commons/lang3/CharUtils I have all the plug-in installed in my Jmeter/lib/ext. Can someone help me point out which jar is missing to resolve this issue Building in workspace /Users/Shared/Jenkins/Home/jobs/Jmeter-First/workspace [workspace] $ /bin/sh -xe /Us

Join the discussion →

SAP GUI script opens an Excel window and I can't stop it

I'm trying to automate SAP GUI export to an Excel file, which in turn is then used by another Excel file with some VBA code to automate filtering and formatting the data. I've got it all running, except for one (seemingly minor) problem: SAP GUI always opens the exported Excel file automatically and there seems to be no way of stopping this as it seems to happen AFTER the subroutines to import the Data in Excel VBA have finished (they contain the SAP GUI script). If I only run the sap_export subroutine, then the Excel file opens, which is simply annoying. But if I run refresh_sap(), which call

Join the discussion →

Spark - UbuntuVM - insufficient memory for the Java Runtime Environment

I'm trying to install Spark1.5.1 on Ubuntu14.04 VM. After un-tarring the file, I changed the directory to the extracted folder and executed the command "./bin/pyspark" which should fire up the pyspark shell. But I got an error message as follows: [ OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x00000000c5550000, 715849728, 0) failed; error='Cannot allocate memory' (errno=12) There is insufficient memory for the Java Runtime Environment to continue. Native memory allocation (malloc) failed to allocate 715849728 bytes for committing reserved memory. An error report file with more in

Join the discussion →

Mean calculation in pandas, excluding zeros

Is there a direct way to calculate the mean of a dataframe column in pandas, but not taking into account data that has zero as a value? Like a parameter inside the .mean() function? I was currently doing it like this: x = df[df[A]!=0] x.mean()

Join the discussion →

Run Chrome kiosk mode in windows 10 assigned access

It is a good news that Windows 10 assigned access support running Desktop Application(Win 8.1 only support running universal apps). I want to run Chrome's kiosk mode using --kiosk in command line. The bottom of this article have a tutorial. https://technet.microsoft.com/en-us/library/mt219051(v=vs.85).aspx However, I am very new to Powershell. Can anyone explain how to launch Chrome's kiosk mode by powershell? My command line is "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --kiosk http://my.website.com how to use the script at the bottom of the article? Thanks.

Join the discussion →

Error with X11 on R

I tried the following command in RStudio version Version 0.99.441 in Linux system: X11(width=800,height=600,pointsize=12) But it gives me the error: No protocol specified Error in .External2(C_X11, d$display, d$width, d$height, d$pointsize, : unable to start device X11cairo In addition: Warning message: In X11(width = 800, height = 600, pointsize = 12) : unable to open connection to X11 display '' I am not able to find out the problem here. ADDITION capabilities() It gives the following output: jpeg png tiff tcltk X11 aqua http/ftp sockets libxml TRUE TRUE TRUE TRUE FALSE FALSE TRUE TRUE TRUE

Join the discussion →

How can I generate a unique random number at each row of record?

I'm using SQL Server 2000. I'd like to generate random number without repetition at each row. However, my code is not working. I tried many times but I cannot fix the repetition problem. My code as below: I used "case" to handle duplicate number but it does not work. Can anyone help me? DECLARE @index INT ,@ran_no INT ,@counter INT ,@i INT SET @i = 1 WHILE @i <= 18 BEGIN SELECT @index = count(basket_seq) FROM dbo.test WHERE basket_seq = @i AND flag = 'left' BEGIN UPDATE dbo.test SET @ran_no = convert(INT, 1 + @index * RAND(CHECKSUM(NEWID()))) ,@ran_no = ( CASE WHEN convert(INT, 1 + @index * RA

Join the discussion →

How to test the method that reads the data from the excel file in java?

The above picture shows the excel file containing the Facebook data. The class FacebookDataExtraction reads the data from the Excel file and stores the data as list of row objects as shown in the code. I have made use of the config.properties file to get the file path. The contents of config.properties file are: FILE_NAME=D:/Refreshed_data_daily/all_hue_posts_in_excel.xlsx. public class FacebookDataExtraction { //private static final String FILE_NAME="D:/Refreshed_data_daily/all_hue_posts_in_excel.xlsx"; private static final String SHEET_NAME="nextv54plus_actions"; XSSFWorkbook workbook; publi

Join the discussion →

How to retrieve all kinds of dates and temporal values from text

I wanted to retrieve dates and other temporal entities from a set of Strings. Can this be done without parsing the string for dates in JAVA as most parsers deal with a limited scope of input patterns. But input is a manual entry which here and hence ambiguous. Inputs can be like: 12th Sep |mid-March |12.September.2013 Sep 12th |12th September| 2013 Sept 13 |12th, September |12th,Feb,2013 I've gone through many answers on finding date in Java but most of them don't deal with such a huge scope of input patterns. I've tried using SimpleDateFormat class and using some parse() functions to check if

Join the discussion →

Request Timed out with Code=-1001_kCFStreamErrorCodeKey=-2102

Sometimes network request from my app gets stuck, And I get the following error after a while, failed with error: Error Domain=NSURLErrorDomain Code=-1001 "The request timed out."UserInfo={NSUnderlyingError=0x1390937f0 {Error Domain=kCFErrorDomainCFNetwork Code=-1001 "(null)" UserInfo={_kCFStreamErrorCodeKey=-2102, _kCFStreamErrorDomainKey=4}}, NSErrorFailingURLStringKey=https://apis.xyz.xyz.com, NSErrorFailingURLKey=https://apis.xyz.xyz.com, _kCFStreamErrorDomainKey=4, _kCFStreamErrorCodeKey=-2102, NSLocalizedDescription=The request timed out.} Any request I make after this, The same sent req

Join the discussion →

How to make a Materialize Jumbotron

I am trying to build a sign up page like this one Sign up page I checked the source code, its using angular material design. So couldn't figure out on how to do this using Matrialize.css itself. It is similar to a Jumbotron in bootstrap. But I guess its implementation is not as simple as it was in bootstrap. I suppose that this is done using cards in Materialize. But I am not being able to produce or replicate the same thing. Can anyone shed light on how to use cards properly in Materialize. Thank You

Join the discussion →

Erlang machine stopped instantly (distribution name conflict?). The service is not restarted as OnFail is set to ignore

I am using RabbitMQ. For some reason the rabbitMQ service stops as soon as you start it. I saw following error in the event log: RabbitMQ: Erlang machine stopped instantly (distribution name conflict?). The service is not restarted as OnFail is set to ignore. Someone told me to run this command: erl -sname rabbit This command generates following output: {(no error logger present")i neirtr otre: r"mEirnraotri nign ipnr odcoe_sbso o< t0".,2{.b0a>d awrigt,h[ {eexrilt_p rviaml_uleo:a d{ebra,dcahregc,k[_{feirlle__pr reismu_llto,a3d,e[r{,fcihleec,k"_efrill_e_prreismu_llto,a3d,e[r{.feirlle",}\,"{e lr

Join the discussion →

S3 Cross Account Notifications

It is possible to send S3 events from Account A to an SQS queue in Account B. But, the only way I have been able to achieve this is by opening the permissions for the sendMessage action in SQS to allow everyone access. Is it possible to configure S3 events to sendMessage to a different account with some permission restrictions in place on the SQS queue? For example, if I try to restrict access to a specific account (e.g. 123456789012, I receive an error in the S3 console when I try to save the event: Unable to validate the following destination configurations : Permissions on the destination q

Join the discussion →

How to perform a range query over AWS dynamoDB

I have a AWS DynamoDB table storing books information, the hash key is book id. There is an attribute for book price. Now I want to perform a query to return all the books whose price is lower than a certain value. How to do this efficiently, without scanning the whole table? The query on secondary-index seems only could return a set of entries with the index being a certain value, so I am confused about how to perform a range query efficiently. Thank you very much!

Join the discussion →

The binding status was "DT_NTEXT". The data flow column type is "DBBINDSTATUS_UNSUPPORTEDCONVERSION"

I have the following query in Access: SELECT Field1, Field2, Field3, "2015" As TestYear FROM Table1 I use this query in SQL Server Import/Export tool to get data from Access database into SQL Server database. I keep getting an error: "(SQL Server Import and Export Wizard) Error 0xc002f446: Data Flow Task 1: An error occurred while setting up a binding for the "TestYear" column. The binding status was "DT_NTEXT". The data flow column type is "DBBINDSTATUS_UNSUPPORTEDCONVERSION". The conversion from the OLE DB type of "DBTYPE_IUNKNOWN" to the destination column type of "DBTYPE_WVARCHAR" might no

Join the discussion →
Older stories