Programming

52K

Solutions

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

actualy i have created a popup.on the body part of browser i have disbled mouse click(right and left click) bt now i want , if i click on new window tab or browser cut buttion it should be disabled(both right click and left click).
i am using programming language html,css,javascript......can u plz give me the solution
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

How can I be very proficient in Java? I am an electrical electronics engineer but I have keen interest in programming though my age is not that encouraging- I am 35 years old.
0
I am working with my son learning javascript by following a book called '3D Game Programming for Kids'. It is an awesome book, explains thing nicely and we were doing great until we got to the following bit of code that we absolutely need to continue the book. It is supposed to add four trees to the screen but when I place this bit of code in the main code our original avatar does not even show up anymore so i know that the only problem was with this section of code with the tree not with the rest of it. I will show you this section of code (that I copied exactly from the book) and then then entire avatar code so far. Any help is very much appreciated as we are completely stuck and cannot move forward and I really need your help to help my son learn but I'm learning at the same time. Thanks! :)

This is the Tree code:

***********

makeTreeAt(500, 0);
makeTreeAt(-500, 0);
makeTreeAt(750, 0);
makeTreeAt(-750, 0);

function makeTreeAt(x, z) {
  var trunk = new THREE.Mesh(
    new THREE.Cylinder.Geometry(50, 50, 200),
    new THREE.MeshBasicMaterial({color: 0xA0522D})
    );
 
  var top = new THREE.Mesh(
    new THREE.SphereGeometry(150),
    new THREE.MeshBasicMaterial({color: 0x228B22})
    );
    top.position.y = 175;
    trunk.add(top);
   
    trunk.position.set(x, -75, z);
    scene.add(trunk);
}

**********************************************************


Here is the entire code for the avatar with the tree code added:

0
Hello

I'm currently trying to write a simple tool that creates a series of simple buttons that open various system tools.  Using the Process.start option and I'm experiencing a file not found issue when the commands are run.  Currently I'm using the script below to open up for programs as a test.  The first two commands work fine (compmgmt.msc, eventvwr.msc) but the system errors with an Exception Unhandled System.ComponentModel.Win32Exception 'The system cannot find the file specified' when it tries to run dsa.msc.  I've googled it but not found much help, the .msc are definitely in that folder and I can run them from file explorer by double-clicking on them or from a command/PowerShell prompt.   I'm a complete novice with vb.net and most programming, so any light that can be shed on this issue would be gratefully received.

Private Sub ADUC_Click(sender As Object, e As EventArgs) Handles ADUC.Click
        System.Diagnostics.Process.Start("c:\windows\system32\compmgmt.msc")
        System.Diagnostics.Process.Start("C:\Windows\System32\eventvwr.msc")
        System.Diagnostics.Process.Start("C:\Windows\System32\dhcpmgmt.msc")
        System.Diagnostics.Process.Start("C:\Windows\System32\dsa.msc")

    End Sub


Blessings

Jez
0
I'm currently trying to create a script that will search for specific data in an excel document and print out a range of cells.

For example, it would search for "color" in column A. If "color" was found in A4 it would print out the data in A4, B4, C4, D4, etc.

import openpyxl
wb = openpyxl.load_workbook('example.xlsx')
sheet = wb.get_sheet_by_name('Sheet1')

for rowOfCellObjects in sheet['A1':'C3']:
    for cellObj in rowOfCellObjects:
        print(cellObj.coordinate, cellObj.value)

Open in new window


This is the only code I have so far which is an excerpt from Al Sweigart. “Automate the Boring Stuff with Python: Practical Programming for Total Beginners.” iBooks. and the only thing it does is search for specific cell addresses and prints those.

Is this a feasible project? I'm very new to Python so I don't fully grasp its limitations.

Any help would be appreciated!
0
*I was tasked with writing a script (suggested in python but can be anything that the Crontab will work with) but my programming skills are definitely lacking. In the past week I have been researching and trying to learn as much as I can and below is what I came up with but I could use some help from the EE community. Thanks!

I am trying to write a script in python that will run on our Crontab of our Linux VM server. The script is supposed to recursively go through all the files on the remote server directory and download the specified file type (.csv in this case) and then promptly delete whatever files successfully download from the server. I have the following code using pysftp but I am open to using other modules such as paramiko or lftp if it's easier. It just needs to be able to be run as a Cron job in our Crontab on the linux server.

