We help IT Professionals succeed at work.

Programming

53K

Solutions

41K

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.

I just got an assignment to create a db at work and it's been years since I did any programming.

Please help me with a quick programming task:

Create a Sample ID # text using the record index from the table: Status

SampleID = "SI-" + Year(Date) +"-" + Status(Index)   - Is this correct?

Thanks,

Drew in Georgia
0
Need a way to debug.print in a loop in VB6   names of files in in directory AND the all names in de sub-directory below that path and if more sub-sub directories below that path also
sample map
0
Hello:

I have tried several different ways of combining my two CTEs within one "UNION ALL" statement but am having no luck.

How do I modify my syntax below to accomplish this?

Thank you!

Software Engineer

; with wip as 
(
select NULL as [LOTSEQNBR], FG.BatchNo as [FGBATCH], FG.FormulaId as [FG], FG.[Labor Cost] as [FGLABOR], FG.[OverHead Cost] as [FGOH], 
FG.[Material Cost] as [FGMAT], FG.[Labor Cost] + FG.[OverHead Cost] + FG.[Material Cost] as [FGCOST], FG.[TotalFGWeightYielded] as [FGWEIGHT], 
FG.[Labor Cost]/FG.[TotalFGWeightYielded] as [LABORLB],
FG.[OverHead Cost]/FG.[TotalFGWeightYielded] as [OHLB],
FG.[Material Cost]/FG.[TotalFGWeightYielded] as [MATLB],
NULL as [FORMULA], NULL as [FORMULAMAT], NULL AS [FORMULALABOR], NULL AS [FORMULAOH], NULL AS [Component], NULL as [LOT], NULL as [LOTQTY], 
NULL as [LOTMATUNITCOST], NULL as [LOTMATWIPCOST]
from BM_View_Dashboard_ProductionCostAnalysis FG
INNER JOIN BM010115 BOM ON FG.FormulaId = BOM.PPN_I
where FG.FormulaId = '506' and FG.BatchNo = '50418G12D' and BOM.SUBCAT_I = 1)
select [LOTSEQNBR], [FGBATCH], [FG], [FGLABOR], [FGOH], [FGMAT], [FGCOST], [FGWEIGHT], [LABORLB], [OHLB], [MATLB], [FORMULA], [FORMULAMAT], [FORMULALABOR], 
[FORMULAOH], [Component], [LOT], [LOTQTY], [LOTMATUNITCOST], [LOTMATWIPCOST],
[LABORLB]*[LOTQTY] as [LOTLABORWIPCOST],
[OHLB]*[LOTQTY] as [LOTOHWIPCOST]
from wip
; with wiplot as 
(
select * from (
select DISTINCT LOT.SLTSQNUM AS [LOTSEQNBR], NULL as [FGBATCH], NULL as [FG], NULL 

Open in new window

0
Hello, Experts,

I have a question to ask regarding a python script I have built to find a file, put in an array and SFTP that to a remote location that is running errors. The error I am getting is below.

Traceback (most recent call last):
  File "/Users/isaiah.melendez/Documents/python/alr_to_ho.py", line 38, in <module>
    ftpTransmit()
  File "/Users/isaiah.melendez/Documents/python/alr_to_ho.py", line 34, in ftpTransmit
    sftp.put(ftpALR[i], 'C:\CBASYNC')
  File "/Users/isaiah.melendez/Documents/python/venv/lib/python3.7/site-packages/pysftp/__init__.py", line 364, in put
    confirm=confirm)
  File "/Users/isaiah.melendez/Documents/python/venv/lib/python3.7/site-packages/paramiko/sftp_client.py", line 759, in put
    return self.putfo(fl, remotepath, file_size, callback, confirm)
  File "/Users/isaiah.melendez/Documents/python/venv/lib/python3.7/site-packages/paramiko/sftp_client.py", line 714, in putfo
    with self.file(remotepath, "wb") as fr:
  File "/Users/isaiah.melendez/Documents/python/venv/lib/python3.7/site-packages/paramiko/sftp_client.py", line 372, in open
    t, msg = self._request(CMD_OPEN, filename, imode, attrblock)
  File "/Users/isaiah.melendez/Documents/python/venv/lib/python3.7/site-packages/paramiko/sftp_client.py", line 813, in _request
    return self._read_response(num)
  File "/Users/isaiah.melendez/Documents/python/venv/lib/python3.7/site-packages/paramiko/sftp_client.py", line 865, in _read_response
    self._convert_status(msg)

Open in new window

0
Hi

Is there a way to SYNC and Schedule SVN - repository (source) with working copy on a server?

Can you please explain me how to do it, step by step?

Sync task needs to run every night to pull changes from repository (source) and update working copy on a server.

Regards, M
0
Hi Experts,

If you go to www.iwscc.ca you will see in the header 2 orange buttons: Corporate and Self-Registration, both going to #

Under WP Admin, I see that this theme is called Nonprofit, and the buttons are set in Theme Options >Address Bar, and ou will see in the snapshot that I can set the buttons label, but not the url. My questions are...

1- How do I remove the Corporate button? If I leave it blank, I just get an orange square.

2- How can I actually set an url to these?

I know I can create a child theme, and address #1 with CSS and #2 with JS, but I think there should be an easier way since the theme provides these buttons.

BTW- even though in the screenshot it says Webdivia, under themes it says Nonprofit. I just inherited this website.

Thank you,
wp admin
0
Hi Folks,

When printing an EE article, code snippets are jumbled up...they look like this:

print-bad
Gustav Brock submitted a bug report on this more than two years ago:
Code blocks of article print view are unreadable

The EE Mod at the time, Modalot, said this:
Ouch. That renders the printout almost useless. I've filed this internally as a major bug.
Not being aware of Gustav's bug report, I submitted one about two months ago:
Print feature at articles does not format code snippets properly

In response to my bug report, the same Mod (Modalot) informed me that it is an old bug and is "still unresolved". Being more than 2-1/4 years old and filed as a "major bug" by a Mod who has been an EE member for more than 10 years, it seems to me that EE is either incapable of, or not interested in, fixing the bug. As a result, I'm looking to the experts here for a workaround. I want to use the workaround to "print-to-PDF" my 63 EE articles and the Steps at my 47 EE video Micro Tutorials. Although that's 110 publications, only some of them have code snippets, so while I would prefer as automated a solution as possible, having to do some manual effort on each one is fine. I'm also fine with a solution that requires other products, such as Microsoft Word, or other commercial software. Thanks for your ideas! Regards, Joe
0
Dear Experts

In software development what does reversibility means, if we have to develop application what are the measures on reversibility,  please help us to understand this and best practices.

Thanks in advance
0
Sending text message for free?

I saw a price by Twilio to send text message for $75 per 100 message sent. But, this kills my business model.

Anyone know of a service that can sent Text Message for far less?

Thanks.
0
Hello,
I have a class car and an inner class engine. The inner class shouldn't be visible outside of the class car.
Is there still a way to give a Car an Engine as parameter?
Error: Car.Engine has private access in Car
Here is my code:

public class Main {
    public static void main(String[] args) {
        Car car = new Car("VW", "Red", new Car.Engine("Diesel"));
    }
}

Open in new window


public class Car {
    private String brand;
    private String color;
    private Engine engine;


    public Car(String brand, String color, Engine engine){
        this.brand=brand;
        this.color=color;
        this.engine=engine;
    }

    public Engine getEngineType(){
        return new Engine(engine.getType());
    }


    public void setEngine(Engine engine){
        this.engine=engine;
    }

    private class Engine{
        private String type;

        public Engine(String type){
            this.type=type;
        }

        public String getType() {
            return type;
        }
    }
}

Open in new window

0
Hello,
The program is about playing the next or previous song, replay or remove a song.
If I want to delete a song immediately after starting the program (case 5), I get an "IllegalStateException".
How do I fix the error?
If you see further errors or have improvements to the code, then you can also tell me.


import java.util.LinkedList;
import java.util.ListIterator;
import java.util.Scanner;

public class Songs {

    public static void main(String[] args) {

        LinkedList<String> songs = new LinkedList<>();
        songs.add("Song 1");
        songs.add("Song 2");
        songs.add("Song 3");
        songs.add("Song 4");
        songs.add("Song 5");
        songs.add("Song 6");

        Scanner scanner = new Scanner(System.in);
        boolean quit=false;
        boolean forward=true;
        ListIterator currentSong = songs.listIterator();

        printMenu();
        while(quit==false){
            switch(scanner.nextInt()){
                case 1:
                    printMenu();
                    break;
                case 2:
                    if(!forward){
                        if(currentSong.hasNext()){
                            currentSong.next();
                        }
                        forward=true;
                    }
                    if(currentSong.hasNext()){
                        System.out.println("Now playing " + currentSong.next());
                    }
                    else{
                        

Open in new window

0
I have updated my android studio from a version 2, to the newer version 3.6.1.
When I loaded my existing project into the newer version of Android studio, the gradle would no longer sync correctly. I am getting the error

"Gradle sync failed: Could not find method google() for arguments [] on repository container.
                  Consult IDE log for more details (Help | Show Log) (7 s 47 ms)"

I cannot seem to find a solution that works to resolve this error so that I can continue working on the project? Any help is appreciated.
0
Finding MySQL on my MacBook and remote DB access

I think I used to access MySQL from the browser (Chrome) on localhost, but I do not recall the exact URL.

Can someone explain how to find MySQL?

Also, I have a developer who will be hosting my website, not yet at AWS, but on an internal server. Can I view that database from my version of MySQL? I would of course need to be given access. I will access the website from an IP address I will be given.

Thanks.
0
I had this question after viewing Looking for a new SMS provider for my PowerBuilder application.

I have been using Twilio's SMS messaging service since I originally asked the question I'm referencing.  Now my issue is that my corporate client is requiring that I deploy my application on their internal network and servers.  While my PowerBuilder code which has worked fine while running on my own server, fails to send text messages when deployed on the corporate servers, specifically because they block access to the internet and the only solution they've suggested would require the use of their PROXY server.  I know NOTHING about proxy servers and I'm looking for some help in making the required program changes to be able to utilize a proxy server to permit access to Twilio (api.twilio.com) in order to maintain this feature in my application which has become very popular with my users.

So, besides the PowerBuilder powerscript code, I had to incorporate a third party's APIs (Chilkat Software) in order to send the SMS messages.  My existing code follows:

        loo_Glob             =       create oleobject
      li_rc                   =       loo_Glob.ConnectToNewObject( struct_1.tw_global_object )
      if li_rc < 0 then
            as_response = "Connect to New GLOB Object Error: " + loo_Rest.LastErrorText
            wf_send_warning_email( as_response )      
            destroy loo_Glob
            return false
      end if
0
I have this statement that I would like to run in python as a for each loop then insert all of the data into a table...… I'd like to use pyodbc and maybe pull the data into dataframes…. ?? then take the panda df and insert into a table, but the first thing is to get this running for every table

the first query would be to get the tables then loop thru each table and run the last query

select * from sys.tables- Get this into a variable or list and loop thru and run the below query 

--Filter out all of dates, and the id attributes metadata
 DECLARE @Table SYSNAME = 'ArrestInfo'
-- REVERSE and STUFF used to remove trailing UNION in string
SELECT REVERSE(STUFF(REVERSE((SELECT 'SELECT distinct ' + name 
                                     + ', COUNT(DISTINCT(' 
                                     + QUOTENAME(name) + ')) AS [Count] FROM '
                                     + QUOTENAME(@Table) + ' Group by ' + name + '' + ' UNION ' 
                              -- get column name from sys.columns  
                              FROM   sys.columns 
							  WHERE  object_id = Object_id(@Table) 

                              -- concatenate result strings with FOR XML PATH
                              FOR XML PATH (''))), 1, 7, ';'));

Open in new window

0
Is BitBucket the best choice?

I am starting a project which will involve various developers, some offshore. I need a GIT Repo I can use for source code management and have good memories of BitBucket.

Is it still a great choice?

I saw a difference between Free/Standard/Premium that I dis not understand...

"Build Minutes"...

I do not recall using BitBucket to Build anything. What does this mean? To Build on BitBucket??

This site will have a EJS front end with a JAVA back-end. Does this mean on JAVA code commits, an auto-compilation can be configured? That is probably an option, I presume...it may be a very good option, but I'd like to understand it.

Thanks
0
Hello experts,

Following the question: Question 29174017 I would like to set up a GUI with the following need:
-Based on a clipboard selected display a GUI in which I will be able to report specific string and modulate each line with the following modes:
-Keep: Find the first occurrence of the string reported in each line of clipboard, retains that first occurrence of the string reported and everything in each line of the clipboard that is after it.
Remove: Find the first occurrence of the string reported in each line of clipboard, retains that first occurrence of the string reported and everything in each line of the clipboard that is prior to it.

I attached my first attempt.

1.Could you please let me know your expertise concerning the coding structure.
2.Let me know if there is a best approach to report the example in text instruction such as reduce the font or bold specific text. I don’t know if this is possible.
3.Analyse the feasibility to add an additional radio mode related to keep lines not concerned.
The idea will be to remove or to keep the various lines of the clipboard that doesn't contain the string reported. With the current version nothing is done, they remain in the clipboard. I was wondering if we can add a mode to keep them or remove them.

Thank you for your help.
KeepRemoveBasedOnString.ahk
0
I want to get "Explanation, what would happen if a control flow graph consists of multiple start and/or stop nodes?"
0
Hello experts,

The following statement allows me to retain strings from an specific column in VBA:

    For lngRow = 1 To lngLastRow
        intPos = InStr(1, UCase(Cells(lngRow, strCol).Value), strPrefix)
        If intPos > 0 Then
            Cells(lngRow, strCol).Value = Trim(Mid(Cells(lngRow, strCol).Value, intPos))
        End If
    Next

Open in new window


strPrefix is the string that is reported in a Msgbox.

I was wondering which function/process should I use in AutoHotkey to cover this need.

The final objective is to set up a GUI in which I should report the string involved in the process. Paste the clipboard with the revised text.

Example:

I have the following lines:
testid45
titiid46
test47

If I report as prefix id, I should get:
id45
Id46
 
Any advice, will be really appreciated.

Thank you for your help.
1
Hello Experts,

I was wondering if there is a way in AutoHotkey to get size of an specific folder reported.

The idea is the following:
1.Report the folder that you want to get the size through a GUI
2.Two alternatives, display a Msgbox with it size and send to the clipboard or generate a TempFolderSize txt file located in the folder reported in the GUI and run it. This file will contain the Folder reported in the GUI and the size.
20200226_212642.png
For the moment I am not going to analyse the recurse approach if reported folder has subfolders in order to avoid complexity

Here is my attempt of the GUI however I don't know how to tackle this with AutoHotkey. If you have some advice and proposal it would be great! Thank you very much for your help.

EnvGet,FolderPathForSizeAttribute,UserProfile
AddTextEditWidth:=400 ; Text specific with
Gui,Add,Text,,Report the folder in order to get it size
Gui,Add,Edit,vFolderPathForSizeAttribute cPurple w600 xm,%FolderPathForSizeAttribute%\Downloads
Gui,Add,Button,xm gButtonOKSizeAttribute Default,&OK ;Button Ok
Gui,Add,Button,x+10 gButtonCancelSizeAttribute,&Cancel ;Button Cancel
Gui,Show,,Folder size attribute
Return
ButtonOKSizeAttribute:
Gui,Submit
Gui,Destroy
ButtonCancelSizeAttribute:
Gui,Submit
Gui,Destroy

Open in new window

0
Hello experts,

The following AutoHotkey allows me to list files & folders attributes (question related: Question 29172877)

I have a little issue.
File listing is generating however the action related to open the file with excel is not performed and at the end of the AutoHotkey script I have the following20200225_121352-screenshot.pngAutoHotkey script:
;====================================
;Gui: list files and folders attributes
;====================================

^+f::
If (WinExist("File Listing"))
{
  MsgBox,4112,Error,File Listing dialog is already open
  Return
}
EnvGet,FolderPath,UserProfile
Gui,Add,Edit,vFolderPath cPurple w570 xm,%FolderPath%\Downloads
Gui,Add,Button,x+10 +Default vBrowseFolder gBrowseFolder,&Browse
Gui,Add,Text,xm,If you want a different folder, type/paste into the field above or click the Browse button on the right above and navigate to the folder
Gui,Add,Text,,Select folders to process:
Gui,Add,Radio,Checked vRecurse,&Recurse
Gui,Add,Radio,x+10,&NoRecurse
Gui,Add,Text,xm,Select filename information to put in file listing:
Gui,Add,Radio,Checked vFileInfo,&Without path without date
Gui,Add,Radio,x+10,With &Path without date
Gui,Add,Radio,x+10,Without path with &Date
Gui,Add,Radio,x+10,With &Both path and date
Gui,Add,Button,xm gButtonOKFilesFoldersListing Default,&OK
Gui,Add,Button,x+10 gButtonCancelFilesFoldersListing,&Cancel
Gui,Show,,File Listing
Return

Open in new window

0
Hello experts,

I am trying to set up an AutoHotkey script that I will use on a regular basis to swiftly export file as Pdf and open folder in which it has been saved


I need some advice with the following:
1.      Coding structure and optimization proposal.
2.      Line 6 to 8 are required?
3.      Set up a return if active document has not been saved.
Example: I open a document and I forgot to save the document. If I launch the script an if statement should be set up to block the pdf export.
4.      Find the right saveas method for powerpoint and excel the save as method applied doesn't work. File is exported however When I open the file I got an error message.
5.      End the script by opening the pdf export file
6.      Find a method to applied the same mechanism for outlook>emails
If some requirements are complicated to cover I am willing to give up
If you have questions, please contact me.
SaveAsPdfSwitchCase.txt
1
Hello,
I am looking for a vbscript to find files with filenames of a certain length within one folder
and
another vbscript to delete files with filenames of a certain length within one folder
0
Hello experts,

I have in my AutoHotkey/Hotstring file multiple hotstrings that sendinput date.

I would like to convey them into a single hotstring and modulate them through a GUI.

The idea is the following:

 20200218_042035.png
Could you please help me to:

Set up the process behind to sendinput based on the selection.
I attached current version.

Thank you for your help.
DatesGui.ahk
1
Hi
I am willing to test face recognition on a sample set of images, to check their quality. The basic idea is to have around 1000 images of people and send the to the app and the test if a specific image is there or not. But I would like to avoid any programming.

Does anyone know an app that I could use?
0

Programming

53K

Solutions

41K

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.