Golang

117

Solutions

1

Articles & Videos

331

Contributors

Golang, also called Go, is an open source programming language that is a statically-typed language with syntax loosely derived from C, adding automatic memory management, type safety, some dynamic-typing capabilities, additional built-in types such as variable-length arrays and key-value maps, and a large standard library. Go is a general-purpose systems programming language that aims to be efficient both for development and execution with a focus on fast compilation and increased maintainability of large projects. Go was originally targeted at systems programming tasks such as building server/web applications, high throughput middleware and databases.

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

Sign up to Post

So if my understanding is correct from what I have managed to discover, the problem here is that any device connected to a cell phone hotspot, that has an active VPN, will simply route through the public ip connection on the hotspot and not go through the VPN.

Is there a way to 'route' through the VPN any device connected to the cell hotspot?  I have heard that possibly rooting the cell phone may allow this, but I have never rooted a phone before.

Or, is there another way to make this happen?  I am trying to create a secure VPN from our remote offices back to our main office using a cell phone...without having to step up to a LTE router.
0
How our DevOps Teams Maximize Uptime
How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

I created an InfoPath 2013 Form and it is located in a SharePoint 2013 Document Library. This is an HR form for employee change request. The idea is to have the employee go to the doc library and select new document, then complete the form, but instead of submitting the form to the same library, which is the way it is setup right now, rather I need to configure this form to submit to a different document library. The other library will be secure, so that an employee cannot view sensitive data. I looked at other knowledge based articles but could not find a solution for particular for this issue, unless I missed something.

The first document library is open to all employees, but the submit to document library is secure, only for HR use. Is it possible to accomplish this type of configuration in either InfoPath or Sharepoint?

FYI - I'm a beginner with InfoPath and SharePoint.
0
I have been attempting to use this Macro that I found through VBA Express.  The Macro successfully disables the ability to right-click cut/copy/paste but the keyboard shortcuts are still active.  Any help is greatly appreciated.  I have very little knowledge about writing Macros and usually go to Google to find already existing codes to use.  Please see below:

'*** In a standard module ***
Option Explicit
 
Sub ToggleCutCopyAndPaste(Allow As Boolean)
     'Activate/deactivate cut, copy, paste and pastespecial menu items
    Call EnableMenuItem(21, Allow) ' cut
    Call EnableMenuItem(19, Allow) ' copy
    Call EnableMenuItem(22, Allow) ' paste
    Call EnableMenuItem(755, Allow) ' pastespecial
     
     'Activate/deactivate drag and drop ability
    Application.CellDragAndDrop = Allow
     
     'Activate/deactivate cut, copy, paste and pastespecial shortcut keys
    With Application
        Select Case Allow
        Case Is = False
            .OnKey "^c", "CutCopyPasteDisabled"
            .OnKey "^v", "CutCopyPasteDisabled"
            .OnKey "^x", "CutCopyPasteDisabled"
            .OnKey "+{DEL}", "CutCopyPasteDisabled"
            .OnKey "^{INSERT}", "CutCopyPasteDisabled"
        Case Is = True
            .OnKey "^c"
            .OnKey "^v"
            .OnKey "^x"
            .OnKey "+{DEL}"
            .OnKey "^{INSERT}"
        End Select
    End With
End Sub
 
Sub EnableMenuItem(ctlId As Integer, Enabled As Boolean)
     …
0
Hi Experts,

I am testing my project in multiple computers and found a serious problem.

In Machine 1
I log in as an Admin. Then In the page I have to select Customer, location and Room. Then I click OK to go to a different page. (Sesson Admin='Y')

Then in Machine 2, I log in as a user.  select Customer, location and Room. Then I click OK to go to a different page (Sesson Admin='N')

When I come back machine 1 , where I logged in as Admin='Y' before, it changes it to Admin='N'  and all the selection (Customer, location and Room) has changed to that of machine 2.

What should I do. Please help.

Thanks in advance.
0
My HyperV host is licensed with 2012 R2 Standard, and my first attempt at installing the guest OS of 2012 R2 didn't go well, so I deleted it and started over. (I don't remember having to activate that one)
I have this VM all set up and ready for production, but it has a notification that it needs to be activated. Did I do something wrong? It will not activate with my original key either...
0
I have a pivot table which doesn't seem to sort chronologically. I want it to go by month and year.
See second tab (AMARG).
Help?
Dropped-Item---Excel-Data.xlsx
0
Hi,

Is it possible to extract certain words from multiple documents and then place them in to an excel spreadsheet sort of like a data miner (I guess?).

