Programming

52K

Solutions

58

Articles & Videos

40K

Contributors

Programming includes both the specifics of the language you’re using, like Visual Basic, .NET, Java and others, but also the best practices in user experience and interfaces and the management of projects, version control and development. Other programming topics are related to web and cloud development and system and hardware programming.

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

Sign up to Post

I am trying to embed automatically today's date (DDMMYYD10.) and XML records counts in the XML data file header. Is there an automatic way in SAS how to do that?

This is where today's date and record counts would go:
 
put &tab2. '<SampleDate>2017-06-27</SampleDate>';
 put &tab2. '<CaseCount>10</CaseCount>';

Open in new window


Full SAS code:
filename DirectX  "&basepath\examples\XMLData2.xml";
filename Complete "&basepath\examples\XMLComplete2.xml";

libname xmldir xmlv2 xmlfileref=DirectX xmltype=generic;

/* Macro variables to provide appropriate tab spacing */
%let tab="    ";
%let tab2="        ";

/* Writing two SAS datsets to xmldir library and creating XMLData.xml data file */ 
data xmldir.class(label="dataset class from sashelp library");
       set sashelp.class(obs=10);
run;

data xmldir.cars(label="dataset cars from sashelp library");
       set sashelp.cars(obs=10); 
run; 

libname xmldir clear;

/*  XML file information and header and XML File End*/
data _null_;
 infile	DirectX end=last;
file	Complete;

input;				
 
if _N_ = 1 then
    do;  
	put _infile_;	
    put '<Schema Name="CarsAndClass">';
    put &tab. '<Header>';
    put &tab2. '<SampleDate>2017-06-27</SampleDate>';
    put &tab2. '<CaseCount>10</CaseCount>';
    put &tab2. '<Action>Initial</Action>';
    put &tab2. '<YearPeriod>2017</YearPeriod>';
    put &tab. '</Header>';
    put &tab. '<Payload>';
    end;
else
	put &tab2 _infile_;	
 
if last then
    do;
    put &tab'</Payload>';		
    put '</Schema>';
    end;    
run;

Open in new window

0
What Is Transaction Monitoring and who needs it?
LVL 1
What Is Transaction Monitoring and who needs it?

Synthetic Transaction Monitoring that you need for the day to day, which ensures your business website keeps running optimally, and that there is no downtime to impact your customer experience.

We are trying to migrate from 2010 to o-365 and we have SSRS reports in 2010, so we to have establish the connection between  Visual Studio and o-365,  so that we put the output of the report in O-365.
0
I have several DT700 to put on my SV8100 switch. I setup all the settings correctly on the phone and can even use the web programming to get to it. What section do I go to for setting it up on the PBX with an extension and such? On the phone's display it shows Full Port.
0
I am the only one with Admin rights to BitBucket and want to be sure, for the moment, only I can merge a Pull Request.

Please explain how to configure this...

Thanks
0
Hi, It seems to me that everything is set up correctly, and yet I am not getting a result with this.

I looked over this and all seems to be right. https://mozilla.github.io/nunjucks/templating.html#template-inheritance

But when I try to use it, it does't work. I'm going to upload the relevant files here for you to look at. The problem lies in trying to add meta tags. See my expectations below the files.

src/pages/full-width.html:
full-width.html

src/templates/layout.html:
layout.html

src/templates/partials/head.html:
head.html

dev/gulp/gulpfile.js:
gulpfile.js

My expectation is this: 1. On fullwidth.html, I make this change:

From:
{% block title %}Site - Home Title{% endblock %}
{% block description %}Site - Home Description{% endblock %}

To:
{% block title %}Meal Plans, Healthy Prepared Meal Plans Home Delivery {% endblock %}
{% block description %}Our site offers the best flexible meal program with a satisfaction guarantee. Getting delicious meals delivered to your home has never been easier.{% endblock %}

2. I run gulp nunjucks, and a new file appears in src:  fullwidth.html. This file has two metatags:
<title>Meal Plans, Healthy Prepared Meal Plans Home Delivery </title>
<meta name="description"  content="Our site offers the best flexible meal program with a satisfaction guarantee. Getting delicious meals delivered to your home has never been easier.">

