Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x

Programming Languages-Other

19K

Solutions

19K

Contributors

A programming language is a formal constructed language designed to communicate instructions to a machine, particularly a computer. Thousands of different programming languages have been created, mainly in the computer field, and many more still are being created every year. The description of a programming language is usually split into the two components of syntax (form) and semantics (meaning). Some languages are defined by a specification document (for example, the C programming language is specified by an ISO Standard), while other languages (such as Perl) have a dominant implementation that is treated as a reference. Some languages have both, with the basic language defined by a standard and extensions taken from the dominant implementation being common.

Share tech news, updates, or what's on your mind.

Sign up to Post

Hi, so I've got an Ionic 3 app which has a native camera plugin and onesignal plugin as well for notifications.

The native camera plugin works fine in Ionic View or DevApp, and onesignal works when build it to an APK and run it natively on my Android phone.

However, when I use an emulator to run it, even on IOS, it comes up with cordova_not_available. And even the cameras don't work. i run the command

ionic cordova run android or ionic cordova run ios

Emulator shows up but the issue is that cordova doesn't seem to be compiled in. Thus causing cordova plugins to fail.

What can possible be the issue? I've removed all the plugins and android/ios platform, re-installed an still the same.

It's kind of difficult to develop the OneSignal notification when I can't run it with the emulator.

Anyone who has come across this, please advice.
0
Independent Software Vendors: We Want Your Opinion
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Im trying to do a transfers but they are all pending but Eth never leaves my wallet.
They are all under SIGNER and local transactions.

Im not sure did they even leave my computer?
If I go to TxQueue Viewer I see this
Parity.JPG
Can anyone tell me whats is wrong?
0
I have an application which has a token set to officially expire after 30 minutes. If inactive at the 20- minute mark, it looks back 5 minutes for activity. If none exists, it kills the session. The majority of the users do work in the first 10 minutes and usually tend to other tasks. They are frustrated with our settings and are asking us to check back farther than 5 minutes and the 20-minute mark.

What makes sense to do here in accordance with best practice?
0
We have 4 RDS servers, and 1 RDS Gateway Server which is also the Broker. The 4 Session Host servers is divided into 2  Sessions Collections. When a user RDP into the Gateway he is getting redirected to the Wrong Session Collection.

I have search the internet and can't find a proper explanation on how to broker decide to which Session Collection to send the client. I thought it was based on the group you add when creating the Session collection.

Please any help on this will be much appreciated. The outcome is to have say User Group A to always go to Session Collection A and then User Group B to go to Session Collection B.
0
hi,
any simple end to end application on basic authentication using tomcat and jsp.

please advise
0
I want to create a program in Prolog that reads in a user input and finds a synonym for the words that the enter.

For example, if they entered
?- : [i,like,walking] 

Open in new window

, the program would change it to
[i,love,walking].

Open in new window


I want to do this with an input predicate like...

input:-
    read(X),
    synonym(X),
    output(X).

synonym(likes,[loves,adores]).

output(X):-
    write(X).

Open in new window


I know what I want to do, but I don't know how I would go about doing it.
Any help would be much appreciated.
0
I have a table of data  The table contains data that I need to calculate the distance between two points,. I have the  Latitude, and Longitude of each location  I have a formula that works  well in excel but it is  time consuming as there are  thousands of records to check.   the data looks like the following

table: tbldata
fields  used:  ID(datatype autonumber/integer), LS (datatype text) , Lat(datatype long), Log(datatype Long), status(datatype text),

What is needed is a  way to create a new table,  in the original table are three types of records.
active, pending , and closed  records.

I need  to know the distance between each active record and all other active, pending, and closed records.

the final table  that would be created would look like this.

tblnewdata:  TargetID, TargetLS, TargetLat, TargetLog, CheckID, CheckLS, CheckLat, CheckLog, Distance

the formula I used in excel was as follows.

=6371*ACOS(COS(RADIANS(90-D7))*COS(RADIANS(90-D8))+SIN(RADIANS(90-D7))*SIN(RADIANS(90-D8))*COS(RADIANS(E7-E8)))/1.609

D7 is the Target Latitude
D8 is the Check Latitude
E7 is the Target Longitude
E8 is the CheckLongitude

I had problems running that equation in VBA  it seemed to have trouble with Radians, the other trig elements seem to be fine ie. Acos, Cos, Sin but I did not get it to work yet.

I tried to place the  lats and log in the formula and created a button to run the equation but, it didn't work.

from what I researched it is a nested…
0
The following example makes use of JSONObject and JSONArray where JSONObject is a java.util.Map and JSONArray is a java.util.List, so you can access them with standard operations of Map or List.