Below is my current code but it isn't work in terms of remotepath, localpath. I tried to tell it to download the file to a certain path but it's not going there. Also I don't know the command to remove the files it downloaded only. In other words files might already be on the local server and if so they should NOT download so that means the file wouldn't be removed from the remote server (if it doesnt download it shouldn't get removed).

For security purposes I have removed the server info. I did create a public/private key for ssh but unsure of how to implement it into my code.

import pysftp
import sys
import glob

srv 

Open in new window

0
Hi, does anyone have experience in this field? Where should we start as the beginners?

Many thanks as always!
0
Dear Team, can anyone show me where to begin with C++ in programming mobile apps?

I'm a newbie in C++ so if possible, pls give me links for the Beginners.

Many thanks in advance,
0
Which is the best handheld device for learning programming and later also developing programs on the go anywhere?

So that I can write a few lines of code on the metro, bus, when waiting for a flight etc.

I was thinking of this Raspberry Pi, but some don't recommend it for learning programming.

Is there any other alternative, something with long battery life in the size of a big smartphone (or maybe 9 inches display)?
0
import java.util.*;
import java.util.stream.*;
public class X {
	public static void main(String[] args) {
		List<String> list = Arrays.asList("xxax", "xbxbx", "xxcx", "zzz");
		System.out.println(noX(list));
	}
	public static List<String> noX(List<String> strings) {
		return strings.stream().map(s -> s.replaceAll("x","")).collect(Collectors.toList());
    }	
}

Open in new window

in above program what are Collectors , stream, collect methods. And why map is used in this lamda functional examples
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 created a x64 context menu shell extension in C++, which works fine when I right click a file or folder in the file list. But when I right click on a directory in the directory tree on the left Windows Explorer crashes, with no error details.

Any idea what can cause this to happen only in the directory tree?
0
Hello,
Within the last 3-4 months I had changed the environment variables, and today I can't.  I read the findings from the internet and that has not worked.  I am Administrator.  I read that since Windows 10 15011 the ability to change the environment variables has been disabled.
Might you know of a work around.  I need this solved very soon.  I hope one of you will know.
Thanks
0
Hi,

http://codingbat.com/prob/p105967

I wrote my code as below and failing some tests
public List<String> noX(List<String> strings) {
   strings.replaceAll(x -> "");
  return strings;
}

Open in new window



Expected	Run		
noX(["ax", "bb", "cx"]) → ["a", "bb", "c"]	["", "", ""]	X	
noX(["xxax", "xbxbx", "xxcx"]) → ["a", "bb", "c"]	["", "", ""]	X	
noX(["x"]) → [""]	[""]	OK	
noX([""]) → [""]	[""]	OK	
noX([]) → []	[]	OK	
noX(["the", "taxi"]) → ["the", "tai"]	["", ""]	X	
noX(["the", "xxtxaxixxx"]) → ["the", "tai"]	["", ""]	X	
noX(["this", "is", "the", "x"]) → ["this", "is", "the", ""]	["", "", "", ""]	X	
other tests
		X	

Open in new window


how to fix and improve my code, please advise
0
Hi,

I am trying to double list numbers using functionala lamda programming


http://codingbat.com/prob/p117665
Given a list of integers, return a list where each integer is multiplied by 2.

doubling([1, 2, 3]) → [2, 4, 6]
doubling([6, 8, 6, 8, -1]) → [12, 16, 12, 16, -2]
doubling([]) → []

Open in new window


Solution:

public List<Integer> doubling(List<Integer> nums) {
  nums.replaceAll(n -> n * 2);
  return nums;
  
  // OR the equivalent java streams solution:
  // return nums.stream()
  //  .map(n -> n * 2)
  //  .collect(Collectors.toList());
}

Open in new window

i am trying to write a java a program to execute it in exclipse to see result in eclipise consoel

import java.util.List;

public class FuncProgDouble {
	public static void main(String[] args) {
		List<Integer> li=[1, 2, 3];
		System.out.println(doubling(li));
	}

	
	public static List<Integer> doubling(List<Integer> nums) {
	  nums.replaceAll(n -> n * 2);
	  return nums;
}

	
}

Open in new window


i am getting below compilation error.

Multiple markers at this line
      - Syntax error on token "]", } expected
      - Type mismatch: cannot convert from int[] to
       List<Integer>
      - Syntax error on token "[", { expected

canont i add primitives as below to Integer list


import java.util.ArrayList;
import java.util.List;

public class FuncProgDouble {
      public static void main(String[] args) {
            
            
            ArrayList<Integer> al=new ArrayList<Integer>();  
            al.add("1");  
            al.addAll("3");  
            al.addAll("8");  
            //al.add(1,"Sachin");
            
            //List<Integer> li=[1, 2, 3];
            System.out.println(doubling(al));
      }

      
      public static List<Integer> doubling(List<Integer> nums) {
        nums.replaceAll(n -> n * 2);
        return nums;
}

      
}

please advise
0
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
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
I just need to be alerted (via email) when a Pull Request is created.

How?

Thanks
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
I had this question after viewing Set font smaller and allow box to expand.

Assistance is greatly appreciated.
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 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
This strange error on displayed text (in image) I have seen over and over again on dozens of pages. Then I tried using Chrome and the problem went away.

SafariMacTextError
Do I need to switch to Chrome?

Thanks
0
When I use FileInfo to return the size of a file for me, it is returned in bytes. The code is simple enough.
FileInfo fi = new FileInfo(filePath);

Open in new window

The code then returns 16599774 bytes for the file in question.
size in bytesI then convert it to Megabyte by using the following code in an extension method.
return (bytes > 0) ? (bytes / 1024f) / 1024f : bytes;

Open in new window

I return the MB size as follows:
$"{Round(fileLength.ToMegabytes(),1).ToString()} MB";

Open in new window

I see that the size returned is 15,8 MB. When I look at the file properties however, I see this:
file propertiesWhen I view the file in Windows Explorer, I see a different size again
explorer sizeMy question is this:
1. Why the difference in file sizes between 15.8 MB and 16 599 774 bytes that I am seeing in code and in the file properties? Does it have to do with the data types? The bytes being long and the MB being double?
2. Why is the file size in Windows Explorer different again at 16 211 KB?
I understand why there is a difference between Size and Size on disk, but not between bytes and MB.
0
Back in the day (about to show my age here) when I was deep into using the Commodore Amiga and Workbench, I worked with a developer on the ability to create a RAM Drive. Not just a drive letter in Ram, an actual drive.

Essentially, the idea was to create the ability of making a pseudo hard drive in Volatile Ram space, that could be used as a regular hard drive.

Obviously, this had huge benefits in terms of program speed, as you could hack install an operating system into this disk and then install software into it (mostly games at the time) and then run that software at unheard of speeds. He actually got it working too! Sadly, he's now deceased so all his ideas and work were lost with him.

A recent question on Experts Exchange made me remember the project so I was wondering if anyone had heard of something like this for Windows?

NB: I know the RAM considerations, but I currently have a high end server sitting around here doing nothing, that also has 128GB of RAM installed in it. More than enough for an operating system and some programs.  And yes I know that all would be lost if the host operating system crashed :)