However, what I get is this(although …
0
How can I read csv file as an array and access those values in future
0
I am running PHP 7.1.1.
I have downloaded 7.1.6 zip.
Do I extract it to the folder that contains 7.1.1 which in this case is IIS Express/PHP/ ?
And how do I go about accomplishing upgrading to the new version ?

Michael
0
How do you find out in programming ASP.NET pages what version of html is being used?
Is there a setting in Visual Studio?

What trigger my question was I read the following:

The width attribute of <td> is not supported in HTML5. Use CSS instead.
CSS syntax: <td style="width:100px">

https://www.w3schools.com/tags/att_td_width.asp
0
I have been using JDK 9 on Windows 10 x64 for a while but when I went to install the latest early release (b174), I first uninstalled the previous version (as usual) and then ran the new installer.

It fails with a message box saying "Another Java installation is in progress. You must complete that installation before you can run this installer".

It seems there are some artifacts around causing the problem but only for JDK 9 as I can uninstall & reinstall JDK 8 without any issues. Also, the same problem occurs if I try to run the installers for any prior JDK 9 releases as well (even though they worked before).

Searches have suggested various options like using a Microsoft MSI clean-up tool and registry hacks but nothing is helping.

Can anyone suggest a way to get JDK 9 installed (as now I cannot use any release of JDK 9 at all)?
0
I had this question after viewing VB .Net - web browser control.  Automate clicking on and manipulating popup windows after downloading .exe file.

Basically, I am trying to do almost the same thing but I don't want to wait for the "Choose File to Upload" window to load. Instead, I'd like to:

1) Wait till the window becomes available
2) Automatically hide the window and send it back once it becomes available by intercepting the opening of that window
3) Set the file location to the file upload window in the background
4) Once set, click the "Open" button (like how it is being done now)

Could someone please provide some code on this scenario as I really need to get this working.

Cheers.
0
Technology Partners: We Want Your Opinion!
Technology Partners: 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!

I am working with a new HL7 engine "Mirth" and the previous users have the setting under "Advanced Queue Settings"\"Rotate Queue".

but I noticed the behavior is that it rotates  msgs in the queue on TCP errors and no connectivity errors.

Is there anyway to stop this behavior ?
I only want the queue to rotate on Mal-Formed msgs or msgs that are NAK'ed.