import org.json.simple.JSONObject;
import org.json.simple.JSONArray;
import org.json.simple.parser.ParseException;
import org.json.simple.parser.JSONParser;

class JsonDecodeDemo {

   public static void main(String[] args){
	
      JSONParser parser = new JSONParser();
      String s = "[0,{\"1\":{\"2\":{\"3\":{\"4\":[5,{\"6\":7}]}}}}]";
		
      try{
         Object obj = parser.parse(s);
         JSONArray array = (JSONArray)obj;
			
         System.out.println("The 2nd element of array");
         System.out.println(array.get(1));
         System.out.println();

         JSONObject obj2 = (JSONObject)array.get(1);
         System.out.println("Field \"1\"");
         System.out.println(obj2.get("1"));    

         s = "{}";
         obj = parser.parse(s);
         System.out.println(obj);

         s = "[5,]";
         obj = parser.parse(s);
         System.out.println(obj);

         s = "[5,,2]";
         obj = parser.parse(s);
         System.out.println(obj);
      }catch(ParseException pe){
		
         System.out.println("position: " + pe.getPosition());
         System.out.println(pe);
      }
   }
}
On compiling and executing the above program, the following result will be generated −

The 2nd element of array
{"1":{"2":{"3":{"4":[5,{"6":7}]}}}}

Field "1"

Open in new window

0
hi,

i am looking at below link

http://www.onjava.com/pub/a/onjava/2005/03/02/commonchains.html

How this apache chain related to spring and rest web serives. Any good examples around this to understand end to end flow. why we need chain of beans?

when  i try to download apache chain says
http://commons.apache.org/proper/commons-chain/downloads.html

says
Not Found

The requested URL /proper/commons-chain/downloads.html was not found on this serve


please advise
0
Hello,

Im trying to add persistent fields (FieldDefs) and then add those fields to Fields. From the start i have only 2 fields:

Id : ftInteger
Name : ftString

When i create a new field "Test":ftString and try to add the new persistent field to "Fields" i get error "Missing dataprovider or datapack". Its a standalone use of clientdataset, no provider. When i then go to the fields editor and try to "add fields", the field dissiperar from field-defs. If i the right click on the cds and select "clear data", and then "create dataset" i get error "invalide fieldtype". If i skip to add persistent fields and just add it as a field, i get error "Catastrophic failure"....


Only way i found seems to:

(1) Manually delete all not persistent fields.
(2) Clear dataset
(3) Add the new persistent field
(4) Add all fields.

Not so very brilliant if i have properties on my fields. Clientdataset looks like it been around forever so i'm surprised it bugs like this, or am i missing someting?

unit MissingField;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Data.DB, Vcl.ExtCtrls, Vcl.DBCtrls,
  Datasnap.DBClient, Vcl.Grids, Vcl.DBGrids;

type
  TForm6 = class(TForm)
    DBGrid1: TDBGrid;
    ClientDataSet1: TClientDataSet;
    DataSource1: TDataSource;
    DBNavigator1: TDBNavigator;
    ClientDataSet1Id: TIntegerField;
    ClientDataSet1Name: TStringField;
  

Open in new window

0
Industry Leaders: We Want Your Opinion!
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

hi,

i was reading as below

Throw generic Error Messages − A web service method should use HTTP error messages like 403 to show access forbidden etc.

What HTTP Status Code 201 states?
It means, CREATED, when a resource is successful created using POST or PUT request. Return link to newly created resource using location header.

What HTTP Status Code 204 states?
It means, NO CONTENT, when response body is empty for example, a DELETE request.
i see 200 UNKNOWN No body returned for response




What HTTP Status Code 304 states?
It means, NOT MODIFIED, used to reduce network bandwidth usage in case of conditional GET requests. Response body should be empty. Headers should have date, location etc.



What HTTP Status Code 400 states?
It means, BAD REQUEST, states that invalid input is provided e.g. validation error, missing data


What HTTP Status Code 401 states?
It means, FORBIDDEN, states that user is not having access to method being used for example, delete access without admin rights.



What HTTP Status Code 409 states?
It means, CONFLICT, states conflict situation while executing the method for example, adding duplicate entry.




any good example to test above http status codes?

using post when i tried to create a resourece i got 200 though not 201.

i searched in code for 200 or 201 to change but never found them?
where these numbers are coming from if not from code?
0
Hi,

I was reading as below

Session based authentication − Use session based authentication to authenticate a user whenever a request is made to a Web Service method.

how to do   Session based authentication .

