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, I hope I can explain this well enough.

My folder structure looks like the attached. In each folder, I have src/pages, results, dev/gulp.

pages contains the nunjucks files, results are the resulting html files from running gulp nunjucks, and dev/gulp is where the gulpfile.js is.

When I want to make a change across the board, say to the navigation, I have to use the command line to go into each folder, gulp nunjucks, upload, then back out by changing directories, navigate to the next one, gulp nunjucks, and on through all 13. So my command line looks like the attached.

Can you help me find a way to speed that up?
Capture.JPG
cmd.txt
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!

Below line gives error as below as        device.getInternetConnection() return enum not String.            
callableStatement.setString("InternetConnection", device.getInternetConnection());


Multiple markers at this line
      - The method getInternetConnection() is undefined for the type Device
      - The method setString(String, String) in the type CallableStatement is not applicable for the arguments (String,
       Device.getInternetConnection)


Here  device.getInternetConnection()); returns the enum  InternetConnection

      public enum InternetConnection{
            
            WIFI("08"),
            CELLULAR("06");
            
            InternetConnection(String ip){
                  this.ip = ip;
            }
            
            private final String ip;
            
            public static InternetConnection getFromIP(String ip) {
                  for(InternetConnection pc : InternetConnection.values()) {
                  if(pc.getIP().equals(ip))...
                       ......
                  }
                  throw new IllegalArgumentException("This iP: " + iP + " does not exist");
            }
            
            public String getIP() {
                  return ip;
            }
      }

How to change my callable statement setter to accommodate enum instead of string?
please advise
0
Hi,

while creating client from wsdl using web servicesw getting below error




public class CustomerOrdersWS {

      public static void main(String[] args) {
            // TODO Auto-generated method stub
            CustomerOrdersService service=new CustomerOrdersService(new URL{"http://localhost:8080/wsdlfirstws/services/customerOrders?wsdl"});
            

      }

}




Multiple markers at this line
      - Type mismatch: cannot convert from String[] to
       CustomerOrdersService
      - Syntax error on token(s), misplaced construct(s)
      - Syntax error on token ")", delete this token

i wonder what it mean by above error and how to resolve it please advise
0
tomcat wont start in debug

where as tomcat is staring fine in regular mode.

i increased time out from 45 to 450 still similar error.

Server Tomcat v8.0 Server at localhost was unable to start within 450 seconds. If the server requires more time, try increasing the timeout in the server editor.
i wonder why server starts in regular mode but takes forever to start in debug mode.

regular startup happens in 10 seconds asap.

Aug 14, 2017 5:40:21 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:wsdlfirstws' did not find a matching property.
Aug 14, 2017 5:40:21 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server version:        Apache Tomcat/8.0.39
Aug 14, 2017 5:40:21 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server built:          Nov 9 2016 08:48:39 UTC
Aug 14, 2017 5:40:21 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server number:         8.0.39.0
Aug 14, 2017 5:40:21 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Name:               Windows 10
Aug 14, 2017 5:40:21 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Version:            10.0
Aug 14, 2017 5:40:21 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Architecture:          amd64
Aug 14, 2017 5:40:21 PM org.apache.catalina.startup.VersionLoggerListener log…
0
Hi,

I have  abc.zip which i unzipped and imported to eclipse as maven project.

Later i got updated version of abc2.zip. I extracted to differnt folder called new_folder. Now when i try to import abc2.zip i am getting error as

 Project wsdlfirstws already exists
 Add a version or custom suffix using "Name template" in "Advanced" settings



how to fix this error and import updated abc2 project
0
Hi,

I have downloaded tomcat 9 zip file and extracted to local windows laptop.

i then added as new server in eclipse by pointing to tomcat location.

when i start tomcat now getting below error


i see tomcat 8.5 download page
https://tomcat.apache.org/download-80.cgi

I do not see tomcat 8 download page.
https://tomcat.apache.org/tomcat-8.0-doc/index.html
how to resolve this

any  good video tutorials on this tomcat installationa nd integrating to eclipse
i hate window service installer version on my windows 10 laptop