Example:

Let's assume I need someone with experience in Java and they need at least 3 years experience, I can then type in those requirements and it will then go through all my CV's and put the people it thinks meets those requirements in to a excel spreadsheet.

I'm sure this is possible but I'm not sure how hard this would be (I'm doing this for a school project)

Thanks,
James
0
Hi Expert,

I have created table name inventory and was trying to insert data but i am getting the following error:--

Msg 257, Level 16, State 3, Line 2
Implicit conversion from data type sql_variant to varchar is not allowed. Use the CONVERT function to run this query.
Please help!

Here is the following details:--

CREATE TABLE [dbo].[inventory](
      [InstanceName] [varchar](255) NULL,
      [Product] [varchar](255) NULL,
      [Edition] [varchar](255) NULL,
      [Version] [varchar](255) NULL,
[IP Address Of SQL Server] [varchar] (20) NULL,
[Machine Name] [varchar] (20) NULL,
      [DatabaseName] [nvarchar](255) NULL,
      [CreateDate] [smalldatetime] NULL,
      [compatibility_level] [nvarchar](255) NULL,
      [state_desc] [char] (7) NOT NULL,
      [RecoveryModel] [char] (10) NOT NULL,
      [Database_Owner] [varchar] (10) NOT NULL,
     
) ON [PRIMARY]

GO


insert  into dbo.inventory select  @@SERVERNAME as InstancName, SERVERPROPERTY('PRODUCTLEVEL') as Product, SERVERPROPERTY('EDITION') as Edition,
 SERVERPROPERTY('PRODUCTVERSION') as Version, name as DatabaseName, create_date as CreateDate, compatibility_level, state_desc,
 recovery_model_desc as RecoveryModel, SUSER_SNAME(owner_sid) as Database_Owner
from [servername].[master].sys.databases where [name] not in ('master','msdb','model','tempdb')


Please help
0
Hello,
I need to see if there is a way for me to create a template in Outlook, that when opened up the recipients and the subject line are already filled in.  To go a step further, can the present date be auto inserted to said subject line of the email?  I have a current template that I use for the body and it seems ok for now.  Of course, there are tweaks that need to be done...

TYIA,
Greg
0
I have thousands of rows of date.
This data is in the form of numbers.

I have the problem that many of these cells of data hold the number as text (which I didnt choose). The cells have that little green flag on the top left corner.

This is preventing formula from using the number value of these cells and so from working the way I need it to.

My only option is to go to each individual cell, choose the drop down error menu and change each one to "convert to number".

This will take me years. Is there a way to change all numbers stored as text to stored as number en masse ?

Thanks
0
Major Incident Management Communications
Major Incident Management Communications

Major incidents and IT service outages cost companies millions. Often the solution to minimizing damage is automated communication. Find out more in our Major Incident Management Communications infographic.

Will not boot up. can hear sounds of hard drive or dvd (pretty sure it is the dvd) doing initial test but hard drive light never lights up. Can hear fan.  Dvd movement  and fan movement seem to be running slower than normal. It does not sound the same. Then it just sits there until I turn it off. Could it be an internal power board problem? That is if this unit has one. Shows full battery charge. Tested output on adapter putting out 19.23v. Adapter says it should put out 19.43v. do not know it that is enough difference to matter.  Please Help. Had this same problem about a year after i bought it. The guys at office depot tested it and said the motherboard was fried. Over $500.00 later it was working again. The computer was $1000.00 new. Felt like i got ripped off. Do not want to go down that road again, unless i have a sharp stick in my hand.
0
Hello

I have recently modified an existing GPO (a fairly basic one about printer mapping) and to my surprise it would not work as expected.

I ran the modeling tool and sure enough the old settings are still appearing.

Digging further I see this
error message
That's all nice and dandy but comparing the ACL on both machine they seems identical...

Server 1
server 1Server 2
server2
(I have applied a sort to make comparison easier).

Where do we go from here ?
0
when I go to http://www.alliancesharedsite.com/sst.xml on one pc using ie11 I get the top pic  but when I go there with another pc I get the bottom pic.  what is wrong?  I want the top pic.  See attachment
Presentation1.jpg
0
Good afternoon,

I was cleaning my PC and disconnected some cables to do so but I forgot to take a picture of the cables. /I did not realize there were 5 separate cables in the cluster when I pulled them.  Can anyone help me with this.  I do know that there are some ports labeled "POW LED" but I know that none of the cables go there.
cbl1.JPG
cbl2.JPG
0
I have a functioning 2003 terminal server which does not have a licensing server in the domain. The license server listed in the registry is an old domain controller that no longer exists. My issue is that I simply need to know how many per user CALs are being used on the terminal server? Can I simply re-install the terminal server licensing component on the current terminal server to see the license count? I just don't want to activate the license server and mess up current users who are accessing the terminal server. My only other option is to go into the terminal server manager and count how many sessions there are, but that doesn't accurately tell me the amount. thanks for any help in advance
0
I set up one of four laptops as usual, enabling TPM, turn on bitlocker and require a bitlocker PIN at boot to log onto the computer. In my setup, I create an original admin account (named - pallap005), a standard account (named - clinical) and then enable the default admin account. Once that is done then I disable the pallap005 admin account. In this case, I disabled my pallap005 admin account  before I enabled the default admin account leaving only my standard user account (clinical) available. I need to know if I can enable the admin account and how do I go about doing this?
0
I am using go lang for smtp verification of email id's. During that process i got

panic: runtime error: invalid memory address or nil pointer dereference
        panic: runtime error: invalid memory address or nil pointer dereference
        panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x5b3ac2]

