Off Topic > Off Topic
Programming Megathread
<< < (227/241) > >>
devildogelite:
HolyC is god right?
Timestamp:
guess you could say malbolge

brainforgets you
Pecon:

--- Quote from: Becquerel on April 18, 2017, 04:20:25 PM ---What would the Piet language be?

--- End quote ---
Piet is one of Pee-wee Herman's rube-goldberg machines. It's not really practical for anything, but someone probably thinks it's fun to use.
Meldaril:
I needed to disable my network connection quickly so I wrote this script to disable the network adapter via WMI. Requires UAC elevation. I'm not sure why I turned the argument into a Ruby symbol.


--- Code: ---unless ARGV.length == 1
  puts "Missing arguments. Lockdown --start to begin and --stop to finish lockdown."
  exit
end
if ARGV[0] != '--start' && ARGV[0] != '--stop'
  puts "Invalid argument. Use --start or --stop"
  exit
end
mode = ARGV[0][2..-1].to_sym # '--start' -> :start

require 'win32ole'
wmi = WIN32OLE.connect('winmgmts://./root/standardcimv2')
adapters = wmi.ExecQuery("select * from MSFT_NetAdapter")
for adapter in adapters do
  if adapter.Name == 'Ethernet'
    if mode == :start
      adapter.Enable
    else
      adapter.Disable
    end
  end
end

--- End code ---
Drydess:
can someone explain to me what a pointer is and how you're supposed to use it? i've really been stuck because i gave up early on c in favor of web design languages, but recently tried to get back into it, and still can't grasp much of the application without knowing pointers
Navigation
Message Index
Next page
Previous page

Go to full version