Aug 11, 2017 11:29:22 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.j2ee.server:hellows' did not find a matching property.
Aug 11, 2017 11:29:22 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server version:        Apache Tomcat/9.0.0.M26
Aug 11, 2017 11:29:22 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server built:          Aug 2 2017 20:29:05 UTC
Aug 11, 2017 11:29:22 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server number:         9.0.0.0
Aug 11, 2017 11:29:22 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Name:               Windows 10
Aug 11, 2017 11:29:22 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Version:            10.0
Aug 11, 2017 11:29:22 PM org.apache.catalina.startup.VersionLoggerListener log…
0
http://codingbat.com/prob/p168493
public Map<String, String> firstChar(String[] strings) {
  Map<String, String> map=new HashMap<String, String>();
  
  for(String str:strings){
  int len=str.length();
    map.put(""+str.substring(0,1), ""+str(0,len));
  }
  return map;
}

Open in new window


Compile problems:


cannot find symbol str(int,int) line:6

see Example Code to help with compile problems

I am getting above error. What is int, int here. How to fix this error and improve my code. please advise
0
http://codingbat.com/prob/p126332

public Map<String, String> pairs(String[] strings) {
  Map map=new HashMap();
  for(String str:strings){
    int len=str.length();
    map.put(str.substring(0,1), str.substring(len-1,len));
  }
  return map;
}

Open in new window

xpected      Run            
pairs(["code", "bug"]) → {"b": "g", "c": "e"}      {"b": "g", "c": "e"}      OK      
pairs(["man", "moon", "main"]) → {"m": "n"}      {"m": "n"}      OK      
pairs(["man", "moon", "good", "night"]) → {"g": "d", "m": "n", "n": "t"}      {"g": "d", "m": "n", "n": "t"}      OK      
pairs([]) → {}      {}      OK      
pairs(["a", "b"]) → {"a": "a", "b": "b"}      {"a": "a", "b": "b"}      OK      
pairs(["are", "codes", "and", "cods"]) → {"a": "d", "c": "s"}      {"a": "d", "c": "s"}      OK      
pairs(["apple", "banana", "tea", "coffee"]) → {"a": "e", "b": "a", "c": "e", "t": "a"}      {"a": "e", "b": "a", "c": "e", "t": "a"}      OK      
other tests
OK      

I wrote as above and passing all steps. Any improvements to my code. please advise
0
http://codingbat.com/prob/p152303
For above challenge i wrote my code like below and passing all tests
public Map<String, Integer> word0(String[] strings) {
 
Map<String, Integer> map=new HashMap<String, Integer>();

for(String string : strings){
  map.put(string,0);
    map.put(string,0);
}
return map;
}

Open in new window

Expected      Run            
word0(["a", "b", "a", "b"]) → {"a": 0, "b": 0}      {"a": 0, "b": 0}      OK      
word0(["a", "b", "a", "c", "b"]) → {"a": 0, "b": 0, "c": 0}      {"a": 0, "b": 0, "c": 0}      OK      
word0(["c", "b", "a"]) → {"a": 0, "b": 0, "c": 0}      {"a": 0, "b": 0, "c": 0}      OK      
word0(["c", "c", "c", "c"]) → {"c": 0}      {"c": 0}      OK      
word0([]) → {}      {}      OK      
other tests
OK      
any improvements to my code. please advise
0
Are there any instructors like
simon allardice
from lynda.com, plursight.com
who explain computer science concepts without using a scripting language.

Just verbally.

Please add (or subtract) zones
0
Enroll in August's Course of the Month
LVL 9
Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Dear All,

I have a problem in calculating scrollbar position.

Issue: I have a Panel control (AutoScroll = True) inside which I have a control which change its size based on scrolwheel movement. (lets assume 1 tick at scroll - square control gets as much as doubled in size). What I want to achieve is to automatically scroll to the same position that mouse was pointing at before zoom. It's not as simple as using zoom factor, as the control inside the panel is bigger than panel.

I'd appreciate any advice.

Steps to reproduce:

- place panel and set autoscroll to true.
- place (lets say picturebox) inside a panel.
- implement any simple formula of changing size based on scrollwheel (ie. double size each step and make ~4 steps)