any sample end to end example on this relating to web services ?
0
hi,
i was reading as below
What is the difference between PUT and POST operations?
PUT and POST operation are nearly same with the difference lying only in the result where PUT operation is idempotent and POST operation can cause different result.
i was not clear. what it mean by post can cause different results?

please advise
0
I was reading as below
https://www.tutorialspoint.com/restful/restful_security.htm

Restriction on Method Execution − Allow restricted use of methods like GET, POST and DELETE methods. The GET method should not be able to delete data.

how to use get to delete a data?
is that is possible even though that is not recommended?
please advise
0
hi,

i was reading as below
https://www.tutorialspoint.com/restful/restful_statelessness.htm

what is the meaning of below

Consider the following URL −

https://localhost:8080/UserManagement/rest/UserService/users/1

If you hit the above url using your browser or using a java based client or using Postman, result will always be the User XML whose Id is 1 because the server does not store any information about the client.

<user>
   <id>1</id>
   <name>mahesh</name>
   <profession>1</profession>
</user>

how result with id 1 is related to statelessness.

since we created new user it created with id 1 and while retrieving we get same value right.

please advise
0
Hi, I have one data frame (df1) with 20 observations (one for each year) and 597 variables (each one is one stock). The values are a ratio called book-to-market ratio. I need to build two portfolios for each year which consists of the stocks with values lower than the median and stocks with values above the median. The names of the stocks are the columns from df1. So I need to check if each value from each row (each year) is below or above the median and identify each stock name (columns in df1). Then I need to match it with the columns from another data frame (df2) which has data from the return of each stock in each year (20x597). The end result would be a vector with 20 entries, which are the differences of average returns between the two portfolios. I hope it was clear enough, thanks for the answer and I`m here for any explanation.
0
hi,

i was reading below that rest webservices put is for creating
https://www.tutorialspoint.com/restful/restful_introduction.htm

I remember reading some where POST is for create and PUT is to update.

can you please advise which HTTP method for which?

Sr.No.      HTTP Method      URI      Operation      Operation Type
1      GET      /UserService/users      Get list of users      Read Only
2      GET      /UserService/users/1      Get User with Id 1      Read Only
3      PUT      /UserService/users/2      Insert User with Id 2      Idempotent
4      POST      /UserService/users/2      Update User with Id 2      N/A
5      DELETE      /UserService/users/1      Delete User with Id 1      Idempotent
6      OPTIONS      /UserService/users      List the supported operations in web service      Read Only
why it says operation type for POST is N/A where as put is idempotent. what it means?

for working on rest examples why we need both below entries


<dependency>
                  <groupId>javax.ws.rs</groupId>
                  <artifactId>javax.ws.rs-api</artifactId>
                  <version>2.0.1</version>
            </dependency>
            <dependency>
                  <groupId>org.apache.cxf</groupId>
                  <artifactId>cxf-rt-rs-service-description</artifactId>
                  <version>3.0.0-milestone1</version>
            </dependency>


below is fine
<groupId>javax.ws.rs</groupId>
                  <artifactId>javax.ws.rs-api</artifactId>

but why we need cxf as below as well in pom.xml?
0
I have searched online and have been unable to find a recent example as to how the eBay API can be called from a recent version of Delphi XE using Indy.

If anyone can post here such a piece of code, I am sure it would save many people a lot of time trying to figure it out.

Many thanks!
0
Experts,

I have a program that is calling programs that are in a macro.  One of the  called programs encountered an error but the program did not stop as when it is a stand alone program.  Can someone tell me is there something I can add to the macro or the calling program to put a message to the log, exit the macro and stop all processing.
0
What does it mean to be "Always On"?
LVL 5
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Hi,
To the prompt, after having pressed Password button below. I expect the password strength to be shown, exactly after having input two password (but before Submit button is pressed). What to adjust?
http://my-friend.co/UserMaintenance2/Default.aspx?userid=mc23&readonly=n
0
I was able to retrieve the attached file thru a soap call to a web service, now i need to convert this xml file to a .csv file, is there an easy method of walking thru the xml file to extrtact the fields i need?
Tempxml3.xml
0
hi,

while executing below xquery

for $x in doc("Books.xml")/books/book
return if{$x/@category="XML")then<XMLBOOK>{data($x/title)}</XMLBOOK>
else <NONXML>{data($x/title)}</NONXML>


on below xml


<?xml version="1.0" encoding="UTF-8"?>
<books>
	<book category="JAVA">
		<title>Master Core Java</title>
		<author>JG</author>
		<year>2015</year>
		<price>50</price>
	</book>

	<book category="DOTNET">
		<title>Get Certified in .Net</title>
		<author>BG</author>
		<year>2016</year>
		<price>60</price>
	</book>

	<book category="XML">
		<title lang="en">XML and XML Schema Definition in easy steps</title>
		<author>BT</author>
		<year>2014</year>
		<price>20</price>
	</book>

	<book category="XML">
		<title lang="en">XSLT XPATH and XQuery Fundamentals</title>
		<author>BT</author>
		<year>2016</year>
		<price>30</price>
	</book>
</books>

Open in new window

getting below error

Syntax error on line 2 at column 9 of file:/C:/Users/sg/gpJava/ud/xsl_xpath_jquery/XQuery/Books2.xqy near {....xml")/books/book return if...}
  XPST0003: Unrecognized node constructor if{}
Static error(s) in query

how to fix it
please advise
0
Hi,
I want to adjust the following codes
            $(".btnDelete").click(function () { 
                var houseIdToDelete = $(this).data("house-id");
                $.confirm({
                    title: 'Confirm!',
                    content: 'Are you sure you want to delete current record?',
                    buttons: {
                        Yes: {
                            text: 'Yes',
                            btnClass: 'btn-red',
                            keys: ['enter'],
                            action: function () {
                                DeleteHouseRecord(houseIdToDelete);
                                //-- do ajax call here to delete the record
                            }
                        },
                        No: {
                            text: 'No',
                            btnClass: 'btn-green',
                            keys: ['esc'],
                            action: function () {
                                //$.alert('You clicked No!');
                            }
                        },

                    }
                });
                return false;
            });

Open in new window

to instead show with the details to input the password 2 times (one time to re-confirm it). How?
0
hi,
I was writing below example
https://www.youtube.com/watch?v=ShO_Z64sGwI&list=PLZM-6wiKGRfGmXzuR8uX3UsE8g91K6Vp1&index=5

package com.gp.mockito;

import org.junit.Before;
import org.junit.Test;
import junit.framework.Assert;
import static org.mockito.Mockito.*;

public class CalculatorServiceTest {

	CalculatorService calService;
	
	@Before
	public void setup(){
		ICalculator cal_mock = mock(ICalculator.class);
		when(cal_mock.add(2, 4)).thenReturn(6);
		calService=new CalculatorService();
		//calService.setCal(cal_mock);
		
		
	}
	@Test
	public void testAddNumbers(){
		Assert.assertEquals(6, calService.addTwoNumbers(2,4));
	}
}

Open in new window

package com.gp.mockito;

public class CalculatorService {
ICalculator cal;
public ICalculator getCal() {
	return cal;
}
public void setCal(ICalculator cal) {
	this.cal = cal;
}
public int addTwoNumbers(int x, int y){
	return cal.add(x, y);
}
}

Open in new window

package com.gp.mockito;

public interface ICalculator {
public int add(int x,int y);
}

Open in new window

why we need setter for calservice implementation class.

why are they setting interface mock object to the calservice object

observerd one example here
https://www.youtube.com/watch?v=DyuWgBHfxNQ

i do not see any setter here though?
1
Hi,

i wrote my web application with web.xml as below

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns="http://xmlns.jcp.org/xml/ns/javaee"
	xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
	id="WebApp_ID" version="3.1">
<welcome-file-list>
    <welcome-file>simple.jsp</welcome-file>
</welcome-file-list>
	<security-constraint>
		<web-resource-collection>
			<web-resource-name>MyResources</web-resource-name>
			<url-pattern>/*</url-pattern>
		</web-resource-collection>
		<auth-constraint>
			<role-name>myuserrole</role-name>
		</auth-constraint>
	</security-constraint>
	<login-config>
		<auth-method>BASIC</auth-method>
		<realm-name>FILE</realm-name>
	<!-- 	<form-login-config>
			<form-login-page>/login.jsp</form-login-page>
			<form-error-page>/error.jsp</form-error-page>
		</form-login-config> -->
	</login-config>
</web-app>

Open in new window


i added role and username and password to tomcat-users.xml as below

<?xml version="1.0" encoding="UTF-8"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the 

Open in new window

0

Programming Languages-Other

19K

Solutions

19K

Contributors

A programming language is a formal constructed language designed to communicate instructions to a machine, particularly a computer. Thousands of different programming languages have been created, mainly in the computer field, and many more still are being created every year. The description of a programming language is usually split into the two components of syntax (form) and semantics (meaning). Some languages are defined by a specification document (for example, the C programming language is specified by an ISO Standard), while other languages (such as Perl) have a dominant implementation that is treated as a reference. Some languages have both, with the basic language defined by a standard and extensions taken from the dominant implementation being common.