Giter Club home page Giter Club logo

smckit's People

Contributors

alexpovh avatar beltex avatar perfaram avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

smckit's Issues

SMCKeys on Ventura are completely (almost) different from that on Monterey.

Currently getting the battery info will produce error: keyNotFound(code: "BNum").

SMCKeys on Ventura 13.0:

#KEY
AC-B
AC-C
AC-E
AC-F
AC-I
AC-J
AC-M
AC-N
AC-P
AC-Q
AC-R
AC-S
AC-T
AC-U
AC-W
AC-X
AC-h
AC-i
AC-l
AC-m
AC-n
AC-p
AC-w
AC-x
ACDI
ACFP
ACKG
ACKL
ACKR
ACKS
ACLC
ACLM
ACMg
ACPK
ACPO
ACPW
ACSt
ACVS
AOPb
B0AC
B0AP
B0AT
B0AV
B0BL
B0CA
B0CC
B0CF
B0CH
B0CI
B0CJ
B0CM
B0CS
B0CT
B0CU
B0DC
B0ET
B0FC
B0FD
B0FG
B0FH
B0FI
B0FU
B0FV
B0HM
B0I2
B0IF
B0IM
B0IS
B0IV
B0MS
B0NC
B0OC
B0OS
B0OV
B0PS
B0QD
B0QS
B0R1
B0R2
B0R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
cePz
ceU0
ceU1
cmD1
cmPC
cmPN
cmPS
cmPz
cmTa
cmTb
cmTd
csD0
csP0
csP1
csPB
csPC
csPD
csPa
csPw
csU0
csU1
fcB0
fdS0
fdS1
fdS2
fdS3
fdS4
fiB0
fpC0
fpS0
fpS1
fspz
ft00
ft01
ft02
ft03
ft04
ft05
ft06
ft07
ft08
ft09
ft10
ft11
ft12
ft13
ft14
ft15
ft18
ftA0
ftA1
ftB0
ftE0
ftG0
ftG1
ftG2
ftH0
ftH1
ftN0
ftP0
ftP1
ftP2
ftP3
ftP4
ftP5
ftP6
ftP7
ftP8
ftR0
ftR1
ftR2
ftR3
ftR4
ftS0
ftS1
gP00
gP01
gP02
gP03
gP04
gP05
gP06
gP07
gP08
gP09
gP0a
gP0b
gP0c
gP0d
gP0e
gP0f
gP10
gP11
gP12
gP13
gP14
gP15
gP16
gP17
gP18
gP19
gP1a
gp08
gp0b
gp0e
iaD1
iaD2
iaD3
iaD4
isNn
isP0
isP1
isPB
isPC
isPD
isPa
isPm
isPw
isPz
isU0
isU1
mTPL
mUTL
maP0
maP1
maPB
maPC
maPD
maPa
maPe
maPw
maU0
maU1
mlD0
mlD1
mlD2
mlD3
mlD4
mlP0
mlP1
mlPB
mlPC
mlPD
mlPa
mlPw
mlT0
mlT1
mlTh
mlTp
mlU0
mlU1
mmPN
mxT0
nn00
oF00
oF01
oKI4
oKI5
oKI6
oKI7
oKP4
oKP5
oKP6
oKP7
ocex
ocey
of00
of01
of10
of11
of12
ofE0
ofE1
oft1
oft3
oft5
oft7
oft9
oftb
oftd
oftf
ofti
oisu
oisy
oke0
oke1
oki0
oki1
okia
okib
okic
okid
okie
okin
okix
okiy
okp0
okp1
okpa
okpb
okpc
okpd
okpe
okpn
okpx
okpy
oof0
oof1
oof2
oof3
oof4
oof5
oof6
oof7
oof8
oof9
oofA
oofa
oofb
oofc
oofd
oofe
ooff
oofg
oop1
oop2
opmn
opmx
otSC
oumn
oumx
ov01
ov02
ov03
ov04
ov10
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TOK
ONMI
PAPC
PC0C
PC0R
PC0Z
PC1C
PC2C
PCP2
PCPC
PCPG
PCPL
PCPT
PD0D
PD0E
PD0F
PD0J
PD0K
PD1R
PDCC
PDTR
PDTZ
PFHC
PH1R
PH2R
PHPC
PM0C
PN0R
PN1R
PSHC
PSTR
PZ0E
PZ0F
PZ0T
PZ1T
PZGT
RBr 
REV 
RMde
RPlt
RSvn
RVBF
RVCR
RVUF
SAS!
SBF 
SBFC
SBFD
SBFE
SBFL
SBFN
SBFU
SBFV
SCIA
SCIB
SCII
SCIL
SCXC
SDAF
SDAS
SFBR
SIS!
SIT!
SMBC
SMBG
SMBR
SMBS
SMBW
SPDO
SPH0
SPHR
SPHS
SPHT
SPHZ
SPT!
SPU!
SPV!
SRS!
TA0P
TA0p
TA1P
TA1p
TC0C
TC0D
TC0E
TC0F
TC0G
TC0J
TC0P
TC0c
TC0d
TC0p
TC1C
TC1c
TC2C
TC2c
TC3C
TC3c
TCFC
TCGC
TCGc
TCPG
TCSC
TCSc
TCTD
TCXC
TCXc
TCXr
TH0A
TH0B
TH0C
TH0F
TH0O
TH0X
TH0a
TH0b
TH0c
TH0o
TH1A
TH1B
TH1C
TH1F
TH1O
TH1X
TH1a
TH1b
TH1c
TH1o
TI0P
TI0p
TI1P
TI1p
TM0P
TM0S
TM0p
TMBS
TP0P
TP0p
TPCD
TPCd
TW0P
TW0p
Tp0C
Ts0G
Ts0S
UBDC
UFIS
UPRC
UREV
URPP
URWD
USR0
USR1
USR2
USR3
VC0C
VC0Z
VC0c
VC2C
VC2c
VD0R
VD0Z
VD0r
VM0R
VM0r
VN0R
VN0r
Vp0C
Vp0c
WCPD
WCPW
WKEN
WOr0
WOw0
ZPEN
zDBG
zDSF