I want the scrollbars to update themselves after zooming (so the pointer is pointing at the same pixel on above's said picturebox) - I do not want to change pictures's box location - i want to achieve this by scrolls only.

I hope its clear. Thanks for any help given.
0
http://codingbat.com/prob/p152303
I am looking at above challenge description

Given an array of strings, return a Map<String, Integer> containing a key for every different string in the array, always with the value 0. For example the string "hello" makes the pair "hello":0. We'll do more complicated counting later, but for this problem the value is simply 0.

word0(["a", "b", "a", "b"]) → {"a": 0, "b": 0}
word0(["a", "b", "a", "c", "b"]) → {"a": 0, "b": 0, "c": 0}
word0(["c", "b", "a"]) → {"a": 0, "b": 0, "c": 0}

not clear on what hello has to do with unique string. please advise
public Map<String, Integer> word0(String[] strings) {
 
Map map=new HashMap(<String, Integer>);

for(String : strings){
  map.put(strings[i],0);
}
return map;
}

Open in new window


above gives below error


Compile problems:


missing '}' or illegal start of expression

see Example Code to help with compile problems


how to improve and fix my code . please advise
0
while trying below challenge
http://codingbat.com/prob/p136950

i wrote my code as below

public Map<String, String> mapAB4(Map<String, String> map) {
   if( map.get("a")!=null && map.get("b")!=null && map.get("a").length()> map.get("b").length() ){
    map.put("c",map.get("a"));
    
  }
    if( map.get("a")!=null && map.get("b")!=null && map.get("b").length()> map.get("a").length() ){
    map.put("c",map.get("b"));
    
  }
   if( map.get("a")!=null && map.get("b")!=null && map.get("a").equals(map.get("b")) ){
    map.put("a","");
    map.put("b","");
  }
  
  if( map.get("a")!=null && map.get("b")!=null && map.get("a").equals(map.get("b")) ){
    map.put("a","");
    map.put("b","");
  }
  return map;
}

Open in new window


i am failing below tests
Expected      Run            
mapAB4({"a": "aaa", "b": "bb", "c": "cake"}) → {"a": "aaa", "b": "bb", "c": "aaa"}      {"a": "aaa", "b": "bb", "c": "aaa"}      OK      
mapAB4({"a": "aa", "b": "bbb", "c": "cake"}) → {"a": "aa", "b": "bbb", "c": "bbb"}      {"a": "aa", "b": "bbb", "c": "bbb"}      OK      
mapAB4({"a": "aa", "b": "bbb"}) → {"a": "aa", "b": "bbb", "c": "bbb"}      {"a": "aa", "b": "bbb", "c": "bbb"}      OK      
mapAB4({"a": "aaa"}) → {"a": "aaa"}      {"a": "aaa"}      OK      
mapAB4({"b": "bbb"}) → {"b": "bbb"}      {"b": "bbb"}      OK      
mapAB4({"a": "aaa", "b": "bbb", "c": "cake"}) → {"a": "", "b": "", "c": "cake"}      {"a": "aaa", "b": "bbb", "c": "cake"}      X      
mapAB4({"a": "a", "b": "b", "c": "cake"}) → {"a": "", "b": "", "c": "cake"}      {"a": "a", "b": "b", "c": "cake"}      X      
0
http://codingbat.com/prob/p115011

For above challenge i wrote as below
public Map<String, String> mapAB2(Map<String, String> map) {
  if( map.get("a").equals(map.get("b")) ){
    map.remove("a");
    map.remove("b");
  }
  return map;
}

Open in new window


Expected      Run            
mapAB2({"a": "aaa", "b": "aaa", "c": "cake"}) → {"c": "cake"}      {"c": "cake"}      OK      
mapAB2({"a": "aaa", "b": "bbb"}) → {"a": "aaa", "b": "bbb"}      {"a": "aaa", "b": "bbb"}      OK      
mapAB2({"a": "aaa", "b": "bbb", "c": "aaa"}) → {"a": "aaa", "b": "bbb", "c": "aaa"}      {"a": "aaa", "b": "bbb", "c": "aaa"}      OK      
mapAB2({"a": "aaa"}) → {"a": "aaa"}      {"a": "aaa"}      OK      
mapAB2({"b": "bbb"}) → {"b": "bbb"}      NullPointerException (line:2)      X      
mapAB2({"a": "", "b": "", "c": "ccc"}) → {"c": "ccc"}      {"c": "ccc"}      OK      
mapAB2({}) → {}      NullPointerException (line:2)      X      
mapAB2({"a": "a", "b": "b", "z": "zebra"}) → {"a": "a", "b": "b", "z": "zebra"}      {"a": "a", "b": "b", "z": "zebra"}      OK      
other tests
X      
i am failing one edge case. how to fix it?
please advise on any modifications, improvement to the code

public Map<String, String> mapAB2(Map<String, String> map) {
  if( map.get("a")!=null && map.get("b")!=null && map.get("a").equals(map.get("b")) ){
    map.remove("a");
    map.remove("b");
  }
  return map;
}

Open in new window


above passes all tests but challenge description did not mention a and b values cannot be null or can be null etc?
Modify and return the given map as follows: if the keys "a" and "b" are both in the map and have equal values, remove them both.

mapAB2({"a": "aaa", "b": "aaa", "c": "cake"}) → {"c": "cake"}
mapAB2({"a": "aaa", "b": "bbb"}) → {"a": "aaa", "b": "bbb"}
mapAB2({"a": "aaa", "b": "bbb", "c": "aaa"}) → {"a": "aaa", "b": "bbb", "c": "aaa"}
0
My background is in server virtualization so unfortunately this topic is a bit foreign to me. What I'm trying to accomplish, is to essentially aggregate news articles from various websites such as foxnews, cnn, bizjournals.com, etc, and then email the text of those articles to an email address.

I just want to grab new articles from sites like the ones I listed above, Get the text of the article, then email it.

I've done some googling but I'm not sure exactly which technology I should be looking at here. Preferably something that has examples I can base my code off of. This isn't for any business, but just for a personal project of mine. If there is already a program out there that can do this, I don't mind paying for it.

It looks like I may be able to use API calls to accommodate this, but again this is all new to me. Just looking for some pointers in the right directions in programming languages to look at to handle this.
0
Hi,
How to put short text to chart below?
16t.png
that is from

http://my-friend.co/Test_rec4/Default.aspx?userid=mc23
0
Hi,

I like to see some .class files generated in EAR file. Is there any java free decompiler to do this within eclipse and outside eclipse as well. please advise
0
Hi,
There is one chart shown to this

http://my-friend.co/Test_rec4/Default.aspx?userid=mc23

but how to change the position of chart to be a part of the House list?
0
Hi,


what is difference between below 3 lines




 map.put("ab", map.get("a").concat(map.get("b")));



map.put("ab", map.get("a")+ map.get("b"));

map.put("ab", "null" + map.get("b"));


I passed all tests
http://codingbat.com/prob/p107259
Looking for ways to improve my code and also avoid Null pointer exceptions


Expected	Run		
mapAB({"a": "Hi", "b": "There"}) → {"a": "Hi", "ab": "HiThere", "b": "There"}	{"a": "Hi", "ab": "HiThere", "b": "There"}	OK	
mapAB({"a": "Hi"}) → {"a": "Hi"}	{"a": "Hi"}	OK	
mapAB({"b": "There"}) → {"b": "There"}	{"b": "There"}	OK	
mapAB({"c": "meh"}) → {"c": "meh"}	{"c": "meh"}	OK	
mapAB({"a": "aaa", "ab": "nope", "b": "bbb", "c": "ccc"}) → {"a": "aaa", "ab": "aaabbb", "b": "bbb", "c": "ccc"}	{"a": "aaa", "ab": "aaabbb", "b": "bbb", "c": "ccc"}	OK	
mapAB({"ab": "nope", "b": "bbb", "c": "ccc"}) → {"ab": "nope", "b": "bbb", "c": "ccc"}	{"ab": "nope", "b": "bbb", "c": "ccc"}	OK

Open in new window


please advise
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,

public Map<String, String> topping2(Map<String, String> map) {
  if(map.get("ice cream")!=null){
    map.put("yogurt", map.get("ice cream"));
  }
  if(map.get("spinach")!=null){
    map.put("nuts", map.get("spinach"));
  }
  else{
    map=map;
  }
  return map;
}

Open in new window

how above code different from below code

public Map<String, String> topping2(Map<String, String> map) {
//public Map < String, String > topping1(Map < String, String > map) {
   // map.put("spinach", "nuts");
    if (map.containsKey("spinach")) {
        map.put("spinach", "nuts");
   }
      if (map.containsKey("ice cream")) {
        map.put("yogurt", map.get("ice cream"));
       // map.put("ice cream", map.get("ice cream"));

   }
    return map;
}

Open in new window


my above first code fails below test
http://codingbat.com/prob/p196458

Expected      Run            
topping2({"ice cream": "cherry"}) → {"yogurt": "cherry", "ice cream": "cherry"}      {"yogurt": "cherry", "ice cream": "cherry"}      OK      
topping2({"spinach": "dirt", "ice cream": "cherry"}) → {"yogurt": "cherry", "spinach": "nuts", "ice cream": "cherry"}      {"yogurt": "cherry", "spinach": "dirt", "ice cream": "cherry", "nuts": "dirt"}      X      
topping2({"yogurt": "salt"}) → {"yogurt": "salt"}      {"yogurt": "salt"}      OK      
topping2({"yogurt": "salt", "bread": "butter"}) → {"yogurt": "salt", "bread": "butter"}      {"yogurt": "salt", "bread": "butter"}      OK      
topping2({}) → {}      {}      OK      
topping2({"ice cream": "air", "salad": "oil"}) → {"yogurt": "air", "ice cream": "air", "salad": "oil"}      {"yogurt": "air", "ice cream": "air", "salad": "oil"}      OK      
0
Hi,

How below solution is different from

public Map<String, String> topping3(Map<String, String> map) {
 // Map<String, String> map=null;
  if(map.get("potato")!=null){
    map.put("fries",map.get("potato"));
  }
    if(map.get("salad")!=null){
    map.put("spinatch",map.get("salad"));
  }
  else
  map=map;
  return map;
  
}

Open in new window


below solution

public Map < String, String > topping3(Map < String, String > map) {
   // map.put("bread", "butter");
    if (map.containsKey("potato")) {
        map.put("fries", map.get("potato"));

    }
     if (map.containsKey("salad")) {
        map.put("spinach", map.get("salad"));

    }
    return map;
}

Open in new window



please advise.

First one does not pass all tests from
http://codingbat.com/prob/p128461
Expected      Run            
topping3({"potato": "ketchup"}) → {"potato": "ketchup", "fries": "ketchup"}      {"potato": "ketchup", "fries": "ketchup"}      OK      
topping3({"potato": "butter"}) → {"potato": "butter", "fries": "butter"}      {"potato": "butter", "fries": "butter"}      OK      
topping3({"salad": "oil", "potato": "ketchup"}) → {"spinach": "oil", "salad": "oil", "potato": "ketchup", "fries": "ketchup"}      {"salad": "oil", "spinatch": "oil", "potato": "ketchup", "fries": "ketchup"} missing: "spinach": "oil"      X      
topping3({"toast": "butter", "salad": "oil", "potato": "ketchup"}) → {"toast": "butter", "spinach": "oil", "salad": "oil", "potato": "ketchup", "fries": "ketchup"}      {"toast": "butter", "salad": "oil", "spinatch": "oil", "potato": "ketchup", "fries": "ketchup"} missing: "spinach": "oil"      X      
topping3({}) → {}      {}      OK      
topping3({"salad": "pepper", "fries": "salt"}) → {"spinach": "pepper", "salad": "pepper", "fries": "salt"}      {"salad": "pepper", "spinatch": "pepper", "fries": "salt"} missing: "spinach": "pepper"      X      
other tests
OK
0
hi,

i have a massive python project without Readme file. what is the best way to understand how to run that project?

many thanks.
0
Hi,
To this site
http://my-friend.co/Test_rec4/Default.aspx?userid=mc23

I want to decrease the width of the highlighted area (in red), and increase the width of the area (highlighted in yellow), and to put two more buttons (under current Delete button). Can you please show me the change for these?
16j.png
0
0
Hi,
Further to this
https://www.experts-exchange.com/questions/29042667/Add-button.html?anchor=a42220705¬ificationFollowed=192653361#a42220705

I adjust the column name in Javascript but the problem persists (I cannot delete the record), after re-deployment.
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.