Thanks
0
Would for example Java or GWbasic be a good choice? (If possible to achieve without Excel's VBA.) Or could I benefit from using an online tool such as Unity or Game Maker Studio 2? What about Smalltalk or Ruby? And should I avoid PHP, JavaScript and C++ according to this website?:

https://medium.com/smalltalk-talk/the-three-worst-programming-languages-b1ec25a232c1

I already have a lot of VBA in this Excel, and now want to add a simulator for simulation of each harness race I have handicapped. It would consist of an oval shaped circuit and objects (maximum 15), that represent the horses, running around this circuit, and which I can control by entering values in a table below the circuit. Something like this:

https://www.youtube.com/watch?v=GaDdmlARB10&feature=youtu.be
https://www.youtube.com/watch?v=0jynCeeLAtI

(But my simulation would be an oval shaped circuit, otherwise the same principle with a table below where I can enter values that affect how the race is run/simulated.)

A layout something like this is what I have in mind:

https://www.youtube.com/watch?v=gV_0o40ckf4&t=442s
https://sites.google.com/site/e90e50fx/home/racetrack-chart-with-excel
(The first option would be perfect, if possible in Excel and in Windows 10.)

Of course these kind of layouts would be very good also, but probably not possible in Excel:

https://www.youtube.com/watch?v=i2-aJjgi7mE

So no high requirements on graphics (is not possible anyway in Excel), but on being able …
0
As a junior, I'm a bit new to front end programming (crammed learning JS/other languages/NPM/NodeJS/etc within three months for my current role) so apologies if what I say doesn't make sense.

I've helped to build a UI for an application with the use of NPM/Node JS. The application stores data on a UNIX server. The UI accesses the data on the server (https://myhostname:8090/blah/blah) and presents the results with a nice UI. With the help of GIT, I've managed to do move all the src UI code onto the UNIX server. The purpose is for automation

While a specific file (in my UI code) specifies the UNIX server configuration, I've used NPM to build a bundle.js (Which bundles all the JS files into a single file) file. I move this bundles.js along with the index.html and CSS styling files to an appropriate directory in order to use Maven to build a JAR file. And with a start/stop server script to run the process to run  the code, I can just enter the UNIX hostname/port number in my browser window in order to access the UI and data. This all works.

However. I now need to generalise the server configuration in my bundle.js file as well as properties file on server side such that I'm not hard coding server configuration anywhere (meaning I can deploy the UI on any server with no issue). i.e. playing with "localhost" instead of the actual server hostname etc.

I want to try my best, but I need to acknowledge that I have no real server configuration experience and hence need a …
0
I got a requirement from my client that he wishes to encrypt/ password protect some of the documents, before sending over to another user in another regional office.

By not writing the password into the email body.

How can the user in another regional office knows the password to decrypt/ open the protected documents?

What approach should be adopted? Is there any standard/ algorithm I can refer to? But we prefer not to use any 3rd party software/ utility.

Thank you.
0
I'd like to display a multi-level directory structure to provide mp3 file downloads. Below are some details and my wants.
  • Server 2008r2 with IIS 7.5
  • PHP 7.1 - Functional and tested
  • Possible directory navigation running up to 3 levels deep
  • I would like the page to be aesthetically pleasing to the eye. Currently it looks like a basic ftp page.
  • I have a static image that I'd like to display as background
I have zero experience with php, other than installation today and functionality test. I have searched the web and tried different 'fixes' but, haven't found a way to display it in a clear concise manner and allow multi-level nav.
I'm not even sure if what I'm asking is making sense to anyone seasoned in php programming.
I obviously know what I want, but, can't find the correct web search criteria to retrieve anything usable.

Any help would be appreciated.
0
I am doing below challenge

http://codingbat.com/prob/p128270
public int[] front11(int[] a, int[] b) {
   //int[] z;
  if(a.length>0&&b.length>0){
 
 // z[0]=a[0];
 // z[1]=b[0];
 // return z;
   return new int[]{a[0],b[0]};
  }
   else if(a.length>=0&&b.length==0){
  // int[] z=new int[2];
  //z[0]=a[0];
  //z[1]=b[0];
  return new int[]{a[0]};
  }
  else if(a.length==0&&b.length>=0){
  // int[] z=new int[2];
 // z[0]=a[0];
 // z[0]=b[0];
 // return z;
   return new int[]{b[0]};
  }
  return new int[0];
  
}

Open in new window


i am failing one
how to improrve my code
Expected      Run            
front11([1, 2, 3], [7, 9, 8]) → [1, 7]      [1, 7]      OK      
front11([1], [2]) → [1, 2]      [1, 2]      OK      
front11([1, 7], []) → [1]      [1]      OK      
front11([], [2, 8]) → [2]      [2]      OK      
front11([], []) → []      ArrayIndexOutOfBoundsException: 0 (line:14)      X      
front11([3], [1, 4, 1, 9]) → [3, 1]      [3, 1]      OK      
front11([1, 4, 1, 9], []) → [1]      [1]      OK      
other tests
OK      
please advise
0
Hi,

I was working on below challenge again

http://codingbat.com/prob/p151359
public String withoutX2(String str) {
  
  if(str.length()==1&&str.charAt(0)=='x'){
    return "";
  }
  if(str.length()>=2){
  if ( str.charAt(0)=='x' && str.charAt(1)=='x' ){
  return str.substring(2);
  }else if(str.charAt(0)=='x'){
      return str.substring(1);
  }else if(str.charAt(1)=='x'){
      return str.substring(0,1)+str.substring(2);
  }
  }
  return str;
}

Open in new window

below code passes all tests
Expected      Run            
withoutX2("xHi") → "Hi"      "Hi"      OK      
withoutX2("Hxi") → "Hi"      "Hi"      OK      
withoutX2("Hi") → "Hi"      "Hi"      OK      
withoutX2("xxHi") → "Hi"      "Hi"      OK      
withoutX2("Hix") → "Hix"      "Hix"      OK      
withoutX2("xaxb") → "axb"      "axb"      OK      
withoutX2("xx") → ""      ""      OK      
withoutX2("x") → ""      ""      OK      
withoutX2("") → ""      ""      OK      
withoutX2("Hello") → "Hello"      "Hello"      OK      
withoutX2("Hexllo") → "Hexllo"      "Hexllo"      OK      
withoutX2("xHxllo") → "Hxllo"      "Hxllo"      OK      
other tests
OK      

But if i have input say z what would be output and my code fails in that scenario right

withoutX2("z") → z
public class WithoutX2 {

	public static void main(String[] args) {
		
		// TODO Auto-generated method stub
		System.out.println("Value is"+withoutX2("z"));//should get true but getting false
	}
	
	public static String withoutX2(String str) {
		  
		  if(str.length()==1&&str.charAt(0)=='x'){
		    return "";
		  }
		  if(str.length()>=2){
		  if ( str.charAt(0)=='x' && str.charAt(1)=='x' ){
		  return str.substring(2);
		  }else if(str.charAt(0)=='x'){
		      return str.substring(1);
		  }else if(str.charAt(1)=='x'){
		      return str.substring(0,1)+str.substring(2);
		  }
		  }
		  return str;
		}


}

Open in new window

0
A Pythagorean triple consists of three positive integers a,b and c such that a^2 + b^2 = c^2. Such a triple is commonly written as(a,b,c) . This term comes from the Pythagorean theorem, which says that Pythagorean Triple will be the lengths of the sides of a right-angled triangle.

You have been given an integer a which represents the length of one of cathetus of a right-angle triangle.

You need to find the lengths of the remaining sides. There may be multiple possible answers; any one will be accepted.

Hints:

- Every odd number 2k+1  can be represented as (k+1)^2-k^2 .
- If m and n  are integers and (m^2 - n ^2) + (2mn)^2 = (m^2 + n^2)^2

Input Format

The first line contains an integer a  denoting the length of one of cathetus of the right-angled triangle.


Output Format
A single line containing the possible values of a,b and c . You may print them in any order.

Sample Input 0
5
Sample Output 0
5 12 13
Explanation 0

We can see that the triple (5,12,13)  is a pythagorean triple
0
Hi,
I tried below challenge as
http://codingbat.com/prob/p167430
public class Has271 {

	public static void main(String[] args) {
		int[] arr={1, 2, 7, 1};
		// TODO Auto-generated method stub
		System.out.println("Value is"+has271(arr));//should get true but getting false
	}
	
	public static boolean has271(int[] nums) {
		 int val=nums[0];
		 
		 for(int i=0;i<nums.length-2;i++){
		   
		   if(  (nums[i+1]==val+5)
		   && (  (Math.abs(nums[i+2]-val)<=2) )  )
		   return true;
		   continue;
		 }
		 return false;
		}


}

Open in new window


what is wrong with my above code why i am getting false instead of true?
please advise
0
Get 15 Days FREE Full-Featured Trial
LVL 1
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Can anyone shed light on this?

6/9/2017 2:46:57 PM      domain\Administrator      ERROR: Error running SQL command '  IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[MARKETING_CONTROL_JOBS]') AND OBJECTPROPERTY(id, N'IsUserTable') = 1) BEGIN    CREATE TABLE [dbo].[MARKETING_CONTROL_JOBS]  (   JOB_ID int NOT NULL IDENTITY (1, 1),   JOB_TYPE tinyint NOT NULL,   JOB_STATE tinyint NOT NULL,   SOURCE_ID uniqueidentifier NULL,   STAGE_ID uniqueidentifier NULL,   REFRESH_PARENTS bit NULL,   REFRESH_SOURCES bit NULL,   BLOCK_ACTIVITIES bit NULL,   NEW_RECIPIENTS_ONLY bit NULL,   START_DATE_TIME datetime NULL,   CREATED_DATE_UTC datetime NOT NULL,   UPDATED_DATE_UTC datetime NULL,   PROCESS_START_UTC datetime NULL,   PROCESS_END_UTC datetime NULL,   [USER_ID] uniqueidentifier NOT NULL,   RUN_ID uniqueidentifier NULL  )   ON [PRIMARY];    ALTER TABLE [dbo].[MARKETING_CONTROL_JOBS]   ADD CONSTRAINT PK_MARKETING_CONTROL_JOBS PRIMARY KEY CLUSTERED   (   JOB_ID  )   WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)   ON [PRIMARY];    CREATE INDEX [IX_MARKETING_CONTROL_JOBS__JOB_STATE__INCL_FLT]   ON [dbo].[MARKETING_CONTROL_JOBS]([JOB_STATE])  INCLUDE  (   [JOB_TYPE]   ,[SOURCE_ID]   ,[STAGE_ID]   ,[REFRESH_PARENTS]   ,[REFRESH_SOURCES]   ,[BLOCK_ACTIVITIES]   ,[NEW_RECIPIENTS_ONLY]   ,[START_DATE_TIME]   ,[PROCESS_START_UTC]   ,[PROCESS_END_UTC]   ,[USER_ID]   ,[RUN_ID]  )  WHERE [JOB_STATE] = 0; END;': Incorrect …
0
Hello,