All that said.. anyone heard of something like this being developed for Windows?
0
I would like to implement a fast fixed point sine approximation for PIC24F microcontrollers on 16bit.
I started from here: http://www.coranac.com/2009/07/sines/
The approximation is done with polynomials: 3rd order up to 5th or even 6th order.
I am stuck in the beginning.
The 3rd order polynomial is S3(x)=(3/PI)*x-(4/PI^3)*(x^3) or S3(z)=(1/2)*z*(3-z^2) with z=x/(1/(2*PI))
I tried an Excel sheet for this function and I compared with sin() from Excel.
Either I make a mistake or the approximation error is too big.
Here is the Excel: https://goo.gl/2KJXj8 
Could you help to debug this?
0
Hello,

In case it's frowned upon, I apologize for importing a question/thread from another forum but I could use some help understanding a couple of comments.

Several years ago, I began using Directory Opus in place of Windows Explorer as my primary file manager for reasons not really relevant to this question.

Recently, I posted a question on the Directory Opus forum with the title:

Force folder shortcut in Windows Explorer to open destination folder in Directory Opus

However, after receiving two fairly detailed replies, I'm unfortunately still not sure what to do. Also, I sense that the difficulty I'm having is related more to my general level of computer know-how (or lack thereof :P) rather than my proficiency level re Directory Opus — although it could easily be that I'm lacking too much in both. Therefore, rather than post a request for a third clarification, I opted to see if one of my friends here on EE (who is likely more familiar with my skill level) could help me understand what to do.

The thread from the other site is included in its entirety below (in case it is the topic of a future search on EE) or it can obviously be accessed at the above link.

Thanks

__________________________________________________
Thread from Force folder shortcut in Windows Explorer to open destination folder in Directory Opus
0

Programming

52K

Solutions

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.