goroutine 16 [running]:
panic(0x674140, 0xc42000c0e0)
        /usr/local/go/src/runtime/panic.go:500 +0x1a1
net/smtp.(*Client).Close(0x0, 0xc420061280, 0x6bfe79)
        /usr/local/go/src/net/smtp/smtp.go:74 +0x22
panic(0x674140, 0xc42000c0e0)
        /usr/local/go/src/runtime/panic.go:458 +0x243
net/smtp.(*Client).hello(0x0, 0x65d580, 0x0)
        /usr/local/go/src/net/smtp/smtp.go:79 +0x26
net/smtp.(*Client).Quit(0x0, 0xc420061280, 0x6bfe79)
        /usr/local/go/src/net/smtp/smtp.go:381 +0x2f
panic(0x674140, 0xc42000c0e0)
        /usr/local/go/src/runtime/panic.go:458 +0x243
net/smtp.(*Client).Hello(0x0, 0x6c9932, 0x9, 0x9, 0x6bfe79)
        /usr/local/go/src/net/smtp/smtp.go:95 +0x26
smtp/checkme.checkMailbox.func1(0x0, 0xc420181ba0, 0x6c9926, 0x15, 0xc42005f6e0, 0xc4200531d4, 0x15)
        /usr/local/GoProjects/Projects/src/smtp/checkme/checker.go:84 +0xcf
created by smtp/checkme.checkMailbox
        /usr/local/GoProjects/Projects/src/smtp/checkme/checker.go:125 +0x406

Open in new window

0
Hi,
Long story - but basically having to migrate SQL from one server to another using a clone.  Shut down SQL services on the one, copied the DBs and log files to their respective volume on the new server, but SQL not starting.  
Went into SQL configuration manager and changed the startup parameters of SQL service to point to the master db and log file, but now I'm getting errors in the event log like this when I try to start SQL:

FileMgr::StartLogFiles: Operating system error 2(The system cannot find the file specified.) occurred while creating or opening file 'C:\Mount\DWSqlLog\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\sg1_maintenance_log.ldf'. Diagnose and correct the operating system error, and retry the operation.

the path:  C:\mount\ has two icons that appear to be shortcuts, dwsqllog and dwsqldata.  even though the data and log volumes are named the same, same drive letter, same contents, for some reason that path isn't working.

is there either
a) a way to change the path SQL is attempting when loading all these databases? or
b) a way to make SQL load WITHOUT loading any databases, so I can go in manually in management studio and attach them?

I'm getting one of these errors for every log file of every database - a few dozen of them.

Any ideas?  Thanks!
0
I've looked through the CSS and the plugin settings but can't find how to adjust the Send button on the contact form page to show when you go to the page vs. only showing when you hover:

Link is: http://verbondtraining.com
0
Webinar: Aligning, Automating, Winning
Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

Dear Experts, I'mt rying to use GO to read a json file that I have.

I'm using the following code:
package main

import (
	"fmt"
	"encoding/json"
	"io/ioutil"
)

func main() {

	b, _ := ioutil.ReadFile("/home/david/jsontest/create.jsontest.campaigns.ninja.json")

	type UserData struct {
		user_id    string
		user_email string
		user_name  string
	}

	type campaign struct {
		domain      string
		Ssl         int64
		server_key  string
		certificate string
		bundle      string
		php_ver     string
		wp          int64
		lang        string
		start_date  string
		end_date    string
		description string
		user_data   UserData
		CampaignID  int64
	}

	var m campaign
	err := json.Unmarshal(b, &m)
	if err != nil {
		panic (err)
	}
	fmt.Printf("%d", m.CampaignID)
	fmt.Printf("%s",m.user_data.user_email)
}

