on-internet

Asterisk AMI no longer allows connection

I have been connecting to Asterisk AMI and things have been fine but suddenly it just stopped receiving connections I suppose. My manager.conf looks like this [general] enabled = yes port = 5038 bindaddr = 0.0.0.0 displayconnects = yes [myusername] secret = mysecret deny=0.0.0.0/0.0.0.0 permit=111.222.333.444/255.255.255.0 read = all write = all Suddenly it just stopped working. I tried to connect to the address 111.222.333.444 with the port 5038 on Telnet using Putty but the connection was refused. Please what might go wrong suddenly?

Join the discussion →

How do I view the size of npm packages?

When I search for packages on NPM, I would like to see package sizes (in KB or MB, etc). NPM doesn’t seem to show this information. How can I determine how much bloat an NPM package will add to my project? Update 2020 (copied from @styfle answer) The "Unpacked Size" (basically Publish Size) is available on the npmjs.com website along with "Total Files". However, this is not recursive meaning that npm install will likely be much bigger because a single package likely depends on many packages (thus Package Phobia is still relevant). There is also a pending RFC for a feature which prints this inf

Join the discussion →

Unable to authentication a user with spring custom filter

I am trying to authenticate a user on login request with username and password comparing from database using jpa but some how the authentication fails and returns 401 error. The request flow is as follows: Request from client side: login: function(data,success, error){ $http.post('auth', data).success(success).error(error); } application.yml is configured to accept request for "auth" as # config context path to "/" by setting an empty string server: contextPath: # JACKSON spring: jackson: serialization: INDENT_OUTPUT: true jwt: header: Authorization secret: mySecret expiration: 604800 route: a

Join the discussion →

How to Sync Mysql into Bigquery in realtime?

Currently I have some script which first deletes the table and upload the table from MySQL to Bigquery. And many time it had failed. Plus it run only once a day. I am looking for some scalable and realtime solution. Your Help will be much appreciated :)

Join the discussion →

Inno Setup - Post Processing

I would like to build an MD5 checksum file of the setup file generated by Inno Setup. I've found the pre-processor and was wondering if there is a way to do some processing once the 'setup' output file has been created. It needs to run at the compile time not during installation.

Join the discussion →

Select 2 empty value in dropdown

I want to display option in my dropdown without value, but select 2 prohibits it. <select name="searchcategory[]" multiple="multiple" class="js-example-basic-multiple"> <option value=''>All Category</option> </select> my select2 js $(".js-example-basic-multiple").select2({ placeholder: "Choose category", });

Join the discussion →

subprocess.Popen and relative directories

I am writing a script to open notepad.exe using subprocess.Popen(): import subprocess command = '%windir%\system32\\notepad.exe' process = subprocess.Popen(command) output = process.communicate() print(output[0]) This throws a FileNotFoundError. Is it possible to change/add to the above code to make it work with relative paths? I did try to run the script from C:\Windows> after moving it there, which again failed. Also set the shell=True, but failed as well. Writing a similar script using os.popen() works ok with relative paths, regardless which directory the script is run from, but as far as

Join the discussion →

Error in curl::curl_fetch_memory(url, handle = handle) : URL using bad/illegal format or missing URL

I have this function that won't run. The command inside of the code works when it is applied on it's own but when I run it in this lapply function it errors out. I have tried updating my Curl libraries etc... No idea why it's happening. library(curl) ##dataframe looks like this as factor list: x = "http://google.com" funk <- function(x) { read_html(x) %>% html_node("title") %>% html_text } df$titles<-lapply(df$urls,funk) Error: 'Error in curl::curl_fetch_memory(url, handle = handle) : URL using bad/illegal format or missing URL ' does not exist in current working directory ('/Users/Home/'). An

Join the discussion →

¿Como visualizar un archivo PDF en el navegador?

Tengo un proyecto en ASP.NET Web API el cual es consumida por una aplicación web en html, tengo un formulario en el cual envió información y un archivo PDF, esto lo realice con formdata, el archivo PDF se guarda en una carpeta en el servidor con la extensión original y un nombre que le asigno, los demás datos los guardo en la base de datos, así como el nombre que le asigne al archivo. Todo esto funciona correctamente. Mi pregunta es cómo puedo visualizar ese archivo que subí al servidor (estoy trabajando de forma local) a través de la aplicación web, y que se muestre en el navegador. He invest

Join the discussion →

How add a a number to a variable in batch

Hey I'm working on a project of mine in batch. yes I know its bad but I'm using it anyways. I was trying to make an updating inventory system when I ran into this problem. I was trying to add a set number E.X 1 to a variable like this: @echo off set var=0 echo I will add these numbers from var+1 set /a var=%var%+1 pause echo var pause what is the problem?