I am using MATLAB  to solve equation using (syms) then evaluating the result. The program is working. However, each loop taking almost 23 second. Is there anyway that I can optimize program so it will work faster?

I used the below code
clear;
clc;
syms A B C D E ; 
R=((4*B*A)/((D-C)^2+(B+A)^2));
R1=((4*B*A)/((D+C)^2+(B+A)^2));
F1 = ellipticK(R);
I1 = ellipticE(R);
F2 = ellipticK(R1);
I2 = ellipticE(R1);
P= ((((A*B)^(1/2))/(2*E*(R^(1/2))))*(((2 - R)*F1) -...
    (2*I1)))-(((((A*B)^(1/2))/(2*E*(R1^(1/2)))))* ...
    (((2 - R1)*F2) - (2*I2)));
P1=feval(symengine,'simplify',P,'IgnoreAnalyticConstraints');

X=(1/B)*(diff(P1,D));
X1=feval(symengine,'simplify',X,'IgnoreAnalyticConstraints');
[B,D]= meshgrid(linspace(0.1,10),linspace(0.1,10));
E=3;
N1 = 10*rand(100000,1);
N2 = 5*rand(100000,1);
M(:)=0;
for i=1:100000
    tic
    A=N1(i);C=N2(i);
    F = matlabFunction(X1);
    B = F(A, B, C, D, E);
    In(:,:,i)=B(:,:); 
    fprintf('%d\n ', i); 
    toc