Open in new window


When I run the code however, the Result is this:
/usr/lib/golang/bin/go run /home/david/GoglandProjects/CampaignsNinja/jsontest.go
80099700
Process finished with exit code 0

Which is correct, but partial.. I'm missing the 2nd value which should be 74 (according to the  attached JSON below)

{"domain":"jsontest.campaigns.ninja","ssl":1,"server_key":"","certificate":"","bundle":"","php_ver":"5.6","wp":1,"lang":"english","start_date":"2017-02-02","end_date":"2017-03-02","description":"This is a test","user_data":{"user_id":"74","user_email":"usertest@gmail.com","user_name":"usertest"},"CampaignID":80099700}

Any Ideas why is the code behaving that way?
0
Hey guys.

WE were trying to write a small program in GO to read system load in Linux.

But it always returned strange value.

However, by following this link

We saw the next snippet:

err := syscall.Sysinfo(si)
	if err != nil {
		panic("Commander, we have a problem. syscall.Sysinfo:" + err.Error())
	}
	scale := 65536.0 // magic

	defer sis.mu.Unlock()
	sis.mu.Lock()

	unit := uint64(si.Unit) * 1024 // kB

	sis.Uptime = time.Duration(si.Uptime) * time.Second
	sis.Loads[0] = float64(si.Loads[0]) / scale
	sis.Loads[1] = float64(si.Loads[1]) / scale
	sis.Loads[2] = float64(si.Loads[2]) / scale

Open in new window


Scale seems to be 2 to the power of 16, but why should the RAW value be divided by it? How is that value measured?
0
Hi guys,

I'm very new to Go and I'm afraif the guides regarding JSON aren't very clear.

I have the following JSON output (saved as a .json file in a certain path) the content of which is

{"domain":"jsontest.campaigns.ninja","ssl":1,"server_key":"","certificate":"","bundle":"","php_ver":"5.6","wp":1,"lang":"english","start_date":"2017-02-02","end_date":"2017-03-02","description":"This is a test","user_data":{"user_id":"74","user_email":"usertest@gmail.com","user_name":"usertest"},"CampaignID":80099700}

and the following Piece of code written in Go:

package main

import (
	"io/ioutil"
	"log"
	"strings"
	"encoding/json"
	"os"
)

func main() {
	type Message struct {
		domain      string
		ssl         int
		server_key  string
		certificate string
		bundle      string
		php_ver     string
		wp          int
		lang        string
		start_date  string
		end_date    string
		Description string
	}

	var m Message
	err := json.Unmarshal(b, &m)
}

Open in new window


Where b should be the path to the json file.

but as you can see, the JSON itswelf has nested fields...

My question is,
and I'm sorry if it's a long one but I really tried looking it up just can't get the concept...
How do I include the nested fields in the structure called Message and how do I read each and every value into a variable (preferably not an array but a separate variable for each value)
0
Sir I've completed my 12th  with  74.2%  from  isc board with commerce stream and my subjects and there scores are respectively  english  71, hindi  96,commerce  70, accounts  67, maths 67... Sir i want to go for  SEBI (stock exchange board of India)  o want to make my carrer in stock exchange so tell me what should I've to do
0
In a class of 40 students, everyone has either a pierced nose or a pierced ear. The professor asks everyone with a pierced nose to raise his or her hand. Nine hands go up. Then the professor asked everyone with a pierced ear to do likewise. This time there are 33 hands raised. How many students have piercings both on their ears and their noses?
0
I have created a List in SharePoint 2013 where individuals can go and add tasks and updates to projects. But I want it to have different sections and each section to have a distinct heading. Is there an Out of the box way to do this without code or SharePoint Designer?
0

Golang

117

Solutions

1

Articles & Videos

331

Contributors

Golang, also called Go, is an open source programming language that is a statically-typed language with syntax loosely derived from C, adding automatic memory management, type safety, some dynamic-typing capabilities, additional built-in types such as variable-length arrays and key-value maps, and a large standard library. Go is a general-purpose systems programming language that aims to be efficient both for development and execution with a focus on fast compilation and increased maintainability of large projects. Go was originally targeted at systems programming tasks such as building server/web applications, high throughput middleware and databases.