Join the discussion →

Displaying single row of sql query result in view

In my view I'm trying to display just once the user_username at the top of the page,and then all the messages and the message times below. I don't have a problem with the foreach($message as $row) part and that is displaying correctly. However I cannot get the Messages by <?php echo $message['user_username']; ?> to display the name of the message poster. Any help on how I can do this will be greatly appreciated. View <html> <head> <title> View Messages </title> </head> <body> Messages by <?php echo $message['user_username']; ?>: <?php foreach($message as $row){?> <?php echo $row->text;?> <br>

Join the discussion →

PHP | Access to undeclared static property

After trying several attempts at this for some reason i get the error Access to undeclared static property when i try to make an object out my class. My class: final class repo { var $b; /** * @var \Guzzle\Http\Client */ protected $client; function repo($myvar) { static::$b = $myvar; $this->client = $b; } } Me making an object: $myobj = new repo("test");

Join the discussion →

Pass arguments from the command line

I want to pass arguments from the command line, so I had tried the following code, but it throws an error: use strict; use warnings; use Getopt::Long qw(GetOptions); use Getopt::Std; print "raw data:@ARGV\n"; my $site = getopts('bangalore', 'norwood', 'limerick'); if ($site) { print "success"; } else { die "error"; } print "final data:@ARGV \n";

Join the discussion →

Drupal 8 preprocess page

I'm new in Drupal 8 & I have an issue. I need to display a CCK field (custom field) in my theme page page-front.html.twig. As I understand it's impossible to display node variables in a non-node page, so I start to do a preprocess hook. My preprocess looks like this: mythemename.theme <?php function THEME_NAME_preprocess_page(&$vars) { if (isset($vars['node'])) { $node = $vars['node']; if ($node->isset('field_numero_cin') { $field_cin = $node->get('field_numero_cin'); $vars['field_cin'] = $field_image->value(); } } } Unfortunately, when I'm debugging (kint) my variable in page-front.html.twig

Join the discussion →

Failed to read artifact descriptor for org.seleniumhq.selenium:selenium-java:jar:3.0.1

Here is my POM.xml <?xml version="1.0" encoding="UTF-8"?> http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 <groupId>test3</groupId> <artifactId>test3</artifactId> <version>1.0-SNAPSHOT</version> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.12</version> <scope>test</scope> </dependency> <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi</artifactId> <version>3.15</version> </dependency> <dependency> <groupId>org.seleniumhq.selenium</groupId> <artifactId>selenium-java</artifactId> <version>3.0.1</version> </dependency> </dependencies> The depende

Join the discussion →

How can download file in service in android

I want download file from server and i want download this in background such as service. My codes is : public class MainActivity extends AppCompatActivity { Button download; TextView downloadCount; ProgressBar progressBar; Future<File> downloading; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // Enable global Ion logging Ion.getDefault(this).configure().setLogging("ion-sample", Log.DEBUG); setContentView(R.layout.activity_main); download = (Button) findViewById(R.id.download); downloadCount = (TextView) findViewById(R.id.download_count); pr

Join the discussion →

Flexible-date flight search engine with specified weekdays

I would like to search for cheap flights for a week-end out, without specific restrictions on dates or destinations. Is there a flight search engine that allows one to search for all flights leaving from city X to an unspecified/flexible location on an (also unspecified/flexible) Friday evening and returning on the next Sunday?

Join the discussion →

ESP8266: How to send TCP messages using AT+CIPSEND command

I am experimenting with Arduino and ESP8266 module, and now I am trying to send some sensor data to a TCP server. For this purposes I am using AT+CIPSTART command (to establish a TCP connection) and AT+CIPSEND to send the data. If I am testing it using Serial Monitor, it works fine. After entering CIPSEND command I can write some text in a terminal and this message/text will be sent to the TCP server. When I am trying to make it inside Arduino sketch, then it sends an empty message. The connection works, but I do not see any data. How can I send a message text (msg) with my TCP packet? Here is

Join the discussion →

Serialize parquet data with C#

Is there a way to serialize data in Apache Parquet format using C#, I can't find any implementation of that. In the oficial Parquet docs it is said that "Thrift can be also code-genned into any other thrift-supported language." but I'm not sure what this actually means. Thanks

Join the discussion →

WHERE clause from controller method's final query is added to CodeIgniter's session UPDATE query and causes query failure [closed]

In my CodeIgniter application, I am interacting with my database from the controller layer. I collect user submission and database data before loading my view file. The problem is that the last query builder script contains a WHERE clause condition that is mysteriously leaking into a session-related UPDATE query executed outside of my controller method. I don't understand why this is happening or how to fix it. function student_feeConfig() { // ...irrelevant portion of code if ($class_id != -1) { $this->db->select('enroll.group_id, student_feeConfig.*'); $this->db->from('enroll'); $this->db->j

Join the discussion →

How to specify sql dialect when creating spark dataframe from JDBC?

I'm having an issue reading data via custom JDBC with Spark. How would I go about overriding the SQL dialect inferred via JDBC URL? The database in question is Vitess (https://github.com/youtube/vitess) which runs a MySql variant, so I want to specify a mysql dialect. The JDBC URL begins with jdbc:vitess// Otherwise, the DataFrameReader is inferring a default dialect which uses """ as a quote identifier. As a result, queries via spark.read.jdbc get sent as select 'id', 'col2', col3', 'etc' from table instead of select id, col2, col3, etc from table ...which returns the string constants instead

Join the discussion →

double vs. double* in C++

I'm developing a piece of code which makes scientific calculation, and as a result I use extensive use of double variables. These variables travel from function to function, but most of them are never modified and hence defined as const in function signatures. I have used double* in function signatures, but then I started to wonder that whether it's better to use double instead because: double* and double are same size, 8 bytes in C++. When I send in double*, I need another fetch operation in the function. When using the variables in const fashion, are there any valid reasons to use double* in

Join the discussion →

Diferença entre Vast x VPAID [fechada]

Estou tentando ver mas não consegui entender qual seria a diferença entre esses dois Vast x VPAID eu comprei um plugin para utilizar o DFP do google com o Vast, mas qual seria a diferença dele para o VPAID?

Join the discussion →

Execute function with multiple values in single parameter

I have SQL function which takes parameter as BIGINT like below: FUNCTION [dbo].[fn_doc] ( @DocID bigint ) I want to pass multiple doc ID and want to get results. For which I'm doing like this: declare @DocID bigint SET @DocID = (2949146,2949148,2949149,14016926,14025278,14016928,14016928,14025280,14025280) select * from [fn_doc] (@DocID) My question is, how to execute a function with multiple values to single parameter in this case?

Join the discussion →

opencv3.1 on windows. object has no attribute 'MinDistancePredictCollector'

I'm using OpenCV3.1 with python27 on Windows 7 for face recognition. I compile the OpenCV 3.1 and the opencv_contrib modules using CMAKE and VS Express 2012 with all teh required stuff. Until I reach to the last part, which is for the collector to calculate the matching picture to the database or more specifically this line: collector = cv2.face.MinDistancePredictCollector() and outputting this error: AttributeError: 'module' object has no attribute 'MinDistancePredictCollector'

Join the discussion →

scikit-learn pipeline model predicting same results for all input

In the program, I am scanning a number of brain samples taken in a time series of 40 x 64 x 64 images every 2.5 seconds. The number of 'voxels' (3D pixels) in each image is thus ~ 168,000 ish (40 * 64 * 64), each of which is a 'feature' for an image sample. I thought of using Recursive Feature Elimination (RFE). Then follow this up with principal component analysis (PCA) because of the ridiculously high n to perform dimensionality reduction. There are nine classes to predict. Thus a multi-class classification problem. Starting with RFE: estimator = SVC(kernel='linear') rfe = RFE(estimator,n_fe

Join the discussion →

Check if the unique constraint exists and drop it using liquibase

I have a changeset wherein I initially check if the unique constraint exists and then if it does it will drop the constraint. <changeSet author="loren" id="DROP_UNIQUE_CONSTRAINT_RULEPRIORITY_ORACLE_v1" dbms="oracle"> <preConditions onFail="MARK_RAN"> <sqlCheck expectedResult="1"> SELECT COUNT(*) FROM USER_CONSTRAINTS WHERE CONSTRAINT_NAME='UC_RULES_PRIORITY' </sqlCheck> </preConditions> <dropUniqueConstraint constraintName="UC_RULES_PRIORITY" schemaName="${main.schema}" tableName="RULES"/> </changeSet> The issue with this is it does not seem to pass the precondition. It always says MARK_RAN m

Join the discussion →

Why does following program shows error Q and D are not declared?

I wrote this program for an FIR filter and used D flip flop for delay. I needed to implement filter with Impulse response h(n) = {1, -1} Despite various efforts, it shows the same error that D and Q aren't defined/declared properly. There was another error saying Q has been illegally redeclared; for that, I deleted the line where I defined Q output register in the second module. Please point out the error and tell me how to fix it. module firfilter (dout, din, clock); input din, clock; output dout; parameter b0 = 1'd1; parameter b1 = 1'd1; assign dout = b0 - b1 * Q; always @(posedge clock) D <

Join the discussion →
Older stories