end

Open in new window

0
I need a program that will take the user's name, age, grade, the hardest class they are taking, and the last 12 grades in said class. needs to be a for loop. In this or a different loop it needs to take out the lowest number. then another loop that will add all of the grades up except for the lowest grade. so instead of the average of 12 grades it is 11. Then it needs to see if the student needs tutoring or not. Anything below a 70 needs tutoring, between 70 and 85 did a good job, greater than 85 did a great job. All this in Java.
0
Hello,

I have 1000 same xml files. I want to change a single line of code in all files.
<ClimateFileID>0</ClimateFileID>
<ClimateFileName>2A_H2_0001.wac</ClimateFileName>
 <KLIClimateSideID>1</KLIClimateSideID>

I want each file to go from 2A_H2_0001 to 2A_H2_1000 and also change the filename in the same way.
I have very little programming skills. Is there a faster way to do it?

I tried doing this in MATLAB but the Unicode format is getting messed up and the xml files cannot be read by my software after the MATLAB process.

Thanks
0
Hello
I need to know what would you advise as responsive website language to de develop a website having this features :
- Community having their own space
- Google map and geolocalisation
Thanks for your help,
Johana
0
I'm totally confused, nowhere I'm getting proper information about how to start programming in AS/400.
What are the software & hardware requirements of AS/400? What should I know about AS/400 to become a programmer in that?
How can I do JAVA, C, C++, C#, .net programs using AS/400, or is there any other way?

I will be pleased, if anyone could provide a detailed information.
0

Programming

52K

Solutions

58

Articles & Videos

40K

Contributors

Programming includes both the specifics of the language you’re using, like Visual Basic, .NET, Java and others, but also the best practices in user experience and interfaces and the management of projects, version control and development. Other programming topics are related to web and cloud development and system and hardware programming.