Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x

Scripting Languages

26K

Solutions

20K

Contributors

A scripting language is a programming language that supports scripts, programs written for a special run-time environment that automate the execution of tasks that could alternatively be executed one-by-one by a human operator. Scripting languages are often interpreted (rather than compiled). Primitives are usually the elementary tasks or API calls, and the language allows them to be combined into more complex programs. Environments that can be automated through scripting include software applications, web pages within a web browser, the shells of operating systems (OS), embedded systems, as well as numerous games. A scripting language can be viewed as a domain-specific language for a particular environment; in the case of scripting an application, this is also known as an extension language.

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

Sign up to Post

I am playing with a puzzle program where certain puzzle pieces will have information to share, and those are the ones with a "dog-ear" on the upper corner.

Sample
Those with a dog-ear will respond differently to user interaction and each will have images, videos and/or help text, explaining what's so special about the selected  puzzle piece. There could also be a left-click or a right-click which opens an enlarged version of a given puzzle piece, so the user can get a close-up.

I need some ideas about how to present this information to the user. I am not sure what types of click or clicks would be used to bring up what probably would be a menu of options.


Suggestions?
0
Free Tool: ZipGrep
LVL 10
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Here i the CSS I use to create the dark corner in the upper-right.


.dog-ear {
	position: absolute;
	top: 0;
	right: 0;
	height: 10px;
	width: 10px;
	background: linear-gradient(45deg, #333 0%, #333 50%, #fff 50%, #fff 100%);
}

Open in new window



But It sometimes looks choppy.

Choppy line
Is there a different way to do this?
0
In Vmware VM and Templates , I have several folders, and in each folder there are multiple VMs.
I want to know to which Host and Cluster each VM belongs to
is it possible to get the list through Powercli ? or it needs a script?

for instance:

VM Name,        Cluster Name,        ESX Host Name
VM 1		    Clust1	                    ESX1
VMX                    ClustA                    ESXB  

Open in new window



Thank you
1
I added a class to a div, and verify the booelan's working.  But, the ng-class is failing.

    <div ng-class="{ 'dog-ear' : isDogEared }"></div>

Open in new window


Inside the Typescript template I have:
@Output() isDogEared:boolean;

  dogEarIndexes: number[];

  constructor() 
  { 
    this.dogEarIndexes = [ 1,3,5 ];
  }

  ngOnInit() {
    this.imageFilename = "PuzzlePiece_Maps_" + (this.value.id + 1).toString() + ".gif";
    
    this.id = this.value.id;
    this.isDogEared = this.dogEarIndexes.indexOf(this.id) > -1;
    console.log('Id:'+this.id+" - " + this.imageFilename + " isDogEared="+ this.isDogEared.toString());    
  }

Open in new window


and the page does not generate any errors, and I verified the boolean values are properly set in ngOnInit()

Booleans Work OK

What am I missing?
0
I had this question after viewing Modifying PowerShell script to list last 5 Event ID not working ?.

Hi All,

When I modify the script to get the Exchange server events, somehow it does not show it in the first column ?

$objExcel = New-Object -comobject Excel.Application
$objExcel.Visible = $True
$objWorkbook = $objExcel.Workbooks.Add()
$objSheet = $objWorkbook.Worksheets.Item(1)
$objSheet.Cells.Item(1,1) = "Server"
$objSheet.Cells.Item(1,2) = "LogName"
$objSheet.Cells.Item(1,3) = "Time"
$objSheet.Cells.Item(1,4) = "Category"
$objSheet.Cells.Item(1,5) = "ID"
$objSheet.Cells.Item(1,6) = "Source"
$objSheet.Cells.Item(1,7) = "Message"
$objSheetFormat = $objSheet.UsedRange
$objSheetFormat.Interior.ColorIndex = 19
$objSheetFormat.Font.ColorIndex = 11
$objSheetFormat.Font.Bold = $True

$Row = 2

$Servers = Get-ExchangeServer

foreach ($Server in $Servers) {
    foreach ($Log in @("Application", "Security", "System")) {
        $Events = Get-EventLog -LogName $Log -Computer $Server -Newest 5 -ea Silentlycontinue | Where-Object {$_.EntryType -in 'Error', 'Warning'} | Sort-Object Source
        foreach ($Event in $Events) {
            $objSheet.Cells.Item($Row, 1).Font.Bold = $True
            $objSheet.Cells.Item($Row, 1) = $Server
            $objSheet.Cells.Item($Row, 2) = $Log
            $objSheet.Cells.Item($Row, 3) = 

Open in new window

0
Hi All,

I got this script that used to work to report the last 5 error & warning from multiple Exchange Server then write it into Excel.

Somehow this is not working ?

$objExcel = New-Object -comobject Excel.Application
$objExcel.visible = $True
$objWorkbook = $objExcel.Workbooks.Add()
$objSheet = $objWorkbook.Worksheets.Item(1)
$objSheet.Cells.Item(1,1) = "Server"
$objSheet.Cells.Item(1,2) = "LogName"
$objSheet.Cells.Item(1,3) = "Time"
$objSheet.Cells.Item(1,4) = "Source"
$objSheet.Cells.Item(1,5) = "Message"
$objSheetFormat = $objSheet.UsedRange
$objSheetFormat.Interior.ColorIndex = 19
$objSheetFormat.Font.ColorIndex = 11
$objSheetFormat.Font.Bold = $True

$row = 1

$servers = Get-ExchangeServer

foreach ($server in $servers)
{
  $row = $row + 1
  $AppLog = Get-EventLog -LogName Application -computer $server -Newest 5 | Where-Object {$_.EntryType -like 'Error' -or $_.EntryType -like 'Warning'} | Sort-Object Source
  $SecLog = Get-EventLog -LogName Security -computer $server -Newest 5 -ea Silentlycontinue | Where-Object {$_.EntryType -like 'Error' -or $_.EntryType -like 'Warning'} | Sort-Object Source
  $SysLog = Get-EventLog -LogName System -computer $server -Newest 5 | Where-Object {$_.EntryType -like 'Error' -or $_.EntryType -like 'Warning'} | Sort-Object Source
  foreach ($Cat in $AppLog,$Syslog,$Seclog)
  {
    if ($cat -is [array])
    {
      if ($AppLog -contains $cat[0]) {$Catname = "Application"}
      if ($SecLog -contains $cat[0]) {$Catname = 

Open in new window

0
Please provide me with the command line or power shell commands to enable & disable network discovery within Windows 10.
0
I have an Access DB, in it I have an authentication form for users, I want to import data using a powershell script, but when the script opens the DB fails to import because the form does not enter the access data. My code is this and I could not make it work

$database = 'D:\db.accdb'
$Acc = New-Object –comObject Access.Application
$Acc.Visible = $false
$Acc.OpenCurrentDataBase($database)
$Acc.DoCmd.OpenForm('Form_Login_bd')
$AccForm = $Acc.Forms.item('Form_Login_bd')
$AccForm.Controls.Item("txt_login").value = "Test_Admin"
$AccForm.Controls.Item("txt_contrasena").value = "Test_Admin123"
.
.
.
script to import data
.
.
.

Any idea how to solve it
0
Hello all,

I need to build a table that has which cost center should be mapped different service codes.  

I have a list of almost 35K records that I need to map.  In a perfect world, I could just say 000001 to 000100 belongs to 5010 then 000101 to 000200 belong to 5020.  Well that does not work as I have some ranges within a range that belongs to a different cost center or in one section every other code changes to a different cost center really only 2 (000300 = 5040, 000301 = 7485, 000302 = 5040, 000303 = 7485 and so on.) I still would like to have some SQL code that would read in the first record say OK here is the start of my range and it goes to cost center xxxx then look at the next record it is the same cost center so it is the top of the range, go to the next one it is the same cost center so it is now the top of the range.  Finally, the cost center changes so it is the start of the new range for the new cost center and I do the same logic again.  Does this sound right?  I just need a little help getting started.

*** UPDATE ***
10/19/2017
I built the table manually but I would still like to create a script in SQL or VBA that will take my listing of codes and map a range out for each section.  The listing is around 25,000 lines and my range table is about 4,000 lines.  It took me a few hours to create it.  Creating the range in SQL is my preference, but I can do VBA as well.  Thanks again.


10/18/2017
I have started creating a VBA Function in Access to …
0
I hope to post a sample application which displays a problem I am having and need to find what aspects I need to create for this. It would mainly be for posts on EE but could be used to share my code for other purposes.

Can you suggest one?

I create a GitGub account and use Git to put the latest version of my site to GitHub.

What if two people want to make an alteration to the code I post there? When someone makes a change, is there a way to auto-fork the repo?
0
Free Tool: Subnet Calculator
LVL 10
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

I need to Deploy a Scheduled Task via GP which needs to run a Domain User to access different shares needed within the script.
Task needs to run at a spefific time and day of week regardless if user is logged in or not.
Microsoft released the Patch that did with that Setting . https://support.microsoft.com/en-us/kb/2962486

What are the alternatives to run a script that needs access to network resources , run under specific credentials, runs at spefic time?
The Script basically copies files from local System32\ to a network location.

Startup scripts won’t work since it’s domain wide collection that needs to be completed within a few hours window. And machine reboots are not an option.
0
I received an excellent response to my question of deleting files based on match and amount of days old.   Initially I was told they should delete based on age of file and if they have a matching .xxx file.    That has since changed to:   files should delete based on if there is a matching .xxx file and only if it is older than 3 days (regardless if the other files are older).  

The script help I received before from Bill Prew looks like:

@echo off
setlocal EnableDelayedExpansion

rem Define folder to process
set "BaseDir=C:\Users\ad9f2p\TEST CLEANUP"

rem Look at each .XXX file
for %%A IN ("%BaseDir%\*.xxx") do (

  rem Reset delete flag, and check all files with this same base filename
  set DeleteFlag=Y
  for %%B IN ("%BaseDir%\%%~nA.*") do (

    rem Get dyas since last modified (using VBS helper routine)
    set Fileage=0
    for /f "tokens=*" %%C in ('cscript //nologo fileage.vbs "%%~B"') do (
      set Fileage=%%C
    )

    rem If any file found less than 3 days old, do not delete the group
    if !FileAge! LEQ 3 (
      set DeleteFlag=N
    )
  )

  rem If all files found older than 3 days, delete them all
  if "!DeleteFlag!" EQU "Y" (
    ECHO del /q "%BaseDir%\%%~nA.*"
  )
)

Open in new window

Can I add a nested If statement to the section:

    rem If any file found less than 3 days old, do not delete the group
    if !FileAge! LEQ 3 (
      set DeleteFlag=N
    )

Open in new window

Can I check the file age on only the .xxx files and delete the corresponding files that match then, only if the .xxx file is older than 3 days?   I've tried doing this by rearranging the logic, currently it deletes everything with a .xxx file:    What am I missing here?


Open in new window

0
I need a script to press automatically OK every 2 min, see snapshot bellow and here the script i use, not working:

Set wshShell = CreateObject("WScript.Shell") 

Do 
    ret = wshShell.AppActivate("Remote Desktop Connection") 
    If ret = True Then 
        wshShell.SendKeys "{ENTER}" 
        Exit Do 
    End If 
    WScript.Sleep 500 
Loop 

Open in new window

error.JPG
0
I am unsure about how to change the styling on my PuzzlePiece Component. I draw an image inside of a span.

<div class="puzzle-piece">
    <span><img src="{{ imageFilename }}" /></span>
</div>

Open in new window


with the following styling...
.puzzle-piece {
    width: 12.5%;
    float: left;
    box-sizing: border-box;
    background-color: #007acc;
    position: relative;
    padding-bottom: 12.5%;
    border-right: 2px solid blue;
    border-bottom: 2px solid blue;
    text-align: center;
    z-index: 10;
}
.puzzle-piece span {
    position: absolute;
    top: 50%;
    left: 50%;
    font-size: 3em;
    font-family: 'Arial';
    transform: translateX(-50%) translateY(-50%);
    color: rgba(255,255,255,5);
}

Open in new window


In order to make the edges touch for each of the puzzle pieces, I needed to make the width of the puzzle 100%:
.puzzle {
    width: 100%;
    margin: 0 auto;
    border-top: 2px solid blue;
    border-left: 2px solid blue;
}

Open in new window


But I prefer a lower width, like 80%.

Full screen
Also, I'd like the image to maintain its integrity, and stay tight, even when the browser grows.
centered
Lastly, does the span style control the image style? Or does img need its own styling?
0
Hello there,

I wrote a small Python script to send email and push notifications.

It clearly needs the user to store his email user and password and his push services access data.

How can I secure this data in a good way?

At the moment being I save the user and pass on a separate file and make that file readable only by the user that will run the script.

Is this sufficient?

Thanks for your time and help
1
Code snippet from PuzzleCanvasComponent where I fill the PuzzlePieceComponent array.
ngOnInit() { 
    let index = 0;
    for(let row = 0; row < this.rows; row++) {
      for(let column = 0; column < this.columns; column++) {
        this.pieces[index] = new PuzzlePieceComponent();
        this.pieces[index].id=index;
        index++;
      }
    }
  }

Open in new window


I want to set the "id" property there, but this line does nothing:
        this.pieces[index].id=index;


So I tried to use the HTML template for PuzzleCanvasComponent, but have the syntax wrong.
<div class="puzzle">
    <puzzle-piece *ngFor="#piece of pieces; #i=index" [value]="piece" [id]="i"></puzzle-piece>
</div>

Open in new window


with the following properties created in the TS file
export class PuzzlePieceComponent implements OnInit {
  @Input() value:PuzzlePieceComponent;
  @Input() id:Number;
...

Open in new window


I'd prefer if the first method could be made to work, especially since I want to expand the number or properties set in
ngOnInit() beyond just the id.

Is method #1 fixable? Or must iI use the second method? If so, what is the syntax?
0
I need help creating a Script that will Check if the Uptime(Hours) is exided on Windows 10 Operating Systems. I am not that Scripting guy just a newbie in the Scripting world.The following will be the Parameters I would like to have:

Parameter 1 specifies after how many hours without rebooting the user is asked via a message box  to restart their computer themself or to shut down .

Parameter 2 specifies after how many hours without restarting will the script plan an automatic restart in 60min (with no prompt for cancelling)


The script must be controllable with at least two parameters
Thank You in Advance
0
I have a little Angular app with two small Components, PuzzleCanvas and PuzzlePiece. I have a sample number of 9

PuzzlePieceComponent with a style CSS I just can not update. So, as a result, all PuzzlePieceComponents are drawn over the other.
import { Component, OnInit, Input } from '@angular/core';
declare var jquery:any;
declare var $ :any;

@Component({
  selector: 'puzzlepiece',
  styles: [ ],
  template: `
     <img id="#PuzzePiece{{ id }}" 
     style="position:absolute; display:block; width:100px; height:100px; left:12px; top:12px;"
     src="../../../assets/images/PuzzleCompleted_{{ id+1 }}.gif"/>
  `
})


export class PuzzlePieceComponent implements OnInit {
  title = 'Puzzle Piece';
  @Input() data:PuzzlePieceComponent;
  @Input() id:Number;
  //pieceStyling:string=this.getPieceLocation();
  constructor() { }

  ngOnInit() {
    this.id = this.data.id;   
    console.log("ID:" + this.id) 
  }

Open in new window



PuzzleCanvasComponent is constructing the PuzzlePieceComponents correctly
import { Component, Input, OnInit } from '@angular/core';
import { NgFor } from '@angular/common';
import { PuzzlePieceComponent } from '../puzzlepiece/puzzlepiece.component';

@Component({
  selector: 'puzzlecanvas',
  styles: [`canvas { width: 800px; height: 500px; border: 2px solid black; }`],
  template: `<canvas></canvas>
             <puzzlepiece *ngFor="let piece of pieces" [data]="piece" [id]=index></puzzlepiece>`
})

export class PuzzleCanvasComponent implements OnInit {
  title = 'Puzzle Peace';
  @Input() piece:PuzzlePieceComponent;
  pieces = [];
  columns:number = 3;
  rows:number = 3;

  constructor() { }

  ngOnInit() { 
    let index = 0;
    for(let row = 0; row < this.rows; row++) {
      for(let column = 0; column < this.columns; column++) {
        this.pieces[index] = new PuzzlePieceComponent();
        this.pieces[index++].id=index;
      }
    }
  }
}

Open in new window



The PuzzleCanvasComponents are being written one over the other...
Overwriting

But I have verified all 9 PuzzlePieceComponents are loading
Creation
I feel like I have tried everything. Notice I can use the {{}} for property binding when it comes to setting the ID and the src for image.

I have a jquery (Plan B) solutin that also does not work. That question is here:
https://www.experts-exchange.com/questions/29062600/Angular-CSS-need-to-resort-to-jquery.html

It seems like I reached a limiting factor in the Javascript methodology. Is that possible?

Is there a different place in the page life-cycle, besides ngOnInit(), where I can place update logic?

My project is stuck until I can get past this.

Thanks.
0
hi friends well we all know that if the computer is lock the script gets paused or doesnt works is their a way that even if the computer is lock the scripts still works????? because i have seen few processes which continue to work even if the computer is lock
0
Keep up with what's happening at Experts Exchange!
LVL 10
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

I use Chrome and wonder what I need to install into Visual Studio Code in order to debug inside of Visual Studio Code.

I do not want to use the Chrome debugger, since I waste so much time  searching for the file to debug. I wand to set breakpoints in Visual Studio Code.

Thanks.
0
I want to make it easy to run my Angular app so it's easier to show the problem I am having. But I just noticed the repo contains tons of node packages, brining the size of this little Angular program (with two Components) to 172 MB.

I did not want to commit and push this without asking how Plunker works and what options I have regarding all those node modules.

Thanks.
0
Using Angular alone, I have trouble setting the "left" and the "top" for the following image tag. But you can see I am successfully updating  the src value with a variable called "id."

 template: `<img id="#PuzzePiece{{ id }}" style="left:10px; top:10px; position:absolute; width:100px; height:100px;"
                  src="../../../assets/images/PuzzleCompleted_{{ id+1 }}.gif"/>`
})

So I am trying to use jquery with no luck. I am just doing a test, trying to get left and top set to 100. I verified the jquery is correct.

The page thrown no errors so I assume I installed jquery correctly.


  ngOnInit() {
    this.id = this.data.id;    
    this.updateImageCoordinates();
  }

  updateImageCoordinates()
  {
    var imageId = "#PuzzlePiece" + this.id.toString();
    $(imageId).css({"left":100,"top":100});
  }
 
What am I missing?

Thanks
0
when I update this:

constructor()
{
}
 
to be this:

constructor(public _id:Number, public _X:Number, public _Y:Number)
{
}

I get the attached error:

error
and the page fails to load.

Clearly, the declaration of PuzzlePieceComponent in the app.module.ts Module is setting up the expectation for a version with no parameters. How do I et around this?

Are these params needed if I use:

  @Input() id:Number;
  @Input() X:Number;
  @Input() Y:Number;

Thanks.
0
I am successfully setting these values inside the PuzzlePiece component...

  @Input() id:Number;
  @Input() X:Number;
  @Input() Y:Number;

The ID is used to successfully load the correct image file. But I do not know how to draw that image at the X and Y values.

How do I pass a component's value to the CSS?
0
I need to load an image based on a generated filename but find the following logic fails.

@Component({
  selector: 'puzzlepiece',
  styles: [],
  template: '<img src="../../../assets/images/PuzzleCompleted_" + {{ id }} + ".gif" />'
})

Instead of displaying the image, the path name variable is displayed on the page, thusly:

path name
but when I hard code the filename, it works:

@Component({
  selector: 'puzzlepiece',
  styles: [],
  template: '<img src="../../../assets/images/PuzzleCompleted_1.gif" />'
})

hard coded path
How do I use a variable to set the "src" for an image inside an HTML template?
0

Scripting Languages

26K

Solutions

20K

Contributors

A scripting language is a programming language that supports scripts, programs written for a special run-time environment that automate the execution of tasks that could alternatively be executed one-by-one by a human operator. Scripting languages are often interpreted (rather than compiled). Primitives are usually the elementary tasks or API calls, and the language allows them to be combined into more complex programs. Environments that can be automated through scripting include software applications, web pages within a web browser, the shells of operating systems (OS), embedded systems, as well as numerous games. A scripting language can be viewed as a domain-specific language for a particular environment; in the case of scripting an application, this is also known as an extension language.