Programming Languages-Other

19K

Solutions

66

Articles & Videos

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,
Using these codes (in the project),
        private static Cell InsertCellInWorksheet(string columnName, uint rowIndex, WorksheetPart worksheetPart)
        {
            Worksheet worksheet = worksheetPart.Worksheet;
            SheetData sheetData = worksheet.GetFirstChild<SheetData>();
            string cellReference = columnName + rowIndex;
            Row row;
            if (sheetData.Elements<Row>().Where(r => r.RowIndex == rowIndex).Count() != 0)
            {
                row = sheetData.Elements<Row>().Where(r => r.RowIndex == rowIndex).First();
            }
            else
            {
                row = new Row() { RowIndex = rowIndex };
                sheetData.Append(row);
            }
            if (row.Elements<Cell>().Where(c => c.CellReference.Value == columnName + rowIndex).Count() > 0)
            {
                return row.Elements<Cell>().Where(c => c.CellReference.Value == cellReference).First();
            }
            else
            {
                Cell refCell = null;
                foreach (Cell cell in row.Elements<Cell>())
                {
                    if (string.Compare(cell.CellReference.Value, cellReference, true) > 0)
                    {
                        refCell = cell;
                        break;
                    }
                }
                Cell newCell = new Cell() { CellReference = cellReference };
                row.InsertBefore(newCell, refCell);
                

Open in new window

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!

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
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
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
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
Hi,
How to adjust to list below, to have also one picture file included, that is retrieved from database?

            using (SqlConnection sqlConn = new SqlConnection(ConfigurationManager.ConnectionStrings["Mssqlconn3"].ConnectionString))
            {
                using (SqlCommand sqlCmd = new SqlCommand("SELECT house_name, address1, address2, price, price_curr FROM house_tab", sqlConn))
                {
                    sqlConn.Open();
                    sqlCmd.CommandType = CommandType.Text;
                    SqlDataAdapter sqlAd = new SqlDataAdapter(sqlCmd);
                    DataTable sqlDt = new DataTable();
                    sqlAd.Fill(sqlDt);
                    sqlConn.Close();
                    if (null != sqlDt)
                    {
                        houseList = sqlDt
                                        .AsEnumerable()
                                        .Select(dataRow => new HouseData
                                        {
                                            house_name = dataRow.Field<string>("house_name"),
                                            address1 = dataRow.Field<string>("address1"),
                                            address2 = dataRow.Field<string>("address2"),
                                            price = dataRow.Field<decimal>("price"),
                                            price_curr = dataRow.Field<string>("price_curr"),
                                        })
         

Open in new window

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
Dear Experts, I'mt rying to use GO to read a json file that I have.

I'm using the following code:
package main

import (
	"fmt"
	"encoding/json"
	"io/ioutil"
)

func main() {

	b, _ := ioutil.ReadFile("/home/david/jsontest/create.jsontest.campaigns.ninja.json")

	type UserData struct {
		user_id    string
		user_email string
		user_name  string
	}

	type campaign struct {
		domain      string
		Ssl         int64
		server_key  string
		certificate string
		bundle      string
		php_ver     string
		wp          int64
		lang        string
		start_date  string
		end_date    string
		description string
		user_data   UserData
		CampaignID  int64
	}

	var m campaign
	err := json.Unmarshal(b, &m)
	if err != nil {
		panic (err)
	}
	fmt.Printf("%d", m.CampaignID)
	fmt.Printf("%s",m.user_data.user_email)
}

Open in new window


When I run the code however, the Result is this:
/usr/lib/golang/bin/go run /home/david/GoglandProjects/CampaignsNinja/jsontest.go
80099700
Process finished with exit code 0

Which is correct, but partial.. I'm missing the 2nd value which should be 74 (according to the  attached JSON below)

{"domain":"jsontest.campaigns.ninja","ssl":1,"server_key":"","certificate":"","bundle":"","php_ver":"5.6","wp":1,"lang":"english","start_date":"2017-02-02","end_date":"2017-03-02","description":"This is a test","user_data":{"user_id":"74","user_email":"usertest@gmail.com","user_name":"usertest"},"CampaignID":80099700}

Any Ideas why is the code behaving that way?
0
Hello

Let's say i narrow the language in github search. I further want to specify a string to search for in all the repos available. Possible? How?

thanks
0
Free Tool: Site Down Detector
LVL 9
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Hello,
I've followed the instructions below and nothing happens.  I have searched the internet and can't find much more, so I ask you;
How does one install the Selenium 3.4 javadoc in Eclipse Neon 3?
INSTRUCTIONS:
http://stackoverflow.com/questions/25781853/how-to-bind-selenium-javadoc-to-eclipse
selenium-server-3.4.0-javadoc
Navigate To:
project properties => Java Build Path => Libraries => Selenium-java-2.42.2.jar
Select Selenium-java-2.xx.x.jar & Expand it.
You will see Javadoc location option. Select it and click on Edit button.
On next window add
http://seleniumhq.github.io/selenium/docs/api/java/ 
link in javadoc location path textbox and click on Ok button.
0
Do you have the source code for Metro Board Game in Prolog. Here is the description : http://www.bluering.nl/sieuwert/games/metro/  Thank you.
0
I have successfully installed LinqToXSD which is supposed to enforce strong typing and also provide a relatively easy way to create XML files but there are no classes to use "new" on which should create the document.  Does anyone know how to create a class that is an XML Document that is tied to a LinqtoXSD schema?
0
Hello,
For testing and verification purposes, I am trying to compute the count of good duplicates found in both Data1 and Data2  and in Data3, and in one or the other. These are the steps I am trying to accomplish to get to my final results:

#1.  Create a list (Data4) of unique Data1 and Data2 where variable rec_flag=A, B, C, D.
#2.  Build a duplicate (Data5) file from the list in #1 by generating a record linking each two records where Var3 and Var4 are linked to the same Var6 and Var7.
#3.  Match Data5 file with Data3 where variable rec_flag=B, C, D using key variables Var3, Var4, Var6, and Var7.
#4.  Display in the output .lis the number of records in:
     #4.1 Both Data5 and Data3
     #4.2 Data5 only
     #4.3 Data3 only
 
The issue that I am having is with #2 where I need to build a duplicate file Data5.

Here is my SAS code below with missing step #2:

libname mydir "/home/myprofile/links"; 
%macro cnt_lnks;

 /*  #1 */
proc sort data=mydir.Data1
          out=Data1out(where=(rec_flag='A', 'B', 'C', 'D') keep=Var3 Var4 Var6 Var7 rec_flag);
          by Var3 Var4 Var6 Var7;
run;

proc sort data=mydir.Data2
          out=Data2out(where=(rec_flag='A', 'B', 'C', 'D') keep=Var3 Var4 Var6 Var7 rec_flag);
          by Var3 Var4 Var6 Var7;
run;

/*********************************************
 Datastep: merge Data1 & Data2
           by Var3 Var4 Var6 Var7
 ********************************************/
data all_links1;
  merge 

Open in new window

0
I have created a copy of a built-in report in SCCM (1702) and created my own custom copy. Everything is fine except I cannot figure out how to update the displayed title and description. They're not matching the actual custom report title and description defined when I "Manage" the report in SSRS b/c the fields are defined expressions that point back to some other data source.

Title:
=SrsResources.Localization.GetString("Report234_Name", User!Language) + "  "

Description:
=SrsResources.Localization.GetString("Report234_Description", User!Language)

I don't see where the "Report234" or "Report234_Description" values are defined in the report. They're not fields, variables, or parameters. I can't find them defined in any of the datasets created for the report. Where do I find these (I don't even know what to call them)?

I tried changing the description for the original report in SSRS (select report in SSRS > Manage > change description > Apply), and then rerunning the report, and the change in description is NOT displayed.  So where are these descriptions being defined?!?

I "need" to figure this out. Our service desk relies on several custom reports and it will create a lot of confusion if the wrong title and description is displayed.
0
I have fixed size panels (used for charting). It has X and Y axes virtually (not plotted visibly). So, if I add controls (say bar or lines) horizontally in the panel beyond its bounds, it will display while scrolling.

Like, if I add controls (same bar or lines) vertically in the panel beyond its bounds, it will not automatically adjust or visible, while moving horizontal scrollbar.

I dont want vertical scrollbar in panel. Need only horizontal scrollbar in panel. If I move horizontal scrollbar, vertically out of bound controls should display automatically or adjust itself.

The horizontal scrollbar in panel is not Auto Scrollbar attached to panel. We should use Horizontal Scrollbar Control and while moving the HSBar Control, the panel would move horizontally. Both should synchronize exactly.
0
Hi,
Based on schema file like the attached, how can I derive the relevant sample EDI file?
0
I'm just trying to find the right syntax to use to set the background color of a node in json with google charts.

This is the code I have and of course it's not working because I have no idea what I'm doing.

	
$style = new stdClass;
$style->p = "style: 'background-color:green;'";
$item->p = $style;

Open in new window


There's more to my code of course but this is what I'm using to set the background color of a specific node.
0
I have java text file and I want to find out how many variables are declared and initialized in that file?
I have also done one small program but that only find the how many data types are declared..........


import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;



public class Variables
{
    public static void  main(String abc[]) throws FileNotFoundException, IOException
    {
 
     try {
         ArrayList<String> a=new <String>ArrayList();
         a.add("byte");
         a.add("short");
         a.add("int");
         a.add("long");
         a.add("float");
         a.add("double");
         a.add("boolean");
         a.add("char");
         
          ArrayList<KeyWords> k;
        KeyWords kw;
        k=new <KeyWords>ArrayList();
   
       
     for(int i=0;i<a.size();i++)
       {
           System.out.println("i="+i);
              String str=a.get(i);
              System.out.println("Checking for= "+str);
     
            FileReader fileIn = new FileReader("/home/milind/fileVar.txt");
            BufferedReader reader = new BufferedReader(fileIn);
            String line;
            int count = 0;
           // String f="float";
            char chk=',';
            while((line = reader.readLine()) != null)
            {
               System.out.println(line);
               if(line.contains(str))
              …
0
Transaction Monitoring Vs. Real User Monitoring
LVL 1
Transaction Monitoring Vs. Real User Monitoring

Synthetic Transaction Monitoring Vs. Real User Monitoring: When To Use Each Approach? In this article, we will discuss two major monitoring approaches: Synthetic Transaction and Real User Monitoring.

I'm trying to display the word "Hello" when the time equals to a hard-coded time. What I have below doesn't work. Can you please help? Thanks!


local function alarm()
      if (year ==2017 and month == 4 and day ==23 and hour== 16 and minute == 51) then display.newText("hello", 160, 200, impact, 23)
end
0
Hi, I am using the below code to match some data from an input csv to 2 drop downs from a website, then download both a csv and pdf... (the csv, I am extracting info from, then overwriting it with the next download since I do not need it -- the pdf, I am keeping, if the day of the month is the 1st or the 15th... but, as you can see here, for testing, I have it set to today, the 14th, instead of 15th)

My problem is that it will run Ok, for the first 10 lines or so (the csv list is between 1200-2500 lines, so i'm not even close..)
but then, it will throw the below error:

[Errno 10061] No connection could be made because the target machine actively refused it

Can anyone help me resolve this? I am new to python, scraping AND selenium so would appreciate any help -- or suggestions regarding making the code more efficient in general. Thank you!

# -*- coding: utf-8 -*-

from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
import unittest, time, os, shutil, csv
from fuzzywuzzy import process
import datetime

class Here(unittest.TestCase):
    def setUp(self):
        path_to_chromedriver = 'chromedriver.exe'  # change path as needed
        self.driver = webdriver.Chrome(executable_path=path_to_chromedriver)
        self.base_url = "https://mybaseurl/"
        

Open in new window

0
I have two connection factories under Resources ->JMS ->Connection Factories.

1) ConnectionFactory 2) IntegrationConnectionFactory

I want to modify the maximum Connection of connection pool under both the connection factories. Resources ->JMS ->Connection Factories -> ConnectionFactory -> Connection Pool -> Maximum Connection.

Can someone please help me to write Jython script to modify the maximum connection of connection pool under connection Factories.

For creating Conncetion factories  :
import sys

nodeName =sys.argv[0]
serverName =sys.argv[1]
queueManagername =sys.argv[2]
queueHostname =sys.argv[3]
queuePort=sys.argv[4]

def createconnectionFactories(nodeName,serverName,queueManagername,queueHostname,queuePort):

      print "Creating connection factories"

      ds = AdminConfig.getid("/Node:"+nodeName+"/Server:"+serverName+"/" )

      print queuePort

      connection1 = AdminTask.createWMQConnectionFactory(ds,["-name ConnectionFactory -jndiName 'jms/ConnectionFactory' -type CF -wmqTransportType BINDINGS_THEN_CLIENT -qmgrSvrconnChannel SYSTEM.AUTO.SVRCONN -qmgrName " + queueManagername + "   -qmgrHostname " + queueHostname + "  -qmgrPortNumber " + queuePort ])

      AdminTask.createWMQConnectionFactory(ds,["-name IntegrationConnectionFactory -jndiName 'jms/IntegrationConnectionFactory' -type CF  -wmqTransportType BINDINGS_THEN_CLIENT -qmgrSvrconnChannel SYSTEM.AUTO.SVRCONN -qmgrName " + queueManagername + "  -qmgrHostname " + …
0
Anyone know a program or Dialing system for making interviews over phone.
Like a system or program that you can make interview questions flows easy. Then save the statistics for later review or send them to a partner.  
Either you have a interview system than a Dialer separated they don't need to be combine into one.
0
I did my main Part but i m unable to put the input/ output code.  I want to add one file and output file using array of structure and file I/O.  So i need help if any one can help me out with that codes. this my main part of code in this i want to add the file I/O part . with reading a file from the data and output to the console window. I have attached one .pdf file to the program i want to to that thing in this program. So i need your help.

#include <iostream>
#include <cmath>
#include <iomanip>

using namespace std;

struct Weather
{
    double Temperature;
    double windSpeed;
    double dewPoint;
    double windChill;
    double cloudBase;
};

void get_input(double& tempF, double& windSpeed, double& dewPoint);
float get_windChill(double tempF, double windSpeed);
float get_cloudBase(double tempF, double dewPoint);
void show_output(double tempF, double dewPoint, double windSpeed, double windChill, double cloudBase);


int main()
{
   

    cout << "-----------------------------------------------------" << endl;
    cout << "This program determines wind chill using temperature" << endl;
    cout << "in Fahrenheit and wind speed in mph, and computes" << endl;
    cout << "the cloud base using the dew point in Fahrenheit" << endl;
    cout << "-----------------------------------------------------" << endl;


    double degreesFahrenheit, mph,dewPoint;
    float cloudBase, wc;

    get_input(degreesFahrenheit, mph, dewPoint);
    wc = get_windChill(degreesFahrenheit,

Open in new window

0
There are two different teams of pineapples. You get to choose the different colors of the pineapples. For example if you wanted the offence to be blue and the defense green then the goalie red. The pine apples could upgrade to make them faster or better dribbling skills and  more. There also would be power ups. They would give you speed boost and kick power. Once you get to a certain level you level up and get more choices of upgrades and different scenes. You can play pineapple soccer on mobile devices and on xbox360, xbox1 and wii. The game could be connected through blue-tooth to have it so that you would be able to play on different devices.
0

Programming Languages-Other

19K

Solutions

66

Articles & Videos

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.