R is a programming language and environment used primarily for statistical data analysis.

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

Sign up to Post

Looking for a solution to this sql statement

declare @ID int =17592

(select TOP 1 LineNum from a where ID=@ID
 order by desc)
I am capturing labor data in the form of an excel file (Single row per employee), and want to import that into an ACCESS or SQL database.
I am thinking of starting with Access as it is more user friendly (I Mostly VBA programming experience).

I see some examples, but one problem I am running into is that each day I get the last 5 days of data (in case the manager edits the older data), so I am looking to update an replace older data each day. One approach is to delete the last 4 days of data, then import everything as new.

Just looking for some suggestions on best way to get into database, so I am not missing something that I later regret..

Not sure how I will award point, maybe split it multiple good replys

import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map.Entry;
import java.util.Set;
import java.util.TreeMap;
public class MyHashMapEntrySet3 {
    public static void main(String arg[]){
      HashMap hm = new HashMap<Integer, String>();
    	//HashMap hm = new TreeMap<String, String>();
    	//HashMap hm = new LinkedHashMap<String, String>();
        //add key-value pair to hashmap
        hm.put(3, "C");
        hm.put(1, "A");
        hm.put(2, "B");
        //hm.put(3, "C");
        //getting value for the given key from hashmap
       /* Set<Entry<String, String>> entires = hm.entrySet();
        for(Entry<String,String> ent:entires){
            System.out.println(ent.getKey()+" ==> "+ent.getValue());*/
       //d }

Open in new window

{1=A, 2=B, 3=C}

i wonder how i got above sorted output based on key all the time first 1 then 2 then 3 key set? please advise
When an application is started, what are the steps it goes through until data is saved and the application is closed? What are the interactions with the registry and .ini files etc.

Ex. - 1. Executable is left mouse clicked. 2. The application takes the credentials and authenticate. 3. Assigns privileges etc.

Where does the security token fit in this sequence?
Where does the registry/ini files fit is this sequence?

I want to put the answer in a diagram to assist with troubleshooting
need the answer as soon as possible. thanks in advance
I have a VB.NET application that looks for a specific folder called "datarepository" that gets created in the Windows temp path.  The settings value within the application is named "datapath".  

Below is the value that is within the settings:

Name              Type                 Scope                                Value  

datapath         String               User                                 "C:\Users\<username>\AppData\Local\Temp\datarepository"

Within the vshost.exe.config file the values show as the following:

<setting name="datapath" serializeAs="String">

Please note the "&lt" around the "username" within the string value.  I think this is causing an error within the application as the path is not found.  Can someone advise on how to pass in the value so I can be certain that the folder and path are created correctly in both Win 7 and 10 OS?

I am programming a gateway for the current website I am working on .

The callback posting from the gateway requires a web service query to eliminate man in the middle attacks.

When the call back is posted, the following information is sent

$gtpay_tranx_id = $_POST['gtpay_tranx_id']//Transaction id
$gtpay_tranx_status_code = $_POST['gtpay_tranx_status_code']//'==> 00
$gtpay_tranx_curr = $_POST['gtpay_tranx_curr']//'==> NGN
$gtpay_tranx_status_msg = $_POST['gtpay_tranx_status_msg']//'==> Approved by Financial Institution
$gtpay_tranx_amt = $_POST['gtpay_tranx_amt']//'==> 140000.00
$gtpay_cust_id = $_POST['gtpay_cust_id']//'==> destiny@icecoolcontracts.mx
$gtpay_echo_data = $_POST['gtpay_echo_data']//'==> Transaction ID:AS20170222150106;ClientName: Destiny Amana [Icecool Contracts Limited]: Purchase of Basic Plus
$site_redirect_url = $_POST['site_redirect_url']//'==> /gtpayresponse.asp
$gtpay_gway_name = $_POST['gtpay_gway_name']//'==> webpay
$gtpay_tranx_hash = $_POST['gtpay_tranx_hash']//'==> CDFB59FDBCE4DCCC7A1348EFF165AC2AA1438356FE042D0DCD5F39DD4DF3F7F4C79BDCF586B858626748CCD0D79B6A39D9A1532949FA5FB7C4E4CBAD3774D335
$gtpay_verification_hash = $_POST['gtpay_verification_hash']//'==> 7CBC424420E73377B6BB1B93979CED3D2A7C53576B13EC61B8F271CCF0025B1EFB4553592382559667560D8FCD3405FA2DC53AF18B6938AE55A67F37AB11F1F1
$gtpay_full_verification_hash = $_POST['gtpay_full_verification_hash']//'==> …

I need to create a java program to enter the time in hours and minutes.

The time entered is assumed to be a valid time on the 24 hour clock. The program should print out the time followed by one of AM, PM, Noon, midnight as appropriate.

I am new to programming and I would appreciate any help!

Many thanks
Microsoft seem to be getting better at updating their control ID lists for major new releases of Office but for the 365 updates, it's not quite there yet.

How can I find the ID for a 2016 ribbon control when it's not in the documentation:


For example the recent addition of SVG support added a new Icon button to the Illustrations group of the Insert tab but the control ID is not listed in the document above.

I need to hide this button and have tried [and failed] all sorts of logical strings for the ID based on what else I know is in that group:

- ShapesInsertGallery
- SmartArtInsert
- ChartInsert

...but is there a more intelligent way of finding out what it is rather than guessing?

I tried searching the CommandBars object for clues but to no avail:

Sub SearchCommandBarControls()
  Dim x As Long, y As Long
  With Application.CommandBars
    For x = 1 To .Count
      For y = 1 To .Item(x).Controls.Count
        If UCase(.Item(x).Name) Like "*ICON*" Then Debug.Print "cBar : " & .Item(x).Name
        If UCase(.Item(x).Controls(y).Caption) Like "*ICON*" Then
          Debug.Print "Control : " & .Item(x).Controls(y).Caption
        End If
  End With
End Sub

Open in new window

The idea is to be able to right click on a shortcut and be able to select an option to "copyaspath", which will store the Target URL in memory so that it will be available for pasting.

The command line would need to be placed in Reg Key: HKey_Classes_Root\InternetShortcut\shell\copyaspath\command
Use the Default String Type to add command line.

This works:

cmd.exe /c FINDSTR "URL=" "%1"|clip


But we only need the URL line without "URL="

I was thinking this but not working:
cmd.exe /c For /F "tokens=2 delims==" %1 IN ('FINDSTR "URL"') DO (%1|Clip)

Any help would be appreciated.
In asking my question about the Java EE 5,6,7, documentation; another question came up.
The Eclipse Mars was suggested, yet I had installed Neon2 because that was what I was using before.  I see that Neon 3 is released.
Last night I installed Neon 3 and the documentation options did not come up at all, like in Neon2.
The question that I now have is; with, let's say Neon3,  which now I have installed Neon2 and Neon3.  And I have downloaded Jdk 1.8.111/121, and Goldfish4/java_ee_sdk-7u2-web.  If I wanted to use Jdk 1.8.121 with Neon2 and Goldfish4 with Neon3; how would I configure the "Environmental System Variable "Path?"  
Is it that Eclipse has a setting that I could set up which Java version to use?
I apologize that I have not gone to check whether Eclipse Neon has such a setting.
Thank you for your answer.
I have a couple of "unresolved" issues.  I tried fixing my problems using the options within Eclipse, but nothing works.
I know that I have in import/install the org.opeqa.selenium API, yet can't find the API at org.openqa, and I know that my Selenium API needs to be installed as well.  I thought I did have it via Selinity - Selenium plugin, but I guess not.
These are my issues;
import org.openqa...cannot be resolved
FirefoxDriver cannot be resolved to a type
Method undined for WebDriver

This is the code;
import org.junit.Test;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;

public class MyFirstWebdriverTest<WebDriver> {
      public void checkSeleniumHQinFirefox(){
        WebDriver driver = new FirefoxDriver();
I am in an Exchange admin with about 15 years experience, starting off in Helpdesk.

I recall the days when every company, regardless of size, had an on-site technical crew to manage their Exchange servers and everything else.

Then the smaller ones opted for the cloud, and the larger organisations kept dedicated technical teams

Now the larger ones are moving to the cloud too, and the only ones left with on-prem infrastructure are the ones with separate teams for exchange, storage, and so on.

Once these move to the cloud, I wonder what is next? So my question is, for someone in IT would it make sense to focus on software development rather than infrastructure skills?
We currently have an application called "Support" for mobile devices (runs on iOS/Android). The end user types their issue into the a form and it goes off to the helpdesk, who log a ticket.

To me, this seems somewhat pre-historic.

I was thinking of utilising bots, so that the user could interface with some level of AI which would then at least be able to present solutions

Is this possible? Are chatbots available to understand that the user has written and then point them to a Knowledge Base?

Any way to make this even better?
I am not trained in SQL. I'm trained in other programming languages, so explain this slowly for me.

I've been beating my head against the wall with this query. I spent a couple of days on it and got the results that I wanted, but noticed today that I had duplicates rows. Essentially, it's a list of clergy members. The clergy members have multiple addresses. What I'm most concerned about is the address types 'Main\Home Address' and the 'Parsonage Address'. I was able to figure out a join statement that gets me only these two address types, but I didn't plan on some of the clergy having both, so they both show up causing my duplicates.

Essentially, if both address types are listed for a clergy member, then I only want 'Main\Home Address to appear'. Otherwise, I want those clergy that have 'Main\Home Address' and those clergy members that have 'Parsonage Address' to appear in the query. The code is below. It's an awful database, so I'm hoping that what I've typed makes sense. Again, I'm not trained in SQL, but I've tried to comment within the code so things are clear. I really hope for some ideas on what to do. Thanks for the help.

OtherPersonalInformation_GCFA203.int_value AS Id,
P.first_name AS FirstName,
P.last_name AS LastName,
P.nick_name AS PreferredName,
P.middle_name AS MiddleName,
ISNULL(tb_person_suffix.lookup_value, '') AS person_suffix,
ISNULL(tb_person_title.lookup_value, '') AS person_title,

I'm looking for a website that gives a much deeper explanation about the Selenium api.

I found this site, yet it is not enough to fully understand; for what and how to use the api;

Could you suggest a better site?

I'm starting a project to integrate a third party add-in from SagePay to our in-house Access database and unsure on some of the basics. I've completed the following steps but not clear on where the initial problem lies. Any assistance appreciated..

1. Discovered that I need a type library (tlb file) for the dll so I generated file using regasm (have .net framework 4.5 installed which is a listed minimum requirement)

(regasm.exe in c:\windows\microsoft.net\framework\v4.0.30319 = v4.5 folder after upgrade by all accounts)
regasm c:\sagepay\guardian\bin\Integral.Library.GuardianClient.dll /tlb

Open in new window

2. Added a reference to the add-in to vba project
VBA reference to SagePay dll
3. Declared function call for the add-in using documentation:

Public Declare Function Process Lib "c:\sagepay\guardian\bin" ( _
        ByVal transactionAmount As Integer, _
        ByRef tillInfo As TillInformation, _
        ByRef transInfo As TransactionInfo) _
As Boolean

Open in new window

4. This is where my knowledge gets a bit sketchy; I assumed the add-in would include the tillinformation type definition which I checked in the object browser but this is not the case as it shows no members?

VBA object view of TillInformation class
Hence, declared a VBA type as shown to match the documentation although documentation does not specify actual data types. I've tried varying strings / integers for some of the type declarations with no effect.
Public Type TillInformation
    merchantname As String
    address1 As String
    address2 As String
    address3 As String
    address4 As String
    phonenumber As String
    sitenumber As String
    tillnumber As String
    receiptnumber As String
    operatorid As String
End Type

Open in new window

5. Now when I try to call the function fro a test form, I get a type mismatch with 'tillinformation' parameter so it’s obviously not happy with the declaration..

Runtime / compile error with Process function
I don't know if the issue is with the add-in registration or the way I'm trying to declare the necessary types etc. so desperately in need of some guidance please! Thanks
Is there a formula for showing return on investment for training?

I'm thinking something like this.

(Salary per Year) / (Minutes Worked Per Year) = Employee Cost per Minute

(Cost of Training) / (Employee Cost per Minute) = (Number of minutes necessary for employee to be more productive to pay for course)

I guess you need to also factor in lost time due to course attendance and cost salary.

Has anyone seen anything similar to this?
i often need to backup data from different disk drives, and Windows OS'es - so
i would like to make a backup program that offers me :
choice of multiple source folders to copy
choice of destination folder

preferably with robocopy to speed up the copying

if possible, using editable source code;a windows interface like Gui would be nice, but not necessary

of course free
if you know some that do this - they're welcome too

Is there a way to run an AutoHotkey (AHK) script directly from Notepad++?

I recently began editing my AutoHotkey scripts in Notepad++ rather than in Notepad. Now I'm wondering if, after making changes to a file, I can run it directly from Notepad++.

With regular Notepad, you must first save the edited file then go to Explorer (or wherever you have a shortcut) and run the file from there. It would save several keystrokes if the file could be run directly from Notepad++.

I do see a "Run" menu but after clicking, a box comes up asking you to enter the file you'd like to run. It would be quicker of course if there's a way to simply run the code in the currently active tab.

I am just getting into a little php and programming and I would like to know what something like
If ($sMap != "") what does !="" mean and what does "" and " " on its own generally mean?

Thank you.
Before doing a linear regression on a data-set one needs to find out a few things about the data:

  • is there is a linear relation between the dependent and independent variables
  • are the variables normally distributed (if not, do a Data Transformation)


  1. Book1.xlsx
  2. In Excel, do I simply use the CORREL() function to determine a linear relation between the dependent and independent variables?
  3. How do I interpret these results (i.e. low value = low correlation, high value = high correlation)?
  4. To test normality, can I simply use the QQ Plot test or should I use other tests, like the K-S Test as well?
  5. How do I interpret the K-S Test results?
  6. How do I go about doing a "Data Transformation" and how do I know whether I should do it?
  7. Please do not confuse things with only Statistics talk when giving an answer because I might not understand what you're saying. I've uploaded a sample of a data-set.

Thank you!
i got this code from internet, i want to run a test on this.  where i can get a good software where i can run tests like this that can support more than just one language. i mean if it can have plug-ins for other languages?

what i need something that i can run as portable, i do not want MS visual studio .


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace euler1 {
    class Problem7 {

        public static void Main(string[] args) {
            new Problem7().BruteForce();
            new Problem7().Smart();

        public void BruteForce() {
            DateTime startTime = DateTime.Now;
            int numPrimes = 1;
            int numm = 1;

            while (numPrimes < 10001) {
                numm = numm + 2;

                if (isPrime(numm)) {

            DateTime stopTime = DateTime.Now;
            TimeSpan duration = stopTime - startTime;
            Console.WriteLine("Prime number {0} is {1} ", numPrimes, numm);
            Console.WriteLine("Solution took {0} ms", duration.TotalMilliseconds);

        private bool isPrime(int numm) {

            if (numm <= 1) {
                return false;

            if (numm == 2) {
                return true;

            if (numm % 2 == 0) {
                return false;

            int counter = 3;     


Open in new window

I have a table


 PK                                      FK                            
 OrderDetailID                OrderID           LineNo          
 8238                                7780                  1
 8239                                7780                  2
 8240                                7781                  1

 How do I create the column LineNo based of OrderID to increment starting with one?  So once the FK OrderID changes it starts back to 1 for the next orderid.  The lineno field must autogenerate and needs to be stored.

What type of codes are the following and how do you enter them using a standard PC keyboard?

asc 225

Open in new window

I thought the technique was to hold down the ALT key while entering the characters in the number pad. However, for the first one, I've tried each of the following entries and only get clubs (♣♣♣).


I found them in an AutoHotkey script in which case they code for ß & Δ respectively.

b::Send {ASC 225}
+c::Send {U+03B4}

Open in new window