Any way to update this code with more sensors?

Hi, I'm on a MacBook Pro 13,2 and I'm wondering what the process would be for adding sensors to the list/where to find the four character codes used. Is there any way perhaps to find out? In iStat Menus there are quite a few sensors; I'm not sure how they got it working

Thanks!

Replace open() & close() with failable init() + deinit

  • Would make things simpler and cleaner
  • However, still a bit confused on deinit's behaviour
    • It's only called once the object is nil (no refs). Don't want to have to manually set it once done (might as well use close()). Neither do we want to use optional binding (it's a long lived object, gets repetitive). Want to use an implicitly unwrapped optional (due to the failable init()), but then deinit doesn't get called
    • What happens on program exit? Doesn't seem to be called. Want to still make sure that connection is closed. It's not a memory issue, OS X takes care of that on proc exit

Fan keyNotFound on latest macpro

smckit gives :

AMBIENT_AIR_0 11.0°C which is not the case

CPU_0_DIE -70.0°C negative temp ?

and for fan

keyNotFound(code: "F0ID")
keyNotFound(code: "BATP")

Use array instead of enumerating values in SMCParamStruct

  • The original SMCParamStruct defines an array of 32 UInt8 values (for the actual data returned from the SMC)
  • When we do this, can't read the array once passed back from C (I/O Kit call), thus we enumerate 32 UInt8 values instead
    • The array works fine on the C side, checked via bridging header to a small C wrapper function
  • We know the data is there (as enumerating values works)
  • There's some trickery to be had here with UnsafePointers, but have yet to get it to work

Xcode 8.1 - Can't return anything with SMCKit

Running this code (on MacBookPro13,2 with 10.12.1):

import Cocoa
import SMCKit

do {
    let fans = try SMCKit.fanCount()
    print(fans)
} catch {
    print("Error")
}

Prints "Error". It happens with fan speed, fan names, etc. What am I doing wrong?

Getting fan name on MacbookPro15,1 is not working

Some of the keys to get information about the fans are not working on a 15" MacbookPro from 2018.
After testing the keys, I got the result that the following keys are not working:

  • F0ID
  • F0Mt
  • F1ID
  • F1Mt

Trying to read data from these keys will throw an exception.
Any idea how to fix this?

Unit tests via XCTest

Test:

  • Data type conversions
  • Struct padding & alignment for SMCParamStruct
  • Expected kIOReturnSuccess cases
  • Expected failures (bad SMC keys, bad RPM, etc)
  • etc

fanSetMinSpeed() doesn't seem to work?

Running this code as root (with SIP off):

import SMCKit

func setMinimumFanspeed5000() {
        do {
            try SMCKit.open()

            do {
                try SMCKit.fanSetMinSpeed(0, speed: 5000)
            } catch {
                print("Error - could not set fan speed")
            }

            do {
                print(try SMCKit.fanMinSpeed(0))
            } catch {
                print("Error.")
            }

            let _ = SMCKit.close()
        } catch {
            print("Error - could not open connection to SMC")
        }
    }

setMinimumFanspeed5000()

Prints 5000 as expected, but the fan itself does not seem to change its speed - there is no audible sound and SMCKit.fanCurrentSpeed(0) still returns 0.

Removal of tuple return - I/O Kit & SMC return codes

... -> (..., IOReturn: kern_return_t, kSMC: UInt8)

Do we really need to return the error codes? On a debug build, they'll be printed out. In release, could you/would you act on those error codes? Probably not. The value returned should indicate if something has gone wrong already, like 0 RPM for a fan speed call.

Line breaks within :param: text not recognized, messes up formatting of other sections

Jazzy correctly recognizes and interprets line breaks within some blocks (such as :notes: and :returns:) but not in the :param: block.

In the following screenshot, the text from the :param: block for the scheme parameter appears in two places: the portion before the line break appears correctly in the parameter table for scheme, but the portion after the line break is incorrectly interpreted as being part of the function's description:

screen shot 2015-02-23 at 12 06 02 pm

Only the text "Attempts to construct a URL to represent the specified destination." should appear in the description; everything coming after should be part of the scheme parameter description.

The screenshot above is from the latest release of Jazzy (0.1.1 at the time of this writing), and was rendered from the following source:

screen shot 2015-02-23 at 12 06 19 pm

Additional CPU & GPU temperature SMC keys

  • Minor
  • No Mac with more than two GPUs, correct? 15"/17" MacBook Pro & Mac Pro
  • As for CPU, do individual cores count? Unlikely each has a temperature sensor, maybe in the newer chips. If not, again, should be a max of two separate CPUs (Mac Pro)
    • Highest current is dual hexa-core (24 logical) Mac Pro
    • We can get the number of physical cores at runtime via Mach call, but this won't help as Temperature enum is fixed

Get power information

in iStat Menus 6, it is possible to view the CPU, DC-In, and other powers (in watts, volts, and amps).

Is there support for these features in SMCKIt? I had a look through the code and it doesn't appear to have them.

Thanks!

Programmatically elevate privileges for writes

Writing to the SMC requires root (setFanRPM() for example). Currently, this is done by simply running the process as root (sudo). Instead we want to do this programmatically, prompting the user for privileges (credentials).

See "Elevating Privileges Safely" Apple doc.

Update to Swift 2.0

Meant to open this up sooner for visibility. There is a working Swift 2.0 branch, now on Xcode 7 Beta 2. With all the new stuff in Swift, its a good opportunity to get some refactoring in as well. Want to have all new functionality on this branch here on out.

How to use in a swift project

Hey,

I imported SMC.swift in my project.
However I can't get it to print the current Temperature values.
The following prints an empty array and 0.0 for every Temperature sensor.
Am I missing something?

let smc = SMC()
println(smc.getAllValidTemperatureKeys())
for tempKey in enumerate(SMC.Temperature.allValues) {
    println(smc.getTemperature(tempKey.element.0, unit: SMC.TemperatureUnit.Celsius).0)
}

output in json/xml?

This tool looks pretty great. The output isn't very easy to process after the fact.

We're going to look at adding a flag which would provide a more structured format.

  • Has any work been done along these lines already?
  • @beltex is this of interest to you?
  • Before we start specing what a json output might look like, we thought it'd be good to ask others to see what existing users would want to see.

Wanted fan support for MacBookPro16,1

Here are the fan keys (or at any rate, keys beginning with F)
on a MacBook Pro (16-inch, 2019) aka MacBookPro16,1:

F0AH [spf0] 5971 (bytes 17 53)
F0AL [spf0] 5616 (bytes 15 f0)
F0Ac [flt ] (bytes 15 cf 60 45)
F0Dc [flt ] (bytes 99 16 d1 3e)
F0Fb [ui8 ] 1 (bytes 01)
F0Fc [ui16] 4 (bytes 00 04)
F0Md [ui8 ] 0 (bytes 00)
F0Mn [flt ] (bytes 00 80 e5 44)
F0Mx [flt ] (bytes 00 80 af 45)
F0Sf [ui16] 0 (bytes 00 00)
F0St [ui8 ] 5 (bytes 05)
F0Tg [flt ] (bytes 00 b0 62 45)
F1AH [spf0] 5971 (bytes 17 53)
F1AL [spf0] 5200 (bytes 14 50)
F1Ac [flt ] (bytes cb 78 51 45)
F1Dc [flt ] (bytes 9f 9d c0 3e)
F1Fb [ui8 ] 1 (bytes 01)
F1Fc [ui16] 4 (bytes 00 04)
F1Md [ui8 ] 0 (bytes 00)
F1Mn [flt ] (bytes 00 80 d4 44)
F1Mx [flt ] (bytes 00 80 a2 45)
F1Sf [ui16] 0 (bytes 00 00)
F1St [ui8 ] 5 (bytes 05)
F1Tg [flt ] (bytes 00 f0 51 45)
FAC0 [ui8 ] 0 (bytes 00)
FAC1 [ui8 ] 0 (bytes 00)
FAC2 [ui8 ] 0 (bytes 00)
FAC3 [ui8 ] 0 (bytes 00)
FBAD [hex_] (bytes 00 00 00 00)
FNum [ui8 ] 2 (bytes 02)
FOff [ui8 ] 0 (bytes 00)
FRmp [ui16] 0 (bytes 00 00)

Note that there is NO F0ID or F1ID key provided!

Below are the F... keys listed in https://app.assembla.com/wiki/show/fakesmc
with some description of what they are.

It seems it should be possible to show fan info (F#Ac, etc) when there is no corresponding F#ID key, by simply calling it fan 0 etc.

F0Ac fpe2 2 K_VAR_ATOM_RW Fan0 Actual RPM, DIAG_LOG
F0ID {fds K_CONST Fan0 Description
F0Mn fpe2 2 K_VAR_ATOM_RW Fan0 Minimum RPM
F0Mt ui16 2 K_VAR_ATOM_RW Fan0 Max calculated target RPM
F0Mx fpe2 2 K_VAR_ATOM_RW Fan0 Maximum RPM
F0Sf fpe2 2 K_VAR_ATOM_RW Fan0 Safe RPM
F0Tg fpe2 2 K_VAR_ATOM_RW Modify this in conjunction with Fan force bit [0] to set fan speed.
F1Ac fpe2 2 K_VAR_ATOM_RW Fan1 Actual RPM
F1ID {fds K_CONST Fan1 Description
F1Mn fpe2 2 K_VAR_ATOM_RW Fan1 Minimum RPM
F1Mt ui16 2 K_VAR_ATOM_RW Fan1 Max calculated target RPM
F1Mx fpe2 2 K_VAR_ATOM_RW Fan1 Maximum RPM
F1Sf fpe2 2 K_VAR_ATOM_RW Fan1 Safe RPM
F1Tg fpe2 2 K_VAR_ATOM_RW Modify this in conjunction with Fan force bit [1] to set fan speed.
F2Ac fpe2 2 K_VAR_ATOM_RW Fan2 Actual RPM
F2ID {fds K_CONST Fan2 Description
F2Mn fpe2 2 K_VAR_ATOM_RW Fan2 Minimum RPM
F2Mt ui16 2 K_VAR_ATOM_RW Fan2 Max calculated target RPM
F2Mx fpe2 2 K_VAR_ATOM_RW Fan2 Maximum RPM
F2Sf fpe2 2 K_VAR_ATOM_RW Fan2 Safe RPM
F2Tg fpe2 2 K_VAR_ATOM_RW Modify this in conjunction with Fan force bit [2] to set fan speed.
FNum ui8 1 K_CONST Number of supported fans.
FPhz si16 2 KPRIV_VAR_ATOM_RW Programmable Fan Phase offset affects all fans. Signed value
has legal values between 0 and 360. Default is 360 (no change).
FS! ui16 2 K_VAR_ATOM_RW Fan force bits. FS![15:0] Setting bit to 1 allows for external control over fan speed target and
prevents thermal manager from actively overidding value set via key access.

Binary releases

Hello

Would it be possible to add already compiled binaries to SMCKit releases?

Is it safe to run this command?

I did the installation on my iMac. I can run smckit perfectly, but my HDD fan shows Current: 0 RPM.
That is my problem I changed my HD because the original one failed. I put a Western Digital and the sensor cable did not match. I got one for the Western Digital but it seems is not reporting temp data back. The HD fan is running high. Can I use this command to set the speed of the HD fan:
sudo smckit -n 1 -s 1102? Is it safe to run this?

SMC.swift:373: Assertion failed: SMCParamStruct size is != 80

Trying to use SMC.swift in a command line tool for macOS 13 and up. Building fails with
SMC.swift:373: Assertion failed: SMCParamStruct size is != 80

The app will build if I comment that out, but then trying to
let allKnownSensors = try SMCKit.allKnownTemperatureSensors().sorted { $0.name < $1.name }
results in
Swift/ErrorType.swift:200: Fatal error: Error raised at top level: smc_test.SMCKit.SMCError.unknown(kIOReturn: 268435459, SMCResult: 0)

"System Information" method for pulling SMC related data

  • Add method to pull SMC related data from a machine and export to something like JSON
  • Grab model, valid SMC keys (TMP sensors, fan keys, etc.), values such as fan min and max RPMs, etc.
  • Will allow for the building of a reference list of all models. Some work has been done on this front by others, but none complete. Also allows for easy sharing of what a machine can and can't do.
    • Could add this to the API as a p-list

i'm getting "error 65"

when I do "make install", it'll go through everything and then say it failed due to;

> ** BUILD FAILED **
> 
> 
> The following build commands failed:
> 	CompileSwift normal x86_64
> 	CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler
> (2 failures)
> make: *** [build] Error 65

WIRELESS_MODULE (TW0P) temperature sensor misreports 129°C on MacBookPro11,1

On a MacBookPro11,1 the WIRELESS_MODULE (TW0P) temperature sensor reports 129°C (max temperature) constantly (right from boot with Wi-Fi off). Seems to be an issue in software, not hardware. The Apple Hardware Test (AHT) reports that everything is fine. Tested on a few machines of the same model in the Apple store, same results, other models do not seem to have this problem. Wi-Fi works fine. For now, commenting out the sensor to prevent confusion, not worth putting in the logic to check for model number.

Here's a sample of temperature readings. The sensors value is completely disproportionate to the rest. The SMC doesn't report any errors and the system is not under any load, nor is Wi-Fi on. The value is constant, does not fluctuate at all. Of course, TW0P may not actually correspond to the wireless module (AirPort card).

AMBIENT_AIR_0
    34.0°C
CPU_0_PROXIMITY
    49.0°C
ENCLOSURE_BASE_0
    29.0°C
ENCLOSURE_BASE_1
    27.0°C
ENCLOSURE_BASE_2
    26.0°C
HEATSINK_1
    41.0°C
MEM_SLOTS_PROXIMITY
    42.0°C
PALM_REST
    26.0°C
WIRELESS_MODULE
    129.0°C

SMC version is 2.16f68

$ uname -a
Darwin beltex.local 14.1.0 Darwin Kernel Version 14.1.0: Mon Dec 22 23:10:38 PST 2014; root:xnu-2782.10.72~2/RELEASE_X86_64 x86_64

So my guess is that the SMC either misreads the temperature sensor or mishandles it somehow for this specific hardware. AHT probably reads it in a different manner. Don't believe its anything on the SMCKit side, it's simply the raw data returned from the SMC itself. If you see the same or different behaviour, do chime in! :)

As a side note, HEATSINK_0 (Th0H) on a MacBookPro5,1 reports 0°C constantly (though only checked on a single machine), so this sort of thing is not entirely uncommon.

Invalid temperatures on iMac 2017 model 18,3

When I run SMCKitTool on my 2017 iMac (i5 - mode 18.3) I'm getting the following output which is clearly wrong for the sensors AMBIENT_AIR_0, CPU_0_DIE, HDD_PROXIMITY.

The other sensors look OK but it is hard to trust them.

-- Temperature --
AMBIENT_AIR_0 �[0;0m11.0°C �[0;0m
CPU_0_DIE �[0;0m-73.0°C �[0;0m
CPU_0_PROXIMITY �[0;0m37.0°C �[0;0m
GPU_0_DIODE �[0;0m36.0°C �[0;0m
GPU_0_PROXIMITY �[0;0m34.0°C �[0;0m
HDD_PROXIMITY �[0;0m-121.0°C �[0;0m
LCD_PROXIMITY �[0;0m31.0°C �[0;0m
MEM_SLOTS_PROXIMITY �[0;0m33.0°C �[0;0m
MISC_PROXIMITY �[0;0m34.0°C �[0;0m
-- Fan --
[id 0] Main �������
Min: 1200 RPM
Max: 2700 RPM
Current: �[0;0m1191 RPM �[0;0m
-- Power --
AC Present: �[0;0mtrue�[0;0m
Battery Powered: �[0;0mfalse�[0;0m
Charging: �[0;0mfalse�[0;0m
Battery Ok: �[0;0mtrue�[0;0m
Battery Count: 0
-- Misc --
Disc in ODD: �[0;0mfalse�[0;0m
Program ended with exit code: 0

Add debug logging

  • May not actually be of much use in the short term
  • Logging framework TBD
    • Use builtin Swift DEBUG macro? Simple, but does the job. See here for example.

SMCWrite error while setting the fan PRM

When I tried to write smc to set the fan RPM, it returned like this "smc.swift:callSMC(inputStruct:outputStruct:) - IOReturn = -536870207 - kSMC = 0". I figured out the IOReturn code means kIOReturnNotPrivileged. Does anyone have ideas how to solve this problem?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.