content
stringlengths 4
1.04M
| lang
stringclasses 358
values | score
int64 0
5
| repo_name
stringlengths 5
114
| repo_path
stringlengths 4
229
| repo_licenses
listlengths 1
8
|
---|---|---|---|---|---|
package inline
inline fun f(body: () -> Unit) {
body()
println("i'm inline function")
}
| Groff | 4 | qussarah/declare | jps-plugin/testData/incremental/multiModule/inlineFunctionTwoPackageParts/module1_inlineF.kt.new.1 | [
"Apache-2.0"
] |
$url = 'https://dl.google.com/tag/s/dl/chrome/install/beta/googlechromebetastandaloneenterprise.msi';
if ([Environment]::Is64BitProcess) {
$url = 'https://dl.google.com/tag/s/dl/chrome/install/beta/googlechromebetastandaloneenterprise64.msi'
}
Write-Host "Downloading Google Chrome Beta"
$wc = New-Object net.webclient
$msiInstaller = "$env:temp\google-chrome-beta.msi"
$wc.Downloadfile($url, $msiInstaller)
Write-Host "Installing Google Chrome Beta"
$arguments = "/i `"$msiInstaller`" /quiet"
Start-Process msiexec.exe -ArgumentList $arguments -Wait
Remove-Item $msiInstaller
$suffix = "\\Google\\Chrome Beta\\Application\\chrome.exe"
if (Test-Path "${env:ProgramFiles(x86)}$suffix") {
(Get-Item "${env:ProgramFiles(x86)}$suffix").VersionInfo
} elseif (Test-Path "${env:ProgramFiles}$suffix") {
(Get-Item "${env:ProgramFiles}$suffix").VersionInfo
} else {
write-host "ERROR: failed to install Google Chrome Beta"
exit 1
}
| PowerShell | 3 | burner/playwright | packages/playwright-core/bin/reinstall_chrome_beta_win.ps1 | [
"Apache-2.0"
] |
.class public Ltrycatch/TestFinally3;
.super Ljava/lang/Object;
.field public bytes:[B
.method public test()[B
.registers 4
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/lang/Exception;
}
.end annotation
const/4 v0, 0x0
:try_start_1
iget-object v1, p0, Ltrycatch/TestFinally3;->bytes:[B
if-nez v1, :cond_1a
invoke-direct {p0}, Ltrycatch/TestFinally3;->validate()Z
:try_end_8
.catchall {:try_start_1 .. :try_end_8} :catchall_24
move-result v1
if-nez v1, :cond_10
invoke-static {v0}, Ltrycatch/TestFinally3;->close(Ljava/io/InputStream;)V
return-object v0
:cond_10
:try_start_10
invoke-direct {p0}, Ltrycatch/TestFinally3;->getInputStream()Ljava/io/InputStream;
move-result-object v0
invoke-direct {p0, v0}, Ltrycatch/TestFinally3;->read(Ljava/io/InputStream;)[B
move-result-object v1
iput-object v1, p0, Ltrycatch/TestFinally3;->bytes:[B
:cond_1a
iget-object v1, p0, Ltrycatch/TestFinally3;->bytes:[B
invoke-direct {p0, v1}, Ltrycatch/TestFinally3;->convert([B)[B
:try_end_1f
.catchall {:try_start_10 .. :try_end_1f} :catchall_24
move-result-object v1
invoke-static {v0}, Ltrycatch/TestFinally3;->close(Ljava/io/InputStream;)V
return-object v1
:catchall_24
move-exception v1
invoke-static {v0}, Ltrycatch/TestFinally3;->close(Ljava/io/InputStream;)V
throw v1
.end method
.method private convert([B)[B
.registers 3
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/lang/Exception;
}
.end annotation
const/4 v0, 0x0
new-array v0, v0, [B
return-object v0
.end method
.method private static close(Ljava/io/InputStream;)V
.registers 1
return-void
.end method
.method private getInputStream()Ljava/io/InputStream;
.registers 3
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/lang/Exception;
}
.end annotation
new-instance v0, Ljava/io/ByteArrayInputStream;
const/4 v1, 0x0
new-array v1, v1, [B
invoke-direct {v0, v1}, Ljava/io/ByteArrayInputStream;-><init>([B)V
return-object v0
.end method
.method private read(Ljava/io/InputStream;)[B
.registers 3
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/lang/Exception;
}
.end annotation
const/4 v0, 0x0
new-array v0, v0, [B
return-object v0
.end method
.method private validate()Z
.registers 2
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/lang/Exception;
}
.end annotation
const/4 v0, 0x0
return v0
.end method
| Smali | 4 | Dev-kishan1999/jadx | jadx-core/src/test/smali/trycatch/TestFinally3.smali | [
"Apache-2.0"
] |
5.253879724303298e-19 -0.36535806190329384 8.294894787896746 8.041405860931532 -6.508295955738513 -34.85193087880761 -20.465585371385195 -2.98581123210721 0.2658664504038635 -4.014409023576435 -16.532863148560434 -9.782285880560782 -32.30450100987721 -22.07419849514698 -2.9012236297384746 -1.0379838152679142 0.4873619116247213 -29.233930462188404 -22.283733726666828 21.118608460124534 -7.917280287300311 -8.769424931437626 10.945395542422855 1.0162556674459136 0.06359122945075618 -3.1507942245003258 -25.403527803147398 -30.15325762014069 -37.631597194151695 7.276062549348733 14.971437183820386 -0.1834120801869407 0.0 18.918039345055774 10.55873948096877 -34.3075362898856 30.000610445814807 59.2432252108873 27.751781294611902 0.0 -0.7857459336731594 13.89580532437417 21.010958185277232 -32.2792137244429 -28.983161471802713 34.210023610512444 47.02615607795734 1.0096418628823107 -1.3934105370718985 9.574187869854267 -5.461607295655477 -33.677357345629204 -12.781618996388865 40.4071034918189 46.349460144839156 -1.5685893053609097 -0.03788468430772829 0.9949479247191566 6.479117740668763 22.072029493651165 23.949651553478425 23.2186394259507 12.774324358155374 -1.7644540927473191
2.327854602971151e-15 -2.7120809664759364 -23.020275084093964 17.569927288810057 18.44751803255661 0.13244448055145297 9.717341407526717 0.7972686838373987 0.019822604560960525 -6.592090160427637 9.979648127704886 37.224589520800436 -20.37423479479169 -4.09674782725215 33.776874180941945 1.9682219524666247 -0.3423399535721668 2.1408192523896177 -6.0393040842993635 11.244575922117862 3.080672470529749 22.165880716338844 21.436945072997137 1.6512109524340826 -0.25745922378789904 -5.178019828913531 -19.130776979863867 23.646433855802798 40.234048116639855 19.679572158918862 -3.038709419137063 0.30125922313440207 0.0 -7.47771194754016 -42.79114910310857 27.75409647406052 34.36801785900221 -6.392153927428581 -17.01807850358947 0.0 0.4451761473823281 2.169092737522866 -8.915161051534657 24.677006694071444 -3.770309833697046 2.304142222778663 -21.346010191196342 -0.6730939419245034 1.0448133307968483 6.288486847692124 -5.039115294931892 37.701769455224216 -0.624085788100353 -9.809115549639174 -3.79509076849706 0.6066078366422654 -0.06270191479433791 -0.7588551863204304 -19.004783785275286 5.178991753507564 -6.873845448568337 10.274423989633558 16.043883462449788 6.935926979957664
-1.279231346642054e-14 1.1079574230298088 25.457204821524925 45.34956032130584 -12.176892064556933 -19.886896311109176 -4.7478629110560755 -1.0319584515602649 -0.5972866371583463 15.588479114587473 47.38394433550485 5.373146066520472 -2.1300124678414396 21.74741738688126 7.453824575487797 -1.2228384307906377 0.2061659674815774 5.751489917252382 -1.0827422727149103 -19.465272262031075 18.23996444835447 5.842494078446949 -0.14050766449292978 -0.8336793620852866 -0.05100113933223868 -11.78097394272212 -30.220249148391197 -5.268617551892304 -11.195797039612726 14.239979152768628 -3.8330231690137464 -0.009451873265478555 0.0 -15.540694911822385 -26.11600513128056 8.883152332387004 4.625531649142603 29.468207714213353 -17.916390193205423 0.0 0.4216703364239507 -7.1358463567588455 -2.9438891715087934 17.69139914682063 -4.864596351035647 8.33872195278897 0.05728779056752359 1.0949260812906807 -0.1081676388996186 0.7471152046791759 26.152723501518132 43.08202168084459 -24.107509974070755 31.59137646975083 47.21049633025394 8.00300946869728 -0.1295425805337899 1.5131586545085065 23.852712311614514 33.926405797929675 -19.2447060308263 32.819986192283494 26.320111262638104 5.8156339559581305
1.229923661533117e-13 -4.823777397966892 -7.096752324823189 -3.9882903530264646 -0.3182479972939066 -25.55673897307223 -22.811360078012886 0.011309256450822966 0.12621360357773262 -4.734926518487089 10.43289456533357 2.3350545114153842 28.154740782325128 2.307589858473461 -5.25319308820846 2.257340349391387 0.19358851976562041 3.1700919376020495 3.9432519764988347 -26.375983587442768 6.005750690513307 13.751866794036252 1.4055053929969188 1.6596432144666262 0.10550705382054315 2.4835434509780625 -0.7076936999952529 -10.242860865287021 -12.787388503861822 1.0020972840672044 32.22738393970275 0.04591698151860263 0.0 16.93392751138621 -0.13029364987980607 -51.75188130223695 -23.310249617160924 6.076163977860092 19.185531427191737 0.0 0.22698407490934275 6.408044236406366 -2.624283860361839 -45.236045161761304 -41.55434505442266 17.725390048818536 27.083827990509285 0.17143458263683686 0.9252739360799789 11.149852082324195 18.030271366419733 -33.49168862284212 -6.145052747683266 61.50434156850001 29.459497959405812 0.45200083033827576 0.1268465128252938 -6.32881957202892 1.0983276729622604 -12.870349045758559 29.658962029396058 15.736597225991977 -20.345679847613255 -16.28198721754337
-5.3610370345905183e-14 3.5654389425596156 0.6136500703554552 -18.89166845611348 -31.92816005874687 -43.28169757027993 -9.439490542751196 -4.890109738454526 -0.020308528127306658 -9.157866034344105 -18.793686553406637 27.12321810482453 -14.97532923026514 -67.80355871542197 -10.360350777391282 1.7242729811175106 -0.24732633416698518 -18.157446371883662 52.81851920988819 50.74036291639858 -51.60167742472294 -43.248543435493694 14.822095905151867 0.5783808269544481 -0.048646691276853525 8.16455459578535 71.86957912627248 16.43236832445111 -31.676592792649167 -16.523161170273067 -0.2602524598506944 -0.08615572918917952 0.0 25.854830198358503 28.331904008733495 5.0151076003108175 33.84654700085518 4.038487703230793 -8.2392103058598 0.0 -0.3024443661361757 5.937302124451543 2.522267357107087 1.2039644486437768 79.19682897821525 14.288329281349277 -8.135311193697964 -0.32748865385234366 0.5704322150778038 -1.1959675455627405 9.287253531517095 -2.5892534756487935 67.1416169787677 -5.628333546657084 7.8181058973979916 2.753227311148816 -0.021231749068623185 1.6040820517056023 4.948652108298762 -2.0688258258740473 38.549988064361735 -3.529651177515626 21.488639988930004 6.284479163285805
2.9927133946155273e-14 -2.233307688338874 -4.513326028830151 -29.064138129643652 15.9795025875439 22.898450355656585 9.26872325080319 1.513974486377626 -0.27391475098153917 -22.3755704259349 -7.155063869203102 -3.228162578566782 -27.276069578673567 -25.288981661016777 -5.178998210960825 3.774782978980661 -0.054245132300981574 -18.505556694044454 20.022763666413866 19.82673705030557 -51.30104102788775 -45.7632700762403 -2.1762912916909127 2.2723874849827417 0.13865199366306785 2.8671186215248383 40.19854720848879 17.01791873376988 -16.142810417327883 20.543286399753022 11.23590275220765 0.20351460906360905 0.0 23.167707529631716 45.68314738069606 15.248310504271666 18.80188759835029 33.31295008947084 34.5284717738355 0.0 0.676564032979997 14.94672048322125 0.9148904386562887 3.422225476995544 38.365425433972646 -3.605607672428752 17.903569251120665 -0.3613633315292497 0.8714567030786823 6.656320718505963 -18.669102329824327 -42.54686401326757 29.083245765940962 -4.759518189635382 5.060481990615391 2.6609438208179514 -0.03238009815182845 -3.423696902440927 -21.348091032044856 -9.756476933634856 34.05526181045134 -1.080824242630487 -4.531340264950131 13.399482829291944
3.395571868221292e-14 1.4509786761450414 1.7955707637155085 -11.009164112411913 23.267905928407718 -5.038872544373799 -3.6996674975914927 1.7477996106670786 0.025617282416507355 2.7530435057475 12.140637846806571 -17.393943633827405 -15.045926385960975 28.588074574833726 6.607588835155397 -2.5646465302630044 -0.13519666202895983 -4.9033228234592015 3.6507223061130554 -13.346500949847107 -22.264491558278376 22.745920786706634 33.06641466783921 -0.6106788422900865 -0.09693313702053462 5.035455230139799 4.447899468620191 -12.023633662165407 -8.205195581992301 13.21573315356816 14.030365357429407 0.11090686605204828 0.0 -8.816207689515482 7.575652452214861 -31.46514927125814 -2.915193423229481 1.6110854400819246 7.429232404081276 0.0 -0.2657550586906414 -9.162611498185415 -9.915920504512183 -30.332712619392307 9.014172267579314 2.248157540944254 2.578720283014185 1.7122192102842488 1.22344420421755 -3.9081129094840144 14.316281385545917 15.481880329469423 9.039198847613049 -16.250345535509265 -14.278241024048057 -1.7587511518513517 0.09698862172849362 1.9113808460505999 -7.22374107318792 0.4032033285549401 17.131567620941063 -3.4507817086901236 -5.468752448402525 -3.918667427362706
-3.187810361101332e-14 -0.8141664678575358 12.590652930694343 14.181347047994102 -5.731662883736135 52.74495750978837 13.019036133741109 0.4719614638160741 0.6076023326836631 -5.266514138429543 12.875675853786664 12.338690235248606 19.454731703087727 41.630548191452576 11.221592150208643 0.1086060912165229 -0.0179788701208327 22.705243269593606 3.777420849382532 -19.98479884698173 38.02562371235661 24.4112235465726 -4.097504234249161 -3.5326426904598804 -0.08633181713367648 10.70291780454008 11.264378323272668 25.54579598355041 -15.186797100893878 -19.12667351610313 1.8606479022956128 -0.24482117493096817 0.0 6.276767671873917 33.21862397292229 23.806836497293276 -52.786362829547166 -43.36209930881882 -17.55994635399705 0.0 0.18698978039870073 -1.5286301994485982 18.39165150565385 35.000639143996395 23.875561478582128 -30.284552808922047 -40.126429128375705 -1.9164815420844317 -0.24955701818993753 0.804279304088538 27.93006407503597 44.49294525268565 -15.010004859334884 -9.989847896791137 -38.58753002525134 -2.3195595737244528 -0.07203792762565686 2.90163920921441 6.3393136699488455 14.44912624124717 -25.5052446934816 -2.843636857104262 -19.206303376395283 -1.0102468356533183
-5.708996036993972e-15 10.253289573864135 41.92317203765716 36.63013245879227 14.090978011579875 -5.436275763292482 3.4154013899173488 1.0892916418353604 -0.26440810271292087 30.428884211866112 34.47524016441128 -28.07309995766333 37.38934531510534 13.122690535631811 0.6056336428067274 -1.2807797985339033 -0.20212550976449517 12.265349850700732 -21.414970906801237 -42.49105298620341 32.14101653828083 -12.352597116375506 -2.364920560660419 0.6980523519116332 -0.12690154429492234 -14.535996204028791 -20.591026116336952 10.792406868653602 21.126176740283114 -7.587691291758691 -9.268809470754833 -0.014755063810389567 0.0 -22.919214894058626 -28.411213618826043 28.179057869223172 -6.543216936409803 -25.765659080975915 -6.345854722105939 0.0 0.18230730074264803 -17.255393053355526 -42.17482457198121 19.441642563168607 -23.179924346797588 -42.44259358406013 -8.800312358071018 0.8341372167498929 -0.04725453007802173 -7.58156620276001 -11.263589261219334 23.81971190502431 -1.6391550691568202 -32.787694850937605 -12.206773264254222 -1.2870490788893167 0.029532891102705735 6.197688004761288 33.181283942729785 36.64870269188151 -26.480884753524453 -21.027310879493765 -10.189904510517772 -1.622145843833245
2.9938910425236036e-14 -0.02355131441772157 -23.94300149144437 -9.536026798723052 5.852349125764098 -28.904152969832044 -17.651084866913866 3.043225428571327 -0.31361768090246506 -7.384945330945219 -0.9894925490484716 -5.8756990366346535 -10.455799292914723 -36.458336382592655 -30.311978200116602 3.007577905967758 0.33254607736066955 4.329075940494332 23.770189445317097 3.9539494438528378 -10.243442857479462 -7.542930439768985 -6.561498854898098 1.8373482174710478 0.07754115701653941 9.571337059403055 17.252844891895542 20.823223338737563 13.60783125024115 -1.4624234974479067 -1.9954225137680281 0.2282565611545706 0.0 1.7345356593241659 -18.550617013931177 -39.45277864596647 -22.089225922253682 15.08610623700143 -3.8456588301061663 0.0 -0.7868522116403989 -4.508630208790165 11.582416382125214 -51.41400271464631 -38.91489823720611 54.22777923241798 7.508369404099788 1.3180156042763804 -0.5511315749483632 -14.769889822214626 8.777146008930464 -23.21264639683757 -10.927685397430347 35.89983816775537 -1.0047463233957332 2.6353426237464417 -0.14427716408899682 -1.9075572856505247 -21.93318110371148 -1.0726208435609417 26.041941738346406 25.219685717848563 13.522341455290142 14.01171850827554
4.3981223709876623e-14 3.228239707895265 27.87625561587449 35.28726270440219 -32.278532103068365 -16.415527137016873 -7.855125316308787 4.297919934881983 0.33000118053140437 10.597791651305092 13.536525117893468 -2.4309834874296072 6.819062133413409 7.950005945778933 -8.657490138877481 3.937146738848549 0.2645684797653389 17.501910144171315 10.016465927824694 -2.740420645648603 55.316097079858494 -20.671905186930932 -27.02580110399648 0.42715643647188406 0.28845674271422145 7.013628284002713 0.8416591998361972 -4.606032719330033 33.29770177122113 -21.18619874643167 -15.792669389691113 0.12095045574550409 0.0 -19.643086047628934 -36.379748678244155 7.392258575091198 -17.718676982391237 -41.27618854693662 -10.353547369395077 0.0 -0.2019753449336532 -19.49469257436721 -68.61111043822649 8.335452813082956 6.464999090067908 -11.41993305424607 -31.859558771014537 -1.0476273568146086 -0.9961528589017354 0.06557433960733872 -18.838120235630196 1.2915531636453985 -10.238750477283853 -18.71951096846323 -24.334147582039705 -1.5179402913103202 0.09443985992351135 0.9562801867040658 45.01916368261636 16.63886607513185 -0.13768636660225964 -41.07797751084631 -10.78858175284527 4.484923188733127
-3.9701320054126706e-14 3.2209087990901875 -15.714687656042807 7.015994617456618 45.54839910130487 56.41052626424373 22.78751731866352 -1.3241105300196796 0.09544551896716469 22.42483301535157 -0.5575514991894437 18.524105438141767 -8.404626009707275 19.357110514823734 23.01970327073315 -2.6949747974335097 -0.2319375842965841 23.58898280888015 20.74471684861965 16.596106941939894 2.260121695490222 21.40458011878425 8.950851725743068 1.0206147580205536 -0.2523194786676777 15.258347946455043 -1.9680809182849837 -16.746846870116002 -2.111357085286388 -1.022578566239857 -22.458592189159265 0.10532773924759892 0.0 1.408443263333072 6.452411981289658 46.076250422779715 25.627302634131972 1.3221405272206916 -10.533631345756728 0.0 -0.22547182922303122 12.706829559191638 22.1324390654289 36.71568037910825 28.386395375994294 -24.150544537625837 -7.05992044460322 -1.5674353625788346 0.38329156142018833 2.1711379275161558 -15.493678424959166 28.388409576864156 15.692632920272029 -50.530975981051846 -8.87603126460405 -2.282545243542181 0.24625663809492748 4.451799797524402 -10.111087158602881 -2.339972248754761 -8.846346662784462 -3.630442499231114 11.169828210294101 -6.365286086549384
-7.954253413072361e-14 -0.8529423823483901 -15.762332172881282 -30.487110756332257 4.639359643265694 50.822881713427485 34.31128473123187 8.494485796027458 -0.03660852629747021 -6.2478803212147165 -30.59316521770504 -2.2456299015202306 1.342927373978731 18.362209227470935 9.336192225590812 -0.1114052885322096 -0.32641292300898445 -14.314462480178321 -14.92987359301498 12.985878906050786 -24.341384911893346 28.40059592787196 0.7676250630545214 -2.4059458800457056 0.10168498215723387 -8.05476799000197 -5.770774191100566 14.445970552079075 22.507893340463205 56.844543295472256 24.20607777624978 -0.09581829581872417 0.0 9.986749951227623 24.20865425837026 11.204723937171211 17.772165662637473 27.370277996902907 14.157505313158646 0.0 0.8317031694211909 18.242302923009944 12.046429681907492 3.6809620484113177 40.99889579302295 24.150007045528138 -8.605938410164386 0.06157021874277126 -0.2067140861634042 -1.1547840957743598 -35.65444573283121 -46.468448202932606 4.58457555822078 -31.728635943442494 -36.263651277288474 -0.2123753905305229 -0.13358591588372556 -1.0134262261004703 -13.694687229875512 -34.32592953853892 -48.38013540368163 -36.755318114213964 -4.773805909929785 1.1614654371682098
1.527215599516913e-14 -3.988935592347417 -30.00539005379159 -4.580461740770511 26.965117602573002 4.508751132535114 -1.7090787464481756 -5.994822794874746 0.014290639032036138 -13.528895818630088 -15.351034710932867 25.082644948616746 20.99834216692712 21.39967865327945 5.580656118217827 -0.7521219924210855 0.07216141637197476 -8.008000852875 -41.54785450316044 3.030862493796942 0.9666012660804264 23.51048849942631 0.776005661922274 1.3174807016618868 0.1851240500509593 -8.429601063174394 -29.240703650737544 -32.43501221131595 -4.400621079586347 -18.54843438985087 -13.30352561784703 0.09552315924076722 0.0 -7.542050921897712 28.226347871289484 15.844941061606809 14.15413111180073 -2.1836876824546883 -7.227992410039032 0.0 0.43419296251344014 -7.128071026879901 67.22144669115723 39.67051224280583 -1.3309536121658079 -6.931377172022604 -5.084702852607135 -1.3904742339593512 -0.6778588178175876 -4.755855529325471 11.874615627740194 32.520536766295606 15.946650072768142 -8.272701272132087 2.5440595482073878 -1.3778695347865697 -0.11626928008844878 0.11125136038791111 -28.781956983477293 3.6310152717383026 2.4193444274450417 -3.231979286406426 2.2290233750521367 -1.1644951159356824
1.4591952936376106e-13 -6.533602900870116 16.01734232309473 -19.542033771339078 -28.284789758640198 10.512619803365315 0.13089897698627556 -4.822453542985234 0.02056088000765996 1.8811973565949724 -17.710100481866633 -19.027106686666546 49.46815013547519 6.487978248643326 -28.251238423857167 -6.887662064978417 0.01678368347006528 10.56298602547546 2.8459733468793136 8.792419397477591 30.438708143487553 0.573459456507083 -42.093290384422 -5.036219366930674 -0.03572021697719195 -0.3787015547996056 21.323057164642474 11.230978013303984 38.516161992805564 -21.684843730852787 -20.352608527382007 -0.5711922138957107 0.0 -13.24556248083277 -6.388378343518325 -6.72961187499245 -21.921375464497967 -28.162080011483166 5.841883976894489 0.0 -0.7863257377483526 -1.9477843532628885 1.3335248870717153 -10.414066478980049 -59.18447551001939 -10.073750554582134 40.08100209803467 1.0864337117670688 -0.6685316414561466 -1.4321930921659387 19.39607158083781 -13.512477923481514 -29.041979279204536 50.71215892868683 11.320435039338877 -4.458988344804762 0.17669712753476488 -6.503356552027308 15.978063950900493 -30.94612750020999 4.498312654565483 31.30537698357098 -22.67129985458602 -18.83068944405067
| IDL | 0 | imomayiz/Dictionnary-Learning-for-Sparse-Representations | dlm_files/Z3.dlm | [
"MIT"
] |
/*
github.com style (c) Vasily Polovnyov <[email protected]>
*/
.hljs-light {
display: block;
overflow-x: auto;
padding: 0.5em;
color: #333;
}
.hljs-light .hljs-comment,
.hljs-light .hljs-quote {
color: #998;
font-style: italic;
}
.hljs-light .hljs-keyword,
.hljs-light .hljs-selector-tag,
.hljs-light .hljs-subst {
color: #333;
font-weight: bold;
}
.hljs-light .hljs-number,
.hljs-light .hljs-literal,
.hljs-light .hljs-variable,
.hljs-light .hljs-template-variable,
.hljs-light .hljs-tag .hljs-attr {
color: #008080;
}
.hljs-light .hljs-string,
.hljs-light .hljs-doctag {
color: #d14;
}
.hljs-light .hljs-title,
.hljs-light .hljs-section,
.hljs-light .hljs-selector-id {
color: #900;
font-weight: bold;
}
.hljs-light .hljs-subst {
font-weight: normal;
}
.hljs-light .hljs-type,
.hljs-light .hljs-class .hljs-title {
color: #458;
font-weight: bold;
}
.hljs-light .hljs-tag,
.hljs-light .hljs-name,
.hljs-light .hljs-attribute {
color: #000080;
font-weight: normal;
}
.hljs-light .hljs-regexp,
.hljs-light .hljs-link {
color: #009926;
}
.hljs-light .hljs-symbol,
.hljs-light .hljs-bullet {
color: #990073;
}
.hljs-light .hljs-built_in,
.hljs-light .hljs-builtin-name {
color: #0086b3;
}
.hljs-light .hljs-meta {
color: #999;
font-weight: bold;
}
.hljs-light .hljs-deletion {
background: #fdd;
}
.hljs-light .hljs-addition {
background: #dfd;
}
.hljs-light .hljs-emphasis {
font-style: italic;
}
.hljs-light .hljs-strong {
font-weight: bold;
}
| CSS | 3 | mgelbart/ray | dashboard/client/src/components/LogView/github.css | [
"Apache-2.0"
] |
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Collections.Immutable;
using Microsoft.CodeAnalysis.Host;
using Microsoft.CodeAnalysis.Navigation;
using Microsoft.CodeAnalysis.Shared.Extensions;
using Microsoft.CodeAnalysis.Text;
namespace Microsoft.CodeAnalysis.NavigateTo
{
internal static class NavigateToUtilities
{
public static ImmutableHashSet<string> GetKindsProvided(Solution solution)
{
var result = ImmutableHashSet.CreateBuilder<string>(StringComparer.Ordinal);
foreach (var project in solution.Projects)
{
var navigateToSearchService = project.GetLanguageService<INavigateToSearchService>();
if (navigateToSearchService != null)
result.UnionWith(navigateToSearchService.KindsProvided);
}
return result.ToImmutable();
}
public static TextSpan GetBoundedSpan(INavigableItem item, SourceText sourceText)
{
var spanStart = item.SourceSpan.Start;
var spanEnd = item.SourceSpan.End;
if (item.IsStale)
{
// in the case of a stale item, the span may be out of bounds of the document. Cap
// us to the end of the document as that's where we're going to navigate the user
// to.
spanStart = spanStart > sourceText.Length ? sourceText.Length : spanStart;
spanEnd = spanEnd > sourceText.Length ? sourceText.Length : spanEnd;
}
return TextSpan.FromBounds(spanStart, spanEnd);
}
}
}
| C# | 4 | Cadris/roslyn | src/Features/Core/Portable/NavigateTo/NavigateToUtilities.cs | [
"MIT"
] |
local helpers = require('test.functional.helpers')(after_each)
local clear = helpers.clear
local eq = helpers.eq
local iswin = helpers.iswin
local fnamemodify = helpers.funcs.fnamemodify
local getcwd = helpers.funcs.getcwd
local command = helpers.command
local write_file = helpers.write_file
local alter_slashes = helpers.alter_slashes
local function eq_slashconvert(expected, got)
eq(alter_slashes(expected), alter_slashes(got))
end
describe('fnamemodify()', function()
setup(function()
write_file('Xtest-fnamemodify.txt', [[foobar]])
end)
before_each(clear)
teardown(function()
os.remove('Xtest-fnamemodify.txt')
end)
it('handles the root path', function()
local root = helpers.pathroot()
eq(root, fnamemodify([[/]], ':p:h'))
eq(root, fnamemodify([[/]], ':p'))
if iswin() then
eq(root, fnamemodify([[\]], ':p:h'))
eq(root, fnamemodify([[\]], ':p'))
command('set shellslash')
root = string.sub(root, 1, -2)..'/'
eq(root, fnamemodify([[\]], ':p:h'))
eq(root, fnamemodify([[\]], ':p'))
eq(root, fnamemodify([[/]], ':p:h'))
eq(root, fnamemodify([[/]], ':p'))
end
end)
it(':8 works', function()
eq('Xtest-fnamemodify.txt', fnamemodify([[Xtest-fnamemodify.txt]], ':8'))
end)
it('handles examples from ":help filename-modifiers"', function()
local filename = "src/version.c"
local cwd = getcwd()
eq_slashconvert(cwd .. '/src/version.c', fnamemodify(filename, ':p'))
eq_slashconvert('src/version.c', fnamemodify(filename, ':p:.'))
eq_slashconvert(cwd .. '/src', fnamemodify(filename, ':p:h'))
eq_slashconvert(cwd .. '', fnamemodify(filename, ':p:h:h'))
eq('version.c', fnamemodify(filename, ':p:t'))
eq_slashconvert(cwd .. '/src/version', fnamemodify(filename, ':p:r'))
eq_slashconvert(cwd .. '/src/main.c', fnamemodify(filename, ':s?version?main?:p'))
local converted_cwd = cwd:gsub('/', '\\')
eq(converted_cwd .. '\\src\\version.c', fnamemodify(filename, ':p:gs?/?\\\\?'))
eq('src', fnamemodify(filename, ':h'))
eq('version.c', fnamemodify(filename, ':t'))
eq_slashconvert('src/version', fnamemodify(filename, ':r'))
eq('version', fnamemodify(filename, ':t:r'))
eq('c', fnamemodify(filename, ':e'))
eq_slashconvert('src/main.c', fnamemodify(filename, ':s?version?main?'))
end)
it('handles advanced examples from ":help filename-modifiers"', function()
local filename = "src/version.c.gz"
eq('gz', fnamemodify(filename, ':e'))
eq('c.gz', fnamemodify(filename, ':e:e'))
eq('c.gz', fnamemodify(filename, ':e:e:e'))
eq('c', fnamemodify(filename, ':e:e:r'))
eq_slashconvert('src/version.c', fnamemodify(filename, ':r'))
eq('c', fnamemodify(filename, ':r:e'))
eq_slashconvert('src/version', fnamemodify(filename, ':r:r'))
eq_slashconvert('src/version', fnamemodify(filename, ':r:r:r'))
end)
it('handles :h', function()
eq('.', fnamemodify('hello.txt', ':h'))
eq_slashconvert('path/to', fnamemodify('path/to/hello.txt', ':h'))
end)
it('handles :t', function()
eq('hello.txt', fnamemodify('hello.txt', ':t'))
eq_slashconvert('hello.txt', fnamemodify('path/to/hello.txt', ':t'))
end)
it('handles :r', function()
eq('hello', fnamemodify('hello.txt', ':r'))
eq_slashconvert('path/to/hello', fnamemodify('path/to/hello.txt', ':r'))
end)
it('handles :e', function()
eq('txt', fnamemodify('hello.txt', ':e'))
eq_slashconvert('txt', fnamemodify('path/to/hello.txt', ':e'))
end)
it('handles regex replacements', function()
eq('content-there-here.txt', fnamemodify('content-here-here.txt', ':s/here/there/'))
eq('content-there-there.txt', fnamemodify('content-here-here.txt', ':gs/here/there/'))
end)
it('handles shell escape', function()
local expected
if iswin() then
-- we expand with double-quotes on Windows
expected = [["hello there! quote ' newline]] .. '\n' .. [["]]
else
expected = [['hello there! quote '\'' newline]] .. '\n' .. [[']]
end
eq(expected, fnamemodify("hello there! quote ' newline\n", ':S'))
end)
it('can combine :e and :r', function()
-- simple, single extension filename
eq('c', fnamemodify('a.c', ':e'))
eq('c', fnamemodify('a.c', ':e:e'))
eq('c', fnamemodify('a.c', ':e:e:r'))
eq('c', fnamemodify('a.c', ':e:e:r:r'))
-- multi extension filename
eq('rb', fnamemodify('a.spec.rb', ':e:r'))
eq('rb', fnamemodify('a.spec.rb', ':e:r:r'))
eq('spec', fnamemodify('a.spec.rb', ':e:e:r'))
eq('spec', fnamemodify('a.spec.rb', ':e:e:r:r'))
eq('spec', fnamemodify('a.b.spec.rb', ':e:e:r'))
eq('b.spec', fnamemodify('a.b.spec.rb', ':e:e:e:r'))
eq('b', fnamemodify('a.b.spec.rb', ':e:e:e:r:r'))
eq('spec', fnamemodify('a.b.spec.rb', ':r:e'))
eq('b', fnamemodify('a.b.spec.rb', ':r:r:e'))
-- extraneous :e expansions
eq('c', fnamemodify('a.b.c.d.e', ':r:r:e'))
eq('b.c', fnamemodify('a.b.c.d.e', ':r:r:e:e'))
-- :e never includes the whole filename, so "a.b":e:e:e --> "b"
eq('b.c', fnamemodify('a.b.c.d.e', ':r:r:e:e:e'))
eq('b.c', fnamemodify('a.b.c.d.e', ':r:r:e:e:e:e'))
end)
end)
| Lua | 5 | uga-rosa/neovim | test/functional/vimscript/fnamemodify_spec.lua | [
"Vim"
] |
#!/usr/bin/env xdg-open
[Desktop Entry]
Type=Application
Name=MarvinSketch
Exec=@out@/bin/msketch %f
Icon=MarvinSketch
MimeType=text/xml;text/plain;chemical/x-cml;chemical/x-mdl-molfile;chemical/x-mdl-sdfile;chemical/x-mol2;chemical/x-pdb;chemical/x-xyz;chemical/x-mdl-rdfile;chemical/x-mdl-rxnfile;chemical/x-inchi;
Categories=Education;Science;Chemistry;
StartupWMClass=com-install4j-runtime-launcher-UnixLauncher
Comment=Molecular modelling, analysis and structure drawing program
| desktop | 2 | collinwright/nixpkgs | pkgs/applications/science/chemistry/marvin/MarvinSketch.desktop | [
"MIT"
] |
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
struct Uniforms {
half4 colorGreen;
half4 colorRed;
float unknownInput;
};
struct Inputs {
};
struct Outputs {
half4 sk_FragColor [[color(0)]];
};
bool check_bf2f2f2f3i2i2f2f2f4i2b4f2f2f2b2b2b3(float2 v1, float2 v2, float2 v3, float3 v4, int2 v5, int2 v6, float2 v7, float2 v8, float4 v9, int2 v10, bool4 v11, float2 v12, float2 v13, float2 v14, bool2 v15, bool2 v16, bool3 v17) {
return (((((((((((((((half(v1.x) + half(v2.x)) + half(v3.x)) + half(v4.x)) + half(v5.x)) + half(v6.x)) + half(v7.x)) + half(v8.x)) + half(v9.x)) + half(v10.x)) + half(v11.x)) + half(v12.x)) + half(v13.x)) + half(v14.x)) + half(v15.x)) + half(v16.x)) + half(v17.x) == 17.0h;
}
fragment Outputs fragmentMain(Inputs _in [[stage_in]], constant Uniforms& _uniforms [[buffer(0)]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _out;
(void)_out;
float2 v1 = float2(1.0);
float2 v2 = float2(1.0, 2.0);
float2 v3 = float2(1.0);
float3 v4 = float3(float2(1.0), 1.0);
int2 v5 = int2(1);
int2 v6 = int2(1, 2);
float2 v7 = float2(1.0, 2.0);
float2 v8 = float2(v5);
float4 v9 = float4(float(v6.x), _uniforms.unknownInput, 3.0, 4.0);
int2 v10 = int2(3, int(v1.x));
bool4 v11 = bool4(true, false, true, false);
float2 v12 = float2(1.0, 0.0);
float2 v13 = float2(0.0);
float2 v14 = float2(0.0);
bool2 v15 = bool2(true);
bool2 v16 = bool2(true);
bool3 v17 = bool3(true, bool2(true));
_out.sk_FragColor = check_bf2f2f2f3i2i2f2f2f4i2b4f2f2f2b2b2b3(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17) ? _uniforms.colorGreen : _uniforms.colorRed;
return _out;
}
| Metal | 3 | fourgrad/skia | tests/sksl/shared/VectorConstructors.metal | [
"BSD-3-Clause"
] |
module Dashboard.FilterBuilder exposing (instanceGroupFilter)
quoted : String -> String
quoted s =
"\"" ++ s ++ "\""
-- Note: this has to be in a separate module to avoid a long import cycle
-- as a result of this function being used in SideBar.InstanceGroup
instanceGroupFilter : { r | teamName : String, name : String } -> String
instanceGroupFilter { teamName, name } =
"team:" ++ quoted teamName ++ " group:" ++ quoted name
| Elm | 4 | Caprowni/concourse | web/elm/src/Dashboard/FilterBuilder.elm | [
"Apache-2.0"
] |
[
'getopt',
'multipackage5_B',
]
| TeX | 0 | hawkhai/pyinstaller | tests/functional/logs/multipackage5_B.toc | [
"Apache-2.0"
] |
nonce = null
Rails.loadCSPNonce = ->
nonce = document.querySelector("meta[name=csp-nonce]")?.content
# Returns the Content-Security-Policy nonce for inline scripts.
Rails.cspNonce = ->
nonce ? Rails.loadCSPNonce()
| CoffeeScript | 4 | Jiwoong/rails | actionview/app/assets/javascripts/rails-ujs/utils/csp.coffee | [
"MIT"
] |
# This file is distributed under the same license as the Django package.
#
# Translators:
# Jannis Leidel <[email protected]>, 2011
# Mattia Procopio <[email protected]>, 2014
# Tomasz Kajtoch <[email protected]>, 2016
msgid ""
msgstr ""
"Project-Id-Version: django\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-01-17 11:07+0100\n"
"PO-Revision-Date: 2017-09-23 18:54+0000\n"
"Last-Translator: Tomasz Kajtoch <[email protected]>\n"
"Language-Team: Polish (http://www.transifex.com/django/django/language/pl/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: pl\n"
"Plural-Forms: nplurals=4; plural=(n==1 ? 0 : (n%10>=2 && n%10<=4) && (n"
"%100<12 || n%100>14) ? 1 : n!=1 && (n%10>=0 && n%10<=1) || (n%10>=5 && n"
"%10<=9) || (n%100>=12 && n%100<=14) ? 2 : 3);\n"
msgid "Sessions"
msgstr "Sesje"
msgid "session key"
msgstr "klucz sesji"
msgid "session data"
msgstr "dane sesji"
msgid "expire date"
msgstr "data wygaśnięcia sesji"
msgid "session"
msgstr "sesja"
msgid "sessions"
msgstr "sesje"
| Gettext Catalog | 2 | jpmallarino/django | django/contrib/sessions/locale/pl/LC_MESSAGES/django.po | [
"BSD-3-Clause",
"0BSD"
] |
:- initialization((
logtalk_load_context(directory, Directory),
atom_concat(Directory, 'a/', ADirectory),
assertz(logtalk_library_path(a, ADirectory)),
atom_concat(Directory, 'b/', BDirectory),
assertz(logtalk_library_path(b, BDirectory))
)).
:- initialization((
logtalk_load(a(loader)),
logtalk_load(b(loader))
)).
| Logtalk | 3 | PaulBrownMagic/logtalk3 | examples/looping/loader.lgt | [
"Apache-2.0"
] |
(ns todomvc.components.todo-item
(:require [reagent.core :as reagent]
[todomvc.session :as session]
[todomvc.actions :as actions]
[todomvc.helpers :as helpers]
[todomvc.components.todo-edit :as todo-edit]))
(defn todo-item-class [completed editing]
(str (when completed "completed ")
(when @editing "editing")))
(defn todo-checkbox [id completed]
[:input.toggle {:type "checkbox"
:checked completed
:on-change #(actions/toggle-todo id)}])
(defn component [todo]
(let [editing (reagent/atom false)]
(fn [{:keys [id title completed] :as todo}]
[:li {:class (todo-item-class completed editing)
:style {:display (helpers/display-item
(helpers/todo-display-filter completed @session/todos-display-type))}}
[:div.view
[todo-checkbox id completed]
[:label {:on-double-click #(reset! editing true)} title]
[:button.destroy {:on-click #(actions/delete-todo id)}]]
[todo-edit/component todo editing]])))
| Clojure | 5 | dtelaroli/todomvc | examples/reagent/src/cljs/todomvc/components/todo_item.cljs | [
"MIT"
] |
<?= $this->partial('layout/layout.phtml', ['contentPartial' => 'partials/classes.phtml']) ?>
| HTML+PHP | 2 | nawawi/zephir | templates/Api/themes/api-base/classes.phtml | [
"MIT"
] |
# This file is a part of Julia. License is MIT: https://julialang.org/license
content =
"""
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna aliqua. Arcu non sodales neque sodales.
Placerat orci nulla pellentesque dignissim enim sit amet venenatis. Mauris
augue neque gravida in fermentum et sollicitudin. Amet venenatis urna cursus
eget. Enim praesent elementum facilisis leo vel fringilla est. Vitae sapien
pellentesque habitant morbi tristique. Ornare lectus sit amet est placerat in.
Leo urna molestie at elementum eu facilisis. Aliquam vestibulum morbi blandit
cursus risus at ultrices. Id aliquet lectus proin nibh. Facilisi etiam
dignissim diam quis enim lobortis scelerisque fermentum. Pretium lectus quam id
leo in vitae turpis massa sed. Elementum facilisis leo vel fringilla est.
Vulputate ut pharetra sit amet aliquam. Quis enim lobortis scelerisque
fermentum dui faucibus in ornare. Cursus turpis massa tincidunt dui ut.
A arcu cursus vitae congue mauris rhoncus. Tellus rutrum tellus pellentesque
eu. Fringilla phasellus faucibus scelerisque eleifend donec pretium. Aliquam
etiam erat velit scelerisque. Volutpat lacus laoreet non curabitur gravida.
Felis imperdiet proin fermentum leo vel orci. Viverra tellus in hac habitasse
platea dictumst vestibulum rhoncus est. Ullamcorper dignissim cras tincidunt
lobortis feugiat vivamus. Sit amet luctus venenatis lectus. Odio facilisis
mauris sit amet massa vitae tortor condimentum. Purus sit amet volutpat
consequat mauris nunc congue. Enim nunc faucibus a pellentesque sit amet. Purus
non enim praesent elementum facilisis leo vel fringilla est.
""" |> strip
let p = Pager(content)
@test p.pagesize == 10
@test length(p.lines) == 22
@test startswith(content, p.lines[1])
@test endswith(content, p.lines[end])
buffer = IOBuffer()
TerminalMenus.printmenu(buffer, p, 1)
str = String(take!(buffer))
@test contains(str, "(10 / 22) 45%")
@test endswith(str, "leo in vitae turpis massa sed. Elementum facilisis leo vel fringilla est.")
end
| Julia | 3 | jonas-schulze/julia | stdlib/REPL/test/TerminalMenus/pager.jl | [
"MIT"
] |
// FOREIGN_ANNOTATIONS
// FILE: spr/Nullable.java
package spr;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import javax.annotation.Nonnull;
import javax.annotation.meta.TypeQualifierNickname;
import javax.annotation.meta.When;
@Target({ElementType.METHOD, ElementType.PARAMETER})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Nonnull(when = When.MAYBE)
@TypeQualifierNickname
public @interface Nullable {
}
// FILE: spr/NonNullApi.java
package spr;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import javax.annotation.Nonnull;
import javax.annotation.meta.TypeQualifierDefault;
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Nonnull
@TypeQualifierDefault({ElementType.METHOD, ElementType.PARAMETER})
public @interface NonNullApi {
}
// FILE: A.java
import spr.*;
@NonNullApi
public class A {
public String field = null;
public String foo(String x, @Nullable CharSequence y) {
return "";
}
public String bar() {
return "";
}
@Nullable
public java.util.List<String> baz() {
return null;
}
}
| Java | 4 | AndrewReitz/kotlin | compiler/fir/resolve/testData/enhancement/jsr305/typeQualifierDefault/SpringNullable.java | [
"ECL-2.0",
"Apache-2.0"
] |
{
"@context": {
"@vocab": "http://example.org/",
"list": {"@container": "@list", "@nest": "nestedlist"},
"nestedlist": "@nest"
},
"nestedlist": {
"list": ["a", "b"]
}
} | JSONLD | 3 | fsteeg/json-ld-api | tests/compact/n005-out.jsonld | [
"W3C"
] |
Module: status-buttons
Synopsis: Noddy status switching buttons demo
Author: Keith Playford
Copyright: Original Code is Copyright (c) 1995-2004 Functional Objects, Inc.
All rights reserved.
License: See License.txt in this distribution for details.
Warranty: Distributed WITHOUT WARRANTY OF ANY KIND
define frame <status-buttons-frame> (<simple-frame>)
pane ok-button (frame)
make(<push-button>,
label: "OK",
max-width: $fill,
max-height: $fill,
activate-callback:
method (gadget)
display-status-ok(tip: "Status: OK");
end);
pane warning-button (frame)
make(<push-button>,
label: "Warning",
max-width: $fill,
max-height: $fill,
activate-callback:
method (gadget)
display-status-warning(tip: "Status: Warning");
end);
pane error-button (frame)
make(<push-button>,
label: "Error",
max-width: $fill,
max-height: $fill,
activate-callback:
method (gadget)
display-status-error(tip: "Status: Error");
end);
layout (frame)
vertically (spacing: 2)
ok-button(frame);
warning-button(frame);
error-button(frame);
end;
keyword width: = 500;
keyword height: = 500;
keyword title: = "Dylan Status Buttons";
end frame;
define method main () => ()
block ()
start-frame(make(<status-buttons-frame>));
cleanup
stop-status-display();
end;
end method main;
begin
main();
end;
| Dylan | 4 | kryptine/opendylan | sources/examples/c-ffi/taskbar-icons/status-buttons/status-buttons.dylan | [
"BSD-2-Clause"
] |
##! Augments conn.log and notice.log with VLAN and location information
# Reservoir Labs Inc. 2017 All Rights Reserved.
@load protocols/conn/vlan-logging
@load base/frameworks/input
@load base/frameworks/notice
@load misc/scan
@load misc/detect-traceroute
@load protocols/ssh/detect-bruteforcing
@load ./tap-data.bro
@load ./vlan-data.bro
module VLANLocation;
export {
## The set of notice types which should be augmented with VLAN information
global Notice::sampled_notes: set[Notice::Type] = {
Scan::Address_Scan,
Scan::Port_Scan,
SSH::Password_Guessing
} &redef;
## Return type for VLAN based lookups
type vlanresult: record{
vaddr: addr;
vlan: int;
location: string;
};
## Stores a mapping of the subnet to VLAN ID, used for augmenting notices
## where only IP Address is available but not connection info
global net_to_vlan: table[subnet] of int = table();
## Lookup function that uses the net_to_vlan table to return the VLAN ID corresponding to an IP address
global vlan_lookup: function(myaddr: addr): int;
## Lookup function to return the VLAN information corresponding to either the src or destination IP addresses
global vlan_lookup_pair: function(mysrc: addr, mydst: addr): vlanresult;
## Lookup function to return VLAN information corresponding to the connection information
global vlan_lookup_conn: function(c: connection): vlanresult;
## VLAN related fields added to the configured notices
redef record Notice::Info += {
vlan: int &log &optional;
location: string &log &optional;
sampled: bool &log &default=F;
};
## VLAN related fields added to each connection
redef record Conn::Info += {
location: string &log &optional;
};
}
event bro_init(){
# once vlanlist is built we need to build the subnet lookup table
# for when we don't have the full conn info in Notices
for (vlan in vlanlist) {
if (vlanlist[vlan]?$ipv4net) {
net_to_vlan[vlanlist[vlan]$ipv4net] = vlan;
}
if (vlanlist[vlan]?$ipv6net) {
net_to_vlan[vlanlist[vlan]$ipv6net] = vlan;
}
}
}
event connection_state_remove(c: connection){
# Add any VLAN information to the connection
# Preference for inner_vlan followed by outer vlan
if (c?$inner_vlan && c$inner_vlan in vlanlist) {
c$conn$location = vlanlist[c$inner_vlan]$location;
}
if (c?$vlan && c$vlan in vlanlist) {
c$conn$location = vlanlist[c$vlan]$location;
}
}
# To be used only for rare/occasional lookups eg during notice generation
function vlan_lookup(myaddr: addr): int{
for (mynet in net_to_vlan) {
if (myaddr in mynet) {
return net_to_vlan[mynet];
}
}
return 0;
}
## For external scripts
## given a src/dst pair, try to find VLAN/location data for both of them.
## and return which addr matched as well as the other results.
## Preference is given to source ip address followed by destination ip address.
function vlan_lookup_pair(mysrc: addr, mydst: addr): vlanresult{
local vr: vlanresult;
vr$vlan = vlan_lookup(mysrc);
if (vr$vlan == 0) {
vr$vlan = vlan_lookup(mydst);
vr$vaddr = mydst;
} else {
vr$vaddr = mysrc;
}
if (vr$vlan != 0) {
vr$location = vlanlist[vr$vlan]$location;
}
return vr;
}
function vlan_lookup_conn(c: connection): vlanresult{
local vr: vlanresult;
if (c?$vlan) {
vr$vlan = c$vlan;
} else if (c?$inner_vlan) {
vr$vlan = c$inner_vlan;
} else {
return vlan_lookup_pair(c$id$orig_h,c$id$resp_h);
}
vr$location=vlanlist[vr$vlan]$location;
if (c$id$orig_h in Site::local_nets) {
vr$vaddr = c$id$orig_h;
} else {
vr$vaddr = c$id$resp_h;
}
return vr;
}
hook Notice::policy(n: Notice::Info)
{
local dst_addrs: vector of string;
local sample_str: string;
n$vlan = 0;
n$location = "Unknown";
# if the conn info exists, it already has the VLAN so use it
if (n?$conn) {
if (n$conn?$inner_vlan) {
n$location = vlanlist[n$conn$inner_vlan]$location;
n$vlan = n$conn$inner_vlan;
} else if (n$conn?$vlan) {
n$location = vlanlist[n$conn$vlan]$location;
n$vlan = n$conn$vlan;
}
}
# Assume inner VLANs are more accurate for location information
if (n?$src && n$vlan==0) {
# if the src matches a VLAN, we'll prefer that over the dst.
n$vlan = vlan_lookup(n$src);
if (n$vlan != 0) {
n$location = vlanlist[n$vlan]$location;
}
}
if (n?$dst && n$vlan==0) {
n$vlan = vlan_lookup(n$dst);
if (n$vlan != 0) {
n$location = vlanlist[n$vlan]$location;
}
}
if (n$note in Notice::sampled_notes && n$vlan == 0) {
# In this case we may have a sampled set of servers
# generated by sumstats, we can look them up but they
# could be in difference VLANs. Better to set the location
# to "sampled" ?
# We'll use the first VLAN we can successfully lookup,
# but also create a 'sampled' field in the Notice so they
# can be excluded from the data later if necessary.
for (sample_str in set(n$msg,n$sub)) {
n$sampled = T;
dst_addrs = extract_ip_addresses(sample_str);
for (dst_idx in dst_addrs) {
n$vlan = vlan_lookup(to_addr(dst_addrs[dst_idx]));
if (n$vlan != 0) {
n$location = vlanlist[n$vlan]$location;
break;
}
}
}
}
if(n$vlan == 0){
n$location = "Unknown";
}
}
| Bro | 5 | reservoirlabs/bro-scripts | vlan-info/vlan-location.bro | [
"Apache-2.0"
] |
window.EmberENV = {
# FEATURES: {},
# EXTEND_PROTOTYPES: {
# Function: false,
# Array: true
# }
}
| EmberScript | 2 | JakeKaad/ember-rails | lib/generators/templates/environment.em | [
"MIT"
] |
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M16.23,7h2.6c-0.06,-0.47 -0.36,-0.94 -0.79,-1.17L11.4,2.45c-0.56,-0.29 -1.23,-0.29 -1.8,-0.01L2.8,5.83C2.32,6.09 2,6.64 2,7.17V15c0,1.1 0.9,2 2,2V7.4L10.5,4L16.23,7z"/>
<path
android:fillColor="@android:color/white"
android:pathData="M20,8H7c-1.1,0 -2,0.9 -2,2v9c0,1.1 0.9,2 2,2h13c1.1,0 2,-0.9 2,-2v-9C22,8.9 21.1,8 20,8zM20,11.46c0,0.33 -0.19,0.64 -0.48,0.79l-5.61,2.88c-0.25,0.13 -0.56,0.13 -0.81,0l-5.61,-2.88C7.19,12.1 7,11.79 7,11.46v0c0,-0.67 0.7,-1.1 1.3,-0.79l5.2,2.67l5.2,-2.67C19.3,10.36 20,10.79 20,11.46L20,11.46z"/>
</vector>
| XML | 3 | bubenheimer/androidx | compose/material/material/icons/generator/raw-icons/rounded/mark_as_unread.xml | [
"Apache-2.0"
] |
package CaseTest;
module mkTb();
rule test;
// ----------------------------- 测试 case 语句 -----------------------------
Bit#(4) x = 'b1110;
int y;
case(x)
'b0000 : y = -87;
'b0001 : y = -87;
'b0100 : y = 42;
'b0110 : y = 42;
'b1110 : y = 1;
default : y = 0;
endcase
$display("%d", y);
// ----------------------------- 测试 case 表达式 -----------------------------
y = case(x)
'b0000 : return -87;
'b0001 : return -87;
'b0100 : return 42;
'b0110 : return 42;
'b1110 : return 1;
default : return 0;
endcase;
$display("%d", y);
// ----------------------------- 测试 case matches 表达式(模糊匹配) -----------------------------
y = case(x) matches
'b000? : return -87;
'b01?0 : return 42;
'b1110 : return 1;
default : return 0;
endcase;
$display("%d", y);
$finish;
endrule
endmodule
endpackage
| Bluespec | 5 | Xiefengshang/BSV_Tutorial_cn | src/20.CaseTest/CaseTest.bsv | [
"MIT"
] |
func(x: 1, y: 2) { x + y }; func(y: 1, 1) | Objective-J | 0 | justinmann/sj | tests/function10.sj | [
"Apache-2.0"
] |
<style>
.light-theme {
--test: #ff0;
}
.dark-theme {
--test: #f00;
}
.theme {
background-color: var(--test);
padding: 1rem;
}
</style>
| HTML | 4 | asksyllable/storybook | examples/vue-3-cli/.storybook/preview-head.html | [
"MIT"
] |
pragma solidity ^0.5.0;
import "./LeafC.sol";
contract LeafA is LeafC {
uint leafA;
}
| Solidity | 4 | wbt/truffle | packages/truffle/test/sources/inheritance/contracts/LeafA.sol | [
"MIT"
] |
CREATE TABLE `tb_caahynuejc` (
`col_ceosnfriqs` integer,
`col_aklqoixrun` year(4),
UNIQUE INDEX `col_ceosnfriqs` (`col_ceosnfriqs`),
UNIQUE `uk_gekdmzrybz` (`col_aklqoixrun`)
) DEFAULT CHARSET=utf8;
CREATE TABLE `tb_xbsrcfksox` (
`col_qsljaaxbrj` datetime DEFAULT '2019-07-04 00:00:00',
`col_vusitjjcdx` char CHARACTER SET latin1,
`col_ufwmvwjonj` integer unsigned NOT NULL,
UNIQUE KEY `uk_henpwhqovc` (`col_ufwmvwjonj`),
UNIQUE INDEX `col_vusitjjcdx` (`col_vusitjjcdx`,`col_ufwmvwjonj`)
) DEFAULT CHARSET=latin1;
CREATE TABLE `tb_eroteuzada` (
`col_aipblmdcsw` float(32) NOT NULL,
`col_sklhosmnvr` bigint unsigned zerofill NOT NULL,
`col_skwdbrxmlc` mediumblob,
UNIQUE INDEX `col_aipblmdcsw` (`col_aipblmdcsw`,`col_sklhosmnvr`),
UNIQUE INDEX `uk_inmzvqrjoq` (`col_sklhosmnvr`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
RENAME TABLE `tb_eroteuzada` TO `tb_thlwjjfpcg`;
RENAME TABLE `tb_thlwjjfpcg` TO `tb_ydbfvvwhvi`;
ALTER TABLE `tb_caahynuejc` ADD COLUMN `col_noipbutgvd` char CHARACTER SET utf8mb4 NULL;
ALTER TABLE `tb_caahynuejc` ADD (`col_eyefseknmn` time DEFAULT '00:00:00', `col_nxbdoexmux` bigint(139) zerofill NULL);
ALTER TABLE `tb_caahynuejc` ADD `col_aulqirvfec` tinyblob;
ALTER TABLE `tb_caahynuejc` ADD COLUMN (`col_tlcpasbobp` bigint zerofill NULL, `col_fyktzflvgx` tinytext CHARACTER SET utf8);
ALTER TABLE `tb_caahynuejc` ADD (`col_bufdgcwxci` time DEFAULT '00:00:00', `col_snfugvbwkh` enum('enum_or_set_0','enum_or_set_1','enum_or_set_2') CHARACTER SET utf8 NULL);
ALTER TABLE `tb_caahynuejc` ADD (`col_hcvfpfsxxl` longblob, `col_tnpnwxtkvp` longblob);
ALTER TABLE `tb_caahynuejc` DEFAULT CHARACTER SET utf8;
ALTER TABLE `tb_caahynuejc` ADD UNIQUE KEY `uk_kvrvlewpkc` (`col_bufdgcwxci`);
ALTER TABLE `tb_caahynuejc` ALTER `col_eyefseknmn` DROP DEFAULT;
ALTER TABLE `tb_caahynuejc` CHANGE `col_fyktzflvgx` `col_dijbniwgme` decimal(20,1) NULL;
ALTER TABLE `tb_caahynuejc` CHANGE `col_aulqirvfec` `col_wpzatdhhyw` datetime NOT NULL DEFAULT '2019-07-04 00:00:00';
ALTER TABLE `tb_caahynuejc` DROP COLUMN `col_bufdgcwxci`;
ALTER TABLE `tb_caahynuejc` DROP COLUMN `col_snfugvbwkh`;
ALTER TABLE `tb_caahynuejc` DROP COLUMN `col_tnpnwxtkvp`;
ALTER TABLE `tb_caahynuejc` DROP `col_nxbdoexmux`, DROP `col_hcvfpfsxxl`;
ALTER TABLE `tb_caahynuejc` DROP COLUMN `col_dijbniwgme`;
ALTER TABLE `tb_caahynuejc` DROP COLUMN `col_wpzatdhhyw`;
| SQL | 2 | yuanweikang2020/canal | parse/src/test/resources/ddl/alter/test_23.sql | [
"Apache-2.0"
] |
<cfcomponent>
<cffunction name="foo">
<cfcookie name="_dist" value="" expires="now" httponly="true">
</cffunction>
</cfcomponent> | ColdFusion CFC | 1 | tonym128/CFLint | src/test/resources/com/cflint/tests/VarScoper/cfcookie_518.cfc | [
"BSD-3-Clause"
] |
extern (C++):
alias void* function(void*, const(char)*) fp_speller_t;
extern __gshared char[63] idchars;
void* speller(const(char)* seed, fp_speller_t fp, void* fparg, const(char)* charset);
| D | 3 | the-grue/Compiler | dm/src/dmc/speller.di | [
"BSL-1.0"
] |
#!/use/bin/env sage
def pohlig_hellman(A, B, M, Pt, Qt, P_order_factors=None, n_max=None):
'''Compute dicrete logarithm on Elliptic Curve using Pohlig-Hellman (order of P should be smooth)
https://koclab.cs.ucsb.edu/teaching/ecc/project/2015Projects/Sommerseth+Hoeiland.pdf
y^2 = x^3 + A*x + B mod M
Q = n*P
Args:
A, B, M(int)
Pt, Qt(tuple)
P_order_factors(dict/None)
n_max(int/None)
Returns:
n(int)
'''
# prepare stuff
E = EllipticCurve(GF(M), [A,B])
P = E(Pt)
Q = E(Qt)
# factor P order
P_order = P.order()
if P_order_factors is None:
P_order_factors = dict(P_order.factor())
print('P order factors: {}'.format(P_order_factors))
modules = sorted([x for x in P_order_factors])
modules_done = []
residues = []
n_recovered = 1
for fac_one in modules:
factor = fac_one^P_order_factors[fac_one]
Px = P*int(P_order/fac_one)
Qx = Q*int(P_order/fac_one)
l = Px.discrete_log(Qx)
residues.append(l)
modules_done.append(factor)
n_recovered *= factor
print 'n%{} == {}'.format(factor, l)
if n_max is not None and n_recovered >= n_max:
break
# print residues
# print modules_done
n = crt(residues, modules_done)
return n
| Sage | 5 | akbarszcz/CryptoAttacks | CryptoAttacks/EllipticCurve/pohlig_hellman.sage | [
"MIT"
] |
div.text-center
div.alert.alert-info(style="display: inline-block")
span(style="padding-right: 20px" data-i18n="teacher.remember_new_courses")
a.btn.btn-primary.pull-right.more-info(data-i18n="teacher.more_info") | Jade | 2 | cihatislamdede/codecombat | app/templates/teachers/course-nag.jade | [
"CC-BY-4.0",
"MIT"
] |
:- use_module(library(plunit)).
:- begin_tests(sqlite3).
:- use_module(library(lists)).
:- use_module(library(maplist)).
:- use_module(library(myddas)).
:- if( current_prolog_flag(android,true) ).
test(db_open) :-
db_open(sqlite3, '/data/user/0/pt.up.yap/files/chinook.db', _, _).
:- else.
test(db_open) :-
db_open(sqlite3,myddas,dataset('chinook.db'),_,_).
:-endif.
test(schema0, all((Desc ==[(table albums),
(table artists),
(table customers),
(table employees),
(table genres),
(table invoice_items),
(table invoices),
(table media_types),
(table playlist_track),
(table playlists),
(table sqlite_sequence),
(table sqlite_stat1),(table tracks)]))) :-
db_show_tables(myddas,Desc).
test(import) :-
db_import('artists', user:artists),
db_import('albums', user:albums),
db_import('tracks', user:tracks).
test(all_artists, all((
X-Y == [1-'AC/DC',2-'Accept',3-'Aerosmith',4-'Alanis Morissette',5-'Alice In Chains',6-'Antônio Carlos Jobim',7-'Apocalyptica',8-'Audioslave',9-'BackBeat',10-'Billy Cobham',11-'Black Label Society',12-'Black Sabbath',13-'Body Count',14-'Bruce Dickinson',15-'Buddy Guy',16-'Caetano Veloso',17-'Chico Buarque',18-'Chico Science & Nação Zumbi',19-'Cidade Negra',20-'Cláudio Zoli',21-'Various Artists',22-'Led Zeppelin',23-'Frank Zappa & Captain Beefheart',24-'Marcos Valle',25-'Milton Nascimento & Bebeto',26-'Azymuth',27-'Gilberto Gil',28-'João Gilberto',29-'Bebel Gilberto',30-'Jorge Vercilo',31-'Baby Consuelo',32-'Ney Matogrosso',33-'Luiz Melodia',34-'Nando Reis',35-'Pedro Luís & A Parede',36-'O Rappa',37-'Ed Motta',38-'Banda Black Rio',39-'Fernanda Porto',40-'Os Cariocas',41-'Elis Regina',42-'Milton Nascimento',43-'A Cor Do Som',44-'Kid Abelha',45-'Sandra De Sá',46-'Jorge Ben',47-'Hermeto Pascoal',48-'Barão Vermelho',49-'Edson, DJ Marky & DJ Patife Featuring Fernanda Porto',50-'Metallica',51-'Queen',52-'Kiss',53-'Spyro Gyra',54-'Green Day',55-'David Coverdale',56-'Gonzaguinha',57-'Os Mutantes',58-'Deep Purple',59-'Santana',60-'Santana Feat. Dave Matthews',61-'Santana Feat. Everlast',62-'Santana Feat. Rob Thomas',63-'Santana Feat. Lauryn Hill & Cee-Lo',64-'Santana Feat. The Project G&B',65-'Santana Feat. Maná',66-'Santana Feat. Eagle-Eye Cherry',67-'Santana Feat. Eric Clapton',68-'Miles Davis',69-'Gene Krupa',70-'Toquinho & Vinícius',71-'Vinícius De Moraes & Baden Powell',72-'Vinícius De Moraes',73-'Vinícius E Qurteto Em Cy',74-'Vinícius E Odette Lara',75-'Vinicius, Toquinho & Quarteto Em Cy',76-'Creedence Clearwater Revival',77-'Cássia Eller',78-'Def Leppard',79-'Dennis Chambers',80-'Djavan',81-'Eric Clapton',82-'Faith No More',83-'Falamansa',84-'Foo Fighters',85-'Frank Sinatra',86-'Funk Como Le Gusta',87-'Godsmack',88-'Guns N\' Roses',89-'Incognito',90-'Iron Maiden',91-'James Brown',92-'Jamiroquai',93-'JET',94-'Jimi Hendrix',95-'Joe Satriani',96-'Jota Quest',97-'João Suplicy',98-'Judas Priest',99-'Legião Urbana',100-'Lenny Kravitz',101-'Lulu Santos',102-'Marillion',103-'Marisa Monte',104-'Marvin Gaye',105-'Men At Work',106-'Motörhead',107-'Motörhead & Girlschool',108-'Mônica Marianno',109-'Mötley Crüe',110-'Nirvana',111-'O Terço',112-'Olodum',113-'Os Paralamas Do Sucesso',114-'Ozzy Osbourne',115-'Page & Plant',116-'Passengers',117-'Paul D\'Ianno',118-'Pearl Jam',119-'Peter Tosh',120-'Pink Floyd',121-'Planet Hemp',122-'R.E.M. Feat. Kate Pearson',123-'R.E.M. Feat. KRS-One',124-'R.E.M.',125-'Raimundos',126-'Raul Seixas',127-'Red Hot Chili Peppers',128-'Rush',129-'Simply Red',130-'Skank',131-'Smashing Pumpkins',132-'Soundgarden',133-'Stevie Ray Vaughan & Double Trouble',134-'Stone Temple Pilots',135-'System Of A Down',136-'Terry Bozzio, Tony Levin & Steve Stevens',137-'The Black Crowes',138-'The Clash',139-'The Cult',140-'The Doors',141-'The Police',142-'The Rolling Stones',143-'The Tea Party',144-'The Who',145-'Tim Maia',146-'Titãs',147-'Battlestar Galactica',148-'Heroes',149-'Lost',150-'U2',151-'UB40',152-'Van Halen',153-'Velvet Revolver',154-'Whitesnake',155-'Zeca Pagodinho',156-'The Office',157-'Dread Zeppelin',158-'Battlestar Galactica (Classic)',159-'Aquaman',160-'Christina Aguilera featuring BigElf',161-'Aerosmith & Sierra Leone\'s Refugee Allstars',162-'Los Lonely Boys',163-'Corinne Bailey Rae',164-'Dhani Harrison & Jakob Dylan',165-'Jackson Browne',166-'Avril Lavigne',167-'Big & Rich',168-'Youssou N\'Dour',169-'Black Eyed Peas',170-'Jack Johnson',171-'Ben Harper',172-'Snow Patrol',173-'Matisyahu',174-'The Postal Service',175-'Jaguares',176-'The Flaming Lips',177-'Jack\'s Mannequin & Mick Fleetwood',178-'Regina Spektor',179-'Scorpions',180-'House Of Pain',181-'Xis',182-'Nega Gizza',183-'Gustavo & Andres Veiga & Salazar',184-'Rodox',185-'Charlie Brown Jr.',186-'Pedro Luís E A Parede',187-'Los Hermanos',188-'Mundo Livre S/A',189-'Otto',190-'Instituto',191-'Nação Zumbi',192-'DJ Dolores & Orchestra Santa Massa',193-'Seu Jorge',194-'Sabotage E Instituto',195-'Stereo Maracana',196-'Cake',197-'Aisha Duo',198-'Habib Koité and Bamada',199-'Karsh Kale',200-'The Posies',201-'Luciana Souza/Romero Lubambo',202-'Aaron Goldberg',203-'Nicolaus Esterhazy Sinfonia',204-'Temple of the Dog',205-'Chris Cornell',206-'Alberto Turco & Nova Schola Gregoriana',207-'Richard Marlow & The Choir of Trinity College, Cambridge',208-'English Concert & Trevor Pinnock',209-'Anne-Sophie Mutter, Herbert Von Karajan & Wiener Philharmoniker',210-'Hilary Hahn, Jeffrey Kahane, Los Angeles Chamber Orchestra & Margaret Batjer',211-'Wilhelm Kempff',212-'Yo-Yo Ma',213-'Scholars Baroque Ensemble',214-'Academy of St. Martin in the Fields & Sir Neville Marriner',215-'Academy of St. Martin in the Fields Chamber Ensemble & Sir Neville Marriner',216-'Berliner Philharmoniker, Claudio Abbado & Sabine Meyer',217-'Royal Philharmonic Orchestra & Sir Thomas Beecham',218-'Orchestre Révolutionnaire et Romantique & John Eliot Gardiner',219-'Britten Sinfonia, Ivor Bolton & Lesley Garrett',220-'Chicago Symphony Chorus, Chicago Symphony Orchestra & Sir Georg Solti',221-'Sir Georg Solti & Wiener Philharmoniker',222-'Academy of St. Martin in the Fields, John Birch, Sir Neville Marriner & Sylvia McNair',223-'London Symphony Orchestra & Sir Charles Mackerras',224-'Barry Wordsworth & BBC Concert Orchestra',225-'Herbert Von Karajan, Mirella Freni & Wiener Philharmoniker',226-'Eugene Ormandy',227-'Luciano Pavarotti',228-'Leonard Bernstein & New York Philharmonic',229-'Boston Symphony Orchestra & Seiji Ozawa',230-'Aaron Copland & London Symphony Orchestra',231-'Ton Koopman',232-'Sergei Prokofiev & Yuri Temirkanov',233-'Chicago Symphony Orchestra & Fritz Reiner',234-'Orchestra of The Age of Enlightenment',235-'Emanuel Ax, Eugene Ormandy & Philadelphia Orchestra',236-'James Levine',237-'Berliner Philharmoniker & Hans Rosbaud',238-'Maurizio Pollini',239-'Academy of St. Martin in the Fields, Sir Neville Marriner & William Bennett',240-'Gustav Mahler',241-'Felix Schmidt, London Symphony Orchestra & Rafael Frühbeck de Burgos',242-'Edo de Waart & San Francisco Symphony',243-'Antal Doráti & London Symphony Orchestra',244-'Choir Of Westminster Abbey & Simon Preston',245-'Michael Tilson Thomas & San Francisco Symphony',246-'Chor der Wiener Staatsoper, Herbert Von Karajan & Wiener Philharmoniker',247-'The King\'s Singers',248-'Berliner Philharmoniker & Herbert Von Karajan',249-'Sir Georg Solti, Sumi Jo & Wiener Philharmoniker',250-'Christopher O\'Riley',251-'Fretwork',252-'Amy Winehouse',253-'Calexico',254-'Otto Klemperer & Philharmonia Orchestra',255-'Yehudi Menuhin',256-'Philharmonia Orchestra & Sir Neville Marriner',257-'Academy of St. Martin in the Fields, Sir Neville Marriner & Thurston Dart',258-'Les Arts Florissants & William Christie',259-'The 12 Cellists of The Berlin Philharmonic',260-'Adrian Leaper & Doreen de Feis',261-'Roger Norrington, London Classical Players',262-'Charles Dutoit & L\'Orchestre Symphonique de Montréal',263-'Equale Brass Ensemble, John Eliot Gardiner & Munich Monteverdi Orchestra and Choir',264-'Kent Nagano and Orchestre de l\'Opéra de Lyon',265-'Julian Bream',266-'Martin Roscoe',267-'Göteborgs Symfoniker & Neeme Järvi',268-'Itzhak Perlman',269-'Michele Campanella',270-'Gerald Moore',271-'Mela Tenenbaum, Pro Musica Prague & Richard Kapp',
272-'Emerson String Quartet',
273-'C. Monteverdi, Nigel Rogers - Chiaroscuro; London Baroque; London Cornett & Sackbu',
274-'Nash Ensemble',
275-'Philip Glass Ensemble'] ))) :-
artists(X,Y).
test(cut_artists, true((X-Y == 1-'AC/DC'))) :-
artists(X, Y),
!.
test(select_with_1st, true(Y == 'Nação Zumbi')) :-
artists(191, Y), !.
test(select_with_2st, true(X == 97)) :-
artists(X, 'João Suplicy'),
!.
test(join, true((A == 'AC/DC',
AId == 1,
Artist == 1,
GId == 1,
I == 1,
MId == 1,
T == 1,
Bs == 11170334,
CId == 'Angus Young, Malcolm Young, Brian Johnson',
Msec == 343719,
N == 'For Those About To Rock (We Salute You)',
P == 0.9900000000000000,
Tit == 'For Those About To Rock We Salute You'))) :-
artists(I,A),
tracks(T,N,AId,MId,GId,CId,Msec,Bs,P),
albums(AId,Tit,Artist),
!.
test(att_types, true((Als == ['AlbumId','','Title','','ArtistId',''],
As == ['ArtistId','','Name',''],
Ts == ['TrackId','','Name','','AlbumId','','MediaTypeId','','GenreId','',
'Composer','','Milliseconds','','Bytes','','UnitPrice','']))) :-
.,
db_get_attributes_types(tracks,Ts),
db_get_attributes_types(artists,As).
test(nb_atts, true((Als = 3, As = 2,Ts = 9 ))) :-
db_number_of_fields(albums,Als),
db_number_of_fields(tracks,Ts),
db_number_of_fields(artists,As).
test(describe, all((Als == [tableinfo('AlbumId','INTEGER',1,1,null(0),''),
tableinfo('Title','NVARCHAR(160)',1,0,null(1),''),
tableinfo('ArtistId','INTEGER',1,0,null(2),'')]))) :-
db_describe(albums, Als).
test(close) :-
db_close.
:- end_tests(sqlite3).
:- run_tests.
| Prolog | 4 | ryandesign/yap | regression/sqlitest.yap | [
"Artistic-1.0-Perl",
"ClArtistic"
] |
- var page = "Pushpin Demo"
- var isDemo = true
doctype html
html(lang="en")
head
include _head.jade
style.
html, body, .block {
height: 100%;
}
nav ul li a:hover, nav ul li a.active {
background-color: rgba(0,0,0,.1);
}
footer {
padding-left: 0;
}
body
include page-contents/pushpin_demo_content.html
include _footer.html
include _scripts.html | Jade | 3 | afzalsayed96/materialize | jade/pushpin-demo.jade | [
"MIT"
] |
@echo off
echo Setting up dev environment...
rem Open Console build environment setup
rem Adds msbuild to your path, and adds the open\tools directory as well
rem This recreates what it's like to be an actual windows developer!
rem skip the setup if we're already ready.
if not "%OpenConBuild%" == "" goto :END
rem Add Opencon build scripts to path
set PATH=%PATH%;%~dp0;
rem add some helper envvars - The Opencon root, and also the processor arch, for output paths
set OPENCON_TOOLS=%~dp0
rem The opencon root is at ...\open\tools\, without the last 7 chars ('\tools\')
set OPENCON=%OPENCON_TOOLS:~0,-7%
rem Add nuget to PATH
set PATH=%PATH%%OPENCON%\dep\nuget;
rem Run nuget restore so you can use vswhere
nuget restore %OPENCON%\OpenConsole.sln -Verbosity quiet
nuget restore %OPENCON%\dep\nuget\packages.config -Verbosity quiet
:FIND_MSBUILD
set MSBUILD=
rem GH#1313: If msbuild is already on the path, we don't need to look for it.
for %%X in (msbuild.exe) do (set MSBUILD=%%~$PATH:X)
if defined MSBUILD (
echo Using MsBuild at %MSBUILD% which was already on the path.
goto :FOUND_MSBUILD
)
rem Find vswhere
rem from https://github.com/microsoft/vs-setup-samples/blob/master/tools/vswhere.cmd
for /f "usebackq delims=" %%I in (`dir /b /aD /o-N /s "%~dp0..\packages\vswhere*" 2^>nul`) do (
for /f "usebackq delims=" %%J in (`where /r "%%I" vswhere.exe 2^>nul`) do (
set VSWHERE=%%J
)
)
if not defined VSWHERE (
echo Could not find vswhere on your machine. Please set the VSWHERE variable to the location of vswhere.exe and run razzle again.
goto :EXIT
)
rem Add path to MSBuild Binaries
rem
rem We're going to always prefer prerelease version of VS. This lets people who
rem are using VS 2022 use that from the commandline over the 2019 version. This
rem will use whatever the newest version of VS is, regardless if it's stable or
rem not.
rem
for /f "usebackq tokens=*" %%B in (`%VSWHERE% -latest -prerelease -products * -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe 2^>nul`) do (
set MSBUILD=%%B
)
if not defined MSBUILD (
echo Could not find MsBuild on your machine. Please set the MSBUILD variable to the location of MSBuild.exe and run razzle again.
goto :EXIT
)
:FOUND_MSBUILD
set PATH=%PATH%%MSBUILD%\..;
if "%PROCESSOR_ARCHITECTURE%" == "AMD64" (
set ARCH=x64
set PLATFORM=x64
) else (
set ARCH=x86
set PLATFORM=Win32
)
set DEFAULT_CONFIGURATION=Debug
rem call .razzlerc - for your generic razzle environment stuff
if exist "%OPENCON_TOOLS%\.razzlerc.cmd" (
call %OPENCON_TOOLS%\.razzlerc.cmd
) else (
(
echo @echo off
echo.
echo rem This is your razzlerc file. It can be used for default dev environment setup.
) > %OPENCON_TOOLS%\.razzlerc.cmd
)
rem if there are args, run them. This can be used for additional env. customization,
rem especially on a per shortcut basis.
:ARGS_LOOP
if (%1) == () goto :POST_ARGS_LOOP
if (%1) == (dbg) (
set DEFAULT_CONFIGURATION=Debug
shift
goto :ARGS_LOOP
)
if (%1) == (rel) (
set DEFAULT_CONFIGURATION=Release
shift
goto :ARGS_LOOP
)
if (%1) == (x86) (
set ARCH=x86
set PLATFORM=Win32
shift
goto :ARGS_LOOP
)
if exist %1 (
call %1
) else (
echo Could not locate "%1"
)
shift
goto :ARGS_LOOP
:POST_ARGS_LOOP
set TAEF=%OPENCON%\packages\Microsoft.Taef.10.60.210621002\build\Binaries\%ARCH%\TE.exe
rem Set this envvar so setup won't repeat itself
set OpenConBuild=true
:END
echo The dev environment is ready to go!
:EXIT
| Batchfile | 4 | sonvt1710/terminal | tools/razzle.cmd | [
"MIT"
] |
{} (:package |app)
:root $ {} (:ns |main) (:def |main!)
:files $ {}
|updater.router $ {}
:ns $ [] |ns |app.updater.router
[] |:require ([] |[] |app.util.stack |:refer $ [] |[] |get-path) ([] |[] |clojure.string |:as |string)
:defs $ {}
|toggle-palette $ [] |defn |toggle-palette ([] |store |op-data |op-id)
[] |update-in |store ([] |[] |:router |:show-palette?) (, |not)
|route $ [] |defn |route ([] |store |op-data)
[] |let ([] $ [] |router |op-data) ([] |assoc |store |:router |router)
|open-file-tree $ [] |defn |open-file-tree ([] |store |op-data |op-id)
[] |let
[] $ [] |code-path ([] |get-path |store)
[] |-> |store
[] |assoc-in ([] |[] |:router |:name) (, |:file-tree)
[] |assoc-in ([] |[] |:graph |:ns-path)
[] |vec $ [] |string/split ([] |:ns |code-path) (, ||.)
:procs $ []
|comp.brief-file $ {}
:ns $ [] |ns |app.comp.brief-file
[] |:require ([] |[] |hsl.core |:refer $ [] |[] |hsl) ([] |[] |respo.core |:refer $ [] |[] |defcomp |div |list-> |<> |span |input) ([] |[] |clojure.string |:as |string) ([] |[] |respo-ui.core |:as |ui) ([] |[] |respo.comp.space |:refer $ [] |[] |=<) ([] |[] |app.style.widget |:as |widget) ([] |[] |app.util.keycode |:as |keycode)
:defs $ {}
|comp-brief-file $ [] |defcomp |comp-brief-file ([] |states |ns-text |file)
[] |let
[] ([] |cursor $ [] |:cursor |states)
[] |state $ [] |or ([] |:data |states) (, ||)
[] |div ([] |{} $ [] |:style |style-file)
[] |div ([] |{} $ [] |:style |ui/row) ([] |<> |ns-text |nil) ([] |=< |16 |nil)
[] |span $ [] |{} ([] |:inner-text ||ns)
[] |:style $ [] |{} ([] |:cursor |:pointer)
[] |:on-click $ [] |on-edit-ns |ns-text
[] |=< |16 |nil
[] |span $ [] |{} ([] |:inner-text ||procs)
[] |:style $ [] |{} ([] |:cursor |:pointer)
[] |:on-click $ [] |on-edit-procs |ns-text
[] |=< |16 |nil
[] |span $ [] |{} ([] |:inner-text ||Delete) ([] |:style |widget/clickable-text) ([] |:on-click $ [] |on-remove |ns-text)
[] |div ([] |{})
[] |input $ [] |{} ([] |:value |state) ([] |:placeholder "||new def") ([] |:style |widget/input)
[] |:on-input $ [] |fn ([] |e |d!) ([] |d! |cursor $ [] |:value |e)
[] |:on-keydown $ [] |fn ([] |e |d!)
[] |if ([] |= |keycode/key-enter $ [] |:key-code |e)
[] |if ([] |not $ [] |string/blank? |state)
[] |do ([] |d! |:collection/add-definition $ [] |[] |ns-text |state) ([] |d! |cursor ||)
[] |=< |nil |8
[] |list-> ([] |{})
[] |->> ([] |:defs |file) ([] |sort |compare)
[] |map $ [] |fn ([] |entry)
[] |let
[] $ [] |def-text ([] |key |entry)
[] |[] |def-text $ [] |div
[] |{} ([] |:inner-text |def-text)
[] |:style $ [] |{} ([] |:cursor |:pointer) ([] |:font-size |14) ([] |:line-height "|\"24px") ([] |:color $ [] |hsl |0 |0 |50)
[] |:on-click $ [] |on-edit-def |ns-text |def-text
|on-edit-procs $ [] |defn |on-edit-procs ([] |ns-text)
[] |fn ([] |e |dispatch!)
[] |dispatch! |:collection/edit $ [] |{} ([] |:kind |:procs) ([] |:ns |ns-text) ([] |:extra |nil) ([] |:focus $ [] |[])
|on-remove $ [] |defn |on-remove ([] |ns-text)
[] |fn ([] |e |d! |m!) ([] |d! |:collection/remove-file |ns-text)
|on-keydown $ [] |defn |on-keydown ([] |ns-text |def-text)
[] |fn ([] |e |d! |m!) ([] |println ||event)
[] |if ([] |= |keycode/key-enter $ [] |:key-code |e)
[] |if ([] |not $ [] |string/blank? |def-text)
[] |do ([] |d! |:collection/add-definition $ [] |[] |ns-text |def-text) ([] |m! ||)
|on-edit-ns $ [] |defn |on-edit-ns ([] |ns-text)
[] |fn ([] |e |dispatch!)
[] |dispatch! |:collection/edit $ [] |{} ([] |:kind |:ns) ([] |:ns |ns-text) ([] |:extra |nil) ([] |:focus $ [] |[])
|on-edit-def $ [] |defn |on-edit-def ([] |ns-text |def-text)
[] |fn ([] |e |dispatch!)
[] |dispatch! |:collection/edit $ [] |{} ([] |:kind |:defs) ([] |:ns |ns-text) ([] |:extra |def-text) ([] |:focus $ [] |[] |2)
|style-file $ [] |def |style-file
[] |{} ([] |:padding "|\"0 8px 16px 8px") ([] |:line-height |1.6)
:procs $ []
|comp.loading $ {}
:ns $ [] |ns |app.comp.loading
[] |:require ([] |[] |hsl.core |:refer $ [] |[] |hsl) ([] |[] |respo.core |:refer $ [] |[] |defcomp |div |<> |span |input) ([] |[] |respo-ui.core |:as |ui)
:defs $ {}
|comp-loading $ [] |defcomp |comp-loading ([])
[] |div
[] |{} $ [] |:style ([] |merge |ui/fullscreen |ui/row-center |style-loading)
[] |<> ||Loading... |nil
|style-loading $ [] |def |style-loading
[] |{} ([] |:background-color $ [] |hsl |200 |40 |10) ([] |:justify-content ||center) ([] |:color $ [] |hsl |0 |0 |80) ([] |:font-size ||32px) ([] |:font-weight ||100) ([] |:font-family |ui/font-fancy)
:procs $ []
|comp.command $ {}
:ns $ [] |ns |app.comp.command
[] |:require ([] |[] |clojure.string |:as |string) ([] |[] |respo.core |:refer $ [] |[] |defcomp |div |<> |span |input) ([] |[] |hsl.core |:refer $ [] |[] |hsl) ([] |[] |respo.comp.space |:refer $ [] |[] |=<) ([] |[] |respo-ui.core |:as |ui)
:defs $ {}
|style-command $ [] |def |style-command
[] |{} ([] |:backgroud-color $ [] |hsl |0 |0 |0) ([] |:padding "||0 8px") ([] |:line-height "|\"30px") ([] |:font-family |ui/font-normal) ([] |:cursor ||pointer)
|comp-command $ [] |defcomp |comp-command ([] |command |selected? |on-select)
[] |div
[] |{}
[] |:style $ [] |merge |style-command
[] |if |selected? $ [] |{} ([] |:background-color $ [] |hsl |0 |0 |20 |0.8)
[] |:on-click $ [] |fn ([] |e |dispatch!) ([] |on-select |dispatch!)
[] |case ([] |first |command)
[] |:defs $ [] |div ([] |{}) ([] |<> $ [] |get |command |2) ([] |=< |16 |nil)
[] |<> ([] |get |command |1)
[] |{} $ [] |:color ([] |hsl |0 |0 |40)
[] |<> ([] |string/join "|| " |command) (, |nil)
:procs $ []
|updater $ {}
:ns $ [] |ns |app.updater
[] |:require ([] |[] |respo.cursor |:refer $ [] |[] |update-states) ([] |[] |app.updater.router |:as |router) ([] |[] |app.updater.collection |:as |collection) ([] |[] |app.updater.notification |:as |notification) ([] |[] |app.updater.stack |:as |stack) ([] |[] |app.updater.modal |:as |modal) ([] |[] |app.updater.graph |:as |graph)
:defs $ {}
|updater $ [] |defn |updater ([] |store |op |op-data |op-id)
[] |let
[] $ [] |handler
[] |case |op
[] |:states $ [] |fn ([] |x) ([] |update-states |x |op-data)
[] |:router/route |router/route
[] |:router/toggle-palette |router/toggle-palette
[] |:router/open-file-tree |router/open-file-tree
[] |:collection/add-definition |collection/add-definition
[] |:collection/add-namespace |collection/add-namespace
[] |:collection/edit |collection/edit
[] |:collection/edit-ns |collection/edit-ns
[] |:collection/write |collection/write-code
[] |:collection/load |collection/load-remote
[] |:collection/remove-this |collection/remove-this
[] |:collection/remove-file |collection/remove-file
[] |:collection/rename |collection/rename
[] |:collection/hydrate |collection/hydrate
[] |:notification/add-one |notification/add-one
[] |:notification/remove-one |notification/remove-one
[] |:notification/remove-since |notification/remove-since
[] |:stack/goto-definition |stack/goto-definition
[] |:stack/dependents |stack/dependents
[] |:stack/go-back |stack/go-back
[] |:stack/go-next |stack/go-next
[] |:stack/point-to |stack/point-to
[] |:stack/collapse |stack/collapse
[] |:stack/shift |stack/shift-one
[] |:modal/mould |modal/mould
[] |:modal/recycle |modal/recycle
[] |:graph/load-graph |graph/load-graph
[] |:graph/view-path |graph/view-path
[] |:graph/view-ns |graph/view-ns
[] |:graph/edit-current |graph/edit-current
[] |:graph/show-orphans |graph/show-orphans
, |default-handler
[] |handler |store |op-data |op-id
|default-handler $ [] |defn |default-handler ([] |store |op-data) (, |store)
:procs $ []
|util.keycode $ {} (:ns $ [] |ns |app.util.keycode)
:defs $ {} (|key-esc $ [] |def |key-esc |27) (|key-u $ [] |def |key-u |85) (|key-down $ [] |def |key-down |40) (|key-s $ [] |def |key-s |83) (|key-d $ [] |def |key-d |68) (|key-j $ [] |def |key-j |74) (|key-a $ [] |def |key-a |65) (|key-k $ [] |def |key-k |75) (|key-p $ [] |def |key-p |80) (|key-enter $ [] |def |key-enter |13) (|key-i $ [] |def |key-i |73) (|key-b $ [] |def |key-b |66) (|key-up $ [] |def |key-up |38) (|key-e $ [] |def |key-e |69)
:procs $ []
|updater.stack $ {}
:ns $ [] |ns |app.updater.stack
[] |:require ([] |[] |clojure.string |:as |string) ([] |[] |app.util.analyze |:refer $ [] |[] |list-dependent-ns |parse-ns-deps |extract-deps) ([] |[] |app.util.detect |:refer $ [] |[] |strip-atom |contains-def? |=path?) ([] |[] |app.util |:refer $ [] |[] |remove-idx |helper-notify |helper-create-def |make-path |has-ns?) ([] |app.util.stack |:refer $ [] |push-path |push-paths) ([] |clojure.set |:refer $ [] |union)
:defs $ {}
|collapse $ [] |defn |collapse ([] |store |op-data |op-id)
[] |let ([] $ [] |cursor |op-data)
[] |update |store |:writer $ [] |fn ([] |writer)
[] |-> |writer ([] |assoc |:pointer |0)
[] |update |:stack $ [] |fn ([] |stack) ([] |subvec |stack |cursor)
|go-next $ [] |defn |go-next ([] |store |op-data)
[] |-> |store $ [] |update |:writer
[] |fn ([] |writer)
[] |if
[] |< ([] |:pointer |writer)
[] |dec $ [] |count ([] |:stack |writer)
[] |-> |writer ([] |update |:pointer |inc) ([] |assoc |:focus $ [] |[])
, |writer
|dependents $ [] |defn |dependents ([] |store |op-data |op-id)
[] |let
[] ([] |writer $ [] |:writer |store)
[]
[] |{} ([] |stack |:stack) ([] |pointer |:pointer)
, |writer
[] |code-path $ [] |get |stack |pointer
[]
[] |{} ([] |ns-part |:ns) ([] |kind |:kind) ([] |extra-name |:extra)
, |code-path
[] |pkg $ [] |get-in |store ([] |[] |:collection |:package)
[] |def-as-dep $ [] |{} ([] |:ns $ [] |str |pkg ||. |ns-part) ([] |:def |extra-name) ([] |:external? |false)
[] |files $ [] |get-in |store ([] |[] |:collection |:files)
[] |ns-list $ [] |list-dependent-ns |ns-part |files |pkg
[] |case |kind
[] |:defs $ [] |let
[] $ [] |new-paths
[] |->> ([] |conj |ns-list |ns-part)
[] |map $ [] |fn ([] |ns-text)
[] |let
[] $ [] |file ([] |get |files |ns-text)
[] |into ([] |#{})
[] |concat
[] |->> ([] |:defs |file)
[] |filter $ [] |fn ([] |entry)
[] |let
[] $ [] |def-deps
[] |extract-deps
[] |subvec ([] |val |entry) (, |2)
, |ns-part |file |pkg
[] |contains? |def-deps |def-as-dep
[] |map $ [] |fn ([] |entry)
[] |{} ([] |:kind |:defs) ([] |:ns |ns-text) ([] |:extra $ [] |first |entry) ([] |:focus $ [] |[] |2)
[] |let
[] $ [] |proc-deps
[] |extract-deps ([] |:procs |file) (, |ns-part |file |pkg)
[] |if ([] |contains? |proc-deps |def-as-dep)
[] |list $ [] |{} ([] |:kind |:procs) ([] |:ns |ns-text) ([] |:extra |nil) ([] |:focus $ [] |[] |0)
[] |list
[] |apply |concat
[] |filter $ [] |fn ([] |x) ([] |not $ [] |=path? |x |code-path)
[] |if ([] |empty? |new-paths) ([] |update |store |:notifications $ [] |helper-notify |op-id "||Nothing found.") ([] |update |store |:writer $ [] |push-paths |new-paths)
[] |:ns $ [] |let
[] $ [] |new-paths
[] |map
[] |fn ([] |x) ([] |[] |x |:ns)
, |ns-list
[] |; |println |pointer |new-paths
[] |update |store |:writer $ [] |push-paths |new-paths
, |store
|point-to $ [] |defn |point-to ([] |store |op-data |op-id)
[] |let ([] $ [] |pointer |op-data)
[] |assoc-in |store ([] |[] |:writer |:pointer) (, |pointer)
|go-back $ [] |defn |go-back ([] |store |op-data)
[] |-> |store $ [] |update |:writer
[] |fn ([] |writer)
[] |if ([] |pos? $ [] |:pointer |writer)
[] |-> |writer ([] |update |:pointer |dec) ([] |assoc |:focus $ [] |[])
, |writer
|shift-one $ [] |defn |shift-one ([] |store |op-data |op-id)
[] |let ([] $ [] |pointer |op-data)
[] |update |store |:writer $ [] |fn ([] |writer)
[] |-> |writer
[] |update |:stack $ [] |fn ([] |stack) ([] |remove-idx |stack |pointer)
[] |update |:pointer $ [] |fn ([] |p)
[] |if ([] |= |p |pointer)
[] |if ([] |pos? |p) ([] |dec |p) (, |p)
[] |if ([] |< |p |pointer) (, |p) ([] |dec |p)
|goto-definition $ [] |defn |goto-definition ([] |store |op-data |op-id)
[] |let
[] ([] |forced? |op-data)
[]
[] |{} ([] |pkg |:package) ([] |files |:files)
[] |get-in |store $ [] |[] |:collection
[] |pkg_ $ [] |str |pkg ||.
[]
[] |{} ([] |stack |:stack) ([] |pointer |:pointer)
[] |:writer |store
[] |code-path $ [] |get |stack |pointer
[] |focus $ [] |:focus |code-path
[] |target $ [] |strip-atom
[] |get-in |store $ [] |concat ([] |make-path |code-path) (, |focus)
[] |ns-deps $ [] |parse-ns-deps
[] |get-in |files $ [] |[] ([] |:ns |code-path) (, |:ns)
[] |current-ns-defs $ [] |get-in |files
[] |[] ([] |:ns |code-path) (, |:defs)
[] |dep-info $ [] |if ([] |has-ns? |target)
[] |let
[]
[] ([] |[] |ns-text |def-text) ([] |string/split |target ||/)
[] |maybe-info $ [] |get |ns-deps |ns-text
[] |if
[] |and ([] |some? |maybe-info) ([] |= |:as $ [] |:kind |maybe-info)
[] |{} ([] |:ns $ [] |:ns |maybe-info) ([] |:def |def-text)
, |nil
[] |let
[] $ [] |maybe-info ([] |get |ns-deps |target)
[] |if
[] |and ([] |some? |maybe-info) ([] |= |:refer $ [] |:kind |maybe-info)
[] |{} ([] |:ns $ [] |:ns |maybe-info) ([] |:def |target)
[] |if
[] |or ([] |contains? |current-ns-defs |target) (, |forced?)
[] |{}
[] |:ns $ [] |str |pkg_ ([] |:ns |code-path)
[] |:def |target
, |nil
[] |; |println |target |dep-info
[] |if ([] |some? |dep-info)
[] |if
[] |string/starts-with? ([] |:ns |dep-info) (, |pkg_)
[] |let
[]
[] |existed? $ [] |some?
[] |get-in |files $ [] |[] ([] |:ns |dep-info) (, |:defs) ([] |:def |dep-info)
[] |shorten-ns $ [] |string/replace-first ([] |:ns |dep-info) (, |pkg_ ||)
[] |touch-def $ [] |fn ([] |store) ([] |println ||touching |existed?)
[] |if |existed? |store $ [] |-> |store
[] |update-in ([] |[] |:collection |:files)
[] |helper-create-def |shorten-ns ([] |:def |dep-info) (, |code-path) ([] |:focus |code-path)
[] |-> |store ([] |touch-def)
[] |update |:writer $ [] |push-path
[] |{} ([] |:kind |:defs) ([] |:ns |shorten-ns) ([] |:extra $ [] |:def |dep-info) ([] |:focus $ [] |[] |2)
[] |-> |store $ [] |update |:notifications
[] |helper-notify |op-id $ [] |str "||External package: " ([] |:ns |dep-info)
[] |-> |store $ [] |update |:notifications ([] |helper-notify |op-id $ [] |str "||Can't find: " |target)
:procs $ []
|util.analyze $ {}
:ns $ [] |ns |app.util.analyze
[] |:require ([] |[] |clojure.string |:as |string) ([] |[] |app.util.detect |:refer $ [] |[] |contains-def? |use-vector?)
:defs $ {}
|expand-deps-tree $ [] |defn |expand-deps-tree ([] |internal-ns |def-text |files |pkg |parents)
[] |let
[] ([] |this-file $ [] |get |files |internal-ns)
[] |def-expr $ [] |get-in |this-file ([] |[] |:defs |def-text)
[] |stamp $ [] |{} ([] |:ns |internal-ns) ([] |:def |def-text)
[] |base-dep $ [] |{} ([] |:ns |internal-ns) ([] |:def |def-text) ([] |:external? |false) ([] |:circular? |false)
[] |if ([] |nil? |def-expr) ([] |assoc |base-dep |:external? |true)
[] |if ([] |contains? |parents |stamp) ([] |assoc |base-dep |:circular? |true)
[] |assoc |base-dep |:deps $ [] |let
[] $ [] |def-deps
[] |if ([] |some? |def-expr)
[] |extract-deps ([] |subvec |def-expr |2) (, |internal-ns |this-file |pkg)
, |nil
[] |->> |def-deps
[] |map $ [] |fn ([] |dep-info)
[] |if ([] |:external? |dep-info) (, |dep-info)
[] |let
[]
[] |child-internal-ns $ [] |string/replace-first ([] |:ns |dep-info) ([] |str |pkg ||.) (, ||)
[] |child-def $ [] |:def |dep-info
[] |next-parents $ [] |conj |parents |stamp
[] |expand-deps-tree |child-internal-ns |child-def |files |pkg |next-parents
[] |into $ [] |#{}
|parse-rule $ [] |defn |parse-rule ([] |dict |rule)
[] |let
[]
[] |clean-rule $ [] |if ([] |= ||[] $ [] |first |rule) ([] |subvec |rule |1) (, |rule)
[] |ns-text $ [] |first |clean-rule
[] |binding-rule $ [] |subvec |clean-rule |1
[] |loop
[] ([] |left-binding |binding-rule) ([] |result |dict)
[] |; |println "||doing loop:" |left-binding |result
[] |if
[] |< ([] |count |left-binding) (, |2)
, |result
[] |let
[] ([] |kind $ [] |first |left-binding) ([] |data $ [] |get |left-binding |1)
[] |recur ([] |subvec |left-binding |2)
[] |cond
[] ([] |= ||:as |kind)
[] |assoc |result |data $ [] |{} ([] |:kind |:as) ([] |:ns |ns-text) ([] |:text |data)
[] ([] |= ||:refer |kind)
[] |->> |data
[] |filter $ [] |fn ([] |x) ([] |not= |x ||[])
[] |map $ [] |fn ([] |x)
[] |[] |x $ [] |{} ([] |:kind |:refer) ([] |:ns |ns-text) ([] |:text |x)
[] |into $ [] |{}
[] |merge |result
[] |:else |result
|list-dependent-ns $ [] |defn |list-dependent-ns ([] |ns-name |files |pkg)
[] |let
[] ([] |full-ns $ [] |str |pkg ||. |ns-name)
[] |pick-ns $ [] |fn ([] |xs)
[] |if ([] |use-vector? |xs) ([] |get |xs |1) ([] |first |xs)
[] |->> |files
[] |filter $ [] |fn ([] |entry)
[] |let
[]
[] ([] |[] |ns-part |file) (, |entry)
[] |ns-expr $ [] |:ns |file
[] |ns-rules $ [] |->> ([] |subvec |ns-expr |2) ([] |map |rest) ([] |apply |concat) ([] |map |pick-ns) ([] |into $ [] |#{})
[] |; |println ||Search: |ns-name |ns-rules
[] |contains? |ns-rules |full-ns
[] |map |first
[] |into $ [] |#{}
|pick-dep $ [] |defn |pick-dep ([] |token)
[] |cond
[] ([] |string/blank? |token) (, |nil)
[] ([] |string/starts-with? |token ||:) (, |nil)
[] ([] |string/starts-with? |token ||.) (, |nil)
[] ([] |string/starts-with? |token |||) (, |nil)
[] ([] |string/starts-with? |token ||#) (, |nil)
[] ([] |string/starts-with? |token ||[) (, |nil)
[] ([] |string/starts-with? |token ||') (, |nil)
[] ([] |string/starts-with? |token ||{) (, |nil)
[] ([] |string/starts-with? |token ||%) (, |nil)
[] ([] |string/starts-with? |token ||\) (, |nil)
[] ([] |= |token ||--) (, |nil)
[] ([] |string/includes? |token ||/)
[] |let
[] $ [] ([] |[] |ns-piece |def-piece) ([] |string/split |token ||/)
[] |{} ([] |:kind |:ns) ([] |:data |ns-piece) ([] |:extra |def-piece)
[] ([] |string/includes? |token ||.)
[] |let
[] $ [] ([] |[] |def-piece |prop-piece) ([] |string/split |token ||.)
[] |{} ([] |:kind |:def) ([] |:data |def-piece)
[] ([] |string/starts-with? |token ||@)
[] |{} ([] |:kind |:def) ([] |:data $ [] |subs |token |1)
[] |:else $ [] |{} ([] |:kind |:def) ([] |:data |token)
|parse-ns-deps $ [] |defn |parse-ns-deps ([] |expression)
[] |let
[] $ [] |branches
[] |->> ([] |subvec |expression |2)
[] |filter $ [] |fn ([] |expr) ([] |= ||:require $ [] |first |expr)
[] |if ([] |empty? |branches) ([] |{})
[] |doall $ [] |reduce |parse-rule ([] |{}) ([] |rest $ [] |first |branches)
|extract-deps $ [] |defn |extract-deps ([] |expression |internal-ns |file |pkg)
[] |let
[]
[] |external? $ [] |fn ([] |ns-text)
[] |not $ [] |string/starts-with? |ns-text ([] |str |pkg ||.)
[] |ns-deps $ [] |parse-ns-deps ([] |:ns |file)
[] |->> |expression ([] |flatten) ([] |map |pick-dep) ([] |filter |some?)
[] |map $ [] |fn ([] |info)
[] |case ([] |:kind |info)
[] |:def $ [] |let
[] ([] |def-text $ [] |:data |info) ([] |defs $ [] |:defs |file)
[] |cond
[] ([] |contains? |ns-deps |def-text)
[] |let
[] $ [] |using-mapping ([] |get |ns-deps |def-text)
[] |if ([] |= |:refer $ [] |:kind |using-mapping)
[] |let
[] $ [] |ns-text ([] |:ns |using-mapping)
[] |{} ([] |:ns |ns-text) ([] |:def |def-text) ([] |:external? $ [] |external? |ns-text)
, |nil
[] ([] |contains? |defs |def-text)
[] |{} ([] |:ns $ [] |str |pkg ||. |internal-ns) ([] |:def |def-text) ([] |:external? |false)
[] |:else |nil
[] |:ns $ [] |let
[] $ []
[] |{} ([] |ns-text |:data) ([] |def-text |:extra)
, |info
[] |if ([] |contains? |ns-deps |ns-text)
[] |let
[] $ [] |using-mapping ([] |get |ns-deps |ns-text)
[] |if ([] |= |:as $ [] |:kind |using-mapping)
[] |let
[] $ [] |ns-text ([] |:ns |using-mapping)
[] |{} ([] |:ns |ns-text) ([] |:def |def-text) ([] |:external? $ [] |external? |ns-text)
, |nil
, |nil
, |nil
[] |filter |some?
[] |into $ [] |#{}
:procs $ []
|util $ {}
:ns $ [] |ns |app.util
[] |:require ([] |[] |app.util.detect |:refer $ [] |[] |contains-def? |=path?) ([] |clojure.set |:refer $ [] |union) ([] |clojure.string |:as |string)
:defs $ {}
|remove-idx $ [] |defn |remove-idx ([] |xs |idx)
[] |let
[] $ [] |xs-size ([] |count |xs)
[] |cond
[]
[] |or ([] |>= |idx |xs-size) ([] |neg? |idx)
, |xs
[] ([] |= |xs-size |1) ([] |[])
[] ([] |zero? |idx) ([] |subvec |xs |1)
[] ([] |= |idx $ [] |dec |xs-size) ([] |subvec |xs |0 |idx)
[] |:else $ [] |into ([] |[])
[] |concat ([] |subvec |xs |0 |idx) ([] |subvec |xs $ [] |inc |idx)
|make-focus-path $ [] |defn |make-focus-path ([] |store)
[] |let
[] ([] |writer $ [] |:writer |store) ([] |pointer $ [] |:pointer |writer) ([] |stack $ [] |:stack |writer) ([] |code-path $ [] |get |stack |pointer)
[] |concat ([] |make-path |code-path) ([] |:focus |code-path)
|has-ns? $ [] |defn |has-ns? ([] |x) ([] |string/includes? |x ||/)
|helper-notify $ [] |defn |helper-notify ([] |op-id |data)
[] |fn ([] |notifications)
[] |into ([] |[])
[] |cons ([] |[] |op-id |data) (, |notifications)
|make-path $ [] |defn |make-path ([] |info)
[] |let
[] $ [] |kind ([] |:kind |info)
[] |if ([] |= |kind |:defs)
[] |[] |:collection |:files ([] |:ns |info) (, |:defs) ([] |:extra |info)
[] |[] |:collection |:files ([] |:ns |info) (, |kind)
|view-focused $ [] |defn |view-focused ([] |store) ([] |get-in |store $ [] |make-focus-path |store)
|make-short-path $ [] |defn |make-short-path ([] |info)
[] |let
[] $ [] |kind ([] |:kind |info)
[] |if ([] |= |kind |:defs)
[] |[] ([] |:ns |info) (, |:defs) ([] |:extra |info)
[] |[] ([] |:ns |info) (, |kind)
|helper-create-def $ [] |defn |helper-create-def ([] |ns-part |name-part |code-path |focus)
[] |fn ([] |files)
[] |if ([] |contains-def? |files |ns-part |name-part) (, |files)
[] |assoc-in |files ([] |[] |ns-part |:defs |name-part)
[] |let
[] $ [] |as-fn?
[] |and ([] |not $ [] |empty? |focus) ([] |zero? $ [] |last |focus)
[] |if |as-fn?
[] |let
[] $ [] |expression
[] |get-in |files $ [] |concat ([] |make-short-path |code-path) ([] |butlast |focus)
[] |if
[] |> ([] |count |expression) (, |1)
[] |[] ||defn |name-part $ [] |subvec |expression |1
[] |[] ||defn |name-part $ [] |[]
[] |[] ||def |name-part $ [] |[]
|now! $ [] |defn |now! ([]) ([] |.now |js/performance)
|collect-defs $ [] |defn |collect-defs ([] |node)
[] |let
[] $ [] |base-result
[] |#{} $ [] |select-keys |node ([] |[] |:ns |:def)
[] |if ([] |contains? |node |:deps)
[] |union
[] |apply |union $ [] |map |collect-defs ([] |:deps |node)
, |base-result
, |base-result
:procs $ []
|comp.workspace $ {}
:ns $ [] |ns |app.comp.workspace
[] |:require ([] |[] |hsl.core |:refer $ [] |[] |hsl) ([] |[] |respo.core |:refer $ [] |[] |defcomp |div |<> |>> |span |input) ([] |[] |respo.comp.space |:refer $ [] |[] |=<) ([] |[] |respo.comp.inspect |:refer $ [] |[] |comp-inspect) ([] |[] |respo-ui.core |:as |ui) ([] |[] |app.comp.stack |:refer $ [] |[] |comp-stack) ([] |[] |cirru-editor.comp.editor |:refer $ [] |[] |comp-editor) ([] |[] |app.util.keycode |:as |keycode) ([] |[] |app.util.dom |:as |dom) ([] |[] |app.util |:refer $ [] |[] |make-path) ([] |[] |app.style.widget |:as |widget)
:defs $ {}
|on-command $ [] |defn |on-command ([] |store)
[] |fn ([] |snapshot |dispatch! |e)
[] |let
[] ([] |code $ [] |:key-code |e) ([] |event $ [] |:original-event |e)
[] |command? $ [] |or ([] |.-metaKey |event) ([] |.-ctrlKey |event)
[] |shift? $ [] |.-shiftKey |event
[] |cond
[] ([] |= |code |keycode/key-d)
[] |do ([] |.preventDefault |event) ([] |dispatch! |:stack/goto-definition |shift?)
[] ([] |= |code |keycode/key-u)
[] |do ([] |.preventDefault |event) ([] |dispatch! |:stack/dependents |nil)
[] ([] |= |code |keycode/key-i)
[] |do ([] |.preventDefault |event) ([] |dispatch! |:stack/go-back |nil)
[] ([] |= |code |keycode/key-k)
[] |do ([] |.preventDefault |event) ([] |dispatch! |:stack/shift $ [] |-> |store |:writer |:pointer)
[] ([] |= |code |keycode/key-j)
[] |do ([] |.preventDefault |event) ([] |dispatch! |:stack/go-next |nil)
[] ([] |= |code |keycode/key-s)
[] |do ([] |.preventDefault |event) ([] |dispatch! |:effect/submit |shift?)
[] ([] |and |command? $ [] |= |code |keycode/key-p)
[] |do ([] |.preventDefault |event) ([] |.stopPropagation |event) ([] |dispatch! |:router/toggle-palette |nil) ([] |dom/focus-palette!)
[]
[] |and |command? ([] |not |shift?) ([] |= |code |keycode/key-e)
[] |do ([] |.preventDefault |event) ([] |dispatch! |:collection/edit-ns |nil)
[] |:else |nil
|comp-workspace $ [] |defcomp |comp-workspace ([] |store)
[] |let
[] ([] |router $ [] |:router |store) ([] |states $ [] |:states |store) ([] |writer $ [] |:writer |store)
[] |stack $ [] |get-in |store ([] |[] |:writer |:stack)
[] |pointer $ [] |get-in |store ([] |[] |:writer |:pointer)
[] |code-path $ [] |get |stack |pointer
[] |tree $ [] |if ([] |some? |code-path) ([] |get-in |store $ [] |make-path |code-path) (, |nil)
[] |div
[] |{} $ [] |:style ([] |merge |ui/expand |ui/row |style-container)
[] |div
[] |{} $ [] |:style ([] |merge |ui/column |style-sidebar)
[] |comp-stack |stack |pointer
[] |; |comp-inspect |writer |style-debugger
[] |if ([] |some? |tree)
[] |div
[] |{} $ [] |:style ([] |merge |ui/column |ui/flex)
[] |comp-editor ([] |>> |states |:editor)
[] |{} ([] |:tree |tree) ([] |:focus $ [] |:focus |code-path) ([] |:clipboard $ [] |:clipboard |writer)
, |on-update
[] |on-command |store
[] |div
[] |{} $ [] |:style ([] |merge |ui/row |style-toolbar)
[] |div $ [] |{} ([] |:inner-text ||Rename) ([] |:class-name ||is-unremarkable) ([] |:style |widget/clickable-text) ([] |:on-click $ [] |on-rename |code-path)
[] |=< |8 |nil
[] |div $ [] |{} ([] |:inner-text ||Delete) ([] |:class-name ||is-unremarkable) ([] |:style |widget/clickable-text) ([] |:on-click |on-remove)
[] |div
[] |{} $ [] |:style ([] |merge |ui/column |ui/flex)
[] |div ([] |{} $ [] |:style |style-removed) ([] |<> |span "||No expression" |nil)
|on-update $ [] |defn |on-update ([] |snapshot |dispatch!) ([] |dispatch! |:collection/write |snapshot)
|style-toolbar $ [] |def |style-toolbar
[] |{} ([] |:background-color $ [] |hsl |0 |0 |0) ([] |:justify-content ||flex-start)
|style-container $ [] |def |style-container
[] |{} $ [] |:background-color ([] |hsl |0 |0 |0)
|style-debugger $ [] |def |style-debugger
[] |{} ([] |:z-index |999) ([] |:background-color $ [] |hsl |0 |0 |0) ([] |:opacity |1)
|style-sidebar $ [] |def |style-sidebar
[] |{} ([] |:width ||180px) ([] |:background-color $ [] |hsl |0 |0 |0) ([] |:color $ [] |hsl |0 |0 |80)
|on-rename $ [] |defn |on-rename ([] |code-path)
[] |fn ([] |e |dispatch!) ([] |println "||the code path:" |code-path)
[] |dispatch! |:modal/mould $ [] |{} ([] |:title |:rename-path) ([] |:data |code-path)
[] |dom/focus-rename!
|on-remove $ [] |defn |on-remove ([] |e |dispatch!) ([] |dispatch! |:collection/remove-this |nil)
|style-removed $ [] |def |style-removed
[] |{} ([] |:margin "||32px 16px") ([] |:font-size ||20px) ([] |:font-weight ||lighter) ([] |:color $ [] |hsl |0 |80 |50) ([] |:font-family "||Josefin Sans") ([] |:padding "||0 16px") ([] |:display ||inline-block) ([] |:max-width ||400px)
:procs $ []
|comp.graph $ {}
:ns $ [] |ns |app.comp.graph
[] |:require ([] |[] |hsl.core |:refer $ [] |[] |hsl) ([] |[] |respo.core |:refer $ [] |[] |defcomp |div |list-> |<> |span |input |button) ([] |[] |respo-ui.core |:as |ui) ([] |[] |app.comp.def |:refer $ [] |[] |comp-def) ([] |[] |app.util.detect |:refer $ [] |[] |def-order |=def?) ([] |[] |respo.comp.space |:refer $ [] |[] |=<) ([] |[] |app.style.widget |:as |widget) ([] |[] |clojure.set |:as |set)
:defs $ {}
|style-body $ [] |def |style-body
[] |{} ([] |:flex |1) ([] |:overflow |:auto)
|style-graph $ [] |def |style-graph
[] |{} ([] |:background-color $ [] |hsl |0 |0 |0) ([] |:overflow |:auto)
|on-load $ [] |defn |on-load ([] |e |dispatch!) ([] |dispatch! |:graph/load-graph |nil)
|style-toolbar $ [] |def |style-toolbar ([] |{} $ [] |:padding |16)
|style-column $ [] |def |style-column
[] |{} ([] |:min-width |80) ([] |:overflow |:auto) ([] |:padding "||16px 16px") ([] |:flex-shrink |0)
|comp-graph $ [] |defcomp |comp-graph ([] |store)
[] |div
[] |{} $ [] |:style ([] |merge |ui/expand |ui/column |style-graph)
[] |render-toolbar
[] |let
[]
[] |tree $ [] |get-in |store ([] |[] |:graph |:tree)
[] |root-tree $ [] |assoc ([] |get-in |store $ [] |[] |:collection |:root) (, |:deps) ([] |#{} |tree)
[] |view-path $ [] |get-in |store ([] |[] |:graph |:path)
[] |if ([] |some? |tree)
[] |list->
[] |{} $ [] |:style ([] |merge |ui/row |style-body)
[] |loop
[] ([] |branch |root-tree) ([] |children $ [] |[]) ([] |path $ [] |[])
[] |let
[]
[] |next-path $ [] |conj |path ([] |get |view-path $ [] |count |path)
[] |next-pos $ [] |get |view-path ([] |count |path)
[] |next-children $ [] |conj |children
[] |[] ([] |count |children)
[] |list-> ([] |{} $ [] |:style |style-column)
[] |->> ([] |:deps |branch) ([] |sort |def-order)
[] |map-indexed $ [] |fn ([] |idx |child-node)
[] |[] |idx $ [] |comp-def |child-node |path ([] |=def? |next-pos |child-node)
[] |if ([] |= |path |view-path) (, |next-children)
[] |let
[] $ [] |next-branch
[] |->> ([] |:deps |branch)
[] |set/select $ [] |fn ([] |x)
[] |=def? ([] |get |view-path $ [] |count |path) (, |x)
[] |first
[] |recur |next-branch |next-children |next-path
[] |<> |div "||Not generated yet." $ [] |{} ([] |:padding "||0 16px")
|render-toolbar $ [] |defn |render-toolbar ([])
[] |div ([] |{} $ [] |:style |style-toolbar)
[] |div ([] |{})
[] |button $ [] |{} ([] |:inner-text "||Build tree") ([] |:style |widget/button) ([] |:on-click |on-load)
[] |=< |8 |nil
[] |button $ [] |{} ([] |:inner-text "||Find orphans") ([] |:style |widget/button) ([] |:on-click |on-orphans)
|on-orphans $ [] |defn |on-orphans ([] |e |dispatch!) ([] |dispatch! |:graph/show-orphans |nil)
:procs $ []
|updater.graph $ {}
:ns $ [] |ns |app.updater.graph
[] |:require ([] |app.util.analyze |:refer $ [] |parse-ns-deps |pick-dep |expand-deps-tree) ([] |app.util.stack |:refer $ [] |push-path) ([] |clojure.set |:refer $ [] |union |difference) ([] |app.util |:refer $ [] |collect-defs) ([] |clojure.string |:as |string)
:defs $ {}
|load-graph $ [] |defn |load-graph ([] |store |op-data)
[] |let
[]
[] |root-info $ [] |get-in |store ([] |[] |:collection |:root)
[] |files $ [] |get-in |store ([] |[] |:collection |:files)
[] |internal-ns $ [] |:ns |root-info
[] |ns-deps $ [] |parse-ns-deps ([] |get-in |files $ [] |[] |internal-ns |:ns)
[] |def-expr $ [] |get-in |files
[] |[] ([] |:ns |root-info) (, |:defs) ([] |:def |root-info)
[] |pkg $ [] |get-in |store ([] |[] |:collection |:package)
[] |this-file $ [] |get |files |internal-ns
[] |deps-tree $ [] |expand-deps-tree |internal-ns ([] |:def |root-info) (, |files |pkg) ([] |#{})
[] |; |println |ns-deps
[] |println
[] |-> |store $ [] |assoc-in ([] |[] |:graph |:tree) (, |deps-tree)
|view-path $ [] |defn |view-path ([] |store |op-data)
[] |assoc-in |store ([] |[] |:graph |:path) (, |op-data)
|view-ns $ [] |defn |view-ns ([] |store |op-data)
[] |assoc-in |store ([] |[] |:graph |:ns-path) (, |op-data)
|edit-current $ [] |defn |edit-current ([] |store |op)
[] |let
[] $ [] |maybe-path
[] |last $ [] |get-in |store ([] |[] |:graph |:path)
[] |if ([] |some? |maybe-path)
[] |-> |store
[] |update |:writer $ [] |push-path
[] |{} ([] |:ns $ [] |:ns |maybe-path) ([] |:kind |:defs) ([] |:extra $ [] |:def |maybe-path) ([] |:focus $ [] |[])
[] |assoc |:router $ [] |{} ([] |:name |:workspace) ([] |:data |nil)
, |store
|show-orphans $ [] |defn |show-orphans ([] |store |op-data)
[] |let
[]
[] |all-defs $ [] |->> ([] |get-in |store $ [] |[] |:collection |:files)
[] |map $ [] |fn ([] |file-entry)
[] |let
[] ([] |ns-text $ [] |first |file-entry)
[] |defs $ [] |keys ([] |:defs $ [] |val |file-entry)
[] |->> |defs
[] |map $ [] |fn ([] |def-text)
[] |{} ([] |:ns |ns-text) ([] |:def |def-text)
[] |into $ [] |#{}
[] |apply |union
[] |deps-tree $ [] |get-in |store ([] |[] |:graph |:tree)
[] |defs-in-tree $ [] |collect-defs |deps-tree
[] |update |store |:modal-stack $ [] |fn ([] |xs)
[] |conj |xs $ [] |{} ([] |:title |:orphans) ([] |:data $ [] |difference |all-defs |defs-in-tree)
:procs $ []
|schema $ {} (:ns $ [] |ns |app.schema)
:defs $ {}
|store $ [] |def |store
[] |{}
[] |:router $ [] |{} ([] |:name |:loading) ([] |:data |:definitions) ([] |:show-palette? |false)
[] |:collection $ [] |{} ([] |:package |nil) ([] |:root |nil) ([] |:files $ [] |{})
[] |:graph $ [] |{} ([] |:tree |nil) ([] |:orphans |nil) ([] |:path $ [] |[]) ([] |:ns-path $ [] |[])
[] |:writer $ [] |{} ([] |:stack $ [] |[]) ([] |:pointer |0) ([] |:clipboard $ [] |[])
[] |:notifications $ [] |[]
[] |:modal-stack $ [] |[]
[] |:states $ [] |{}
:procs $ []
|comp.container $ {}
:ns $ [] |ns |app.comp.container
[] |:require ([] |[] |hsl.core |:refer $ [] |[] |hsl) ([] |[] |respo.comp.inspect |:refer $ [] |[] |comp-inspect) ([] |[] |respo.core |:refer $ [] |[] |defcomp |div |>> |<> |span |input) ([] |[] |respo-ui.core |:as |ui) ([] |[] |app.comp.loading |:refer $ [] |[] |comp-loading) ([] |[] |app.comp.workspace |:refer $ [] |[] |comp-workspace) ([] |[] |app.comp.notifications |:refer $ [] |[] |comp-notifications) ([] |[] |app.comp.palette |:refer $ [] |[] |comp-palette) ([] |[] |app.comp.modal-stack |:refer $ [] |[] |comp-modal-stack) ([] |[] |app.comp.graph |:refer $ [] |[] |comp-graph) ([] |[] |app.util.keycode |:as |keycode) ([] |[] |app.util.dom |:as |dom) ([] |[] |app.style.widget |:as |widget) ([] |[] |app.comp.file-tree |:refer $ [] |[] |comp-file-tree)
:defs $ {}
|comp-container $ [] |defcomp |comp-container ([] |store)
[] |let
[] ([] |router $ [] |:router |store) ([] |states $ [] |:states |store) ([] |page $ [] |:name |router)
[] |if ([] |= |:router $ [] |:name |router) ([] |comp-loading)
[] |div
[] |{} $ [] |:style
[] |merge |ui/global |ui/fullscreen |ui/column $ [] |{} ([] |:background-color $ [] |hsl |0 |0 |0) ([] |:color $ [] |hsl |0 |0 |70)
[] |div
[] |{} $ [] |:style
[] |merge |ui/row-middle $ [] |{} ([] |:padding "|\"0 8px")
[] |comp-tab "|\"Files" |:file-tree $ [] |= |page |:file-tree
[] |comp-tab "|\"Editor" |:workspace $ [] |= |page |:workspace
[] |comp-tab "|\"Graph" |:graph $ [] |= |page |:graph
[] |case ([] |:name |router) ([] |:workspace $ [] |comp-workspace |store) ([] |:graph $ [] |comp-graph |store)
[] |:file-tree $ [] |comp-file-tree ([] |>> |states |:file-tree) (, |store)
[] |<> ([] |str |router) (, |nil)
[] |comp-notifications $ [] |:notifications |store
[] |; |comp-inspect ||Store |store $ [] |{} ([] |:bottom |0) ([] |:background-color $ [] |hsl |0 |0 |0) ([] |:opacity |1) ([] |:color |:white)
[] |if ([] |:show-palette? |router)
[] |comp-palette ([] |>> |states |:palette) ([] |:files $ [] |:collection |store)
[] |comp-modal-stack |states $ [] |:modal-stack |store
|comp-tab $ [] |defcomp |comp-tab ([] |title |code |selected?)
[] |div
[] |{}
[] |:style $ [] |merge
[] |{} ([] |:font-family |ui/font-fancy) ([] |:font-size |18) ([] |:font-weight |300) ([] |:min-width |60) ([] |:color $ [] |hsl |0 |0 |50) ([] |:cursor |:pointer)
[] |if |selected? $ [] |{} ([] |:color $ [] |hsl |0 |0 |100)
[] |:on-click $ [] |fn ([] |e |d!)
[] |d! |:router/route $ [] |{} ([] |:name |code)
[] |<> |title
:procs $ []
|comp.def $ {}
:ns $ [] |ns |app.comp.def
[] |:require ([] |[] |hsl.core |:refer $ [] |[] |hsl) ([] |[] |respo.core |:refer $ [] |[] |defcomp |div |<> |span |input) ([] |[] |respo-ui.core |:as |ui) ([] |[] |respo.comp.space |:refer $ [] |[] |=<)
:defs $ {}
|comp-def $ [] |defcomp |comp-def ([] |child-node |path |selected?)
[] |div
[] |{}
[] |:style $ [] |merge |style-def
[] |if ([] |:external? |child-node) (, |style-external)
[] |if |selected? |style-highlight
[] |if ([] |:circular? |child-node) (, |style-circular)
[] |:on-click $ [] |on-view |path |child-node
[] |<> |span
[] |str ([] |:ns |child-node) (, "|| / ") ([] |:def |child-node)
, |nil
[] |=< |4 |nil
[] |let
[] $ [] |many-deps ([] |count $ [] |:deps |child-node)
[] |if ([] |pos? |many-deps) ([] |<> |span |many-deps |style-count)
|on-view $ [] |defn |on-view ([] |path |child-node)
[] |fn ([] |e |dispatch!)
[] |if ([] |.-metaKey $ [] |:original-event |e)
[] |dispatch! |:collection/edit $ [] |{} ([] |:kind |:defs) ([] |:ns $ [] |:ns |child-node) ([] |:extra $ [] |:def |child-node) ([] |:focus $ [] |[])
[] |dispatch! |:graph/view-path $ [] |conj |path
[] |{} ([] |:ns $ [] |:ns |child-node) ([] |:def $ [] |:def |child-node)
|style-circular $ [] |def |style-circular ([] |{} $ [] |:text-decoration |:underline)
|style-def $ [] |def |style-def
[] |{} ([] |:color $ [] |hsl |0 |0 |70 |0.7) ([] |:font-size |14) ([] |:cursor |:pointer) ([] |:white-space |:nowrap)
|style-external $ [] |def |style-external
[] |{} ([] |:color $ [] |hsl |260 |16 |44) ([] |:font-size |12) ([] |:cursor |:default)
|style-highlight $ [] |def |style-highlight
[] |{} $ [] |:color ([] |hsl |0 |0 |100 |0.86)
|style-count $ [] |def |style-count
[] |{} ([] |:font-size |12) ([] |:color $ [] |hsl |0 |0 |100 |0.4)
:procs $ []
|comp.modal-stack $ {}
:ns $ [] |ns |app.comp.modal-stack
[] |:require ([] |[] |hsl.core |:refer $ [] |[] |hsl) ([] |[] |respo.core |:refer $ [] |[] |defcomp |list-> |div |<> |>> |span |input) ([] |[] |respo-ui.core |:as |ui) ([] |[] |app.style.widget |:as |widget) ([] |[] |app.comp.rename-path |:refer $ [] |[] |comp-rename-path) ([] |[] |app.comp.hydrate |:refer $ [] |[] |comp-hydrate) ([] |[] |app.comp.orphans |:refer $ [] |[] |comp-orphans)
:defs $ {}
|on-tip $ [] |defn |on-tip ([] |e |dispatch!)
|style-modal $ [] |def |style-modal
[] |merge |ui/center $ [] |{} ([] |:background-color $ [] |hsl |0 |0 |0 |0.6) ([] |:z-index |900) ([] |:position |:fixed) ([] |:top |0) ([] |:right |0) ([] |:width ||100%) ([] |:height ||100%)
|on-recycle $ [] |defn |on-recycle ([] |e |dispatch!) ([] |dispatch! |:modal/recycle |nil)
|renderer $ [] |defn |renderer ([] |states |kind |title |data)
[] |div ([] |{})
[] |case |title
[] |:rename-path $ [] |comp-rename-path ([] |>> |states |:rename-path) (, |data)
[] |:hydrate $ [] |comp-hydrate ([] |>> |states |:hydrate)
[] |:orphans $ [] |comp-orphans |data
[] |<> |span |title |nil
|comp-modal-stack $ [] |defcomp |comp-modal-stack ([] |states |modal-stack)
[] |list-> ([] |{})
[] |->> |modal-stack $ [] |map-indexed
[] |fn ([] |idx |modal)
[] |let
[] ([] |kind $ [] |:kind |modal) ([] |title $ [] |:title |modal) ([] |data $ [] |:data |modal)
[] |[] |idx $ [] |div
[] |{} ([] |:style |style-modal) ([] |:on-click |on-recycle)
[] |div ([] |{} $ [] |:on-click |on-tip) ([] |renderer |states |kind |title |data)
:procs $ []
|comp.rename-path $ {}
:ns $ [] |ns |app.comp.rename-path
[] |:require ([] |[] |respo.core |:refer $ [] |[] |defcomp |div |<> |span |input) ([] |[] |respo.comp.space |:refer $ [] |[] |=<) ([] |[] |respo-ui.core |:as |ui) ([] |[] |app.style.widget |:as |widget) ([] |[] |app.util.keycode |:as |keycode)
:defs $ {}
|init-state $ [] |defn |init-state ([] |code-path)
[] |let
[] $ []
[] |{} ([] |ns-part |:ns) ([] |kind |:kind) ([] |extra-name |:extra)
, |code-path
[] |if ([] |= |kind |:defs) ([] |str |ns-part ||/ |extra-name) (, |ns-part)
|comp-rename-path $ [] |defcomp |comp-rename-path ([] |states |code-path)
[] |let
[] $ [] |state
[] |or ([] |:data |states) ([] |init-state |code-path)
[] |div ([] |{})
[] |div ([] |{})
[] |<> |span
[] |str "||Rename: " ([] |:ns |code-path) (, ||/) ([] |:extra |code-path)
, |nil
[] |div ([] |{})
[] |input $ [] |{} ([] |:value |state) ([] |:id ||rename-box)
[] |:style $ [] |merge |ui/input ([] |{} $ [] |:width |400)
[] |:on-input |on-input
[] |:on-keydown $ [] |on-keydown |code-path |state
[] |=< |16 |nil
[] |div $ [] |{} ([] |:inner-text ||Rename) ([] |:style |widget/button) ([] |:on-click $ [] |on-rename |code-path |state)
|on-input $ [] |defn |on-input ([] |e |dispatch! |m!) ([] |m! $ [] |:value |e)
|on-rename $ [] |defn |on-rename ([] |code-path |text)
[] |fn ([] |e |d! |m!) ([] |d! |:collection/rename $ [] |[] |code-path |text) ([] |d! |:modal/recycle |nil) ([] |m! |nil)
|on-keydown $ [] |defn |on-keydown ([] |code-path |text)
[] |fn ([] |e |d! |m!) ([] |println |keycode/key-esc)
[] |cond
[]
[] |= ([] |:key-code |e) (, |keycode/key-enter)
[] |do ([] |d! |:collection/rename $ [] |[] |code-path |text) ([] |d! |:modal/recycle |nil) ([] |m! |nil)
[]
[] |= ([] |:key-code |e) (, |keycode/key-esc)
[] |d! |:modal/recycle |nil
[] |:else |nil
:procs $ []
|util.dom $ {} (:ns $ [] |ns |app.util.dom)
:defs $ {}
|focus-palette! $ [] |defn |focus-palette! ([])
[] |js/requestAnimationFrame $ [] |fn ([])
[] |let
[] $ [] |target ([] |.querySelector |js/document ||#command-palette)
[] |if ([] |some? |target) ([] |.focus |target)
|focus-rename! $ [] |defn |focus-rename! ([])
[] |-> ([] |.querySelector |js/document ||#rename-box) ([] |.focus)
:procs $ []
|main $ {}
:ns $ [] |ns |app.main
[] |:require ([] |[] |respo.core |:refer $ [] |[] |render! |clear-cache! |render-element |realize-ssr!) ([] |[] |app.schema |:as |schema) ([] |[] |app.comp.container |:refer $ [] |[] |comp-container) ([] |[] |cljs.reader |:refer $ [] |[] |read-string) ([] |[] |app.updater |:refer $ [] |[] |updater) ([] |[] |app.util.keycode |:as |keycode) ([] |[] |app.util.dom |:as |dom) ([] |[] |app.util |:refer $ [] |[] |now!) ([] |[] |app.actions |:refer $ [] |[] |load-collection! |submit-collection! |submit-changes! |display-code!) ([] |[] |cirru-editor.util.dom |:refer $ [] |[] |focus!)
:defs $ {}
|ssr? $ [] |def |ssr? ([] |some? $ [] |.querySelector |js/document ||meta.server-rendered)
|*focus-moved? $ [] |def |*focus-moved? ([] |atom |false)
|dispatch! $ [] |defn |dispatch! ([] |op |op-data) ([] |println ||Dispatch! |op)
[] |case |op
[] |:effect/submit $ [] |let
[] ([] |shift? |op-data) ([] |sepal-data $ [] |:collection |@*store)
[] |if |shift? ([] |submit-collection! |sepal-data |dispatch!) ([] |submit-changes! |sepal-data |dispatch!)
[] |:effect/dehydrate $ [] |display-code! |@*store
[] |:effect/load $ [] |load-collection! |dispatch! |false
[] |let
[] $ [] |new-store ([] |updater |@*store |op |op-data $ [] |now!)
[] |reset! |*focus-moved? $ [] |not
[] |and
[] |identical? ([] |:collection |@*store) ([] |:collection |new-store)
[] |identical? ([] |:writer |@*store) ([] |:writer |new-store)
[] |reset! |*store |new-store
|*store $ [] |defonce |*store ([] |atom |schema/store)
|main! $ [] |defn |main! ([]) ([] |if |ssr? $ [] |render-app! |realize-ssr!) ([] |render-app! |render!)
[] |add-watch |*store |:changes $ [] |fn ([]) ([] |render-app! |render!)
[] |.addEventListener |js/window ||keydown $ [] |fn ([] |event)
[] |let
[] ([] |code $ [] |.-keyCode |event)
[] |command? $ [] |or ([] |.-metaKey |event) ([] |.-ctrlKey |event)
[] |shift? $ [] |.-shiftKey |event
[] |cond
[] ([] |and |command? $ [] |= |code |keycode/key-p)
[] |do ([] |.preventDefault |event) ([] |.stopPropagation |event) ([] |dispatch! |:router/toggle-palette |nil) ([] |dom/focus-palette!)
[] ([] |and |shift? |command? $ [] |= |code |keycode/key-a)
[] |do $ [] |let
[] ([] |router $ [] |:router |@*store) ([] |writer $ [] |:writer |@*store)
[] |if
[] |= ([] |:name |router) (, |:workspace)
[] |dispatch! |:router/route $ [] |{} ([] |:name |:graph) ([] |:data |nil)
[] |if
[] |not $ [] |empty? ([] |:stack |writer)
[] |dispatch! |:router/route $ [] |{} ([] |:name |:workspace) ([] |:data |nil)
[] |:else |nil
[] |println "||app started!"
[] |load-collection! |dispatch! |true
|render-app! $ [] |defn |render-app! ([] |renderer)
[] |renderer |mount-target ([] |comp-container |@*store) (, |dispatch!)
[] |if |@*focus-moved? $ [] |do ([] |reset! |*focus-moved? |false) ([] |focus!)
|reload! $ [] |defn |reload! ([]) ([] |clear-cache!) ([] |render-app! |render!) ([] |println "||Code updated.")
|mount-target $ [] |def |mount-target ([] |.querySelector |js/document ||.app)
:procs $ []
|updater.notification $ {} (:ns $ [] |ns |app.updater.notification)
:defs $ {}
|add-one $ [] |defn |add-one ([] |store |op-data |op-id)
[] |let ([] $ [] |notification |op-data)
[] |-> |store $ [] |update |:notifications
[] |fn ([] |notifications)
[] |into ([] |[])
[] |cons ([] |[] |op-id |notification) ([] |take |3 |notifications)
|remove-since $ [] |defn |remove-since ([] |store |op-data)
[] |let ([] $ [] |pos |op-data)
[] |-> |store $ [] |update |:notifications
[] |fn ([] |notifications) ([] |take |pos |notifications)
|remove-one $ [] |defn |remove-one ([] |store |op-data)
[] |let ([] $ [] |notification-id |op-data)
[] |-> |store $ [] |update |:notifications
[] |fn ([] |notifications)
[] |filterv
[] |fn ([] |notification) ([] |not= |notification-id $ [] |first |notification)
, |notifications
:procs $ []
|comp.orphans $ {}
:ns $ [] |ns |app.comp.orphans
[] |:require ([] |[] |hsl.core |:refer $ [] |[] |hsl) ([] |[] |respo.core |:refer $ [] |[] |defcomp |div |list-> |<> |span |input) ([] |[] |respo-ui.core |:as |ui)
:defs $ {}
|comp-orphans $ [] |defcomp |comp-orphans ([] |orphans)
[] |div ([] |{} $ [] |:style |style-container)
[] |div ([] |{}) ([] |<> |span ||Orphans: |style-title)
[] |list-> ([] |{})
[] |->> |orphans $ [] |map
[] |fn ([] |def-info)
[] |let
[] $ [] |def-id
[] |str ([] |:ns |def-info) (, ||/) ([] |:def |def-info)
[] |[] |def-id $ [] |div
[] |{} ([] |:inner-text |def-id) ([] |:style |style-def) ([] |:on-click $ [] |on-edit |def-info)
|style-container $ [] |def |style-container
[] |{} ([] |:width |800) ([] |:height |400) ([] |:overflow |:auto) ([] |:padding |16) ([] |:background $ [] |hsl |0 |0 |0 |0.9)
|style-def $ [] |def |style-def
[] |{} ([] |:min-width |200) ([] |:display |:inline-block) ([] |:cursor |:pointer)
|style-title $ [] |def |style-title
[] |{} ([] |:font-size |24) ([] |:font-weight |100) ([] |:font-family "||Josefin Sans")
|on-edit $ [] |defn |on-edit ([] |def-info)
[] |fn ([] |e |dispatch!)
[] |dispatch! |:collection/edit $ [] |{} ([] |:kind |:defs) ([] |:ns $ [] |:ns |def-info) ([] |:extra $ [] |:def |def-info) ([] |:focus $ [] |[] |1)
[] |dispatch! |:modal/recycle |nil
:procs $ []
|comp.palette $ {}
:ns $ [] |ns |app.comp.palette
[] |:require ([] |[] |clojure.string |:as |string) ([] |[] |hsl.core |:refer $ [] |[] |hsl) ([] |[] |respo.core |:refer $ [] |[] |defcomp |list-> |div |<> |span |input) ([] |[] |respo-ui.core |:as |ui) ([] |[] |cirru-editor.util.dom |:refer $ [] |[] |focus!) ([] |[] |app.comp.command |:refer $ [] |[] |comp-command) ([] |[] |app.util.keycode |:as |keycode) ([] |[] |app.style.widget |:as |widget) ([] |[] |app.util.detect |:refer $ [] |[] |fuzzy-search)
:defs $ {}
|on-input $ [] |defn |on-input ([] |cursor |state)
[] |fn ([] |e |dispatch!)
[] |dispatch! |:states $ [] |[] |cursor
[] |merge |state $ [] |{} ([] |:text $ [] |:value |e) ([] |:cursor |0)
|handle-command $ [] |defn |handle-command ([] |cursor |commands |files |dispatch!)
[] |let
[] $ [] |command
[] |get
[] |into ([] |[]) (, |commands)
, |cursor
[] |println ||Command $ [] |pr-str |command
[] |dispatch! |:router/toggle-palette |nil
[] |case ([] |first |command) ([] |:load $ [] |dispatch! |:effect/load |nil) ([] |:patch $ [] |dispatch! |:effect/submit |true) ([] |:dehydrate $ [] |dispatch! |:effect/dehydrate |nil)
[] |:hydrate $ [] |dispatch! |:modal/mould
[] |{} ([] |:title |:hydrate) ([] |:data |nil)
[] |:graph $ [] |dispatch! |:router/route
[] |{} ([] |:name |:graph) ([] |:data |nil)
[] |:defs $ [] |do
[] |dispatch! |:collection/edit $ [] |{} ([] |:ns $ [] |get |command |1) ([] |:kind |:defs) ([] |:extra $ [] |last |command) ([] |:focus $ [] |[] |0)
[] |:ns $ [] |do
[] |dispatch! |:collection/edit $ [] |{} ([] |:ns $ [] |get |command |1) ([] |:kind |:ns) ([] |:extra |nil) ([] |:focus $ [] |[] |0)
[] |:procs $ [] |do
[] |dispatch! |:collection/edit $ [] |{} ([] |:ns $ [] |get |command |1) ([] |:kind |:procs) ([] |:extra |nil) ([] |:focus $ [] |[] |0)
, |nil
|comp-palette $ [] |defcomp |comp-palette ([] |states |files)
[] |let
[]
[] |ns-names $ [] |->> ([] |keys |files)
[] |map $ [] |fn ([] |path) ([] |[] |:ns |path)
[] |cursor $ [] |:cursor |states
[] |state $ [] |or ([] |:data |states) (, |initial-state)
[] |def-paths $ [] |->> |files
[] |map $ [] |fn ([] |entry)
[] |let
[] $ [] ([] |[] |ns-part |tree) (, |entry)
[] |->> ([] |:defs |tree) ([] |keys)
[] |map $ [] |fn ([] |def-name) ([] |[] |:defs |ns-part |def-name)
[] |apply |concat
[] |procedure-names $ [] |->> ([] |keys |files)
[] |map $ [] |fn ([] |proc-name) ([] |[] |:procs |proc-name)
[] |queries $ [] |string/split ([] |:text |state) (, "|| ")
[] |commands $ [] |->> ([] |concat |def-paths |ns-names |procedure-names |basic-commands)
[] |filter $ [] |fn ([] |command) ([] |fuzzy-search |command |queries)
[] |div
[] |{} $ [] |:style ([] |merge |ui/fullscreen |ui/row |style-container)
[] |div
[] |{} $ [] |:style
[] |merge |ui/column $ [] |{} ([] |:background-color $ [] |hsl |0 |0 |0 |0.8) ([] |:width ||800px)
[] |input $ [] |{} ([] |:placeholder "||write command...") ([] |:id ||command-palette) ([] |:value $ [] |:text |state)
[] |:style $ [] |merge |widget/input
[] |{} ([] |:width ||100%) ([] |:line-height ||40px)
[] |:autocomplete "|\"off"
[] |:on-input $ [] |on-input |cursor |state
[] |:on-keydown $ [] |on-keydown |cursor |state |commands ([] |:cursor |state) (, |files)
[] |list->
[] |{} $ [] |:style
[] |merge |ui/flex $ [] |{} ([] |:overflow ||auto)
[] |->> |commands $ [] |map-indexed
[] |fn ([] |idx |command)
[] |[] |idx $ [] |comp-command |command ([] |= |idx $ [] |:cursor |state) ([] |on-select |idx |commands |files)
|style-container $ [] |def |style-container
[] |{} ([] |:position ||fixed) ([] |:background-color $ [] |hsl |200 |40 |10 |0.8) ([] |:justify-content ||center)
|on-select $ [] |defn |on-select ([] |cursor |commands |files)
[] |fn ([] |dispatch!) ([] |handle-command |cursor |commands |files |dispatch!)
|initial-state $ [] |def |initial-state
[] |{} ([] |:text ||) ([] |:cursor |0)
|basic-commands $ [] |def |basic-commands
[] |[] ([] |[] |:save) ([] |[] |:load) ([] |[] |:hydrate) ([] |[] |:dehydrate) ([] |[] |:graph)
|on-keydown $ [] |defn |on-keydown ([] |respo-cursor |state |commands |cursor |collection)
[] |fn ([] |e |dispatch!)
[] |let
[] ([] |code $ [] |:key-code |e) ([] |total $ [] |count |commands)
[] |cond
[] ([] |= |code |keycode/key-esc)
[] |do
[] |dispatch! |:states $ [] |[] |respo-cursor
[] |merge |state $ [] |{} ([] |:text ||)
[] |dispatch! |:router/toggle-palette |nil
[] |focus!
[] ([] |= |code |keycode/key-down)
[] |if ([] |< |cursor $ [] |dec |total)
[] |dispatch! |:states $ [] |[] |respo-cursor
[] |merge |state $ [] |{} ([] |:cursor $ [] |inc |cursor)
[] ([] |= |code |keycode/key-up)
[] |if ([] |> |cursor |0)
[] |dispatch! |:states $ [] |[] |respo-cursor
[] |merge |state $ [] |{} ([] |:cursor $ [] |dec |cursor)
[] ([] |= |code |keycode/key-enter)
[] |do
[] |dispatch! |:states $ [] |[] |respo-cursor
[] |merge |state $ [] |{} ([] |:text ||)
[] |handle-command |cursor |commands |collection |dispatch!
[] |:else |nil
:procs $ []
|comp.stack $ {}
:ns $ [] |ns |app.comp.stack
[] |:require ([] |[] |hsl.core |:refer $ [] |[] |hsl) ([] |[] |respo.core |:refer $ [] |[] |defcomp |div |list-> |<> |span |input) ([] |[] |clojure.string |:as |string) ([] |[] |respo-ui.core |:as |ui)
:defs $ {}
|style-ns $ [] |def |style-ns
[] |{} ([] |:font-size ||11px) ([] |:line-height |1.4) ([] |:color $ [] |hsl |0 |0 |50) ([] |:font-family ||Hind)
|style-bright $ [] |def |style-bright
[] |{} $ [] |:color ([] |hsl |0 |0 |90)
|style-ns-main $ [] |def |style-ns-main
[] |{} ([] |:padding "||0 8px") ([] |:line-height ||36px) ([] |:cursor ||pointer) ([] |:color $ [] |hsl |0 |0 |60) ([] |:font-family ||Hind) ([] |:font-size ||13px) ([] |:white-space ||nowrap)
|on-click $ [] |defn |on-click ([] |pointer)
[] |fn ([] |e |dispatch!)
[] |let
[] ([] |event $ [] |:original-event |e)
[] |command? $ [] |or ([] |.-ctrlKey |event) ([] |.-metaKey |event)
[] |shift? $ [] |.-shiftKey |event
[] |cond ([] |command? $ [] |dispatch! |:stack/collapse |pointer)
[] |shift? $ [] |do ([] |.preventDefault |event) ([] |dispatch! |:stack/shift |pointer)
[] |:else $ [] |do ([] |dispatch! |:stack/point-to |pointer)
|style-container $ [] |def |style-container
[] |{} ([] |:overflow ||auto) ([] |:padding "||16px 0 160px 0") ([] |:user-select |:nonworkspacee)
|style-bar $ [] |def |style-bar
[] |{} ([] |:padding "||4px 8px") ([] |:cursor ||pointer) ([] |:color $ [] |hsl |0 |0 |60) ([] |:font-family "||Source Code Pro,Menlo,monospace") ([] |:font-size |13) ([] |:line-height |1.4) ([] |:white-space ||nowrap)
|comp-stack $ [] |defcomp |comp-stack ([] |stack |pointer)
[] |list->
[] |{} $ [] |:style ([] |merge |ui/flex |style-container)
[] |->> |stack $ [] |map-indexed
[] |fn ([] |idx |item)
[] |[] |idx $ [] |let
[] $ []
[] |{} ([] |ns-part |:ns) ([] |kind |:kind) ([] |extra-name |:extra)
, |item
[] |if ([] |= |kind |:defs)
[] |div
[] |{} ([] |:style |style-bar) ([] |:on-click $ [] |on-click |idx)
[] |div
[] |{} $ [] |:style
[] |if ([] |= |idx |pointer) (, |style-bright)
[] |<> |span |extra-name |nil
[] |div ([] |{} $ [] |:style |style-ns) ([] |<> |span |ns-part |nil)
[] |div
[] |{}
[] |:style $ [] |merge |style-ns-main
[] |if ([] |= |idx |pointer) (, |style-bright)
[] |:on-click $ [] |on-click |idx
[] |<> |span |ns-part |nil
:procs $ []
|comp.notifications $ {}
:ns $ [] |ns |app.comp.notifications
[] |:require ([] |[] |hsl.core |:refer $ [] |[] |hsl) ([] |[] |respo-ui.core |:as |ui) ([] |[] |respo.core |:refer $ [] |[] |defcomp |list-> |div |<> |span |input)
:defs $ {}
|comp-notifications $ [] |defcomp |comp-notifications ([] |notifications)
[] |list-> ([] |{})
[] |->> |notifications $ [] |map-indexed
[] |fn ([] |idx |entry)
[] |[] ([] |first |entry)
[] |div
[] |{}
[] |:style $ [] |merge |style-notification
[] |{} $ [] |:top
[] |str ([] |+ |8 $ [] |* |40 |idx) (, ||px)
[] |:on-click $ [] |on-click |idx
[] |<> |span ([] |last |entry) (, |nil)
|on-click $ [] |defn |on-click ([] |idx)
[] |fn ([] |e |dispatch!) ([] |dispatch! |:notification/remove-since |idx)
|style-notification $ [] |def |style-notification
[] |{} ([] |:position ||fixed) ([] |:top ||8px) ([] |:right ||8px) ([] |:transition ||320ms) ([] |:line-height ||32px) ([] |:white-space ||nowrap) ([] |:color $ [] |hsl |0 |0 |100 |0.5) ([] |:background-color $ [] |hsl |300 |30 |70 |0.2) ([] |:z-index |999) ([] |:min-width ||160px) ([] |:padding "||0 16px") ([] |:cursor ||pointer) ([] |:border-radius ||2px)
:procs $ []
|util.querystring $ {}
:ns $ [] |ns |app.util.querystring ([] |:require $ [] |[] |clojure.string |:as |string)
:defs $ {}
|parse-query $ [] |defn |parse-query ([] |search)
[] |if ([] |= |search ||) ([] |{})
[] |let
[] ([] |content $ [] |subs |search |1)
[] |pairs $ [] |map
[] |fn ([] |piece) ([] |string/split |piece ||=)
[] |string/split |content "||&"
[] |into ([] |{}) (, |pairs)
:procs $ []
|util.detect $ {}
:ns $ [] |ns |app.util.detect ([] |:require $ [] |[] |clojure.string |:as |string)
:defs $ {}
|fuzzy-search $ [] |defn |fuzzy-search ([] |pieces |queries)
[] |every?
[] |fn ([] |query)
[] |some
[] |fn ([] |piece)
[] |string/includes? ([] |str |piece) (, |query)
[] |if ([] |= |:defs $ [] |first |pieces) ([] |subvec |pieces |1) (, |pieces)
, |queries
|contains-def? $ [] |defn |contains-def? ([] |files |ns-part |name-part) ([] |println "||Contains def:" |ns-part |name-part)
[] |if ([] |contains? |files |ns-part)
[] |let
[] $ [] |dict ([] |get-in |files $ [] |[] |ns-part |:defs)
[] |contains? |dict |name-part
, |false
|cirru-vec? $ [] |defn |cirru-vec? ([] |x)
[] |if ([] |vector? |x)
[] |every?
[] |fn ([] |y)
[] |or ([] |string? |y) ([] |cirru-vec? |y)
, |x
, |false
|def-order $ [] |defn |def-order ([] |x |y)
[] |cond
[]
[] |and ([] |:circular? |x) ([] |not $ [] |:circular? |y)
, |-1
[]
[] |and ([] |:circular? |y) ([] |not $ [] |:circular? |x)
, |1
[]
[] |and ([] |:external? |x) ([] |not $ [] |:external? |y)
, |1
[]
[] |and ([] |:external? |y) ([] |not $ [] |:external? |x)
, |-1
[] |:else $ [] |compare
[] |str ([] |:ns |x) (, ||/) ([] |:def |x)
[] |str ([] |:ns |y) (, ||/) ([] |:def |y)
|use-vector? $ [] |defn |use-vector? ([] |xs) ([] |= ||[] $ [] |first |xs)
|=def? $ [] |defn |=def? ([] |x |y)
[] |and
[] |= ([] |:ns |x) ([] |:ns |y)
[] |= ([] |:def |x) ([] |:def |y)
|strip-atom $ [] |defn |strip-atom ([] |token)
[] |-> |token
[] |string/replace ([] |re-pattern ||^@) (, ||)
[] |string/replace ([] |re-pattern ||\.$) (, ||)
[] |string/replace ([] |re-pattern ||/@) (, ||/)
|=path? $ [] |defn |=path? ([] |x |y)
[] |and
[] |= ([] |:ns |x) ([] |:ns |y)
[] |= ([] |:kind |x) ([] |:kind |y)
[] |= ([] |:extra |x) ([] |:extra |y)
:procs $ []
|updater.modal $ {} (:ns $ [] |ns |app.updater.modal)
:defs $ {}
|mould $ [] |defn |mould ([] |store |op-data |op-id)
[] |let ([] $ [] |modal |op-data)
[] |update |store |:modal-stack $ [] |fn ([] |stack) ([] |conj |stack |modal)
|recycle $ [] |defn |recycle ([] |store |op-data |op-id)
[] |update |store |:modal-stack $ [] |fn ([] |stack)
[] |into ([] |[]) ([] |butlast |stack)
:procs $ []
|comp.hydrate $ {}
:ns $ [] |ns |app.comp.hydrate
[] |:require ([] |[] |hsl.core |:refer $ [] |[] |hsl) ([] |[] |respo.core |:refer $ [] |[] |defcomp |div |<> |>> |span |input |button |textarea) ([] |[] |respo.comp.space |:refer $ [] |[] |=<) ([] |[] |respo-ui.core |:as |ui) ([] |[] |app.style.widget |:as |widget) ([] |[] |cljs.reader |:refer $ [] |[] |read-string) ([] |[] |app.util.detect |:refer $ [] |[] |cirru-vec?)
:defs $ {}
|style-textarea $ [] |def |style-textarea
[] |{} ([] |:background-color $ [] |hsl |0 |0 |100 |0.2) ([] |:font-family "||Source Code Pro, Menlo") ([] |:color |:white) ([] |:resize |:none) ([] |:width |640) ([] |:height |200) ([] |:line-height ||24px)
|style-hint $ [] |def |style-hint ([] |{} $ [] |:font-family ||Hind)
|style-toolbar $ [] |def |style-toolbar ([] |{} $ [] |:justify-content |:flex-end)
|on-change $ [] |defn |on-change ([] |cursor)
[] |fn ([] |e |dispatch!)
[] |dispatch! |:states $ [] |[] |cursor ([] |:value |e)
|comp-hydrate $ [] |defcomp |comp-hydrate ([] |states)
[] |let
[] ([] |cursor $ [] |:cursor |states) ([] |state $ [] |:data |states)
[] |div ([] |{})
[] |div ([] |{} $ [] |:style |style-hint) ([] |<> |span "||EDN Cirru code to hydrate:" |nil)
[] |div ([] |{})
[] |textarea $ [] |{} ([] |:value |state) ([] |:style $ [] |merge |ui/textarea |style-textarea) ([] |:on-input $ [] |on-change |cursor)
[] |=< |nil |8
[] |div
[] |{} $ [] |:style ([] |merge |ui/row |style-toolbar)
[] |button
[] |{} ([] |:style |widget/button) ([] |:on-click $ [] |on-hydrate |state)
[] |<> |span ||Hydrate |nil
|on-hydrate $ [] |defn |on-hydrate ([] |text)
[] |fn ([] |e |dispatch!)
[] |let
[] $ [] |piece ([] |read-string |text)
[] |if ([] |cirru-vec? |piece)
[] |do ([] |dispatch! |:collection/hydrate |piece) ([] |dispatch! |:modal/recycle |nil)
[] |dispatch! |:notification/add-one $ [] |str "||Checking failed: " ([] |pr-str |text)
:procs $ []
|comp.file-tree $ {}
:ns $ [] |ns |app.comp.file-tree
[] |:require ([] |[] |hsl.core |:refer $ [] |[] |hsl) ([] |[] |respo.core |:refer $ [] |[] |defcomp |div |list-> |>> |<> |span |input |button) ([] |[] |respo-ui.core |:as |ui) ([] |[] |clojure.string |:as |string) ([] |[] |respo.comp.space |:refer $ [] |[] |=<) ([] |[] |app.comp.brief-file |:refer $ [] |[] |comp-brief-file) ([] |[] |app.style.widget |:as |widget) ([] |[] |app.util.keycode |:as |keycode)
:defs $ {}
|comp-file-tree $ [] |defcomp |comp-file-tree ([] |states |store)
[] |let
[] ([] |cursor $ [] |:cursor |states)
[] |state $ [] |or ([] |:data |states)
[] |{} ([] |:draft "|\"") ([] |:selected-ns |nil)
[] |files $ [] |get-in |store ([] |[] |:collection |:files)
[] |selected-ns $ [] |:selected-ns |state
[] |div
[] |{} $ [] |:style ([] |merge |ui/expand |ui/column |style-file-tree)
[] |div
[] |{} $ [] |:style ([] |merge |ui/row |style-body)
[] |div ([] |{} $ [] |:style |ui/column)
[] |input $ [] |{} ([] |:value $ [] |:draft |state) ([] |:placeholder "||ns/def or ns") ([] |:style |widget/input)
[] |:on-input $ [] |fn ([] |e |dispatch!)
[] |dispatch! |cursor $ [] |assoc |state |:draft ([] |:value |e)
[] |:on-keydown $ [] |on-keydown ([] |:draft |state) (, |cursor)
[] |list->
[] |{} $ [] |:style
[] |{} ([] |:overflow |:auto) ([] |:padding "|\"8px 0px 200px 0px")
[] |->> ([] |keys |files) ([] |sort)
[] |map $ [] |fn ([] |ns-name)
[] |[] |ns-name $ [] |div
[] |{}
[] |:on-click $ [] |fn ([] |e |d!) ([] |d! |cursor $ [] |assoc |state |:selected-ns |ns-name)
[] |:style $ [] |merge
[] |{} ([] |:color $ [] |hsl |0 |0 |50) ([] |:cursor |:pointer)
[] |if ([] |= |ns-name |selected-ns)
[] |{} $ [] |:color ([] |hsl |0 |0 |100)
[] |<> |ns-name
[] |=< |8 |nil
[] |if ([] |contains? |files |selected-ns)
[] |comp-brief-file ([] |>> |states |selected-ns) (, |selected-ns) ([] |get |files |selected-ns)
|style-body $ [] |def |style-body
[] |{} ([] |:flex |1) ([] |:overflow |:auto)
|style-file-tree $ [] |def |style-file-tree
[] |{} ([] |:background-color $ [] |hsl |0 |0 |0) ([] |:padding "|\"0 16px")
|on-keydown $ [] |defn |on-keydown ([] |draft |cursor)
[] |fn ([] |e |dispatch!)
[] |if
[] |= |keycode/key-enter $ [] |.-keyCode ([] |:original-event |e)
[] |do
[] |if ([] |string/includes? |draft ||/) ([] |dispatch! |:collection/add-definition $ [] |string/split |draft ||/) ([] |dispatch! |:collection/add-namespace |draft)
[] |dispatch! |cursor $ [] |{} ([] |:draft "|\"")
:procs $ []
|page $ {}
:ns $ [] |ns |app.page
[] |:require ([] |[] |respo.core |:refer $ [] |[] |create-element) ([] |[] |respo.core |:refer $ [] |[] |html |head |title |script |style |meta' |div |link |body) ([] |[] |respo.render.html |:refer $ [] |[] |make-string) ([] |[] |app.comp.container |:refer $ [] |[] |comp-container) ([] |[] |shell-page.core |:refer $ [] |[] |make-page |slurp |spit) ([] |[] |app.schema |:as |schema) ([] |[] |cljs.reader |:refer $ [] |[] |read-string)
:defs $ {}
|main! $ [] |defn |main! ([])
[] |if ([] |= |js/process.env.env ||dev) ([] |spit ||target/index.html $ [] |dev-page) ([] |spit ||dist/index.html $ [] |prod-page)
|base-info $ [] |def |base-info
[] |{} ([] |:title "||Stack Editor") ([] |:icon ||http://logo.cirru.org/cirru-400x400.png) ([] |:ssr |nil) ([] |:inilne-html ||) ([] |:styles $ [] |[] ||http://cdn.tiye.me/favored-fonts/main-fonts.css)
|prod-page $ [] |defn |prod-page ([])
[] |let
[]
[] |html-content $ [] |make-string ([] |comp-container |schema/store)
[] |assets $ [] |read-string ([] |slurp ||dist/assets.edn)
[] |make-page |html-content $ [] |merge |base-info
[] |{} $ [] |:scripts
[] |map
[] |fn ([] |x) ([] |:output-name |x)
, |assets
|dev-page $ [] |defn |dev-page ([])
[] |make-page || $ [] |merge |base-info
[] |{} $ [] |:scripts ([] |[] ||/client.js)
:procs $ []
|updater.collection $ {}
:ns $ [] |ns |app.updater.collection
[] |:require ([] |[] |clojure.string |:as |string) ([] |[] |app.util |:refer $ [] |[] |helper-notify |make-path |view-focused |make-focus-path) ([] |[] |app.util.detect |:refer $ [] |[] |=path?) ([] |app.util.stack |:refer $ [] |push-path)
:defs $ {}
|rename $ [] |defn |rename ([] |store |op-data |op-id)
[] |let
[]
[] ([] |[] |code-path |new-form) (, |op-data)
[]
[] |{} ([] |ns-part |:ns) ([] |kind |:kind) ([] |extra-name |:extra) ([] |focus |:focus)
, |code-path
[] |pointer $ [] |get-in |store ([] |[] |:writer |:pointer)
[] |case |kind
[] |:ns $ [] |-> |store
[] |update-in ([] |[] |:collection |:files)
[] |fn ([] |files)
[] |-> |files ([] |dissoc |ns-part) ([] |assoc |new-form $ [] |get |files |ns-part)
[] |assoc-in ([] |[] |:writer |:stack |pointer)
[] |{} ([] |:ns |new-form) ([] |:kind |:ns) ([] |:extra |nil) ([] |:focus |focus)
[] |:defs $ [] |let
[] $ [] ([] |[] |new-ns |new-name) ([] |string/split |new-form ||/)
[] |-> |store
[] |update-in ([] |[] |:collection |:files)
[] |fn ([] |files)
[] |if ([] |= |new-ns |ns-part)
[] |update-in |files ([] |[] |ns-part |:defs)
[] |fn ([] |dict)
[] |let
[] $ [] |def-code ([] |get |dict |extra-name)
[] |-> |dict ([] |dissoc |extra-name) ([] |assoc |new-name $ [] |assoc |def-code |1 |new-name)
[] |let
[] $ [] |def-code ([] |get-in |files $ [] |[] |ns-part |:defs |extra-name)
[] |-> |files
[] |update-in ([] |[] |ns-part |:defs)
[] |fn ([] |dict) ([] |dissoc |dict |extra-name)
[] |assoc-in ([] |[] |new-ns |:defs |new-name) ([] |assoc |def-code |1 |new-name)
[] |assoc-in ([] |[] |:writer |:stack |pointer)
[] |{} ([] |:ns |new-ns) ([] |:kind |:defs) ([] |:extra |new-name) ([] |:focus |focus)
[] |do ([] |println "||Cannot rename:" |code-path |new-form) (, |store)
|remove-this $ [] |defn |remove-this ([] |store |op-data |op-id)
[] |let
[] ([] |writer $ [] |:writer |store) ([] |stack $ [] |:stack |writer) ([] |pointer $ [] |:pointer |writer)
[]
[] |{} ([] |ns-part |:ns) ([] |kind |:kind) ([] |extra-name |:extra)
[] |get |stack |pointer
[] |-> |store
[] |update-in ([] |[] |:collection |:files)
[] |fn ([] |files)
[] |case |kind
[] |:defs $ [] |update-in |files ([] |[] |ns-part |:defs)
[] |fn ([] |defs) ([] |dissoc |defs |extra-name)
[] |:procs $ [] |assoc-in |files ([] |[] |ns-part |:procs) ([] |[])
[] |:ns $ [] |dissoc |files |ns-part
, |files
[] |update-in ([] |[] |:writer |:stack)
[] |fn ([] |stack)
[] |cond
[] ([] |empty? |stack) (, |stack)
[] ([] |zero? |pointer) ([] |subvec |stack |1)
[]
[] |= ([] |inc |pointer) ([] |count |stack)
[] |subvec |stack |0 $ [] |dec ([] |count |stack)
[] |:else $ [] |into ([] |[])
[] |concat ([] |subvec |stack |0 |pointer) ([] |subvec |stack $ [] |inc |pointer)
[] |update-in ([] |[] |:writer |:pointer)
[] |fn ([] |pointer)
[] |if ([] |pos? |pointer) ([] |dec |pointer) (, |pointer)
|write-code $ [] |defn |write-code ([] |store |op-data)
[] |let
[] ([] |tree $ [] |:tree |op-data) ([] |focus $ [] |:focus |op-data) ([] |writer $ [] |:writer |store) ([] |stack $ [] |:stack |writer) ([] |pointer $ [] |:pointer |writer) ([] |clipboard $ [] |:clipboard |op-data) ([] |path-info $ [] |get |stack |pointer)
[] |-> |store
[] |assoc-in ([] |[] |:writer |:stack |pointer |:focus) (, |focus)
[] |assoc-in ([] |[] |:writer |:clipboard) (, |clipboard)
[] |assoc-in ([] |make-path |path-info) (, |tree)
|hydrate $ [] |defn |hydrate ([] |store |op-data |op-id)
[] |let
[] ([] |writer $ [] |:writer |store) ([] |collection $ [] |:collection |store)
[] |code-path $ [] |get ([] |:stack |writer) ([] |:pointer |writer)
[] |println |code-path
[] |assoc-in |store
[] |concat ([] |make-path |code-path) ([] |:focus |code-path)
, |op-data
|edit $ [] |defn |edit ([] |store |op-data)
[] |let ([] $ [] |path |op-data)
[] |-> |store ([] |update |:writer $ [] |push-path |op-data)
[] |assoc |:router $ [] |{} ([] |:name |:workspace) ([] |:data |nil)
|add-definition $ [] |defn |add-definition ([] |store |op-data)
[] |let
[]
[] ([] |[] |that-ns |that-name) (, |op-data)
[] |path $ [] |[] |:collection |:files |that-ns |:defs |that-name
[] |maybe-definition $ [] |get-in |store |path
[] |if ([] |some? |maybe-definition) (, |store)
[] |assoc-in |store |path $ [] |[] ||defn |that-name ([] |[])
|edit-ns $ [] |defn |edit-ns ([] |store |op-data |op-id)
[] |let
[] ([] |writer $ [] |:writer |store) ([] |stack $ [] |:stack |writer) ([] |pointer $ [] |:pointer |writer) ([] |code-path $ [] |get |stack |pointer)
[] |pkg $ [] |get-in |store ([] |[] |:collection |:package)
[] |; |println "||Edit ns:" |code-path
[] |if
[] |= ([] |:kind |code-path) (, |:ns)
[] |let
[] ([] |guess-ns $ [] |view-focused |store)
[] |ns-name $ [] |if ([] |some? |guess-ns)
[] |string/replace |guess-ns ([] |str |pkg ||.) (, ||)
, |nil
[] |if
[] |and ([] |some? |ns-name)
[] |some? $ [] |get-in |store ([] |[] |:collection |:files |ns-name)
[] |update |store |:writer $ [] |push-path
[] |{} ([] |:ns |ns-name) ([] |:kind |:ns) ([] |:extra |nil) ([] |:focus $ [] |[])
[] |update |store |:notifications $ [] |fn ([] |notifications) ([] |helper-notify |op-id $ [] |str "||\"" |ns-name "||\" not found")
[] |update |store |:writer $ [] |push-path
[] |{} ([] |:ns $ [] |:ns |code-path) ([] |:kind |:ns) ([] |:extra |nil) ([] |:focus $ [] |[])
|load-remote $ [] |defn |load-remote ([] |store |op-data)
[] |let ([] $ [] |collection |op-data) ([] |; |println ||loading: |collection)
[] |-> |store $ [] |update |:collection
[] |fn ([] |cursor) ([] |merge |cursor |collection)
|add-namespace $ [] |defn |add-namespace ([] |store |op-data)
[] |let
[] ([] |namespace' |op-data)
[] |basic-code $ [] |[] ||ns
[] |str ([] |get-in |store $ [] |[] |:collection |:package) (, ||. |namespace')
[] |-> |store $ [] |assoc-in ([] |[] |:collection |:files |namespace')
[] |{} ([] |:ns |basic-code) ([] |:defs $ [] |{}) ([] |:procs $ [] |[])
|remove-file $ [] |defn |remove-file ([] |store |op-data |op-id)
[] |update-in |store ([] |[] |:collection |:files)
[] |fn ([] |files) ([] |dissoc |files |op-data)
:procs $ []
|util.stack $ {}
:ns $ [] |ns |app.util.stack
[] |:require $ [] |[] |app.util.detect |:refer ([] |[] |=path?)
:defs $ {}
|push-paths $ [] |defn |push-paths ([] |new-paths)
[] |fn ([] |writer)
[] |if ([] |empty? |new-paths) (, |writer)
[] |let
[] ([] |stack $ [] |:stack |writer) ([] |pointer $ [] |:pointer |writer)
[] |if
[] |and ([] |= |1 $ [] |count |new-paths)
[] |>= ([] |path-index-of |stack $ [] |first |new-paths) (, |0)
[] |do
[] |println ||hit $ [] |path-index-of |stack ([] |first |new-paths)
[] |assoc |writer |:pointer $ [] |path-index-of |stack ([] |first |new-paths)
[] |cond
[] ([] |empty? |stack)
[] |{}
[] |:stack $ [] |into ([] |[]) (, |new-paths)
[] |:pointer |0
[] |:focus $ [] |:focus ([] |first |new-paths)
[]
[] |= ([] |inc |pointer) ([] |count |stack)
[] |-> |writer
[] |assoc |:stack $ [] |into ([] |[]) ([] |concat |stack |new-paths)
[] |update |:pointer |inc
[] |assoc |:focus $ [] |:focus ([] |first |new-paths)
[] |:else $ [] |-> |writer
[] |assoc |:stack $ [] |into ([] |[])
[] |concat ([] |subvec |stack |0 $ [] |inc |pointer) (, |new-paths) ([] |subvec |stack $ [] |inc |pointer)
[] |update |:pointer |inc
[] |assoc |:focus $ [] |:focus ([] |first |new-paths)
|push-path $ [] |defn |push-path ([] |x) ([] |push-paths $ [] |[] |x)
|get-path $ [] |defn |get-path ([] |store)
[] |let
[] ([] |writer $ [] |:writer |store)
[] ([] |{} |stack |:stack |pointer |:pointer) (, |writer)
[] |get |stack |pointer
|path-index-of $ [] |defn$ |path-index-of
[] ([] |xs |y) ([] |path-index-of |xs |y |0)
[] ([] |xs |y |idx)
[] |if ([] |empty? |xs) (, |-1)
[] |if ([] |=path? |y $ [] |first |xs) (, |idx)
[] |recur ([] |rest |xs) (, |y) ([] |inc |idx)
:procs $ []
|comp.hot-corner $ {}
:ns $ [] |ns |app.comp.hot-corner
[] |:require ([] |[] |hsl.core |:refer $ [] |[] |hsl) ([] |[] |respo.core |:refer $ [] |[] |defcomp |<> |div |span) ([] |[] |respo.comp.space |:refer $ [] |[] |=<) ([] |[] |respo-ui.core |:as |ui)
:defs $ {}
:procs $ []
|actions $ {}
:ns $ [] |ns |app.actions
[] |:require ([] |[] |cljs.reader |:refer $ [] |[] |read-string) ([] |[] |ajax.core |:refer $ [] |[] |GET |POST |PATCH |json-request-format) ([] |[] |app.util |:refer $ [] |[] |make-path) ([] |[] |app.util.querystring |:refer $ [] |[] |parse-query) ([] |[] |shallow-diff.diff |:refer $ [] |[] |diff)
:defs $ {}
|load-collection! $ [] |defn |load-collection! ([] |dispatch! |file-tree?) ([] |println $ [] |pr-str |options)
[] |GET
[] |str ||http:// ([] |get |options ||host) (, ||:) ([] |get |options ||port)
[] |{}
[] |:handler $ [] |fn ([] |response)
[] |let
[] $ [] |sepal-data ([] |read-string |response)
[] |if ([] |not $ [] |contains? |sepal-data |:package) ([] |js/alert "||Cannot find a :package field")
[] |dispatch! |:collection/load |sepal-data
[] |if |file-tree? $ [] |do
[] |dispatch! |:router/route $ [] |{} ([] |:name |:file-tree) ([] |:data |nil)
[] |; |dispatch! |:graph/load-graph |nil
[] |reset! |*remote-sepal |sepal-data
[] |:error-handler $ [] |fn ([] |error) ([] |println |error) ([] |dispatch! |:notification/add-one "||Failed to fetch collection")
|submit-changes! $ [] |defn |submit-changes! ([] |collection |dispatch!)
[] |PATCH
[] |str ||http:// ([] |get |options ||host) (, ||:) ([] |get |options ||port)
[] |{} ([] |:format $ [] |json-request-format)
[] |:body $ [] |pr-str ([] |diff |@*remote-sepal |collection)
[] |:handler $ [] |fn ([] |response) ([] |println |response) ([] |dispatch! |:notification/add-one ||Patched) ([] |reset! |*remote-sepal |collection)
[] |:error-handler $ [] |fn ([] |error) ([] |println |error)
[] |if ([] |zero? $ [] |:status |error) ([] |dispatch! |:notification/add-one "||Connection failed!")
[] |let
[] $ [] |response ([] |read-string $ [] |:response |error)
[] |dispatch! |:notification/add-one $ [] |:status |response
|*remote-sepal $ [] |defonce |*remote-sepal ([] |atom |nil)
|options $ [] |def |options
[] |merge
[] |{} ([] ||port ||7010) ([] ||host ||localhost)
[] |parse-query $ [] |.-search |js/location
|submit-collection! $ [] |defn |submit-collection! ([] |collection |dispatch!)
[] |POST
[] |str ||http:// ([] |get |options ||host) (, ||:) ([] |get |options ||port)
[] |{} ([] |:format $ [] |json-request-format) ([] |:body $ [] |pr-str |collection)
[] |:handler $ [] |fn ([] |response) ([] |println |response) ([] |dispatch! |:notification/add-one ||Saved) ([] |reset! |*remote-sepal |collection)
[] |:error-handler $ [] |fn ([] |error) ([] |println |error)
[] |if ([] |zero? $ [] |:status |error) ([] |dispatch! |:notification/add-one "||Connection failed!")
[] |let
[] $ [] |response ([] |read-string $ [] |:response |error)
[] |dispatch! |:notification/add-one $ [] |:status |response
|display-code! $ [] |defn |display-code! ([] |store)
[] |let
[] ([] |writer $ [] |:writer |store) ([] |collection $ [] |:collection |store)
[] |path-info $ [] |get ([] |:stack |writer) ([] |:pointer |writer)
[] |tree $ [] |get-in |store ([] |make-path |path-info)
[] |if ([] |some? |tree)
[] |-> |js/window ([] |.open) ([] |.-document)
[] |.write ||<pre><code> ([] |pr-str |tree) (, ||</code></pre>)
:procs $ []
|style.widget $ {}
:ns $ [] |ns |app.style.widget
[] |:require ([] |[] |hsl.core |:refer $ [] |[] |hsl) ([] |[] |respo-ui.core |:as |ui)
:defs $ {}
|entry-line $ [] |def |entry-line
[] |merge |var-entry $ [] |{} ([] |:display ||block)
|clickable-text $ [] |def |clickable-text
[] |{} ([] |:text-decoration |:underline) ([] |:cursor |:pointer) ([] |:color $ [] |hsl |0 |0 |80) ([] |:font-family "||Josefin Sans")
|input $ [] |def |input
[] |merge |ui/input $ [] |{} ([] |:background-color $ [] |hsl |0 |0 |100 |0.14) ([] |:color $ [] |hsl |0 |0 |100) ([] |:font-family "||Source Code Pro,Menlo,monospace") ([] |:width ||200px) ([] |:border |:none)
|var-entry $ [] |def |var-entry
[] |{} ([] |:color $ [] |hsl |0 |0 |80) ([] |:cursor ||pointer) ([] |:font-family "||Source Code Pro,Menlo,monospace") ([] |:font-size ||14px) ([] |:line-height ||24px) ([] |:min-width ||160px)
|entry $ [] |def |entry
[] |{} ([] |:display ||inline-block) ([] |:background-color $ [] |hsl |200 |10 |40 |0) ([] |:color $ [] |hsl |0 |0 |100) ([] |:padding "||0 8px") ([] |:cursor ||pointer) ([] |:margin-bottom ||8px)
|button $ [] |def |button
[] |merge |ui/button $ [] |{} ([] |:background-color $ [] |hsl |0 |0 |100 |0.2) ([] |:color $ [] |hsl |0 |0 |100 |0.6) ([] |:height |28) ([] |:line-height ||28px) ([] |:border |:none)
:procs $ []
| Cirru | 4 | Cirru/stack-editor | stack.cirru | [
"MIT"
] |
-module(escript_test).
-export([start/0, main/1]).
start() ->
ok = application:start(escript_test).
main(Args) ->
io:format("~p", [Args]).
| Erlang | 4 | doughsay/elixir | lib/mix/test/fixtures/escript_test/src/escript_test.erl | [
"Apache-2.0"
] |
// Package mqtt provides tools for working with Message Queuing Telemetry Transport (MQTT) protocol.
//
// introduced: 0.40.0
// tags: mqtt
//
package mqtt
// to outputs data from a stream of tables to an MQTT broker using MQTT protocol.
//
// ## Parameters
// - broker: MQTT broker connection string.
// - topic: MQTT topic to send data to.
// - qos: MQTT Quality of Service (QoS) level. Values range from `[0-2]`. Default is `0`.
// - retain: MQTT retain flag. Default is `false`.
// - clientid: MQTT client ID.
// - username: Username to send to the MQTT broker.
//
// Username is only required if the broker requires authentication.
// If you provide a username, you must provide a password.
//
// - password: Password to send to the MQTT broker.
// Password is only required if the broker requires authentication.
// If you provide a password, you must provide a username.
//
// - name: Name for the MQTT message.
// - timeout: MQTT connection timeout. Default is `1s`.
// - timeColumn: Column to use as time values in the output line protocol.
// Default is `"_time"`.
// - tagColumns: Columns to use as tag sets in the output line protocol.
// Default is `[]`.
// - valueColumns: Columns to use as field values in the output line protocol.
// Default is `["_value"]`.
// - tables: Input data. Default is piped-forward data (`<-`).
//
// ## Examples
// ### Send data to an MQTT broker
// ```no_run
// import "experimental/mqtt"
// import "sampledata"
//
// sampledata.float()
// |> mqtt.to(
// broker: "tcp://localhost:8883",
// topic: "example-topic",
// clientid: r.id,
// tagColumns: ["id"],
// valueColumns: ["_value"],
// )
// ```
//
// tags: mqtt,outputs
//
builtin to : (
<-tables: [A],
broker: string,
?topic: string,
?qos: int,
?retain: bool,
?clientid: string,
?username: string,
?password: string,
?name: string,
?timeout: duration,
?timeColumn: string,
?tagColumns: [string],
?valueColumns: [string],
) => [B]
where
A: Record,
B: Record
// publish sends data to an MQTT broker using MQTT protocol.
//
// ## Parameters
// - broker: MQTT broker connection string.
// - topic: MQTT topic to send data to.
// - message: Message to send to the MQTT broker.
// - qos: MQTT Quality of Service (QoS) level. Values range from `[0-2]`.
// Default is `0`.
// - retain: MQTT retain flag. Default is `false`.
// - clientid: MQTT client ID.
// - username: Username to send to the MQTT broker.
//
// Username is only required if the broker requires authentication.
// If you provide a username, you must provide a password.
//
// - password: Password to send to the MQTT broker.
//
// Password is only required if the broker requires authentication.
// If you provide a password, you must provide a username.
//
// - timeout: MQTT connection timeout. Default is `1s`.
//
// ## Examples
// ### Send a message to an MQTT endpoint
// ```no_run
// import "experimental/mqtt"
//
// mqtt.publish(
// broker: "tcp://localhost:8883",
// topic: "alerts",
// message: "wake up",
// clientid: "alert-watcher",
// retain: true,
// )
// ```
//
// ### Send a message to an MQTT endpoint using input data
// ```no_run
// import "experimental/mqtt"
// import "sampledata"
//
// sampledata.float()
// |> map(fn: (r) => ({r with sent: mqtt.publish(broker: "tcp://localhost:8883", topic: "sampledata/${r.id}", message: string(v: r._value), clientid: "sensor-12a4")}))
// ```
//
// introduced: 0.133.0
// tags: mqtt
//
builtin publish : (
broker: string,
topic: string,
message: string,
?qos: int,
?retain: bool,
?clientid: string,
?username: string,
?password: string,
?timeout: duration,
) => bool
| FLUX | 5 | geropl/flux | stdlib/experimental/mqtt/mqtt.flux | [
"MIT"
] |
/*
* Copyright 2010-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.kotlin.resolve.jvm.checkers
import com.intellij.psi.PsiElement
import org.jetbrains.kotlin.descriptors.ClassDescriptor
import org.jetbrains.kotlin.descriptors.DescriptorVisibilities
import org.jetbrains.kotlin.resolve.DescriptorUtils
import org.jetbrains.kotlin.resolve.annotations.hasJvmStaticAnnotation
import org.jetbrains.kotlin.resolve.calls.checkers.CallChecker
import org.jetbrains.kotlin.resolve.calls.checkers.CallCheckerContext
import org.jetbrains.kotlin.resolve.calls.model.ResolvedCall
import org.jetbrains.kotlin.resolve.descriptorUtil.parentsWithSelf
import org.jetbrains.kotlin.resolve.jvm.diagnostics.ErrorsJvm
class ProtectedInSuperClassCompanionCallChecker : CallChecker {
override fun check(resolvedCall: ResolvedCall<*>, reportOn: PsiElement, context: CallCheckerContext) {
val targetDescriptor = resolvedCall.resultingDescriptor.original
// Protected non-JVM static
if (targetDescriptor.visibility != DescriptorVisibilities.PROTECTED) return
if (targetDescriptor.hasJvmStaticAnnotation()) return
val containerDescriptor = targetDescriptor.containingDeclaration
// Declared in companion object
if (containerDescriptor is ClassDescriptor && containerDescriptor.isCompanionObject) {
val companionDescriptor = containerDescriptor
val companionOwnerDescriptor = companionDescriptor.containingDeclaration as? ClassDescriptor ?: return
val parentClassDescriptors = context.scope.ownerDescriptor.parentsWithSelf.filterIsInstance<ClassDescriptor>()
// Called from within a derived class
if (!parentClassDescriptors.any { DescriptorUtils.isSubclass(it, companionOwnerDescriptor) }) return
// Called not within the same companion object or its owner class
if (companionDescriptor !in parentClassDescriptors && companionOwnerDescriptor !in parentClassDescriptors) {
context.trace.report(ErrorsJvm.SUBCLASS_CANT_CALL_COMPANION_PROTECTED_NON_STATIC.on(reportOn))
}
}
}
}
| Kotlin | 5 | Mu-L/kotlin | compiler/frontend.java/src/org/jetbrains/kotlin/resolve/jvm/checkers/ProtectedInSuperClassCompanionCallChecker.kt | [
"ECL-2.0",
"Apache-2.0"
] |
; CLW file contains information for the MFC ClassWizard
[General Info]
Version=1
ClassCount=16
ResourceCount=0
NewFileInclude1=#include "stdafx.h"
Class1=CRecordUsers
LastClass=CRecordServers
LastTemplate=CRecordset
Class2=CRecordUserData
Class3=CRecordIgnores
Class4=CRecordFriends
Class5=CRecordGames
Class6=CRecordServers
Class7=CRecordSessions
Class8=CRecordClans
Class9=CRecordClanMembers
Class10=CRecordClanData
Class11=CRecordBanned
Class12=CRecordUserStatus
Class13=CRecordMessages
Class14=CRecordRooms
Class15=CRecordChat
Class16=CRecordRoomMembers
[CLS:CRecordUsers]
Type=0
HeaderFile=RecordUsers.h
ImplementationFile=RecordUsers.cpp
BaseClass=CRecordset
Filter=N
VirtualFilter=r
LastObject=CRecordUsers
[DB:CRecordUsers]
DB=1
DBType=ODBC
ColumnCount=26
Column1=[user_id], 4, 4
Column2=[username], 12, 40
Column3=[user_regdate], 12, 20
Column4=[user_password], 12, 32
Column5=[user_email], 12, 50
Column6=[user_icq], 12, 15
Column7=[user_website], 12, 100
Column8=[user_occ], 12, 100
Column9=[user_from], 12, 100
Column10=[user_intrest], 12, 150
Column11=[user_sig], 12, 255
Column12=[user_viewemail], -6, 1
Column13=[user_theme], 4, 4
Column14=[user_aim], 12, 18
Column15=[user_yim], 12, 25
Column16=[user_msnm], 12, 25
Column17=[user_posts], 4, 4
Column18=[user_attachsig], 4, 4
Column19=[user_desmile], 4, 4
Column20=[user_html], 4, 4
Column21=[user_bbcode], 4, 4
Column22=[user_rank], 4, 4
Column23=[user_level], 4, 4
Column24=[user_lang], 12, 255
Column25=[user_actkey], 12, 32
Column26=[user_newpasswd], 12, 32
[CLS:CRecordUserData]
Type=0
HeaderFile=RecordUserData.h
ImplementationFile=RecordUserData.cpp
BaseClass=CRecordset
Filter=N
VirtualFilter=r
LastObject=CRecordUserData
[DB:CRecordUserData]
DB=1
DBType=ODBC
ColumnCount=12
Column1=[data_id], 4, 4
Column2=[user_id], 4, 4
Column3=[release], -6, 1
Column4=[beta], -6, 1
Column5=[demo], -6, 1
Column6=[moderator], -6, 1
Column7=[server], -6, 1
Column8=[admin], -6, 1
Column9=[data], -4, 65535
Column10=[score], 7, 4
Column11=[rank], 12, 50
Column12=[game_id], 4, 4
[CLS:CRecordIgnores]
Type=0
HeaderFile=RecordIgnores.h
ImplementationFile=RecordIgnores.cpp
BaseClass=CRecordset
Filter=N
VirtualFilter=r
[DB:CRecordIgnores]
DB=1
DBType=ODBC
ColumnCount=3
Column1=[key_id], 4, 4
Column2=[user_id], 4, 4
Column3=[ignore_id], 4, 4
[CLS:CRecordFriends]
Type=0
HeaderFile=RecordFriends.h
ImplementationFile=RecordFriends.cpp
BaseClass=CRecordset
Filter=N
VirtualFilter=r
[DB:CRecordFriends]
DB=1
DBType=ODBC
ColumnCount=3
Column1=[key_id], 4, 4
Column2=[user_id], 4, 4
Column3=[friend_id], 4, 4
[CLS:CRecordGames]
Type=0
HeaderFile=RecordGames.h
ImplementationFile=RecordGames.cpp
BaseClass=CRecordset
Filter=N
VirtualFilter=r
LastObject=CRecordGames
[DB:CRecordGames]
DB=1
DBType=ODBC
ColumnCount=8
Column1=[game_id], 4, 4
Column2=[name], 12, 50
Column3=[home_url], 12, 50
Column4=[download_url], 12, 50
Column5=[registry], 12, 50
Column6=[address], 12, 50
Column7=[port], 4, 4
Column8=[valid], -6, 1
[CLS:CRecordServers]
Type=0
HeaderFile=RecordServers.h
ImplementationFile=RecordServers.cpp
BaseClass=CRecordset
Filter=N
VirtualFilter=r
LastObject=CRecordServers
[DB:CRecordServers]
DB=1
DBType=ODBC
ColumnCount=11
Column1=[server_id], 4, 4
Column2=[type], 4, 4
Column3=[flags], 4, 4
Column4=[name], 12, 50
Column5=[description], -1, 65535
Column6=[address], 12, 50
Column7=[port], 4, 4
Column8=[max_clients], 4, 4
Column9=[clients], 4, 4
Column10=[last_updated], 4, 4
Column11=[game_id], 4, 4
[CLS:CRecordSessions]
Type=0
HeaderFile=RecordSessions.h
ImplementationFile=RecordSessions.cpp
BaseClass=CRecordset
Filter=N
VirtualFilter=r
LastObject=CRecordSessions
[DB:CRecordSessions]
DB=1
DBType=ODBC
ColumnCount=4
Column1=[sess_id], 4, 4
Column2=[user_id], 4, 4
Column3=[start_time], 4, 4
Column4=[remote_ip], 12, 15
[DB:CRecordClan]
DB=1
DBType=ODBC
ColumnCount=6
Column1=[clan_id], 4, 4
Column2=[name], 12, 50
Column3=[logo], 12, 50
Column4=[motto], 12, 50
Column5=[home], 12, 50
Column6=[closed], -6, 1
[DB:CRecordClanMembers]
DB=1
DBType=ODBC
ColumnCount=5
Column1=[key_id], 4, 4
Column2=[user_id], 4, 4
Column3=[is_valid], -6, 1
Column4=[is_admin], -6, 1
Column5=[clan_id], 4, 4
[CLS:CRecordClans]
Type=0
HeaderFile=RecordClans.h
ImplementationFile=RecordClans.cpp
BaseClass=CRecordset
Filter=N
VirtualFilter=r
LastObject=CRecordClans
[DB:CRecordClans]
DB=1
DBType=ODBC
ColumnCount=6
Column1=[clan_id], 4, 4
Column2=[name], 12, 50
Column3=[motto], 12, 50
Column4=[home], 12, 50
Column5=[closed], -6, 1
Column6=[approved], -6, 1
[CLS:CRecordClanMembers]
Type=0
HeaderFile=RecordClanMembers.h
ImplementationFile=RecordClanMembers.cpp
BaseClass=CRecordset
Filter=N
VirtualFilter=r
LastObject=CRecordClanMembers
[CLS:CRecordClanData]
Type=0
HeaderFile=RecordClanData.h
ImplementationFile=RecordClanData.cpp
BaseClass=CRecordset
Filter=N
VirtualFilter=r
[DB:CRecordClanData]
DB=1
DBType=ODBC
ColumnCount=5
Column1=[data_id], 4, 4
Column2=[game_id], 4, 4
Column3=[data], -4, 65535
Column4=[score], 7, 4
Column5=[clan_id], 4, 4
[CLS:CRecordBanned]
Type=0
HeaderFile=RecordBanned.h
ImplementationFile=RecordBanned.cpp
BaseClass=CRecordset
Filter=N
VirtualFilter=r
LastObject=CRecordBanned
[DB:CRecordBanned]
DB=1
DBType=ODBC
ColumnCount=6
Column1=[ban_id], 4, 4
Column2=[ban_userid], 4, 4
Column3=[ban_ip], 12, 16
Column4=[ban_start], 4, 4
Column5=[ban_end], 4, 4
Column6=[ban_time_type], 4, 4
[CLS:CRecordUserStatus]
Type=0
HeaderFile=RecordUserStatus.h
ImplementationFile=RecordUserStatus.cpp
BaseClass=CRecordset
Filter=N
VirtualFilter=r
LastObject=CRecordUserStatus
[DB:CRecordUserStatus]
DB=1
DBType=ODBC
ColumnCount=4
Column1=[status_id], 4, 4
Column2=[status], -1, 65535
Column3=[updated], 4, 4
Column4=[user_id], 4, 4
[CLS:CRecordMessages]
Type=0
HeaderFile=RecordMessages.h
ImplementationFile=RecordMessages.cpp
BaseClass=CRecordset
Filter=N
VirtualFilter=r
LastObject=CRecordMessages
[DB:CRecordMessages]
DB=1
DBType=ODBC
ColumnCount=7
Column1=[msg_id], 4, 4
Column2=[from_userid], 4, 4
Column3=[to_userid], 4, 4
Column4=[msg_time], 12, 20
Column5=[poster_ip], 12, 16
Column6=[msg_status], 4, 4
Column7=[msg_text], -1, 65535
[CLS:CRecordRooms]
Type=0
HeaderFile=RecordRooms.h
ImplementationFile=RecordRooms.cpp
BaseClass=CRecordset
Filter=N
VirtualFilter=r
[DB:CRecordRooms]
DB=1
DBType=ODBC
ColumnCount=6
Column1=[room_id], 4, 4
Column2=[name], 12, 50
Column3=[is_static], -6, 1
Column4=[is_moderated], -6, 1
Column5=[is_private], -6, 1
Column6=[game_id], 4, 4
[CLS:CRecordChat]
Type=0
HeaderFile=RecordChat.h
ImplementationFile=RecordChat.cpp
BaseClass=CRecordset
Filter=N
VirtualFilter=r
LastObject=CRecordChat
[DB:CRecordChat]
DB=1
DBType=ODBC
ColumnCount=7
Column1=[message_id], 4, 4
Column2=[author], 12, 50
Column3=[author_id], 4, 4
Column4=[time], 4, 4
Column5=[text], -4, 65535
Column6=[recp_id], 4, 4
Column7=[room_id], 4, 4
[CLS:CRecordRoomMembers]
Type=0
HeaderFile=RecordRoomMembers.h
ImplementationFile=RecordRoomMembers.cpp
BaseClass=CRecordset
Filter=N
VirtualFilter=r
LastObject=CRecordRoomMembers
[DB:CRecordRoomMembers]
DB=1
DBType=ODBC
ColumnCount=3
Column1=[member_id], 4, 4
Column2=[user_id], 4, 4
Column3=[room_id], 4, 4
| Clarion | 2 | CarysT/medusa | GCQ/GCQ.clw | [
"MIT"
] |
# Copyright (c) 2022 Fyde Innovations Limited and the openFyde Authors.
# Distributed under the license specified in the root directory of this project.
# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
# Distributed under the terms of the GNU General Public License v2
EAPI="5"
CROS_WORKON_PROJECT="chromiumos/platform2"
CROS_WORKON_LOCALNAME="platform2"
CROS_WORKON_INCREMENTAL_BUILD=1
CROS_WORKON_OUTOFTREE_BUILD=1
CROS_WORKON_SUBTREE="common-mk installer .gn"
PLATFORM_SUBDIR="installer"
inherit cros-workon platform systemd
DESCRIPTION="Chrome OS Installer"
HOMEPAGE="https://chromium.googlesource.com/chromiumos/platform2/+/master/installer/"
SRC_URI=""
LICENSE="BSD-Google"
SLOT="0"
KEYWORDS="~*"
IUSE="cros_embedded cros_host enable_slow_boot_notify -mtd pam systemd test +oobe_config"
COMMON_DEPEND="
chromeos-base/libbrillo:=
chromeos-base/vboot_reference
"
DEPEND="${COMMON_DEPEND}
chromeos-base/verity
dev-libs/openssl:0=
"
RDEPEND="${COMMON_DEPEND}
pam? ( app-admin/sudo )
chromeos-base/chromeos-common-script
!cros_host? (
!cros_embedded? ( chromeos-base/chromeos-storage-info )
oobe_config? ( chromeos-base/oobe_config )
dev-libs/openssl:0=
)
dev-util/shflags
sys-apps/rootdev
sys-apps/util-linux
sys-apps/which
sys-fs/e2fsprogs"
platform_pkg_test() {
platform_test "run" "${OUT}/cros_installer_test"
}
src_install() {
if use cros_host ; then
dosbin chromeos-install
else
dobin "${OUT}"/{cros_installer,cros_oobe_crypto}
if use mtd ; then
dobin "${OUT}"/nand_partition
fi
dosbin chromeos-* encrypted_import "${OUT}"/evwaitkey
dosym usr/sbin/chromeos-postinst /postinst
# Install init scripts.
if use systemd; then
systemd_dounit init/install-completed.service
systemd_enable_service boot-services.target install-completed.service
systemd_dounit init/crx-import.service
systemd_enable_service system-services.target crx-import.service
else
insinto /etc/init
doins init/*.conf
fi
exeinto /usr/share/cros/init
doexe init/crx-import.sh
fi
}
| Gentoo Ebuild | 3 | FydeOS/chromium_os_for_raspberry_pi | project-cros-pi/chromeos-base/chromeos-installer/chromeos-installer-9999.ebuild | [
"BSD-2-Clause"
] |
CREATE TABLE public.author (
id integer NOT NULL,
name text NOT NULL
);
CREATE SEQUENCE public.author_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER SEQUENCE public.author_id_seq OWNED BY public.author.id;
ALTER TABLE ONLY public.author ALTER COLUMN id SET DEFAULT nextval('public.author_id_seq'::regclass);
ALTER TABLE ONLY public.author
ADD CONSTRAINT author_pkey PRIMARY KEY (id);
| SQL | 4 | gh-oss-contributor/graphql-engine-1 | community/sample-apps/gatsby-postgres-graphql/hasura/migrations/default/1613663714522_init/up.sql | [
"Apache-2.0",
"MIT"
] |
30 5 2 0
0 1 18 25 6 16 12 1 4 9 8 29 23 3 10 13 18 22 2 26 19 [0 0] [0 0] [0 0] [0 0] [0 0] [0 0] [0 0] [0 0] [0 0] [0 0] [0 0] [0 0] [0 0] [0 0] [0 0] [0 0] [0 0] [0 0]
1 2 3 12 11 31 [24 22 -2 -4] [-7 5 13 18] [8 6]
2 2 2 8 27 [3 3 11 -5] [2 0 5 16]
3 2 3 12 31 9 [1 -1 6 -4] [2 6] [-1 1 6 10]
4 2 5 22 31 30 20 15 [14 -4 22 21] [8 8] [-1 14 13 8] [13 24 -5 11] [-254 -172 -241 -146]
5 2 3 31 4 6 [9 5] [7 19 11 -4] [-4 22 4 14]
6 2 3 20 2 31 [5 8 12 16] [-123 -253 -161 -220] [5 10]
7 2 2 31 14 [3 3] [3 8 0 9]
8 2 2 12 10 [2 6 5 11] [4 -1 12 11]
9 2 2 26 21 [-1 5 10 11] [5 6 6 10]
10 2 3 31 16 30 [3 9] [5 9 -6 27] [4 7 3 25]
11 2 2 9 15 [-292 -199 -176 -257] [1 5 1 2]
12 2 6 6 30 26 29 28 1 [14 0 -2 0] [16 10 0 0] [-4 13 5 2] [17 1 1 5] [11 15 3 4] [-262 -293 -227 -186]
13 2 4 29 6 28 31 [5 17 1 -1] [0 14 19 -7] [2 3 16 18] [9 8]
14 2 2 11 31 [3 -4 21 6] [6 7]
15 2 4 11 10 5 31 [-275 -125 -126 -89] [9 -5 0 6] [1 16 -2 -1] [7 3]
16 2 2 19 31 [0 1 -1 24] [1 9]
17 2 4 4 31 18 12 [-136 -198 -249 -283] [6 5] [8 -2 13 14] [-281 -155 -239 -122]
18 2 2 31 23 [2 6] [-1 0 4 6]
19 2 1 13 [10 1 0 3]
20 2 3 24 2 31 [0 0 5 18] [-111 -174 -132 -161] [1 6]
21 2 2 31 7 [2 10] [4 1 25 5]
22 2 6 28 29 27 31 3 25 [4 -1 1 -4] [12 20 12 0] [4 25 17 6] [9 6] [-127 -124 -298 -235] [0 19 13 7]
23 2 2 31 25 [1 8] [0 0 6 24]
24 2 2 17 31 [13 0 6 4] [8 6]
25 2 1 31 [7 3]
26 2 1 31 [7 2]
27 2 1 31 [9 4]
28 2 1 31 [9 2]
29 2 1 31 [9 8]
30 2 1 31 [5 5]
31 1 0
0 1 0 0 0 0 0 0 0 0
1 1 8 4 5 5 3 5 5 2
2 6 4 5 5 3 5 5 2
2 1 1 5 3 2 4 4 3 3
2 6 5 3 2 4 4 3 3
3 1 2 1 1 5 2 4 3 1
2 6 1 1 5 2 4 3 1
4 1 8 5 3 3 1 1 3 5
2 8 5 3 3 1 1 3 5
5 1 9 1 3 2 3 5 4 4
2 5 1 3 2 3 5 4 4
6 1 5 4 5 3 2 1 2 2
2 10 4 5 3 2 1 2 2
7 1 3 5 2 1 2 3 1 5
2 3 5 2 1 2 3 1 5
8 1 3 4 4 4 4 2 1 2
2 7 4 4 4 4 2 1 2
9 1 3 3 5 1 5 3 4 5
2 5 3 5 1 5 3 4 5
10 1 3 3 1 5 3 3 4 4
2 9 3 1 5 3 3 4 4
11 1 2 3 2 3 3 3 4 2
2 1 3 2 3 3 3 4 2
12 1 7 1 3 3 3 4 5 1
2 3 1 3 3 3 4 5 1
13 1 9 2 4 1 3 1 3 1
2 8 2 4 1 3 1 3 1
14 1 6 4 2 1 1 4 4 5
2 7 4 2 1 1 4 4 5
15 1 7 5 1 4 1 2 5 2
2 3 5 1 4 1 2 5 2
16 1 1 1 5 3 1 3 4 2
2 9 1 5 3 1 3 4 2
17 1 6 3 2 2 5 4 2 5
2 5 3 2 2 5 4 2 5
18 1 2 5 4 2 1 5 3 1
2 6 5 4 2 1 5 3 1
19 1 7 3 3 5 2 1 2 5
2 2 3 3 5 2 1 2 5
20 1 1 3 3 3 2 5 1 3
2 6 3 3 3 2 5 1 3
21 1 2 3 1 5 1 3 4 5
2 10 3 1 5 1 3 4 5
22 1 9 5 2 4 3 3 5 5
2 6 5 2 4 3 3 5 5
23 1 1 5 3 3 5 4 1 3
2 8 5 3 3 5 4 1 3
24 1 8 2 1 5 1 1 5 1
2 6 2 1 5 1 1 5 1
25 1 7 2 3 4 2 2 1 2
2 3 2 3 4 2 2 1 2
26 1 7 2 3 4 5 3 2 3
2 2 2 3 4 5 3 2 3
27 1 9 2 2 3 5 1 1 4
2 4 2 2 3 5 1 1 4
28 1 9 1 5 2 4 5 1 3
2 2 1 5 2 4 5 1 3
29 1 9 2 2 4 3 1 5 2
2 8 2 2 4 3 1 5 2
30 1 5 3 4 3 4 2 2 2
2 5 3 4 3 4 2 2 2
31 1 0 0 0 0 0 0 0 0
5 5 5 5 5 90 180
| Eagle | 1 | klorel/or-tools | examples/data/rcpsp/multi_mode_max_delay/mm_j30/psp64.sch | [
"Apache-2.0"
] |
{:duct.server.http/immutant
{:virtual-host "tfb-server"
:host "0.0.0.0"}} | edn | 3 | xsoheilalizadeh/FrameworkBenchmarks | frameworks/Clojure/duct/resources/hello/server-immutant.edn | [
"BSD-3-Clause"
] |
public class Subdir2.Test : GLib.Object {
construct {
stdout.printf("Test from Subdir2/\n");
}
}
| Vala | 3 | kira78/meson | test cases/vala/22 same target in directories/Subdir2/Test.vala | [
"Apache-2.0"
] |
? my $ctx = $main::context;
? $_mt->wrapper_file("wrapper.mt", "Configure", "Using CGI")->(sub {
<p>
Starting from version 1.7, H2O comes with a FastCGI-to-CGI gateway (<code>fastcgi-cgi</code>), which can be found under <code>share/h2o</code> directory of the installation path.
The gateway can be used for running CGI scripts through the FastCGI handler.
</p>
<p>
The example below maps <code>.cgi</code> files to be executed by the gateway.
It is also possible to run CGI scripts under different privileges by specifying the <code>user</code> attribute of the directive.
</p>
<?= $ctx->{example}->('Execute <code>.cgi</code> files using FastCGI-to-CGI gateway', <<'EOT');
file.custom-handler:
extension: .cgi
fastcgi.spawn:
command: "exec $H2O_ROOT/share/h2o/fastcgi-cgi"
EOT
?>
The gateway also provides options to for tuning the behavior.
A full list of options can be obtained by running the gateway directly with <code>--help</code> option.
<?= $ctx->{example}->('Output of <code>share/h2o/fastcgi-cgi --help</code>', <<'EOT');
$ share/h2o/fastcgi-cgi --help
Usage:
share/h2o/fastcgi-cgi [options]
Options:
--listen=sockfn path to the UNIX socket. If specified, the program will
create a UNIX socket at given path replacing the existing
file (should it exist). If not, file descriptor zero (0)
will be used as the UNIX socket for accepting new
connections.
--max-workers=nnn maximum number of CGI processes (default: unlimited)
--pass-authz if set, preserves HTTP_AUTHORIZATION parameter
--verbose verbose mode
EOT
?>
? })
| Mathematica | 4 | Nitrillo/h2o | srcdoc/configure/cgi.mt | [
"MIT"
] |
.CodeMirror-fullscreen {
position: fixed;
top: 0; left: 0; right: 0; bottom: 0;
height: auto;
z-index: 9;
}
| CSS | 2 | scala-steward/rdfshape | modules/server/src/main/resources/static/codemirror-5.24.2/addon/display/fullscreen.css | [
"MIT"
] |
(assert (str.<= "abc" "abc"))
(check-sat)
| SMT | 3 | mauguignard/cbmc | regression/smt2_strings/reflexive_lex_order_const_sat/reflexive_lex_order_const_sat2.smt2 | [
"BSD-4-Clause"
] |
-- Copyright 2021 Jeff Foley. All rights reserved.
-- Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
local json = require("json")
name = "Crtsh"
type = "cert"
function start()
set_rate_limit(3)
end
function vertical(ctx, domain)
local vurl = "https://crt.sh/?q=" .. domain .. "&output=json"
local resp, err = request(ctx, {['url']=vurl})
if (err ~= nil and err ~= "") then
log(ctx, "vertical request to service failed: " .. err)
return
end
resp = "{\"subdomains\":" .. resp .. "}"
local d = json.decode(resp)
if (d == nil or d.subdomains == nil or #(d.subdomains) == 0) then
return
end
for _, r in pairs(d.subdomains) do
if (r['common_name'] ~= nil and r['common_name'] ~= "") then
new_name(ctx, r['common_name'])
end
for _, n in pairs(split(r['name_value'], "\\n")) do
if (n ~= nil and n ~= "") then
new_name(ctx, n)
end
end
end
end
function split(str, delim)
local pattern = "[^%" .. delim .. "]+"
local matches = find(str, pattern)
if (matches == nil or #matches == 0) then
return {str}
end
local result = {}
for _, match in pairs(matches) do
table.insert(result, match)
end
return result
end
| Ada | 4 | Elon143/Amass | resources/scripts/cert/crtsh.ads | [
"Apache-2.0"
] |
import module namespace bin = "http://basex.org/bin-tree" at "binary-tree.xqm";
declare function local:randomize($seq) {
for $x in $seq
order by random:double()
return $x
};
let $seq := local:randomize(1 to 1000)
return bin:serialize(
fold-left(
$seq,
bin:empty(),
function($tree, $x) { bin:insert($x, $tree) }
)
)
| XQuery | 4 | JensErat/basex | basex-examples/src/main/resources/xq/higher-order/binary-tree.xq | [
"BSD-3-Clause"
] |
frequency,raw
20.00,-6.46
20.20,-6.40
20.40,-6.34
20.61,-6.28
20.81,-6.22
21.02,-6.17
21.23,-6.16
21.44,-6.16
21.66,-6.15
21.87,-6.14
22.09,-6.11
22.31,-6.04
22.54,-5.98
22.76,-5.91
22.99,-5.84
23.22,-5.76
23.45,-5.67
23.69,-5.58
23.92,-5.49
24.16,-5.42
24.40,-5.36
24.65,-5.30
24.89,-5.24
25.14,-5.22
25.39,-5.22
25.65,-5.22
25.91,-5.22
26.16,-5.19
26.43,-5.13
26.69,-5.08
26.96,-5.03
27.23,-4.92
27.50,-4.80
27.77,-4.69
28.05,-4.58
28.33,-4.54
28.62,-4.50
28.90,-4.46
29.19,-4.43
29.48,-4.40
29.78,-4.36
30.08,-4.33
30.38,-4.28
30.68,-4.24
30.99,-4.19
31.30,-4.13
31.61,-4.06
31.93,-4.00
32.24,-4.01
32.57,-4.04
32.89,-4.08
33.22,-4.01
33.55,-3.90
33.89,-3.79
34.23,-3.73
34.57,-3.69
34.92,-3.66
35.27,-3.67
35.62,-3.71
35.97,-3.74
36.33,-3.64
36.70,-3.54
37.06,-3.45
37.43,-3.46
37.81,-3.47
38.19,-3.41
38.57,-3.29
38.95,-3.16
39.34,-3.15
39.74,-3.15
40.14,-3.14
40.54,-3.10
40.94,-3.06
41.35,-3.01
41.76,-2.97
42.18,-2.94
42.60,-2.94
43.03,-2.94
43.46,-2.92
43.90,-2.90
44.33,-2.84
44.78,-2.76
45.23,-2.72
45.68,-2.73
46.13,-2.74
46.60,-2.74
47.06,-2.73
47.53,-2.69
48.01,-2.64
48.49,-2.59
48.97,-2.54
49.46,-2.50
49.96,-2.45
50.46,-2.45
50.96,-2.44
51.47,-2.46
51.99,-2.48
52.51,-2.44
53.03,-2.39
53.56,-2.30
54.10,-2.22
54.64,-2.23
55.18,-2.24
55.74,-2.24
56.29,-2.26
56.86,-2.31
57.42,-2.24
58.00,-2.14
58.58,-2.05
59.16,-2.00
59.76,-2.02
60.35,-2.06
60.96,-2.12
61.57,-2.02
62.18,-1.94
62.80,-1.94
63.43,-1.94
64.07,-1.94
64.71,-1.94
65.35,-1.94
66.01,-1.94
66.67,-1.98
67.33,-1.93
68.01,-1.79
68.69,-1.72
69.37,-1.71
70.07,-1.74
70.77,-1.74
71.48,-1.74
72.19,-1.74
72.91,-1.74
73.64,-1.77
74.38,-1.77
75.12,-1.75
75.87,-1.66
76.63,-1.64
77.40,-1.64
78.17,-1.64
78.95,-1.64
79.74,-1.53
80.54,-1.48
81.35,-1.50
82.16,-1.54
82.98,-1.57
83.81,-1.58
84.65,-1.49
85.50,-1.44
86.35,-1.44
87.22,-1.44
88.09,-1.43
88.97,-1.43
89.86,-1.43
90.76,-1.43
91.66,-1.43
92.58,-1.43
93.51,-1.43
94.44,-1.43
95.39,-1.44
96.34,-1.46
97.30,-1.45
98.28,-1.37
99.26,-1.36
100.25,-1.38
101.25,-1.36
102.27,-1.28
103.29,-1.31
104.32,-1.34
105.37,-1.36
106.42,-1.39
107.48,-1.41
108.56,-1.44
109.64,-1.46
110.74,-1.48
111.85,-1.50
112.97,-1.51
114.10,-1.51
115.24,-1.51
116.39,-1.51
117.55,-1.52
118.73,-1.53
119.92,-1.50
121.12,-1.39
122.33,-1.38
123.55,-1.37
124.79,-1.36
126.03,-1.36
127.29,-1.35
128.57,-1.34
129.85,-1.34
131.15,-1.33
132.46,-1.33
133.79,-1.32
135.12,-1.32
136.48,-1.32
137.84,-1.32
139.22,-1.31
140.61,-1.31
142.02,-1.31
143.44,-1.31
144.87,-1.31
146.32,-1.31
147.78,-1.31
149.26,-1.31
150.75,-1.31
152.26,-1.31
153.78,-1.31
155.32,-1.31
156.88,-1.31
158.44,-1.31
160.03,-1.31
161.63,-1.31
163.24,-1.31
164.88,-1.32
166.53,-1.32
168.19,-1.33
169.87,-1.33
171.57,-1.34
173.29,-1.35
175.02,-1.35
176.77,-1.36
178.54,-1.36
180.32,-1.35
182.13,-1.35
183.95,-1.34
185.79,-1.32
187.65,-1.31
189.52,-1.29
191.42,-1.28
193.33,-1.27
195.27,-1.25
197.22,-1.24
199.19,-1.23
201.18,-1.22
203.19,-1.22
205.23,-1.21
207.28,-1.21
209.35,-1.22
211.44,-1.22
213.56,-1.22
215.69,-1.23
217.85,-1.23
220.03,-1.23
222.23,-1.23
224.45,-1.24
226.70,-1.23
228.96,-1.23
231.25,-1.22
233.57,-1.21
235.90,-1.20
238.26,-1.19
240.64,-1.17
243.05,-1.16
245.48,-1.14
247.93,-1.10
250.41,-1.08
252.92,-1.12
255.45,-1.15
258.00,-1.15
260.58,-1.15
263.19,-1.15
265.82,-1.15
268.48,-1.15
271.16,-1.15
273.87,-1.16
276.61,-1.16
279.38,-1.16
282.17,-1.16
284.99,-1.15
287.84,-1.14
290.72,-1.13
293.63,-1.12
296.57,-1.11
299.53,-1.09
302.53,-1.08
305.55,-1.07
308.61,-1.13
311.69,-1.16
314.81,-1.15
317.96,-1.15
321.14,-1.15
324.35,-1.15
327.59,-1.15
330.87,-1.15
334.18,-1.16
337.52,-1.16
340.90,-1.16
344.30,-1.18
347.75,-1.24
351.23,-1.26
354.74,-1.26
358.28,-1.25
361.87,-1.25
365.49,-1.24
369.14,-1.23
372.83,-1.22
376.56,-1.22
380.33,-1.24
384.13,-1.29
387.97,-1.36
391.85,-1.39
395.77,-1.39
399.73,-1.40
403.72,-1.40
407.76,-1.40
411.84,-1.40
415.96,-1.41
420.12,-1.46
424.32,-1.49
428.56,-1.49
432.85,-1.48
437.18,-1.45
441.55,-1.41
445.96,-1.37
450.42,-1.32
454.93,-1.26
459.48,-1.20
464.07,-1.17
468.71,-1.16
473.40,-1.12
478.13,-1.07
482.91,-1.02
487.74,-0.98
492.62,-0.94
497.55,-0.91
502.52,-0.89
507.55,-0.87
512.62,-0.85
517.75,-0.85
522.93,-0.85
528.16,-0.87
533.44,-0.95
538.77,-1.00
544.16,-1.04
549.60,-1.09
555.10,-1.14
560.65,-1.19
566.25,-1.24
571.92,-1.28
577.64,-1.40
583.41,-1.44
589.25,-1.46
595.14,-1.47
601.09,-1.47
607.10,-1.46
613.17,-1.45
619.30,-1.43
625.50,-1.44
631.75,-1.46
638.07,-1.44
644.45,-1.41
650.89,-1.36
657.40,-1.32
663.98,-1.26
670.62,-1.21
677.32,-1.16
684.10,-1.12
690.94,-1.08
697.85,-1.04
704.83,-1.03
711.87,-1.02
718.99,-1.03
726.18,-1.04
733.44,-1.06
740.78,-1.01
748.19,-1.02
755.67,-1.05
763.23,-1.08
770.86,-1.02
778.57,-1.01
786.35,-1.01
794.22,-1.01
802.16,-1.01
810.18,-0.92
818.28,-0.82
826.46,-0.80
834.73,-0.79
843.08,-0.76
851.51,-0.71
860.02,-0.70
868.62,-0.68
877.31,-0.55
886.08,-0.52
894.94,-0.53
903.89,-0.54
912.93,-0.46
922.06,-0.45
931.28,-0.38
940.59,-0.35
950.00,-0.35
959.50,-0.22
969.09,-0.14
978.78,-0.12
988.57,-0.11
998.46,-0.02
1008.44,0.10
1018.53,0.15
1028.71,0.17
1039.00,0.20
1049.39,0.23
1059.88,0.27
1070.48,0.40
1081.19,0.46
1092.00,0.52
1102.92,0.58
1113.95,0.64
1125.09,0.70
1136.34,0.77
1147.70,0.85
1159.18,0.94
1170.77,0.97
1182.48,1.01
1194.30,1.05
1206.25,1.14
1218.31,1.25
1230.49,1.25
1242.80,1.33
1255.22,1.41
1267.78,1.42
1280.45,1.47
1293.26,1.51
1306.19,1.57
1319.25,1.66
1332.45,1.73
1345.77,1.76
1359.23,1.83
1372.82,1.85
1386.55,1.89
1400.41,1.97
1414.42,1.99
1428.56,1.94
1442.85,1.98
1457.28,2.08
1471.85,2.11
1486.57,2.12
1501.43,2.19
1516.45,2.21
1531.61,2.18
1546.93,2.23
1562.40,2.29
1578.02,2.36
1593.80,2.39
1609.74,2.40
1625.84,2.45
1642.10,2.51
1658.52,2.57
1675.10,2.57
1691.85,2.61
1708.77,2.61
1725.86,2.67
1743.12,2.68
1760.55,2.68
1778.15,2.67
1795.94,2.76
1813.90,2.80
1832.03,2.81
1850.36,2.81
1868.86,2.80
1887.55,2.86
1906.42,2.94
1925.49,2.99
1944.74,2.99
1964.19,3.01
1983.83,3.02
2003.67,2.97
2023.71,2.94
2043.94,2.98
2064.38,3.01
2085.03,3.04
2105.88,3.08
2126.94,3.09
2148.20,3.13
2169.69,3.23
2191.38,3.29
2213.30,3.31
2235.43,3.32
2257.78,3.33
2280.36,3.35
2303.17,3.38
2326.20,3.35
2349.46,3.38
2372.95,3.44
2396.68,3.41
2420.65,3.43
2444.86,3.46
2469.31,3.33
2494.00,3.26
2518.94,3.27
2544.13,3.32
2569.57,3.35
2595.27,3.40
2621.22,3.45
2647.43,3.52
2673.90,3.58
2700.64,3.59
2727.65,3.61
2754.93,3.66
2782.48,3.69
2810.30,3.63
2838.40,3.52
2866.79,3.43
2895.46,3.36
2924.41,3.30
2953.65,3.19
2983.19,3.11
3013.02,3.09
3043.15,3.12
3073.58,3.15
3104.32,3.15
3135.36,3.17
3166.72,3.20
3198.38,3.23
3230.37,3.26
3262.67,3.23
3295.30,3.22
3328.25,3.19
3361.53,3.20
3395.15,3.25
3429.10,3.33
3463.39,3.41
3498.03,3.44
3533.01,3.49
3568.34,3.56
3604.02,3.55
3640.06,3.55
3676.46,3.54
3713.22,3.45
3750.36,3.26
3787.86,3.08
3825.74,2.91
3864.00,2.74
3902.64,2.58
3941.66,2.48
3981.08,2.45
4020.89,2.39
4061.10,2.21
4101.71,2.01
4142.73,1.76
4184.15,1.50
4226.00,1.21
4268.26,0.85
4310.94,0.55
4354.05,0.23
4397.59,-0.15
4441.56,-0.45
4485.98,-0.74
4530.84,-1.14
4576.15,-1.46
4621.91,-1.78
4668.13,-2.20
4714.81,-2.55
4761.96,-2.87
4809.58,-3.32
4857.67,-3.78
4906.25,-4.18
4955.31,-4.58
5004.87,-5.01
5054.91,-5.41
5105.46,-5.78
5156.52,-6.20
5208.08,-6.59
5260.16,-6.85
5312.77,-7.18
5365.89,-7.54
5419.55,-7.78
5473.75,-8.00
5528.49,-8.31
5583.77,-8.59
5639.61,-8.85
5696.00,-9.15
5752.96,-9.41
5810.49,-9.70
5868.60,-10.05
5927.28,-10.34
5986.56,-10.52
6046.42,-10.74
6106.89,-10.98
6167.96,-11.20
6229.64,-11.43
6291.93,-11.63
6354.85,-11.83
6418.40,-12.01
6482.58,-12.14
6547.41,-12.29
6612.88,-12.53
6679.01,-12.72
6745.80,-12.79
6813.26,-12.84
6881.39,-12.83
6950.21,-12.77
7019.71,-12.60
7089.91,-12.46
7160.81,-12.33
7232.41,-12.19
7304.74,-12.11
7377.79,-12.05
7451.56,-11.97
7526.08,-11.84
7601.34,-11.70
7677.35,-11.69
7754.13,-11.78
7831.67,-11.61
7909.98,-11.20
7989.08,-10.64
8068.98,-10.05
8149.67,-9.56
8231.16,-8.92
8313.47,-8.26
8396.61,-7.70
8480.57,-7.39
8565.38,-7.21
8651.03,-7.36
8737.54,-8.23
8824.92,-8.71
8913.17,-8.59
9002.30,-8.45
9092.32,-8.16
9183.25,-8.00
9275.08,-7.80
9367.83,-8.04
9461.51,-8.29
9556.12,-8.23
9651.68,-8.47
9748.20,-9.01
9845.68,-9.32
9944.14,-9.59
10043.58,-9.80
10144.02,-9.55
10245.46,-9.34
10347.91,-9.00
10451.39,-8.62
10555.91,-8.29
10661.46,-7.82
10768.08,-7.49
10875.76,-7.31
10984.52,-7.17
11094.36,-7.26
11205.31,-7.17
11317.36,-7.32
11430.53,-7.62
11544.84,-7.07
11660.29,-6.39
11776.89,-6.72
11894.66,-9.61
12013.60,-14.44
12133.74,-17.29
12255.08,-20.55
12377.63,-24.55
12501.41,-27.31
12626.42,-30.22
12752.68,-32.61
12880.21,-33.75
13009.01,-33.63
13139.10,-33.14
13270.49,-32.87
13403.20,-32.71
13537.23,-32.12
13672.60,-31.58
13809.33,-31.21
13947.42,-30.34
14086.90,-29.58
14227.77,-29.07
14370.04,-28.37
14513.74,-27.69
14658.88,-27.21
14805.47,-26.77
14953.52,-26.17
15103.06,-25.97
15254.09,-25.69
15406.63,-25.26
15560.70,-25.29
15716.30,-25.05
15873.47,-24.38
16032.20,-23.52
16192.52,-22.61
16354.45,-21.65
16517.99,-20.67
16683.17,-20.03
16850.01,-20.09
17018.51,-20.38
17188.69,-20.66
17360.58,-20.89
17534.18,-21.22
17709.53,-21.84
17886.62,-22.37
18065.49,-22.72
18246.14,-23.01
18428.60,-23.29
18612.89,-23.35
18799.02,-23.35
18987.01,-22.99
19176.88,-22.84
19368.65,-23.02
19562.33,-23.24
19757.96,-23.37
19955.54,-23.61
| CSV | 1 | vinzmc/AutoEq | measurements/innerfidelity/data/inear/Westone UM1/Westone UM1.csv | [
"MIT"
] |
=pod
=head1 NAME
OSSL_ENCODER_to_data,
OSSL_ENCODER_to_bio,
OSSL_ENCODER_to_fp
- Routines to perform an encoding
=head1 SYNOPSIS
#include <openssl/encoder.h>
int OSSL_ENCODER_to_data(OSSL_ENCODER_CTX *ctx, unsigned char **pdata,
size_t *pdata_len);
int OSSL_ENCODER_to_bio(OSSL_ENCODER_CTX *ctx, BIO *out);
int OSSL_ENCODER_to_fp(OSSL_ENCODER_CTX *ctx, FILE *fp);
Feature availability macros:
=over 4
=item OSSL_ENCODER_to_fp() is only available when B<OPENSSL_NO_STDIO>
is undefined.
=back
=head1 DESCRIPTION
OSSL_ENCODER_to_data() runs the encoding process for the context I<ctx>,
with the output going to the I<*pdata> and I<*pdata_len>.
If I<*pdata> is NULL when OSSL_ENCODER_to_data() is called, a buffer will be
allocated using L<OPENSSL_zalloc(3)>, and I<*pdata> will be set to point at
the start of that buffer, and I<*pdata_len> will be assigned its length when
OSSL_ENCODER_to_data() returns.
If I<*pdata> is non-NULL when OSSL_ENCODER_to_data() is called, I<*pdata_len>
is assumed to have its size. In this case, I<*pdata> will be set to point
after the encoded bytes, and I<*pdata_len> will be assigned the number of
remaining bytes.
OSSL_ENCODER_to_bio() runs the encoding process for the context I<ctx>, with
the output going to the B<BIO> I<out>.
OSSL_ENCODER_to_fp() does the same thing as OSSL_ENCODER_to_bio(), except
that the output is going to the B<FILE> I<fp>.
=for comment Know your encoder!
For OSSL_ENCODER_to_bio() and OSSL_ENCODER_to_fp(), the application is
required to set up the B<BIO> or B<FILE> properly, for example to have
it in text or binary mode as is appropriate for the encoder output type.
=head1 RETURN VALUES
OSSL_ENCODER_to_bio(), OSSL_ENCODER_to_fp() and OSSL_ENCODER_to_data()
return 1 on success, or 0 on failure.
=head1 EXAMPLES
To encode a pkey as PKCS#8 with PEM format into a bio:
OSSL_ENCODER_CTX *ectx;
const char *format = "PEM";
const char *structure = "PrivateKeyInfo"; /* PKCS#8 structure */
const unsigned char *pass = "my password";
ectx = OSSL_ENCODER_CTX_new_for_pkey(pkey,
OSSL_KEYMGMT_SELECT_KEYPAIR
| OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS,
format, structure,
NULL);
if (ectx == NULL) {
/* error: no suitable potential encoders found */
}
if (pass != NULL)
OSSL_ENCODER_CTX_set_passphrase(ectx, pass, strlen(pass));
if (OSSL_ENCODER_to_bio(ectx, bio)) {
/* pkey was successfully encoded into the bio */
} else {
/* encoding failure */
}
OSSL_ENCODER_CTX_free(ectx);
To encode a pkey as PKCS#8 with DER format encrypted with
AES-256-CBC into a buffer:
OSSL_ENCODER_CTX *ectx;
const char *format = "DER";
const char *structure = "PrivateKeyInfo"; /* PKCS#8 structure */
const unsigned char *pass = "my password";
unsigned char *data = NULL;
size_t datalen;
ectx = OSSL_ENCODER_CTX_new_for_pkey(pkey,
OSSL_KEYMGMT_SELECT_KEYPAIR
| OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS,
format, structure,
NULL);
if (ectx == NULL) {
/* error: no suitable potential encoders found */
}
if (pass != NULL) {
OSSL_ENCODER_CTX_set_passphrase(ectx, pass, strlen(pass));
OSSL_ENCODER_CTX_set_cipher(ctx, "AES-256-CBC", NULL);
}
if (OSSL_ENCODER_to_data(ectx, &data, &datalen)) {
/*
* pkey was successfully encoded into a newly allocated
* data buffer
*/
} else {
/* encoding failure */
}
OSSL_ENCODER_CTX_free(ectx);
=head1 SEE ALSO
L<provider(7)>, L<OSSL_ENCODER_CTX(3)>
=head1 HISTORY
The functions described here were added in OpenSSL 3.0.
=head1 COPYRIGHT
Copyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved.
Licensed under the Apache License 2.0 (the "License"). You may not use
this file except in compliance with the License. You can obtain a copy
in the file LICENSE in the source distribution or at
L<https://www.openssl.org/source/license.html>.
=cut
| Pod | 5 | pmesnier/openssl | doc/man3/OSSL_ENCODER_to_bio.pod | [
"Apache-2.0"
] |
h1. Element 'inview' Event Plugin
Event that is fired as soon as an element appears in the user's viewport.
*Author:* "Christopher Blum":http://twitter.com/ChristopherBlum
*Original idea and concept by:* "Remy Sharp":http://remysharp.com/2009/01/26/element-in-view-event-plugin/
*Forked from:* "https://github.com/zuk/jquery.inview/":https://github.com/zuk/jquery.inview/
*Demo* (loading lolcats when they scroll into view): "http://tifftiff.de/jquery.inview/example/live_event.html":http://tifftiff.de/jquery.inview/example/live_event.html
*Requires:* jQuery 1.4+
h2. Usage
The script makes use of the new $.contains method - so it will only work with jQuery 1.4 upwards. If you need to use it with older versions of jQuery, drop a comment, and I'll post an alternative.
The event will only fire when the element comes in to view of the viewport, and out of view. It won't keep firing if the user scrolls and the element remains in view.
The variable after the event argument indicates the visible state in the viewport.
The third variable visiblePartX detects which horizontal part of the element is visible to the user (possible values: left, right, both)
The fourth variable visiblePartY detects which vertical part of the element is visible to the user (possible values: top, bottom, both)
bc.. $('div').bind('inview', function(event, isInView, visiblePartX, visiblePartY) {
if (isInView) {
// element is now visible in the viewport
if (visiblePartY == 'top') {
// top part of element is visible
} else if (visiblePartY == 'bottom') {
// bottom part of element is visible
} else {
// whole part of element is visible
}
} else {
// element has gone out of viewport
}
});
p. To stop listening for the event - simply unbind:
bc.. $('div').unbind('inview');
p. Remember you can also bind once:
bc.. $('div').one('inview', fn);
h2. Live events
Yep, inview events can also be used with .live/.delegate methods.
_Please note that this could slow down your app when the selector is too complex and/or matches a huge set of elements._
The following code snippet only loads images when they appear in the browser's viewport.
bc.. // Assuming that all images have set the 'data-src' attribute instead of the 'src'attribute
$("img[data-src]").live("inview", function() {
var $this = $(this);
$this.attr("src", $this.attr("data-src"));
// Remove it from the set of matching elements in order to avoid that the handler gets re-executed
$this.removeAttr("data-src");
});
h2. More complex example
This way we can attach inview to some DIV in our code to, for example, detect when it FULLY readed by user (user sees it's bottom and top) and only after 1 seconds of view, so after we call some out stats function or whatever
bc.. $(someMyOneDiv).bind('inview', function(e, isInView, visiblePartX, visiblePartY) {
var elem = $(this);
if (elem.data('inviewtimer')) {
clearTimeout(elem.data('inviewtimer'));
elem.removeData('inviewtimer');
}
if (isInView) {
elem.data('inviewtimer', setTimeout(function() {
if (visiblePartY == 'top') {
elem.data('seenTop', true);
} else if (visiblePartY == 'bottom') {
elem.data('seenBottom', true);
} else {
elem.data('seenTop', true);
elem.data('seenBottom', true);
}
if (elem.data('seenTop') && elem.data('seenBottom')) {
elem.unbind('inview');
// here we will do WHAT WHE NEED (for ex. Call Ajax stats collector)
...
}
}, 1000));
}
});
h2. How it works
An interval in the background checks the position of the elements against the viewport dimensions and the scroll position.
However, I wanted to create a utility that would only check the elements that were registered under the 'inview' event, i.e. I didn't want to keep checking the element list if we unbind from the event.
This is achieved by dipping in to the $.cache store within jQuery, and looping through, looking for the elements tied to the 'inview' event.
This way the user can treat it like a native event on the page.
h2. Use cases
* Reduce http requests and traffic on server by loading assets (images, javascript, html, ...) only when they are visible to the user
* Endless scrolling (twitter-like)
* Tracking (eg. to see whether a user has read an entire article)
* ...
h2. Browser Compatibility
h4. The Test Suite succeeds in the following browsers that were tested:
* Firefox 3+
* Safari 3+
* Chrome 7+
* Opera 10+
* IE 6+
* Mobile Safari on iPad 4.2.2
* Fennec 4b on Android 2.2
* Opera Mobile 10.1b on Android 2.2
h4. The Test Suite doesn't completely succeed but the demos in this repository work without problems in the following browsers:
* Mobile WebKit on Android 2.2
* Mobile WebKit on Palm Pre 1 | Textile | 4 | sreekanth1990/djangoproject.com | djangoproject/static/js/lib/jquery.inview/README.textile | [
"BSD-3-Clause"
] |
{ \tempo 4 = 120 c,,,, } | LilyPond | 1 | kindaro/music-suite | test/regression/lilypond/data-lilypond-tempo-change-bpm-generated.ly | [
"BSD-3-Clause"
] |
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=ISO-8859-1\n"
"Content-Transfer-Encoding: 8bit\n"
#: gettext_basic.phpt:11
msgid "Basic test"
msgstr "Perustesti"
| Gettext Catalog | 2 | donsbot/hhvm | hphp/test/zend/good/ext/gettext/tests/locale/fi/LC_MESSAGES/messages.po | [
"PHP-3.01",
"Zend-2.0"
] |
# This file is distributed under the same license as the Django package.
#
# Translators:
# András Veres-Szentkirályi, 2016
# Attila Nagy <>, 2012
# Istvan Farkas <[email protected]>, 2019
# Jannis Leidel <[email protected]>, 2011
msgid ""
msgstr ""
"Project-Id-Version: django\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-09-08 17:27+0200\n"
"PO-Revision-Date: 2019-11-18 09:29+0000\n"
"Last-Translator: Istvan Farkas <[email protected]>\n"
"Language-Team: Hungarian (http://www.transifex.com/django/django/language/"
"hu/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: hu\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
msgid "Content Types"
msgstr "Tartalom típusok"
msgid "python model class name"
msgstr "python modell osztály neve"
msgid "content type"
msgstr "tartalom típusa"
msgid "content types"
msgstr "tartalom típusok"
#, python-format
msgid "Content type %(ct_id)s object has no associated model"
msgstr "A %(ct_id)s tartalomtípus-objektumhoz nincsenek modellek hozzárendelve"
#, python-format
msgid "Content type %(ct_id)s object %(obj_id)s doesn’t exist"
msgstr "A(z) %(ct_id)s típusú %(obj_id)s objektum nem létezik"
#, python-format
msgid "%(ct_name)s objects don’t have a get_absolute_url() method"
msgstr ""
"%(ct_name)s objektumok esetén nincs beállítva a get_absolute_url() metódus."
| Gettext Catalog | 2 | jpmallarino/django | django/contrib/contenttypes/locale/hu/LC_MESSAGES/django.po | [
"BSD-3-Clause",
"0BSD"
] |
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
#include "src/sha.c"
#include "src/hmac.c"
static int ix2alg[] =
{1,1,1,224,224,224,256,256,256,384,384,384,512,512,512};
MODULE = Digest::SHA PACKAGE = Digest::SHA
PROTOTYPES: ENABLE
#include "src/sha.h"
#include "src/hmac.h"
#ifndef INT2PTR
#define INT2PTR(p, i) (p) (i)
#endif
int
shaclose(s)
SHA * s
int
shadump(file, s)
char * file
SHA * s
SHA *
shadup(s)
SHA * s
SHA *
shaload(file)
char * file
SHA *
shaopen(alg)
int alg
void
sharewind(s)
SHA * s
unsigned long
shawrite(bitstr, bitcnt, s)
unsigned char * bitstr
unsigned long bitcnt
SHA * s
void
sha1(...)
ALIAS:
Digest::SHA::sha1 = 0
Digest::SHA::sha1_hex = 1
Digest::SHA::sha1_base64 = 2
Digest::SHA::sha224 = 3
Digest::SHA::sha224_hex = 4
Digest::SHA::sha224_base64 = 5
Digest::SHA::sha256 = 6
Digest::SHA::sha256_hex = 7
Digest::SHA::sha256_base64 = 8
Digest::SHA::sha384 = 9
Digest::SHA::sha384_hex = 10
Digest::SHA::sha384_base64 = 11
Digest::SHA::sha512 = 12
Digest::SHA::sha512_hex = 13
Digest::SHA::sha512_base64 = 14
PREINIT:
int i;
unsigned char *data;
STRLEN len;
SHA *state;
char *result;
PPCODE:
if ((state = shaopen(ix2alg[ix])) == NULL)
XSRETURN_UNDEF;
for (i = 0; i < items; i++) {
data = (unsigned char *) (SvPV(ST(i), len));
shawrite(data, len << 3, state);
}
shafinish(state);
len = 0;
if (ix % 3 == 0) {
result = (char *) shadigest(state);
len = shadsize(state);
}
else if (ix % 3 == 1)
result = shahex(state);
else
result = shabase64(state);
ST(0) = sv_2mortal(newSVpv(result, len));
shaclose(state);
XSRETURN(1);
void
hmac_sha1(...)
ALIAS:
Digest::SHA::hmac_sha1 = 0
Digest::SHA::hmac_sha1_hex = 1
Digest::SHA::hmac_sha1_base64 = 2
Digest::SHA::hmac_sha224 = 3
Digest::SHA::hmac_sha224_hex = 4
Digest::SHA::hmac_sha224_base64 = 5
Digest::SHA::hmac_sha256 = 6
Digest::SHA::hmac_sha256_hex = 7
Digest::SHA::hmac_sha256_base64 = 8
Digest::SHA::hmac_sha384 = 9
Digest::SHA::hmac_sha384_hex = 10
Digest::SHA::hmac_sha384_base64 = 11
Digest::SHA::hmac_sha512 = 12
Digest::SHA::hmac_sha512_hex = 13
Digest::SHA::hmac_sha512_base64 = 14
PREINIT:
int i;
unsigned char *key;
unsigned char *data;
STRLEN len;
HMAC *state;
char *result;
PPCODE:
key = (unsigned char *) (SvPV(ST(items-1), len));
if ((state = hmacopen(ix2alg[ix], key, len)) == NULL)
XSRETURN_UNDEF;
for (i = 0; i < items - 1; i++) {
data = (unsigned char *) (SvPV(ST(i), len));
hmacwrite(data, len << 3, state);
}
hmacfinish(state);
len = 0;
if (ix % 3 == 0) {
result = (char *) hmacdigest(state);
len = shadsize(state->osha);
}
else if (ix % 3 == 1)
result = hmachex(state);
else
result = hmacbase64(state);
ST(0) = sv_2mortal(newSVpv(result, len));
hmacclose(state);
XSRETURN(1);
void
hashsize(self)
SV * self
ALIAS:
Digest::SHA::hashsize = 0
Digest::SHA::algorithm = 1
PREINIT:
SHA *state;
int result;
PPCODE:
state = INT2PTR(SHA *, SvIV(SvRV(SvRV(self))));
result = shadsize(state) << 3;
if (ix == 1 && result == 160)
result = 1;
ST(0) = sv_2mortal(newSViv(result));
XSRETURN(1);
void
add(self, ...)
SV * self
PREINIT:
int i;
unsigned char *data;
STRLEN len;
SHA *state;
PPCODE:
state = INT2PTR(SHA *, SvIV(SvRV(SvRV(self))));
for (i = 1; i < items; i++) {
data = (unsigned char *) (SvPV(ST(i), len));
shawrite(data, len << 3, state);
}
XSRETURN(1);
void
digest(self)
SV * self
ALIAS:
Digest::SHA::digest = 0
Digest::SHA::Hexdigest = 1
Digest::SHA::B64digest = 2
PREINIT:
STRLEN len;
SHA *state;
char *result;
PPCODE:
state = INT2PTR(SHA *, SvIV(SvRV(SvRV(self))));
shafinish(state);
len = 0;
if (ix == 0) {
result = (char *) shadigest(state);
len = shadsize(state);
}
else if (ix == 1)
result = shahex(state);
else
result = shabase64(state);
ST(0) = sv_2mortal(newSVpv(result, len));
sharewind(state);
XSRETURN(1);
| XS | 3 | vlinhd11/vlinhd11-android-scripting | perl/src/ext/Digest-SHA/SHA.xs | [
"Apache-2.0"
] |
module.exports = {
images: {
domains: ['via.placeholder.com'],
// disableStaticImages: true,
},
}
| JavaScript | 3 | blomqma/next.js | test/integration/image-component/typescript/next.config.js | [
"MIT"
] |
[Desktop Entry]
Name=bspwm
Comment=Binary space partitioning window manager
Exec=bspwm
Type=Application
| desktop | 1 | cherrera0001/bspwm | contrib/freedesktop/bspwm.desktop | [
"BSD-2-Clause"
] |
--TEST--
Bug #71331 (Uninitialized pointer in phar_make_dirstream())
--EXTENSIONS--
phar
--FILE--
<?php
$p = new PharData(__DIR__."/bug71331.tar");
?>
DONE
--EXPECTF--
Fatal error: Uncaught UnexpectedValueException: phar error: "%s%ebug71331.tar" is a corrupted tar file (invalid entry size) in %s%ebug71331.php:2
Stack trace:
#0 %s%ebug71331.php(2): PharData->__construct('%s')
#1 {main}
thrown in %s%ebug71331.php on line 2
| PHP | 3 | NathanFreeman/php-src | ext/phar/tests/bug71331.phpt | [
"PHP-3.01"
] |
#include <ATen/ThreadLocalState.h>
#include <c10d/ProcessGroup.hpp>
#include <c10/util/Logging.h>
namespace c10d {
std::string opTypeToString(OpType opType) {
switch (opType) {
case OpType::BROADCAST:
return "BROADCAST";
case OpType::ALLREDUCE:
return "ALLREDUCE";
case OpType::ALLREDUCE_COALESCED:
return "ALLREDUCE_COALESCED";
case OpType::REDUCE:
return "REDUCE";
case OpType::ALLGATHER:
return "ALLGATHER";
case OpType::_ALLGATHER_BASE:
return "_ALLGATHER_BASE";
case OpType::ALLGATHER_COALESCED:
return "ALLGATHER_COALESCED";
case OpType::GATHER:
return "GATHER";
case OpType::SCATTER:
return "SCATTER";
case OpType::REDUCE_SCATTER:
return "REDUCE_SCATTER";
case OpType::ALLTOALL_BASE:
return "ALLTOALL_BASE";
case OpType::ALLTOALL:
return "ALLTOALL";
case OpType::SEND:
return "SEND";
case OpType::RECV:
return "RECV";
case OpType::RECVANYSOURCE:
return "RECVANYSOURCE";
case OpType::BARRIER:
return "BARRIER";
case OpType::UNKNOWN:
return "UNKNOWN";
case OpType::_REDUCE_SCATTER_BASE:
return "_REDUCE_SCATTER_BASE";
default:
TORCH_INTERNAL_ASSERT("Unknown op type!");
}
return "UNKNOWN";
}
bool isP2POp(OpType opType) {
return opType == OpType::SEND || opType == OpType::RECV ||
opType == OpType::RECVANYSOURCE;
}
ProcessGroup::Work::Work(
int rank,
OpType opType,
const char* profilingTitle,
const c10::optional<std::vector<at::Tensor>>& inputTensors)
: rank_(rank), opType_(opType) {
if (profilingTitle != nullptr) {
auto recordingFunction =
std::make_shared<at::RecordFunction>(at::RecordScope::USER_SCOPE);
if (recordingFunction->isActive()) {
// Work events follow a future like pattern and can potentially be marked
// as complete by different threads, so explicitly set as async event.
recordingFunction->_setAsync();
// Passing input tensor to recordFunction allows for shape information in
// profiling output.
std::vector<c10::IValue> inputs;
if (inputTensors) {
inputs.reserve(inputTensors->size());
for (const auto& tensor : *inputTensors) {
inputs.push_back(tensor);
}
}
recordingFunction->before(profilingTitle, inputs);
std::function<void()> end_handler = [this, recordingFunction]() {
recordingFunction->end();
};
recordFunctionEndCallback_ = at::wrapPropagateTLSState(end_handler);
}
}
}
OpType ProcessGroup::Work::retrieveOpType() {
return opType_;
}
ProcessGroup::Work::~Work() {}
bool ProcessGroup::Work::isCompleted() {
std::lock_guard<std::mutex> lock(mutex_);
return completed_;
}
bool ProcessGroup::Work::isSuccess() const {
std::lock_guard<std::mutex> lock(mutex_);
return !exception_;
}
std::exception_ptr ProcessGroup::Work::exception() const {
std::lock_guard<std::mutex> lock(mutex_);
return exception_;
}
int ProcessGroup::Work::sourceRank() const {
TORCH_CHECK(false,
"sourceRank() may only be called on work objects "
"that correspond to a recv or recv-from-any call.");
}
std::vector<at::Tensor> ProcessGroup::Work::result() {
TORCH_CHECK(false, "result() not implemented.");
}
void ProcessGroup::Work::synchronize() {}
bool ProcessGroup::Work::wait(std::chrono::milliseconds timeout) {
std::unique_lock<std::mutex> lock(mutex_);
if (timeout == kNoTimeout) {
// This waits without a timeout.
cv_.wait(lock, [&] { return completed_; });
} else {
// Waits for the user-provided timeout.
cv_.wait_for(lock, timeout, [&] { return completed_; });
if (!completed_) {
// Throw exception if the wait operation timed out and the work was not
// completed.
TORCH_CHECK(false, "Operation timed out!");
}
}
if (exception_) {
std::rethrow_exception(exception_);
}
synchronize();
// Always return true, because abort API is not implemented.
return true;
}
void ProcessGroup::Work::abort() {
TORCH_CHECK(false, "ProcessGroup::Work::abort not implemented.");
}
c10::intrusive_ptr<c10::ivalue::Future> ProcessGroup::Work::getFuture() {
TORCH_CHECK(false, "ProcessGroup::Work::getFuture not implemented.")
}
void ProcessGroup::Work::finish(std::exception_ptr exception) {
std::unique_lock<std::mutex> lock(mutex_);
completed_ = true;
exception_ = exception;
if (recordFunctionEndCallback_) {
recordFunctionEndCallback_();
recordFunctionEndCallback_ = nullptr;
}
lock.unlock();
cv_.notify_all();
}
void ProcessGroup::Work::finishAndThrow(std::exception_ptr exception) {
std::unique_lock<std::mutex> lock(mutex_);
completed_ = true;
exception_ = exception;
if (recordFunctionEndCallback_) {
recordFunctionEndCallback_();
recordFunctionEndCallback_ = nullptr;
}
if (exception_) {
std::rethrow_exception(exception_);
}
}
ProcessGroup::ProcessGroup(int rank, int size)
: rank_(rank), size_(size), dist_debug_level_(parseDistDebugLevel()) {
C10_LOG_API_USAGE_ONCE("c10d.process_group");
}
ProcessGroup::~ProcessGroup() {}
} // namespace c10d
| C++ | 4 | xiaohanhuang/pytorch | torch/csrc/distributed/c10d/ProcessGroup.cpp | [
"Intel"
] |
<GameProjectFile>
<PropertyGroup Type="Layer" Name="BattleResult" ID="e3978c26-50d1-4d93-b9cc-a0df563540e7" Version="2.0.0.0" />
<Content ctype="GameProjectContent">
<Content>
<Animation Duration="0" Speed="1" />
<ObjectData Name="Node_1" CanEdit="False" FrameEvent="" ctype="SingleNodeObjectData">
<Position X="0" Y="0" />
<Scale ScaleX="1" ScaleY="1" />
<AnchorPoint />
<CColor A="255" R="255" G="255" B="255" />
<Size X="480" Y="320" />
<PrePosition X="0" Y="0" />
<PreSize X="0" Y="0" />
<Children>
<NodeObjectData Name="Panel_Back" ActionTag="383602027" FrameEvent="" Tag="439" ObjectIndex="11" TouchEnable="True" BackColorAlpha="192" ComboBoxIndex="1" ColorAngle="0" ctype="PanelObjectData">
<Position X="0" Y="0" />
<Scale ScaleX="3.226071" ScaleY="4.827844" />
<AnchorPoint />
<CColor A="255" R="24" G="20" B="20" />
<Size X="200" Y="200" />
<PrePosition X="0" Y="0" />
<PreSize X="0" Y="0" />
<SingleColor A="255" R="11" G="2" B="6" />
<FirstColor A="255" R="11" G="2" B="6" />
<EndColor A="255" R="255" G="255" B="255" />
<ColorVector ScaleX="1" ScaleY="-4.371139E-08" />
</NodeObjectData>
<NodeObjectData Name="Node_ui" ActionTag="2120887531" FrameEvent="" Tag="1709" ObjectIndex="417" IconVisible="True" ctype="SingleNodeObjectData">
<Position X="0" Y="-1.525879E-05" />
<Scale ScaleX="1" ScaleY="1" />
<AnchorPoint />
<CColor A="255" R="255" G="255" B="255" />
<Size X="0" Y="0" />
<PrePosition X="0" Y="0" />
<PreSize X="0" Y="0" />
<Children>
<NodeObjectData Name="Button_Gohome" ActionTag="342332529" FrameEvent="" Tag="1268" ObjectIndex="5" TouchEnable="True" FontSize="14" ButtonText="" Scale9Width="240" Scale9Height="81" ctype="ButtonObjectData">
<Position X="454.3195" Y="219.0815" />
<Scale ScaleX="1" ScaleY="1" />
<AnchorPoint ScaleX="0.5" ScaleY="0.5" />
<CColor A="255" R="255" G="255" B="255" />
<Size X="240" Y="81" />
<PrePosition X="0.7098742" Y="0.2282098" />
<PreSize X="0" Y="0" />
<TextColor A="255" R="65" G="65" B="70" />
<DisabledFileData Type="Normal" Path="BattleResult/BR18.png" />
<PressedFileData Type="Normal" Path="BattleResult/BR17.png" />
<NormalFileData Type="Normal" Path="BattleResult/BR16.png" />
</NodeObjectData>
<NodeObjectData Name="Button_Provoke" ActionTag="608774771" FrameEvent="" Tag="1269" ObjectIndex="6" TouchEnable="True" FontSize="14" ButtonText="" Scale9Width="240" Scale9Height="81" ctype="ButtonObjectData">
<Position X="189.1207" Y="222.5038" />
<Scale ScaleX="1" ScaleY="1" />
<AnchorPoint ScaleX="0.5" ScaleY="0.5" />
<CColor A="255" R="255" G="255" B="255" />
<Size X="240" Y="81" />
<PrePosition X="0.2955011" Y="0.2317747" />
<PreSize X="0" Y="0" />
<TextColor A="255" R="65" G="65" B="70" />
<DisabledFileData Type="Normal" Path="BattleResult/BR21.png" />
<PressedFileData Type="Normal" Path="BattleResult/BR20.png" />
<NormalFileData Type="Normal" Path="BattleResult/BR19.png" />
</NodeObjectData>
<NodeObjectData Name="Sprite_Flag" ActionTag="624611605" FrameEvent="" Tag="1275" ObjectIndex="12" ctype="SpriteObjectData">
<Position X="319.1598" Y="441.5073" />
<Scale ScaleX="1" ScaleY="1" />
<AnchorPoint ScaleX="0.5" ScaleY="0.5" />
<CColor A="255" R="255" G="255" B="255" />
<Size X="238" Y="262" />
<PrePosition X="0.4986872" Y="0.4599034" />
<PreSize X="0" Y="0" />
<Children>
<NodeObjectData Name="Sprite_Coin" ActionTag="574321968" FrameEvent="" Tag="1278" ObjectIndex="15" ctype="SpriteObjectData">
<Position X="34.48523" Y="183.4022" />
<Scale ScaleX="0.75" ScaleY="0.75" />
<AnchorPoint ScaleX="0.3274201" ScaleY="0.4310155" />
<CColor A="255" R="255" G="255" B="255" />
<Size X="62" Y="62" />
<PrePosition X="0.1448959" Y="0.7000085" />
<PreSize X="0" Y="0" />
<FileData Type="Normal" Path="Common/Cn19.png" />
</NodeObjectData>
<NodeObjectData Name="AtlasLabel_Coincount" ActionTag="2120881465" FrameEvent="" Tag="1268" ObjectIndex="14" CharWidth="14" CharHeight="18" LabelText="50000000" StartChar="." ctype="TextAtlasObjectData">
<Position X="138.13" Y="186.58" />
<Scale ScaleX="1" ScaleY="1" />
<AnchorPoint ScaleX="0.5" ScaleY="0.5" />
<CColor A="255" R="255" G="255" B="255" />
<Size X="112" Y="18" />
<PrePosition X="0.5803782" Y="0.7121374" />
<PreSize X="0" Y="0" />
<LabelAtlasFileImage_CNB Type="Default" Path="Default/TextAtlas.png" />
</NodeObjectData>
<NodeObjectData Name="Sprite_Level" ActionTag="656318277" FrameEvent="" Tag="1277" ObjectIndex="14" ctype="SpriteObjectData">
<Position X="34.64343" Y="126.3345" />
<Scale ScaleX="1.2" ScaleY="1.2" />
<AnchorPoint ScaleX="0.2661503" ScaleY="0.4699185" />
<CColor A="255" R="255" G="255" B="255" />
<Size X="33" Y="38" />
<PrePosition X="0.1455606" Y="0.4821926" />
<PreSize X="0" Y="0" />
<FileData Type="Normal" Path="BattleResult/BR22.png" />
</NodeObjectData>
<NodeObjectData Name="AtlasLabel_Levelnum" ActionTag="2120882719" FrameEvent="" Tag="2522" ObjectIndex="29" CharWidth="14" CharHeight="18" LabelText="50000000" StartChar="." ctype="TextAtlasObjectData">
<Position X="139.59" Y="121.32" />
<Scale ScaleX="1" ScaleY="1" />
<AnchorPoint ScaleX="0.5" ScaleY="0.5" />
<CColor A="255" R="255" G="255" B="255" />
<Size X="112" Y="18" />
<PrePosition X="0.5865126" Y="0.4630534" />
<PreSize X="0" Y="0" />
<LabelAtlasFileImage_CNB Type="Default" Path="Default/TextAtlas.png" />
</NodeObjectData>
</Children>
<FileData Type="Normal" Path="BattleResult/BR11.png" />
</NodeObjectData>
<NodeObjectData Name="Sprite_Flagtop" ActionTag="73470724" FrameEvent="" Tag="1272" ObjectIndex="9" ctype="SpriteObjectData">
<Position X="318.0645" Y="649.7594" />
<Scale ScaleX="1" ScaleY="1" />
<AnchorPoint ScaleX="0.5" ScaleY="0.5" />
<CColor A="255" R="255" G="255" B="255" />
<Size X="454" Y="208" />
<PrePosition X="0.4969757" Y="0.6768327" />
<PreSize X="0" Y="0" />
<Children>
<NodeObjectData Name="Sprite_Sheng" ActionTag="161901062" FrameEvent="" Tag="1273" ObjectIndex="10" ctype="SpriteObjectData">
<Position X="168.3298" Y="90.72003" />
<Scale ScaleX="1" ScaleY="1" />
<AnchorPoint ScaleX="0.5" ScaleY="0.5" />
<CColor A="255" R="255" G="255" B="255" />
<Size X="174" Y="172" />
<PrePosition X="0.3707706" Y="0.436154" />
<PreSize X="0" Y="0" />
<FileData Type="Normal" Path="BattleResult/BR12.png" />
</NodeObjectData>
<NodeObjectData Name="Sprite_Li" ActionTag="505995283" FrameEvent="" Tag="1274" ObjectIndex="11" ctype="SpriteObjectData">
<Position X="276.2626" Y="87.25604" />
<Scale ScaleX="1" ScaleY="1" />
<AnchorPoint ScaleX="0.5" ScaleY="0.5" />
<CColor A="255" R="255" G="255" B="255" />
<Size X="173" Y="169" />
<PrePosition X="0.608508" Y="0.4195002" />
<PreSize X="0" Y="0" />
<FileData Type="Normal" Path="BattleResult/BR13.png" />
</NodeObjectData>
</Children>
<FileData Type="Normal" Path="BattleResult/BR01.png" />
</NodeObjectData>
</Children>
</NodeObjectData>
<NodeObjectData Name="Node_win" ActionTag="2120883240" Visible="False" FrameEvent="" Tag="1105" ObjectIndex="2" IconVisible="True" ctype="ProjectNodeObjectData">
<Position X="326.625" Y="679.1251" />
<Scale ScaleX="1" ScaleY="1" />
<AnchorPoint />
<CColor A="255" R="255" G="255" B="255" />
<Size X="0" Y="0" />
<PrePosition X="0.6804688" Y="2.122266" />
<PreSize X="0" Y="0" />
<FileData Type="Normal" Path="fx_vic.csd" />
</NodeObjectData>
<NodeObjectData Name="Audio_1" ActionTag="2120886403" FrameEvent="" Tag="5278" ObjectIndex="1" IconVisible="True" Volume="1" ctype="SimpleAudioObjectData">
<Position X="311.8731" Y="85.62395" />
<Scale ScaleX="1" ScaleY="1" />
<AnchorPoint />
<CColor A="255" R="255" G="255" B="255" />
<Size X="0" Y="0" />
<PrePosition X="0.6497357" Y="0.2675748" />
<PreSize X="0" Y="0" />
<FileData Type="Normal" Path="BattleResult/victory.mp3" />
</NodeObjectData>
</Children>
</ObjectData>
</Content>
</Content>
</GameProjectFile> | Csound | 3 | chukong/CocosStudioSamples | DemoMicroCardGame/CocosStudioResources/cocosstudio/BattleResult.csd | [
"MIT"
] |
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _createSvgIcon = _interopRequireDefault(require("./utils/createSvgIcon"));
var _jsxRuntime = require("react/jsx-runtime");
var _default = (0, _createSvgIcon.default)( /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-8 11c0 .55-.45 1-1 1H7.25c-.41 0-.75-.34-.75-.75s.34-.75.75-.75H9.5v-1H8c-.28 0-.5-.22-.5-.5s.22-.5.5-.5h1.5v-1H7.25c-.41 0-.75-.34-.75-.75S6.84 9 7.25 9H10c.55 0 1 .45 1 1v4zm5.59 1c-.22 0-.42-.1-.55-.27l-1.54-1.98v1.5c0 .41-.34.75-.75.75s-.75-.34-.75-.75v-4.5c0-.41.34-.75.75-.75s.75.34.75.75v1.5l1.54-1.98c.13-.17.34-.27.55-.27.58 0 .91.66.56 1.12L15.75 12l1.41 1.88c.34.46.01 1.12-.57 1.12z"
}), 'ThreeKRounded');
exports.default = _default; | JavaScript | 4 | good-gym/material-ui | packages/material-ui-icons/lib/ThreeKRounded.js | [
"MIT"
] |
import type { ClientPagesLoaderOptions } from './webpack/loaders/next-client-pages-loader'
import type { MiddlewareLoaderOptions } from './webpack/loaders/next-middleware-loader'
import type { MiddlewareSSRLoaderQuery } from './webpack/loaders/next-middleware-ssr-loader'
import type { NextConfigComplete } from '../server/config-shared'
import type { PageRuntime } from '../server/config-shared'
import type { ServerlessLoaderQuery } from './webpack/loaders/next-serverless-loader'
import type { webpack5 } from 'next/dist/compiled/webpack/webpack'
import type { LoadedEnvFiles } from '@next/env'
import chalk from 'next/dist/compiled/chalk'
import { posix, join } from 'path'
import { stringify } from 'querystring'
import {
API_ROUTE,
DOT_NEXT_ALIAS,
MIDDLEWARE_FILE,
MIDDLEWARE_FILENAME,
PAGES_DIR_ALIAS,
ROOT_DIR_ALIAS,
APP_DIR_ALIAS,
} from '../lib/constants'
import {
CLIENT_STATIC_FILES_RUNTIME_AMP,
CLIENT_STATIC_FILES_RUNTIME_MAIN,
CLIENT_STATIC_FILES_RUNTIME_MAIN_ROOT,
CLIENT_STATIC_FILES_RUNTIME_REACT_REFRESH,
EDGE_RUNTIME_WEBPACK,
} from '../shared/lib/constants'
import { __ApiPreviewProps } from '../server/api-utils'
import { isTargetLikeServerless } from '../server/utils'
import { warn } from './output/log'
import { isServerComponentPage } from './utils'
import { getPageStaticInfo } from './analysis/get-page-static-info'
import { normalizePathSep } from '../shared/lib/page-path/normalize-path-sep'
import { normalizePagePath } from '../shared/lib/page-path/normalize-page-path'
import { serverComponentRegex } from './webpack/loaders/utils'
type ObjectValue<T> = T extends { [key: string]: infer V } ? V : never
/**
* For a given page path removes the provided extensions.
*/
export function getPageFromPath(pagePath: string, pageExtensions: string[]) {
let page = normalizePathSep(
pagePath.replace(new RegExp(`\\.+(${pageExtensions.join('|')})$`), '')
)
page = page.replace(/\/index$/, '')
return page === '' ? '/' : page
}
export function createPagesMapping({
hasServerComponents,
isDev,
pageExtensions,
pagePaths,
pagesType,
}: {
hasServerComponents: boolean
isDev: boolean
pageExtensions: string[]
pagePaths: string[]
pagesType: 'pages' | 'root' | 'app'
}): { [page: string]: string } {
const previousPages: { [key: string]: string } = {}
const pages = pagePaths.reduce<{ [key: string]: string }>(
(result, pagePath) => {
// Do not process .d.ts files inside the `pages` folder
if (pagePath.endsWith('.d.ts') && pageExtensions.includes('ts')) {
return result
}
const pageKey = getPageFromPath(pagePath, pageExtensions)
// Assume that if there's a Client Component, that there is
// a matching Server Component that will map to the page.
// so we will not process it
if (hasServerComponents && /\.client$/.test(pageKey)) {
return result
}
if (pageKey in result) {
warn(
`Duplicate page detected. ${chalk.cyan(
join('pages', previousPages[pageKey])
)} and ${chalk.cyan(
join('pages', pagePath)
)} both resolve to ${chalk.cyan(pageKey)}.`
)
} else {
previousPages[pageKey] = pagePath
}
result[pageKey] = normalizePathSep(
join(
pagesType === 'pages'
? PAGES_DIR_ALIAS
: pagesType === 'app'
? APP_DIR_ALIAS
: ROOT_DIR_ALIAS,
pagePath
)
)
return result
},
{}
)
if (pagesType !== 'pages') {
return pages
}
if (isDev) {
delete pages['/_app']
delete pages['/_error']
delete pages['/_document']
}
// In development we always alias these to allow Webpack to fallback to
// the correct source file so that HMR can work properly when a file is
// added or removed.
const root = isDev ? PAGES_DIR_ALIAS : 'next/dist/pages'
return {
'/_app': `${root}/_app`,
'/_error': `${root}/_error`,
'/_document': `${root}/_document`,
...pages,
}
}
interface CreateEntrypointsParams {
buildId: string
config: NextConfigComplete
envFiles: LoadedEnvFiles
isDev?: boolean
pages: { [page: string]: string }
pagesDir: string
previewMode: __ApiPreviewProps
rootDir: string
rootPaths?: Record<string, string>
target: 'server' | 'serverless' | 'experimental-serverless-trace'
appDir?: string
appPaths?: Record<string, string>
pageExtensions: string[]
}
export function getEdgeServerEntry(opts: {
absolutePagePath: string
buildId: string
bundlePath: string
config: NextConfigComplete
isDev: boolean
isServerComponent: boolean
page: string
pages: { [page: string]: string }
}) {
if (opts.page === MIDDLEWARE_FILE) {
const loaderParams: MiddlewareLoaderOptions = {
absolutePagePath: opts.absolutePagePath,
page: opts.page,
}
return `next-middleware-loader?${stringify(loaderParams)}!`
}
const loaderParams: MiddlewareSSRLoaderQuery = {
absolute500Path: opts.pages['/500'] || '',
absoluteAppPath: opts.pages['/_app'],
absoluteDocumentPath: opts.pages['/_document'],
absoluteErrorPath: opts.pages['/_error'],
absolutePagePath: opts.absolutePagePath,
buildId: opts.buildId,
dev: opts.isDev,
isServerComponent: isServerComponentPage(
opts.config,
opts.absolutePagePath
),
page: opts.page,
stringifiedConfig: JSON.stringify(opts.config),
}
return {
import: `next-middleware-ssr-loader?${stringify(loaderParams)}!`,
layer: opts.isServerComponent ? 'sc_server' : undefined,
}
}
export function getAppEntry(opts: {
name: string
pagePath: string
appDir: string
pageExtensions: string[]
}) {
return {
import: `next-app-loader?${stringify(opts)}!`,
layer: 'sc_server',
}
}
export function getServerlessEntry(opts: {
absolutePagePath: string
buildId: string
config: NextConfigComplete
envFiles: LoadedEnvFiles
page: string
previewMode: __ApiPreviewProps
pages: { [page: string]: string }
}): ObjectValue<webpack5.EntryObject> {
const loaderParams: ServerlessLoaderQuery = {
absolute404Path: opts.pages['/404'] || '',
absoluteAppPath: opts.pages['/_app'],
absoluteDocumentPath: opts.pages['/_document'],
absoluteErrorPath: opts.pages['/_error'],
absolutePagePath: opts.absolutePagePath,
assetPrefix: opts.config.assetPrefix,
basePath: opts.config.basePath,
buildId: opts.buildId,
canonicalBase: opts.config.amp.canonicalBase || '',
distDir: DOT_NEXT_ALIAS,
generateEtags: opts.config.generateEtags ? 'true' : '',
i18n: opts.config.i18n ? JSON.stringify(opts.config.i18n) : '',
// base64 encode to make sure contents don't break webpack URL loading
loadedEnvFiles: Buffer.from(JSON.stringify(opts.envFiles)).toString(
'base64'
),
page: opts.page,
poweredByHeader: opts.config.poweredByHeader ? 'true' : '',
previewProps: JSON.stringify(opts.previewMode),
reactRoot: !!opts.config.experimental.reactRoot ? 'true' : '',
runtimeConfig:
Object.keys(opts.config.publicRuntimeConfig).length > 0 ||
Object.keys(opts.config.serverRuntimeConfig).length > 0
? JSON.stringify({
publicRuntimeConfig: opts.config.publicRuntimeConfig,
serverRuntimeConfig: opts.config.serverRuntimeConfig,
})
: '',
}
return `next-serverless-loader?${stringify(loaderParams)}!`
}
export function getClientEntry(opts: {
absolutePagePath: string
page: string
}) {
const loaderOptions: ClientPagesLoaderOptions = {
absolutePagePath: opts.absolutePagePath,
page: opts.page,
}
const pageLoader = `next-client-pages-loader?${stringify(loaderOptions)}!`
// Make sure next/router is a dependency of _app or else chunk splitting
// might cause the router to not be able to load causing hydration
// to fail
return opts.page === '/_app'
? [pageLoader, require.resolve('../client/router')]
: pageLoader
}
export async function createEntrypoints(params: CreateEntrypointsParams) {
const {
config,
pages,
pagesDir,
isDev,
rootDir,
rootPaths,
target,
appDir,
appPaths,
pageExtensions,
} = params
const edgeServer: webpack5.EntryObject = {}
const server: webpack5.EntryObject = {}
const client: webpack5.EntryObject = {}
const getEntryHandler =
(mappings: Record<string, string>, pagesType: 'app' | 'pages' | 'root') =>
async (page: string) => {
const bundleFile = normalizePagePath(page)
const clientBundlePath = posix.join('pages', bundleFile)
const serverBundlePath =
pagesType === 'pages'
? posix.join('pages', bundleFile)
: pagesType === 'app'
? posix.join('app', bundleFile)
: bundleFile.slice(1)
const absolutePagePath = mappings[page]
// Handle paths that have aliases
const pageFilePath = (() => {
if (absolutePagePath.startsWith(PAGES_DIR_ALIAS)) {
return absolutePagePath.replace(PAGES_DIR_ALIAS, pagesDir)
}
if (absolutePagePath.startsWith(APP_DIR_ALIAS) && appDir) {
return absolutePagePath.replace(APP_DIR_ALIAS, appDir)
}
if (absolutePagePath.startsWith(ROOT_DIR_ALIAS)) {
return absolutePagePath.replace(ROOT_DIR_ALIAS, rootDir)
}
return require.resolve(absolutePagePath)
})()
/**
* When we find a middleware file that is not in the ROOT_DIR we fail.
* There is no need to check on `dev` as this should only happen when
* building for production.
*/
if (
!absolutePagePath.startsWith(ROOT_DIR_ALIAS) &&
/[\\\\/]_middleware$/.test(page)
) {
throw new Error(
`nested Middleware is not allowed (found pages${page}) - https://nextjs.org/docs/messages/nested-middleware`
)
}
const isServerComponent = serverComponentRegex.test(absolutePagePath)
const staticInfo = await getPageStaticInfo({
nextConfig: config,
pageFilePath,
isDev,
})
runDependingOnPageType({
page,
pageRuntime: staticInfo.runtime,
onClient: () => {
if (isServerComponent) {
// We skip the initial entries for server component pages and let the
// server compiler inject them instead.
} else {
client[clientBundlePath] = getClientEntry({
absolutePagePath: mappings[page],
page,
})
}
},
onServer: () => {
if (pagesType === 'app' && appDir) {
server[serverBundlePath] = getAppEntry({
name: serverBundlePath,
pagePath: mappings[page],
appDir,
pageExtensions,
})
} else if (isTargetLikeServerless(target)) {
if (page !== '/_app' && page !== '/_document') {
server[serverBundlePath] = getServerlessEntry({
...params,
absolutePagePath: mappings[page],
page,
})
}
} else {
server[serverBundlePath] = isServerComponent
? {
import: mappings[page],
layer: 'sc_server',
}
: [mappings[page]]
}
},
onEdgeServer: () => {
edgeServer[serverBundlePath] = getEdgeServerEntry({
...params,
absolutePagePath: mappings[page],
bundlePath: clientBundlePath,
isDev: false,
isServerComponent,
page,
})
},
})
}
if (appDir && appPaths) {
const entryHandler = getEntryHandler(appPaths, 'app')
await Promise.all(Object.keys(appPaths).map(entryHandler))
}
if (rootPaths) {
await Promise.all(
Object.keys(rootPaths).map(getEntryHandler(rootPaths, 'root'))
)
}
await Promise.all(Object.keys(pages).map(getEntryHandler(pages, 'pages')))
return {
client,
server,
edgeServer,
}
}
export function runDependingOnPageType<T>(params: {
onClient: () => T
onEdgeServer: () => T
onServer: () => T
page: string
pageRuntime: PageRuntime
}) {
if (params.page === MIDDLEWARE_FILE) {
return [params.onEdgeServer()]
} else if (params.page.match(API_ROUTE)) {
return [params.onServer()]
} else if (params.page === '/_document') {
return [params.onServer()]
} else if (
params.page === '/_app' ||
params.page === '/_error' ||
params.page === '/404' ||
params.page === '/500'
) {
return [params.onClient(), params.onServer()]
} else {
return [
params.onClient(),
params.pageRuntime === 'edge' ? params.onEdgeServer() : params.onServer(),
]
}
}
export function finalizeEntrypoint({
name,
compilerType,
value,
isServerComponent,
}: {
compilerType?: 'client' | 'server' | 'edge-server'
name: string
value: ObjectValue<webpack5.EntryObject>
isServerComponent?: boolean
}): ObjectValue<webpack5.EntryObject> {
const entry =
typeof value !== 'object' || Array.isArray(value)
? { import: value }
: value
if (compilerType === 'server') {
const isApi = name.startsWith('pages/api/')
return {
publicPath: isApi ? '' : undefined,
runtime: isApi ? 'webpack-api-runtime' : 'webpack-runtime',
layer: isApi ? 'api' : isServerComponent ? 'sc_server' : undefined,
...entry,
}
}
if (compilerType === 'edge-server') {
return {
layer: name === MIDDLEWARE_FILENAME ? 'middleware' : undefined,
library: { name: ['_ENTRIES', `middleware_[name]`], type: 'assign' },
runtime: EDGE_RUNTIME_WEBPACK,
asyncChunks: false,
...entry,
}
}
if (
// Client special cases
name !== 'polyfills' &&
name !== CLIENT_STATIC_FILES_RUNTIME_MAIN &&
name !== CLIENT_STATIC_FILES_RUNTIME_MAIN_ROOT &&
name !== CLIENT_STATIC_FILES_RUNTIME_AMP &&
name !== CLIENT_STATIC_FILES_RUNTIME_REACT_REFRESH
) {
return {
dependOn:
name.startsWith('pages/') && name !== 'pages/_app'
? 'pages/_app'
: 'main',
...entry,
}
}
return entry
}
| TypeScript | 5 | sagnik3/next.js | packages/next/build/entries.ts | [
"MIT"
] |
{{
////////////////////////////////////////////////////////////////////////////////////////////
// ILI9325.spin
// 320x240 LCD driver for ILI9325 controller
// Author: Mark Tillotson
// Updated: 2012-09-14
// Designed For: P8X32A
// Version: 1.0
// Provides
// PUB Stop
// PUB Start (nRES, nCS, RS, nWR, nRD, backLight, vidgroup)
// pin numbers for nRESET, nCS, RS, nWR, nRD and backight enable (not currently used)
// vidgroup for the databus (0, 1 or 2 for 0..7, 8..15 and 16..23 respectively)
// PUB Synch
// wait for previous command to finish, normally you don't need to call this
// PUB SetColours (fore, back)
// Colours are 16 bit, RRRRRGGGGGGBBBBB (5, 6, 5 bits per colour)
// foreground colour used for drawing generally, background for clearing screen and character backgrounds
// PUB ClearScreen
// PUB DrawDot (xl, yt)
// PUB DrawLine (xl, yt, xr, yb)
// PUB DrawChar (xl, yt, chr)
// coords of top-left, used Prop font (16x32 pixels)
// PUB DrawCharSmall (xl, yt, chr)
// shrunk Prop font, 8x16 pixels
// PUB DrawString (xl, yt, str)
// null terminated byte string in hub memory
// PUB DrawStringSmall (xl, yt, str)
// PUB DrawRect (xl, yt, xr, yb)
// Note you must ensure xl <= xr, yt <= yb else it will hang
// ToDo: Allow setting up in portrait or landscape mode (currently landscape mode on the TechToy board)
// See end of file for standard MIT licence / terms of use.
// Update History:
// v1.0 - Initial version 2012-09-14
////////////////////////////////////////////////////////////////////////////////////////////
}}
CON
CMD_SETUP = 1
CMD_SETCOLOURS = 2
CMD_RECT = 4
CMD_CLEAR = 5
CMD_LINE = 6
CMD_STRING = 7
CMD_CHAR = 8
CMD_DOT = 9
VAR
long cog
long cmd
long arg0
long arg1
PUB Stop
if cog <> 0
cogstop (cog-1)
cog := 0
PUB Start (nRES, nCS, RS, nWR, nRD, backLight, vidgroup) | mask
Stop
cmd := CMD_SETUP
pingroup := vidgroup
bLightmask := 1 << backLight
nRESmask := 1 << nRES
nCSmask := 1 << nCS
RSmask := 1 << RS
nWRpin := nWR
nWRmask := 1 << nWR
nRDmask := 1 << nRD
datashift := vidgroup << 3
datamask := $FF << datashift
IF_REG := nRESmask | nRDmask | nWRmask
IF_ACTIVE := IF_REG | RSmask
IF_IDLE := IF_ACTIVE | nCSmask
arg0 := @init_data
cog := 1 + cognew (@entry, @cmd)
if cog <> 0
repeat until cmd == 0
result := cog
PUB Synch
repeat until cmd == 0
PUB ClearScreen
Synch
cmd := CMD_CLEAR
PUB DrawDot (xl, yt)
Synch
arg0 := xl << 16 | yt
cmd := CMD_DOT
PUB DrawLine (xl, yt, xr, yb)
Synch
arg0 := xl << 16 | yt
arg1 := xr << 16 | yb
cmd := CMD_LINE
PUB DrawChar (xl, yt, chr)
Synch
arg0 := xl << 16 | yt
arg1 := chr & $FF
cmd := CMD_CHAR
PUB DrawCharSmall (xl, yt, chr)
Synch
arg0 := xl << 16 | yt
arg1 := chr | $100
cmd := CMD_CHAR
PUB DrawString (xl, yt, str)
Synch
arg0 := xl << 16 | yt
arg1 := str
cmd := CMD_STRING
PUB DrawStringSmall (xl, yt, str)
Synch
arg0 := xl << 16 | yt
arg1 := -str
cmd := CMD_STRING
PUB DrawRect (xl, yt, xr, yb)
Synch
arg0 := xl << 16 | yt
arg1 := xr << 16 | yb
cmd := CMD_RECT
PUB SetColours (fore, back)
Synch
arg0 := (back << 16) | (fore & $ffff)
cmd := CMD_SETCOLOURS
DAT ' init calls: delayms,reg,valhi,vallo
init_data long $00E33008
long $00E70012
long $00EF1231
long $0A000001
long $00A40001 ' is this needed?
long $0A070000
long $00010100 ' Source scan direction bit 0100
long $00020700
long $00031038
long $00040000
long $00080202
long $00090000
long $00070101
long $00170001
long $00100000
long $00110007
long $00120000
long $14130000
long $001017B0
long $32110137
long $3212001A
long $00131800
long $3229002A
long $00200000
long $00210000
long $00500000
long $005100EF
long $00520000
long $0053013F
long $00602700 ' gate scan direction bit 8000
long $00610001
long $006A0000
long $00900010
long $00920000
long $00930003
long $00950110
long $00970000
long $00980000
long $00300507
long $00310404
long $00320205
long $00350707 ' $00350002
long $00360000 ' $00360707 ' amp
long $00370507
long $00380404
long $00390205
long $003c0707 ' $003c0700
long $003d0000 ' $003d0707 ' amp
long $32070173
long 0
DAT
ORG 0
entry mov parm, PAR
rdlong op, parm ' can assume is setup
add parm, #4
rdlong ptr, parm
movd vcfg_go, pingroup
movd vcfg_go1, pingroup
movd vcfg_stop, pingroup
mov OUTA, IF_IDLE
mov DIRA, IF_IDLE
or DIRA, datamask
'or DIRA, bLightmask
'or OUTA, bLightmask
andn OUTA, nRESmask
mov delaycount, #2
call #del_millis
or OUTA, nRESmask
mov delaycount, #25
call #del_millis
call #wv_setup
:init_loop rdlong t, ptr wz
if_z jmp #command_loop
add ptr, #4
ror t, #16
mov regaddr, t
and regaddr, #$FF
mov reg_val, t
shr reg_val, #16
call #write_reg
ror t, #8
mov delaycount, t
and delaycount, #$FF wz
if_nz call #del_millis
jmp #:init_loop
del_millis mov time, CNT
add time, MSdelay
waitcnt time, #0
djnz delaycount, #del_millis
del_millis_ret ret
command_return wrlong zero, PAR
command_loop rdlong op, PAR wz
if_z jmp #command_loop
call #read_args
cmp op, #CMD_SETCOLOURS wz
if_nz jmp #:done_setcolours
if_z mov foreground, y0
mov background, x0
jmp #command_return
:done_setcolours
cmp op, #CMD_CLEAR wz
if_nz jmp #:done_clear
mov t, foreground
mov foreground, background
mov x0, #0
mov x1, #319
mov y0, #0
mov y1, #239
call #wv_draw_rect
mov foreground, t
jmp #command_return
:done_clear cmp op, #CMD_RECT wz
if_nz jmp #:done_rect
call #wv_draw_rect
jmp #command_return
:done_rect cmp op, #CMD_LINE wz
if_nz jmp #:done_line
call #draw_line
jmp #command_return
:done_line cmp op, #CMD_STRING wz
if_nz jmp #:done_string
mov strp, t2
cmps strp, #0 wc
if_c neg strp, strp
rcl t, #1
call #draw_string
jmp #command_return
:done_string cmp op, #CMD_CHAR wz
if_nz jmp #:done_char
mov char, t2
test char, #$100 wz
if_z jmp #:normal
and char, #$FF
call #wv_glyph_sm
jmp #command_return
:normal call #wv_glyph
jmp #command_return
:done_char cmp op, #CMD_DOT wz
if_nz jmp #command_return
call #dot
jmp #command_return
read_args rdlong t, parm
add parm, #4
rdlong t2, parm
sub parm, #4
mov x0, t
shr x0, #16
mov y0, t
and y0, HFFFF
mov x1, t2
shr x1, #16
mov y1, t2
and y1, HFFFF
mov col, x0
mov row, y0
read_args_ret ret
{ ------------------------------------------------------ }
wv_draw_rect mov col, x0
mov row, y0
mov rcount, y1
sub rcount, y0
add rcount, #1
:rloop call #move_to
call #start_ram
mov reg_val, foreground
mov icount, x1
sub icount, x0
mov sixteens, icount
shr sixteens, #4 wz
and icount, #15
add icount, #1
shl icount, #1
or DIRA, datamask
andn OUTA, datamask
movs CTRB, nWRpin ' take control of nWR
cmp sixteens, #0 wz
if_z jmp #:short_case
mov VSCL, vscale32
mov VCFG, vcfg_go1 ' start vid gen
waitvid foreground, H55555555 ' first data also synchronizes
andn OUTA, nWRmask ' expose counter control of nWR pulses
:testwaits djnz sixteens, #:morewaits
movs VSCL, icount
waitvid foreground, H55555555
jmp #:donewaits
:morewaits waitvid foreground, H55555555
jmp #:testwaits
:short_case mov VSCL, vscale32
movs VSCL, icount
mov VCFG, vcfg_go1 ' start vid gen
waitvid foreground, H55555555 ' first data also synchronizes
andn OUTA, nWRmask ' expose counter control of nWR pulses
:donewaits waitvid zero, #0 ' synchronize for ending nWR pulses
or OUTA, nWRmask ' force nWR high
mov VCFG, vcfg_stop ' stop vid gen
movs CTRB, #0 ' relinquish counter control of nWR
:no_waits
{
:iloop call #wr_ram
djnz icount, #:iloop
}
call #stop_ram
add row, #1
djnz rcount, #:rloop
wv_draw_rect_ret ret
{ ------------------------------------------------------ }
draw_line mov dx, x1
sub dx, x0
abs dx, dx
shl dx, #8
mov dy, y1
sub dy, y0
abs dy, dy
shl dy, #8
cmp x0, x1 wc
mov xstep, #1
if_nc neg xstep, xstep
cmp y0, y1 wc
mov ystep, #1
if_nc neg ystep, ystep
mov row, y0
mov col, x0
cmp dx, dy wc
if_nc jmp #xdir
ydir neg t, dy
sar t, #1
:loop
call #dot
cmp row, y1 wz
if_z jmp #draw_line_ret
add row, ystep
add t, dx wc
if_nc jmp #:loop
add col, xstep
sub t, dy
jmp #:loop
xdir neg t, dx
sar t, #1
:loop
call #dot
cmp col, x1 wz
if_z jmp #draw_line_ret
add col, xstep
add t, dy wc
if_nc jmp #:loop
add row, ystep
sub t, dx
jmp #:loop
draw_line_ret ret
dot cmp col, #320 wc,wz
if_ae jmp #dot_ret
cmp row, #240 wc,wz
if_ae jmp #dot_ret
' #move_to
mov OUTA, IF_ACTIVE
or DIRA, datamask
cmp col, old_col wz
if_z jmp #:skip_col
mov old_col, col
mov regaddr, #$21
mov reg_val, col
call #wr_reg
:skip_col cmp row, old_row wz
if_z jmp #:skip_row
mov old_row, row
mov regaddr, #$20
mov reg_val, row
call #wr_reg
:skip_row mov regaddr, #$22
mov reg_val, foreground
call #wr_reg
mov OUTA, IF_IDLE
dot_ret ret
{ ------------------------------------------------------ }
draw_string rdbyte char, strp wz
if_z jmp #draw_string_ret
add strp, #1
test t, #1 wz
if_z call #wv_glyph
test t, #1 wz
if_nz call #wv_glyph_sm
jmp #draw_string
draw_string_ret ret
{ ------------------------------------------------------ }
rd_data andn DIRA, datamask
andn OUTA, nRDmask
nop
mov dval, INA
or OUTA, nRDmask
shr dval, datashift
and dval, #$FF
or DIRA, datamask
rd_data_ret ret
{ ------------------------------------------------------ }
wr_data shl dval, datashift
or OUTA, dval
andn OUTA, nWRmask
mov OUTA, IF_ACTIVE
wr_data_ret ret
{ ------------------------------------------------------ }
set_ind mov OUTA, IF_REG
andn OUTA, nWRmask
or OUTA, nWRmask
mov dval, regaddr
shl dval, datashift
or OUTA, dval
andn OUTA, nWRmask
or OUTA, nWRmask
mov OUTA, IF_ACTIVE
set_ind_ret ret
{ ------------------------------------------------------ }
read_reg andn OUTA, nCSmask
call #set_ind
call #rd_data
mov reg_val, dval
shl reg_val, #8
call #rd_data
or reg_val, dval
or OUTA, nCSmask
read_reg_ret ret
{ ------------------------------------------------------ }
write_reg andn OUTA, nCSmask
call #set_ind
call #wr_ram
or OUTA, nCSmask
write_reg_ret ret
wr_reg call #set_ind
call #wr_ram
wr_reg_ret ret
{ ------------------------------------------------------ }
move_to mov regaddr, #$21 ' swap $20 and $31 for portrait mode
mov reg_val, col
call #write_reg
mov regaddr, #$20
mov reg_val, row
call #write_reg
move_to_ret ret
{ ------------------------------------------------------ }
start_ram mov OUTA, IF_ACTIVE
mov regaddr, #$22
call #set_ind
start_ram_ret ret
{ ------------------------------------------------------ }
wr_ram mov dval, reg_val
shr dval, #8
shl dval, datashift
or OUTA, dval
andn OUTA, nWRmask
or OUTA, nWRmask ' need this to guarantee data hold time of >= 15ns on nWR rising edge
mov OUTA, IF_ACTIVE
mov dval, reg_val
and dval, #$FF
shl dval, datashift
or OUTA, dval
andn OUTA, nWRmask
or OUTA, nWRmask ' need this to guarantee data hold time of >= 15ns on nWR rising edge
mov OUTA, IF_ACTIVE
wr_ram_ret ret
{ ------------------------------------------------------ }
stop_ram mov OUTA, IF_IDLE
stop_ram_ret ret
{ ------------------------------------------------------ }
wv_setup movi CTRA, #%0_00001_100 ' divide by 8 5 MHZ counter, x16 -> 80MHz PLL, div 8 -> 10MHz vidclock
mov FRQA, pllclkrate
movi CTRB, #%0_00100_000
movs CTRB, #0
mov FRQB, ctrclkrate ' counter B run directly at 10MHz
mov PHSA, #0
mov PHSB, phasey ' synchronize the two clocks
mov VSCL, vscale
mov VCFG, vcfg_stop ' video hardware configured but in idle mode.
wv_setup_ret ret
{ ------------------------------------------------------ }
{
wv_stop mov VCFG, #0
mov VSCL, #0
mov CTRB, #0
mov CTRA, #0
wv_stop_ret ret
}
{ ------------------------------------------------------ }
get_patt rdlong pattern, gaddr ' read long from Prop font data
add gaddr, #4
test char, #1 wz ' deal with interleaving
if_nz shr pattern, #1
get_patt_ret ret
{ ------------------------------------------------------ }
spread mov expand, H11111111 ' from font we have a bit every two, but we need a bit every four
shr pattern, #2 wc ' in order to send 2 bytes per pixel using 2 bits/clk video mode
muxc expand, H0000000A
shr pattern, #2 wc ' we need 2 bits/clk since one represents foreground/background and
muxc expand, H000000A0 ' one represents high byte / low byte for the 16 bit LCD pixels
shr pattern, #2 wc
muxc expand, H00000A00 ' This routine spreads the bits in the deadtimes between waitvid,
shr pattern, #2 wc ' only just enough time as pumping out 16 bytes per waitvid at 10MHz
muxc expand, H0000A000 ' and only 30 instructions allowed between waitvids.
shr pattern, #2 wc
muxc expand, H000A0000 ' here we duplicate the bits as needed and mux into the right place
shr pattern, #2 wc ' the high/low byte bits are set up with first instruction.
muxc expand, H00A00000
shr pattern, #2 wc
muxc expand, H0A000000
shr pattern, #2 wc
muxc expand, HA0000000
spread_ret ret
{ ------------------------------------------------------ }
glyph_setup mov gaddr, char ' calculate address of first long in Prop font entry for char
and gaddr, #$FF
shr gaddr, #1
or gaddr, #$100 ' $8000 is base of font, $100 shifted left by 7
shl gaddr, #7 ' 32 longs = 2^7 bytes per font entry
mov colours, foreground ' get colour table for waitvid, fg high / fg low / bg high / bg low
shl colours, #16
or colours, background
glyph_setup_ret ret
{ ------------------------------------------------------ }
wv_glyph call #glyph_setup
call #get_patt ' setup first line of pixels in advance.
call #spread
mov lout, expand
call #spread
mov rout, expand
mov linecount, #32
:loop call #move_to
add row, #1
call #start_ram
or DIRA, datamask
andn OUTA, datamask
movs CTRB, nWRpin ' take control of nWR
call #get_patt ' get pattern
mov VSCL, vscale
mov VCFG, vcfg_go ' start vid gen
waitvid colours, lout ' first data also synchronizes
andn OUTA, nWRmask ' expose counter control of nWR pulses
call #spread ' process next line while waiting
mov lout, expand
waitvid colours, rout ' right hand chunk
call #spread ' process next line while waiting
mov rout, expand
waitvid zero, #0 ' synchronize for ending nWR pulses
or OUTA, nWRmask ' force nWR high
mov VCFG, vcfg_stop ' stop vid gen
movs CTRB, #0 ' relinquish counter control of nWR
call #stop_ram
djnz linecount, #:loop
sub row, #32 ' move to next char position
add col, #16
wv_glyph_ret ret
{ ------------------------------------------------------ }
wv_glyph_sm call #glyph_setup
mov linecount, #16
:loop call #move_to
add row, #1
call #start_ram
or DIRA, datamask
andn OUTA, datamask
movs CTRB, nWRpin ' take control of nWR
call #get_patt ' get pattern
add gaddr, #4
and pattern, H11111111 ' get every other bit from our char to shrink it
mov t2, pattern
shl t2, #2
or pattern, t2 ' duplicate the bit
shl pattern, #1 ' now h0h0g0g0f0f0e0e0d0d0c0c0b0b0a0a0 ( hgfedcba are bits from font)
or pattern, H11111111 ' now h0h1g0g1f0f1e0e1d0d1c0c1b0b1a0a1
' x1 codes a high byte of pixel, x0 codes low byte
' so colours register is HHHHHHHHLLLLLLLLhhhhhhhhllllllll where upper case = foreground
' lower case = background.
mov VSCL, vscale
mov VCFG, vcfg_go ' start vid gen in 2 bits/ pixel mode
waitvid colours, pattern' first data also synchronizes
andn OUTA, nWRmask ' expose counter control of nWR pulses
waitvid zero, #0 ' synchronize for ending nWR pulses
or OUTA, nWRmask ' force nWR high
mov VCFG, vcfg_stop ' stop vid gen
movs CTRB, #0 ' relinquish counter control of nWR
call #stop_ram
djnz linecount, #:loop
sub row, #16 ' move to next char position
add col, #8
wv_glyph_sm_ret ret
{ ------------------------------------------------------ }
foreground long $FFFF
background long $0000
MSdelay long 80_000
zero long 0
colours long $FFFF0000
vcfg_go long %0_01_1_0_0_000_00000_000000010_011111111
vcfg_go1 long %0_01_0_0_0_000_00000_000000010_011111111
vcfg_stop long %0_00_0_0_0_000_00000_000000010_011111111
H11111111 long $11111111
H55555555 long $55555555
ctrclkrate long $20000000 ' 10MHz for counter
pllclkrate long $10000000 ' 5MHz for pll
phasey long $C0000000
HFFFF long $FFFF
H0000000A long $0000000A
H000000A0 long $000000A0
H00000A00 long $00000A00
H0000A000 long $0000A000
H000A0000 long $000A0000
H00A00000 long $00A00000
H0A000000 long $0A000000
HA0000000 long $A0000000
vscale32 long (1 << 12) | 32 ' 1 clock per pixel, 16 clocks per frame
vscale long (1 << 12) | 16 ' 1 clock per pixel, 16 clocks per frame
pingroup long 0
datamask long 0
datashift long 0
nWRpin long 0
nWRmask long 0
nRDmask long 0
nCSmask long 0
RSmask long 0
nRESmask long 0
bLightmask long 0
IF_IDLE long 0
IF_ACTIVE long 0
IF_REG long 0
parm res 1
op res 1
arg res 1
pins res 1
pin res 1
msk res 1
delaycount res 1
time res 1
icount res 1
rcount res 1
regaddr res 1
reg_val res 1
dval res 1
t res 1
t2 res 1
ptr res 1
char res 1
col res 1
row res 1
gaddr res 1
linecount res 1
sixteens res 1
pattern res 1
strp res 1
left res 1
right res 1
lout res 1
rout res 1
expand res 1
old_col res 1
old_row res 1
x0 res 1
y0 res 1
xx res 1
yy res 1
x1 res 1
y1 res 1
xstep res 1
ystep res 1
dx res 1
dy res 1
FIT $1F0
{{
////////////////////////////////////////////////////////////////////////////////////////////
// TERMS OF USE: MIT License
////////////////////////////////////////////////////////////////////////////////////////////
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
////////////////////////////////////////////////////////////////////////////////////////////
}}
| Propeller Spin | 5 | deets/propeller | libraries/community/p1/All/ILI9325 320x240 TFT driver/ILI9325.spin | [
"MIT"
] |
-- In this file, change "/path/to/" to the path where you installed clang-format
-- and save it to ~/Library/Application Support/BBEdit/Scripts. You can then
-- select the script from the Script menu and clang-format will format the
-- selection. Note that you can rename the menu item by renaming the script, and
-- can assign the menu item a keyboard shortcut in the BBEdit preferences, under
-- Menus & Shortcuts.
on urlToPOSIXPath(theURL)
return do shell script "python -c \"import urllib, urlparse, sys; print urllib.unquote(urlparse.urlparse(sys.argv[1])[2])\" " & quoted form of theURL
end urlToPOSIXPath
tell application "BBEdit"
set selectionOffset to characterOffset of selection
set selectionLength to length of selection
set fileURL to URL of text document 1
end tell
set filePath to urlToPOSIXPath(fileURL)
set newContents to do shell script "/path/to/clang-format -offset=" & selectionOffset & " -length=" & selectionLength & " " & quoted form of filePath
tell application "BBEdit"
-- "set contents of text document 1 to newContents" scrolls to the bottom while
-- replacing a selection flashes a bit but doesn't affect the scroll position.
set currentLength to length of contents of text document 1
select characters 1 thru currentLength of text document 1
set text of selection to newContents
select characters selectionOffset thru (selectionOffset + selectionLength - 1) of text document 1
end tell
| AppleScript | 4 | clayne/DirectXShaderCompiler | tools/clang/tools/clang-format/clang-format-bbedit.applescript | [
"NCSA"
] |
package org.xtendroid.xtendroidtest.activities
import android.app.ProgressDialog
import android.widget.BaseAdapter
import java.util.Date
import java.util.List
import org.xtendroid.adapter.BeanAdapter
import org.xtendroid.app.AndroidActivity
import org.xtendroid.app.OnCreate
import org.xtendroid.xtendroidtest.R
import org.xtendroid.xtendroidtest.models.ManyItem
import static org.xtendroid.utils.AsyncBuilder.*
import static extension org.xtendroid.utils.AlertUtils.*
import static extension org.xtendroid.xtendroidtest.db.DbService.*
@AndroidActivity(R.layout.list_and_text) class DbTestActivity {
var List<ManyItem> manyItems
@OnCreate
def init() {
manyItems = db.lazyFindAll("manyitems", "id", ManyItem)
mainList.adapter = new BeanAdapter(this, R.layout.main_list_row, manyItems)
if (manyItems.size == 0) {
// let's make many items
val pd = new ProgressDialog(this)
pd.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL)
pd.title = "Creating many items"
pd.indeterminate = false
pd.max = 1000
pd.progress = 0
val now = new Date
async(pd) [a, params|
(0..1000).forEach [i|
db.insert("manyitems", #{
'createdAt' -> now,
'itemName' -> "Item " + i,
'itemOrder' -> i
})
if (a.isCancelled) return;
a.progress(i)
]
"done"
].then [String r|
manyItems = db.lazyFindAll("manyitems", "id", ManyItem)
(mainList.adapter as BaseAdapter).notifyDataSetChanged
].onProgress[Object[] values|
pd.progress = values.get(0) as Integer
].onError [Exception e|
toast("ERROR: " + e.message)
].start()
}
}
} | Xtend | 4 | kusl/Xtendroid | XtendroidTest/src/org/xtendroid/xtendroidtest/activities/DbTestActivity.xtend | [
"MIT"
] |
{:objects
{:Character {:fields
{:name {:type (non-null String)
:description "Character name"}
:episodes {:type (list :episode)}}
:description "A Star Wars character"}
:Query {:fields
{:find_all_in_episode {:type (list :Character)
:args
{:episode
{:type (non-null :episode)
:description "Episode for which to find characters."}}
:resolve :find-all-in-episode
:description "Find all characters in the given episode"}}}
:Mutation {:fields
{:add_character
{:type Boolean
:args {:character {:type (non-null :CharacterArg)}}
:resolve :add-character}}}}
:input-objects
{:CharacterArg {:fields
{:name {:type (non-null String)}
:episodes {:type (non-null (list :episode))}}}}
:enums
{:episode {:values [{:enum-value :NEWHOPE}
{:enum-value :EMPIRE}
{:enum-value :JEDI}]}}
:roots
{:query :Query
:mutation :Mutation}}
| edn | 4 | hagenek/lacinia | docs/_examples/parsed_sample_schema.edn | [
"Apache-2.0"
] |
check: func <T> (t: T, ref: Class) {
if (T != ref) {
"Fail! expected #{ref name}, got #{T name}" println()
exit(1)
}
}
checkValue: func (val, ref: UInt) {
if (val != ref) {
"Fail! expected #{ref}, got #{val}" println()
exit(1)
}
}
main: func {
check(42, Int)
check(42u, UInt)
check(42U, UInt)
check(42l, Long)
check(42L, Long)
check(42ll, LLong)
check(42LL, LLong)
check(42ull, ULLong)
check(42ULL, ULLong)
checkValue(0b101010u, 42u)
checkValue(0b000000101010u, 42u)
checkValue(0c52u, 42u)
checkValue(0x2au, 42u)
"Pass" println()
}
| ooc | 4 | shamanas/rock | test/compiler/literals/int-literal-suffixes.ooc | [
"MIT"
] |
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="security" uri="http://www.springframework.org/security/tags" %>
<html>
<head></head>
<body>
<h1>This is the landing page for the admin</h1>
<security:authorize access="hasRole('ROLE_USER')">
This text is only visible to a user
<br/>
</security:authorize>
<security:authorize access="hasRole('ROLE_ADMIN')">
This text is only visible to an admin
<br/>
</security:authorize>
<a href="<c:url value="/logout" />">Logout</a>
</body>
</html> | Java Server Pages | 4 | zeesh49/tutorials | spring-security-mvc-session/src/main/webapp/WEB-INF/view/console.jsp | [
"MIT"
] |
DROP TABLE "public"."table39";
| SQL | 1 | devrsi0n/graphql-engine | cli/commands/testdata/migrate-squash-test/migrations/1588172670201_create_table_public_table39/down.sql | [
"Apache-2.0",
"MIT"
] |
" Vim syntax file
" Language: "Robots.txt" files
" Robots.txt files indicate to WWW robots which parts of a web site should not be accessed.
" Maintainer: Dominique Stéphan ([email protected])
" URL: http://www.mggen.com/vim/syntax/robots.zip
" Last change: 2001 May 09
" quit when a syntax file was already loaded
if exists("b:current_syntax")
finish
endif
" shut case off
syn case ignore
" Comment
syn match robotsComment "#.*$" contains=robotsUrl,robotsMail,robotsString
" Star * (means all spiders)
syn match robotsStar "\*"
" :
syn match robotsDelimiter ":"
" The keywords
" User-agent
syn match robotsAgent "^[Uu][Ss][Ee][Rr]\-[Aa][Gg][Ee][Nn][Tt]"
" Disallow
syn match robotsDisallow "^[Dd][Ii][Ss][Aa][Ll][Ll][Oo][Ww]"
" Disallow: or User-Agent: and the rest of the line before an eventual comment
synt match robotsLine "\(^[Uu][Ss][Ee][Rr]\-[Aa][Gg][Ee][Nn][Tt]\|^[Dd][Ii][Ss][Aa][Ll][Ll][Oo][Ww]\):[^#]*" contains=robotsAgent,robotsDisallow,robotsStar,robotsDelimiter
" Some frequent things in comments
syn match robotsUrl "http[s]\=://\S*"
syn match robotsMail "\S*@\S*"
syn region robotsString start=+L\="+ skip=+\\\\\|\\"+ end=+"+
hi def link robotsComment Comment
hi def link robotsAgent Type
hi def link robotsDisallow Statement
hi def link robotsLine Special
hi def link robotsStar Operator
hi def link robotsDelimiter Delimiter
hi def link robotsUrl String
hi def link robotsMail String
hi def link robotsString String
let b:current_syntax = "robots"
" vim: ts=8 sw=2
| VimL | 4 | uga-rosa/neovim | runtime/syntax/robots.vim | [
"Vim"
] |
module chat
import io.vertx.lang.golo.GoloVerticleFactory
import io.vertx.golo.core.Vertx
import io.vertx.core.VertxOptions
import io.vertx.core.DeploymentOptions
import io.vertx.core.eventbus.DeliveryOptions
function main = |args|{
var chatVertStart = |verticle|{
let vertx = verticle: getVertx()
let eb = vertx: eventBus()
eb: consumer("chat-demo"):handler(|msg|{
println("[Chat-Demo] Received Msg from "+msg:headers():get("sent-by")+ " : " + msg:body())
})
}
var chatVert = GoloVerticleFactory():createGoloVerticle(chatVertStart,|v|{})
io.vertx.core.Vertx.clusteredVertx(VertxOptions(),|rep|{
let vertx = rep:result()
let eb = vertx:eventBus()
println(chatVert)
vertx: deployVerticle(chatVert,|depId|{
println("Chat Program Running!")
eb:publish("chat-demo","[Test Msg]",DeliveryOptions():addHeader("sent-by","[chat program]"))
var mainBlockingCode = {
var userName = readln("Enter User Name? ")
var finish = false
while(not finish){
var msg = readln()
if(msg == "exit"){
finish = true
}
eb:publish("chat-demo",msg,DeliveryOptions():addHeader("sent-by",userName))
}
return "Stopping Chat Program"
}
vertx:executeBlocking(|f|->f:complete(mainBlockingCode()),|r|->println(r:result()))
})
})
}
| Golo | 4 | ajnavarro/language-dataset | data/github.com/golo-vertx/chat-demo/0b00d89f602290adf3ae04b7fdc34593fc70f878/src/main/golo/main.golo | [
"MIT"
] |
*** Settings ***
Resource ../resources/resource.robot
*** Test Cases ***
Should send keys to inputs
Open iOS Test App
${attr} get element attribute class=XCUIElementTypeApplication name
should be equal ${attr} TestApp
close application
sleep 3s
run keyword and expect error No application is open get webelement class=XCUIElementTypeApplication | RobotFramework | 3 | ismoulsk/appium | sample-code/robotframework/tests/ios_create_session.test.robot | [
"Apache-2.0"
] |
(module
(type $t0 (func (result i32)))
(func $f1 (type $t0) (result i32)
(i32.const 42))
(func $f2 (type $t0) (result i32)
(i32.const 13))
(table $table (export "table") 2 anyfunc)
(elem (i32.const 0) $f1 $f2))
| WebAssembly | 3 | 1shenxi/webpack | test/cases/wasm/table/wasm-table-export.wat | [
"MIT"
] |
' ----- declare a bunch of functions -----
function noArgsFunc()
print "noArgsFunc"
end function
function requiredArgsFunc(a, b)
print "requiredArgsFunc:"
print a
print b
end function
function typedArgsFunc(a as float, b as integer, c as boolean)
print "typedArgsFunc:"
print a
print b
print c
end function
function optionalArgsFunc(a as integer, b = 2, c = a * 2)
print "optionalArgsFunc:"
print a
print b
print c
end function
' ----- then execute them -----
noArgsFunc()
requiredArgsFunc(1, 2)
typedArgsFunc(2.5, 3, false)
optionalArgsFunc(-5) | Brightscript | 3 | lkipke/brs | test/e2e/resources/function/arguments.brs | [
"MIT"
] |
\documentclass{article}
\usepackage{agda}
\begin{document}
\begin{code}
id : {A : Set} → A → A
id {A = A} x = x
foo : (A : Set) → A → A
foo B x = id {A = B} x
\end{code}
\end{document}
| Literate Agda | 3 | cruhland/agda | test/LaTeXAndHTML/succeed/Issue1053.lagda | [
"MIT"
] |
' ********** Copyright 2016 Roku Corp. All Rights Reserved. **********
Sub init()
m.count = 0
m.AdTimer = m.top.findNode("AdTimer")
m.Video = m.top.findNode("Video")
m.RowList = m.top.findNode("RowList")
m.BottomBar = m.top.findNode("BottomBar")
m.ShowBar = m.top.findNode("ShowBar")
m.HideBar = m.top.findNode("HideBar")
m.Hint = m.top.findNode("Hint")
m.Timer = m.top.findNode("Timer")
m.Hint.font.size = "20"
showHint()
m.array = loadConfig()
if m.array.count() = 1
m.BottomBar.visible = false
m.Video.setFocus(true)
end if
m.AdTimer.control = "start"
m.LoadTask = createObject("roSGNode", "RowListContentTask")
m.LoadTask.observeField("content", "rowListContentChanged")
m.LoadTask.control = "RUN"
m.RowList.setFocus(true)
m.RowList.rowLabelFont.size = "24"
m.Timer.observeField("fire", "hideHint")
m.AdTimer.observeField("fire", "change")
m.RowList.observeField("rowItemSelected", "ChannelChange")
End Sub
Sub change()
m.global.Adtracker = 0
End Sub
Sub hideHint()
m.Hint.visible = false
End Sub
Sub showHint()
m.Hint.visible = true
m.Timer.control = "start"
End Sub
Sub optionsMenu()
if m.global.Options = 0
m.ShowBar.control = "start"
m.RowList.setFocus(true)
hideHint()
else
m.HideBar.control = "start"
m.Video.setFocus(true)
showHint()
End if
End Sub
function onKeyEvent(key as String, press as Boolean) as Boolean
handled = false
if press
if key="up" or key = "down"
if m.global.Options = 0
m.global.Options = 1
optionsMenu()
else
m.global.Options = 0
optionsMenu()
end if
handled = true
end if
end if
return handled
end function
Function ChannelChange()
m.global.AdTracker = 0
m.Video.content = m.RowList.content.getChild(m.RowList.rowItemFocused[0]).getChild(m.RowList.rowItemFocused[1])
m.Video.control = "play"
End Function
Sub rowListContentChanged()
m.RowList.content = m.LoadTask.content
if m.count = 0
m.Video.content = m.RowList.content.getChild(0).getChild(0)
m.Video.control = "play"
m.count = 1
end if
End Sub
| Brightscript | 5 | khangh/samples | channel templates/Multi-Live Channel/components/HomeScene.brs | [
"MIT"
] |
integer isTyping = FALSE;
key botID;
default
{
state_entry()
{
//This creates a bot in the sim with the given name, outfit at the given start position.
botID = botCreateBot("Test", "Bot", "", llGetPos(), BOT_CREATE_DEFAULT);
}
touch_start(integer n)
{
if(!isTyping)
{
//Makes the bot begin typing
botStartTyping(botID);
botSay(botID, 0, "I'm starting to type");
}
else if(isTyping)
{
botSay(botID, 0, "I'm finished typing");
//Makes the bot stop typing
botStopTyping(botID);
}
isTyping = !isTyping;
}
} | LSL | 4 | Asterionworld/ether | doc/bot LSL Functions/Examples/bot Typing.lsl | [
"BSD-3-Clause"
] |
export default function Index() {
return <div />
}
| TypeScript | 1 | blomqma/next.js | test/integration/typescript-app-type-declarations/pages/index.tsx | [
"MIT"
] |
<stylesheet version="1.0" xmlns="http://www.w3.org/1999/XSL/Transform">
<template match="/">
<processing-instruction name="xml-stylesheet">
href="resources/xslt-recursion-chain2.xsl" type="text/xsl"
</processing-instruction>
<html xml:lang="en-us" xmlns="http://www.w3.org/1999/xhtml">
<body>
<style>
p.success {
display: none;
}
</style>
<link rel="stylesheet" href="resources/xslt-recursion-chain1.css" />
<script>
if (window.testRunner)
testRunner.dumpAsText();
</script>
<p class="success">Success!</p>
<p class="failure">Failure! (external CSS sheets were ignored)</p>
</body>
</html>
</template>
</stylesheet>
| XSLT | 4 | zealoussnow/chromium | third_party/blink/web_tests/fast/xsl/resources/xslt-recursion-chain1.xsl | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] |
// #docplaster
// #docregion, v1
import { Component, OnInit } from '@angular/core';
// #enddocregion v1
import { Hero } from '../hero';
// #docregion v1
@Component({
selector: 'app-heroes',
templateUrl: './heroes.component.html',
styleUrls: ['./heroes.component.css']
})
export class HeroesComponent implements OnInit {
// #enddocregion, v1
/*
// #docregion add-hero
hero = 'Windstorm';
// #enddocregion add-hero
*/
// #docregion
hero: Hero = {
id: 1,
name: 'Windstorm'
};
// #docregion v1
constructor() { }
ngOnInit(): void {
}
}
// #enddocregion, v1
| TypeScript | 4 | John-Cassidy/angular | aio/content/examples/toh-pt1/src/app/heroes/heroes.component.ts | [
"MIT"
] |
(module
(type $i (func (param i32) (result i32)))
(memory $0 0)
(export "test" (func $test))
(func $test (; 0 ;) (type $i) (param $0 i32) (result i32)
(if (result i32)
(i32.eqz
(get_local $0)
)
(i32.const 0)
(get_local $0)
)
)
) | WebAssembly | 3 | romdotdog/assemblyscript | tests/binaryen/optimize-if-eqz.wat | [
"Apache-2.0"
] |
/* Copyright 2019 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
#include <limits.h>
#include <stdint.h>
#include <sys/sendfile.h>
#include "tensorflow/c/experimental/filesystem/plugins/posix/copy_file.h"
namespace tf_posix_filesystem {
// Transfers up to `size` bytes from `dst_fd` to `src_fd`.
//
// This method uses `sendfile` specific to linux after 2.6.33.
int CopyFileContents(int dst_fd, int src_fd, off_t size) {
off_t offset = 0;
int bytes_transferred = 0;
int rc = 1;
// When `sendfile` returns 0 we stop copying and let callers handle this.
while (offset < size && rc > 0) {
// Use uint64 for safe compare SSIZE_MAX
uint64_t chunk = size - offset;
if (chunk > SSIZE_MAX) chunk = SSIZE_MAX;
rc = sendfile(dst_fd, src_fd, &offset, static_cast<size_t>(chunk));
if (rc < 0) return -1;
bytes_transferred += rc;
}
return bytes_transferred;
}
} // namespace tf_posix_filesystem
| C++ | 5 | yage99/tensorflow | tensorflow/c/experimental/filesystem/plugins/posix/copy_file_linux.cc | [
"Apache-2.0"
] |
body {
justify-content : center;
background-color : white;
color : black;
text-align : center;
margin-left : 15%;
margin-right : 15%;
} | CSS | 3 | DBatOWL/tutorials | spring-web-modules/spring-mvc-views/src/main/resources/themes/white.css | [
"MIT"
] |
#!/bin/bash
# Using `+e` so that all checks are run and we get a complete report (even if some checks failed).
set +e -u -o pipefail
# Variables
exitCode=0
# Helpers
function checkCert {
local certPath=$1
if [[ ! -f "$certPath" ]]; then
echo "Certificate '$certPath' does not exist. Skipping expiration check..."
return
fi
openssl x509 -checkend 0 -in "$certPath" -noout > /dev/null
reportStatus "Certificate '$certPath'"
if [[ $? -ne 0 ]]; then
echo " [WARN]"
echo " If you did not provide the certificate explicitly, try running the"
echo " 'docker build' command again with the '--no-cache' option to generate"
echo " a new self-signed certificate."
fi
}
function reportStatus {
local lastExitCode=$?
echo "$1: $([[ $lastExitCode -eq 0 ]] && echo OK || echo NOT OK)"
[[ $lastExitCode -eq 0 ]] || exitCode=1
return $lastExitCode
}
# Check services
services=(
rsyslog
cron
nginx
pm2-root
)
for s in ${services[@]}; do
service $s status > /dev/null
reportStatus "Service '$s'"
done
# Check SSL/TLS certificates expiration
certs=(
"$AIO_LOCALCERTS_DIR/$AIO_DOMAIN_NAME.crt"
"$TEST_AIO_LOCALCERTS_DIR/$TEST_AIO_DOMAIN_NAME.crt"
)
for c in ${certs[@]}; do
checkCert $c
done
# Check servers
origins=(
http://$AIO_PREVIEW_SERVER_HOSTNAME:$AIO_PREVIEW_SERVER_PORT
http://$AIO_NGINX_HOSTNAME:$AIO_NGINX_PORT_HTTP
https://$AIO_NGINX_HOSTNAME:$AIO_NGINX_PORT_HTTPS
)
for o in ${origins[@]}; do
curl --fail --silent $o/health-check > /dev/null
reportStatus "Server '$o'"
done
# Check resolution of external URLs
origins=(
https://google.com
)
for o in ${origins[@]}; do
curl --fail --silent $o > /dev/null
reportStatus "External URL '$o'"
done
# Exit
exit $exitCode
| Shell | 5 | raghavendramohan/angular | aio/aio-builds-setup/dockerbuild/scripts-sh/health-check.sh | [
"MIT"
] |
module openconfig-spanning-tree {
yang-version "1";
// namespace
namespace "http://openconfig.net/yang/spanning-tree";
prefix "oc-stp";
import openconfig-spanning-tree-types { prefix oc-stp-types; }
import openconfig-interfaces { prefix oc-if; }
import openconfig-types { prefix oc-types; }
import openconfig-vlan-types { prefix oc-vlan-types; }
import openconfig-yang-types { prefix oc-yang; }
import openconfig-extensions { prefix oc-ext; }
// meta
organization "OpenConfig working group";
contact
"OpenConfig working group
www.openconfig.net";
description
"This module defines configuration and operational state data
for the spanning tree protocol.";
oc-ext:openconfig-version "0.3.1";
revision "2019-11-28" {
description
"Correct revision statement date for v0.3.0";
reference "0.3.1";
}
revision "2019-07-10" {
description
"Remove the time-since-last-topology-change leaf and
replace it with a timestamp of last topology change.";
reference "0.3.0";
}
revision "2018-11-21" {
description
"Add OpenConfig module metadata extensions.";
reference "0.2.1";
}
revision "2017-07-14" {
description
"Migrated to OpenConfig types; fixed missing applied state
in rapid-pvst";
reference "0.2.0";
}
revision "2016-10-03" {
description
"Initial public revision";
reference "0.1.0";
}
// OpenConfig specific extensions for module metadata.
oc-ext:regexp-posix;
oc-ext:catalog-organization "openconfig";
oc-ext:origin "openconfig";
// identity statements
// grouping statements
grouping stp-interfaces-state {
description
"Grouping of STP operational data for bridge port";
leaf port-num {
type uint16;
description
"The port number of the bridge port";
reference "RFC4188 BRIDGE-MIB dot1dStpPort";
}
leaf role {
type identityref {
base oc-stp-types:STP_PORT_ROLE;
}
description
"The current role of the bridge port";
reference
"IEEE8021-MSTP-MIB ieee8021MstpPortRole";
}
leaf port-state {
type identityref {
base oc-stp-types:STP_PORT_STATE;
}
description
"The current state of the bridge port";
reference "RFC4188 BRIDGE-MIB dot1dStpPortState";
}
leaf designated-root-priority {
type oc-stp-types:stp-bridge-priority-type;
description
"The bridge priority of the bridge recorded as the
root in the configuration BPDUs transmitted by the designated
bridge for the segment to which the port is attached";
reference "RFC4188 BRIDGE-MIB dot1dStpPortDesignatedRoot";
}
leaf designated-root-address {
type oc-yang:mac-address;
description
"The bridge address of the bridge recorded as the
root in the configuration BPDUs transmitted by the designated
bridge for the segment to which the port is attached";
reference "RFC4188 BRIDGE-MIB dot1dStpPortDesignatedRoot";
}
leaf designated-cost {
type uint32;
description
"The path cost of the Designated Port of the
segment connected to this port";
reference "RFC4188 BRIDGE-MIB dot1dStpPortDesignatedCost";
}
leaf designated-bridge-priority {
type oc-stp-types:stp-bridge-priority-type;
description
"The bridge priority of the bridge that this port considers
to be the designated bridge for this port's segment.";
reference "RFC4188 BRIDGE-MIB dot1dStpPortDesignatedBridge";
}
leaf designated-bridge-address {
type oc-yang:mac-address;
description
"The bridge address of the bridge that this port considers
to be the designated bridge for this port's segment.";
reference "RFC4188 BRIDGE-MIB dot1dStpPortDesignatedBridge";
}
leaf designated-port-priority {
type oc-stp-types:stp-port-priority-type;
description
"The Port priority of the port on the Designated
Bridge for this port's segment, two octet string";
reference "RFC4188 BRIDGE-MIB dot1dStpPortDesignatedPort";
}
leaf designated-port-num {
type uint16;
description
"The Port number of the port on the Designated
Bridge for this port's segment, two octet string";
reference "RFC4188 BRIDGE-MIB dot1dStpPortDesignatedPort";
}
leaf forward-transisitions {
type oc-yang:counter64;
description
"The number of times this port has transitioned
from the Learning state to the Forwarding state";
reference "RFC4188 BRIDGE-MIB dot1dStpPortForwardTransitions";
}
container counters {
description
"The BPDU packet transmition statistics";
leaf bpdu-sent {
type oc-yang:counter64;
description
"The number of BPDU packet sent";
}
leaf bpdu-received {
type oc-yang:counter64;
description
"The number of BPDU packet received";
}
}
}
grouping stp-interfaces-config {
description
"Grouping of STP configuration for bridge port";
leaf name {
type oc-if:base-interface-ref;
description
"Reference to the STP ethernet interface";
}
leaf cost {
type uint32 {
range 1..200000000;
}
description
"The port's contribution, when it is the Root Port,
to the Root Path Cost for the Bridge";
reference
"IEEE 802.1D 17.13.11 PortPathCost";
}
leaf port-priority {
type oc-stp-types:stp-port-priority-type;
description
"The manageable component of the Port Identifier,
also known as the Port Priority";
reference
"IEEE 802.1D 17.13.10 Port Identifier Priority";
}
}
grouping stp-interfaces-top {
description
"Grouping of STP configuration and operation data for
bridge port";
container interfaces {
description
"Enclosing container for the list of interface references";
list interface {
key "name";
description
"List of interfaces on which STP is enable";
leaf name {
type leafref {
path "../config/name";
}
description
"Reference to the list key";
}
container config {
description
"Configuration data for STP on each interface";
uses stp-interfaces-config;
}
container state {
config false;
description
"Operational state data for STP on each interface";
uses stp-interfaces-config;
uses stp-interfaces-state;
}
}
}
}
grouping bridge-priority-config {
description
"Grouping for bridge priority";
leaf bridge-priority {
type oc-stp-types:stp-bridge-priority-type;
description
"The manageable component of the Bridge Identifier";
reference
"IEEE 802.1D 17.13.7 Bridge Identifier Priority";
}
}
grouping stp-common-state {
description
"Grouping for common STP operation data";
leaf bridge-address {
type oc-yang:mac-address;
description
"A unique 48-bit Universally Administered MAC Address
assigned to the bridge";
reference
"IEEE 802.1D 7.12.5 Unique identification of a bridge";
}
leaf designated-root-priority {
type oc-stp-types:stp-bridge-priority-type;
description
"The bridge priority of the root of the spanning
tree, as determined by the Spanning Tree Protocol,
as executed by this node";
reference
"RFC4188 BRIDGE-MIB dot1dStpDesignatedRoot";
}
leaf designated-root-address {
type oc-yang:mac-address;
description
"The bridge address of the root of the spanning
tree, as determined by the Spanning Tree Protocol,
as executed by this node";
reference
"RFC4188 BRIDGE-MIB dot1dStpDesignatedRoot";
}
leaf root-port {
type uint16;
description
"The port number of the port which offers the lowest
cost path from this bridge to the root bridge";
reference
"RFC4188 BRIDGE-MIB dot1dStpRootPort";
}
leaf root-cost {
type uint32;
description
"The cost of the path to the root as seen from this bridge";
reference
"RFC4188 BRIDGE-MIB dot1dStpRootCost";
}
leaf hold-time {
type uint8;
description
"This time value determines the interval length
during which no more than two Configuration bridge
PDUs shall be transmitted by this node";
reference
"RFC4188 BRIDGE-MIB dot1dStpHoldTime";
}
leaf topology-changes {
type oc-yang:counter64;
description
"The total number of topology changes detected by
this bridge since the management entity was last
reset or initialized";
reference
"RFC4188 BRIDGE-MIB dot1dStpTopChanges";
}
leaf last-topology-change {
type oc-types:timeticks64;
description
"The time at which the last topology change was
detected by the bridge entity. The value is
expressed relative to the Unix Epoch (Jan 1, 1970
00:00:00 UTC).";
}
}
grouping stp-timer-config {
description
"Grouping for common STP parameters";
leaf hello-time {
type uint8 {
range 1..10;
}
units "seconds";
description
"The interval between periodic transmissions of
configuration messages by designated ports";
reference
"IEEE 802.1D 17.13.6 Bridge Hello Time";
}
leaf max-age {
type uint8 {
range 6..40;
}
units "seconds";
description
"The maximum age of the information transmitted by the
bridge when it is the root bridge";
reference
"IEEE 802.1D 17.13.8 Bridge Max Age";
}
leaf forwarding-delay {
type uint8 {
range 4..30;
}
units "seconds";
description
"The delay used by STP bridges to transition root and
designated ports to forwarding";
reference
"IEEE 802.1D 17.13.5 Bridge Forward Delay";
}
leaf hold-count {
type uint8 {
range 1..10;
}
default 6;
description
"the maximum number of BPDUs per second that the
switch can send from an interface";
reference
"IEEE 802.1D 17.13.12 Transmit Hold Count";
}
}
grouping stp-rapid-pvst-config {
description
"Configuration parameters relating to rapid PVST";
leaf vlan-id {
type oc-vlan-types:vlan-id;
description
"Interface VLAN ID";
}
}
grouping stp-rapid-pvst-top {
description
"Top grouping for rapid per vlan spanning tree configuration
and operation data";
list vlan {
key "vlan-id";
description
"List of the vlans";
leaf vlan-id {
type leafref {
path "../config/vlan-id";
}
description
"Reference to the list key";
}
container config {
description
"Configuration data for each vlan";
uses stp-rapid-pvst-config;
uses stp-timer-config;
uses bridge-priority-config;
}
container state {
config false;
description
"Operational data for each vlan";
uses stp-rapid-pvst-config;
uses stp-timer-config;
uses bridge-priority-config;
uses stp-common-state;
}
uses stp-interfaces-top;
}
}
grouping mst-instance-config {
description
"Grouping for mstp instance configuration";
leaf mst-id {
type uint16 {
range "1..4094";
}
description
"In an MSTP Bridge, an MSTID, i.e., a value used to identify
a spanning tree (or MST) instance.";
reference
"IEEE8021-TC-MIB IEEE8021MstIdentifier";
}
leaf-list vlan {
type union {
type oc-vlan-types:vlan-id;
type oc-vlan-types:vlan-range;
}
description
"list of vlans mapped to the MST instance";
}
}
grouping mst-instance-top {
description
"Top level grouping for mstp instances";
list mst-instance {
key "mst-id";
description
"List of the mstp instances";
leaf mst-id {
type leafref {
path "../config/mst-id";
}
description
"Reference to the list key";
}
container config {
description
"Configuration data for MSTP instance";
uses mst-instance-config;
uses bridge-priority-config;
}
container state {
config false;
description
"Operational data for MSTP instance";
uses mst-instance-config;
uses bridge-priority-config;
uses stp-common-state;
}
uses stp-interfaces-top;
}
}
grouping mstp-config {
description
"Grouping for MSTP configuration data";
leaf name {
type string {
length "1..32";
}
description
"The Configuration Name in the MST Configuration Identifier";
reference
"IEEE 802.1Q 13.8 MST Configuration Identifier (MCID)";
}
leaf revision {
type uint32;
description
"The Revision Level in the MST Configuration Identifier";
reference
"IEEE 802.1Q 13.8 MST Configuration Identifier";
}
leaf max-hop {
type uint8 {
range 1..255;
}
description
"The max hop determines the number of bridges in an MST
region that a BPDU can traverse before it is discarded";
reference
"IEEE 802.1Q 13.26.4 BridgeTimes";
}
uses stp-timer-config;
}
grouping mstp-state {
description
"Operational state data for MSTP";
}
grouping stp-mstp-top {
description
"Top grouping for MSTP configuration and operation data";
container config {
description
"Configuration data for MSTP";
uses mstp-config;
}
container state {
config false;
description
"Operational data for MSTP";
uses mstp-config;
uses mstp-state;
}
container mst-instances {
description
"Configuration and operation data for MSTP instances";
uses mst-instance-top;
}
}
grouping stp-rstp-top {
description
"Top grouping for RSTP configuration and operation data";
container config {
description
"Configuration data for RSTP";
uses stp-timer-config;
uses bridge-priority-config;
}
container state {
config false;
description
"Operational state data for RSTP";
uses stp-timer-config;
uses bridge-priority-config;
uses stp-common-state;
}
uses stp-interfaces-top;
}
grouping stp-interface-common-config {
description
"Configuration data for interface specific STP features";
leaf name {
type oc-if:base-interface-ref;
description
"Reference to the STP Ethernet interface";
}
leaf edge-port {
type identityref {
base oc-stp-types:STP_EDGE_PORT;
}
description
"Configure the edge port state";
}
leaf link-type {
type oc-stp-types:stp-link-type;
description
"specifies the interface's link type";
}
leaf guard {
type oc-stp-types:stp-guard-type;
description
"Enable root guard or loop guard";
}
uses stp-bpdu-config;
}
grouping stp-interface-common-state {
description
"Operational state data for STP on interfaces";
}
grouping stp-interface-common-top {
description
"Top-level grouping for interface specific STP features";
list interface {
key "name";
description
"List of interfaces on which STP is enable";
leaf name {
type leafref {
path "../config/name";
}
description
"Reference to the list key";
}
container config {
description
"Configuration data for STP on each bridge port";
uses stp-interface-common-config;
}
container state {
config false;
description
"Operational state data for STP on each bridge port";
uses stp-interface-common-config;
uses stp-interface-common-state;
}
}
}
grouping stp-bpdu-config {
description
"Grouping for STP BPDU configuration";
leaf bpdu-guard {
type boolean;
description
"Enable edge port BPDU guard";
}
leaf bpdu-filter {
type boolean;
description
"Enable edge port BPDU filter";
}
}
grouping stp-global-config {
description
"Global spanning tree configuration";
leaf-list enabled-protocol {
type identityref {
base oc-stp-types:STP_PROTOCOL;
}
description
"List of the spanning tree protocols enabled on the
device";
}
leaf bridge-assurance {
type boolean;
description
"Enable bridge assurance to protect against unidirectional
link failure";
}
leaf etherchannel-misconfig-guard {
type boolean;
description
"EtherChannel guard detects a misconfigured EtherChannel
when interfaces on the switch are configured as an
EtherChannel while interfaces on the other device are not
or when not all the interfaces on the other device are in
the same EtherChannel.";
}
leaf bpduguard-timeout-recovery {
type uint8;
units "seconds";
description
"Amount of time, in seconds, the interface receiving BPDUs
is disabled. Once the timeout expires, the interface is
brought back into service.";
}
leaf loop-guard {
type boolean;
description
"The loop guard default setting for the bridge";
}
uses stp-bpdu-config;
}
grouping stp-global-state {
description
"Global operational state for STP";
}
grouping stp-global-base {
description
"Grouping for global spanning tree data";
container config {
description
"Global spanning tree configuration";
uses stp-global-config;
}
container state {
config false;
description
"Global spanning tree state";
uses stp-global-config;
uses stp-global-state;
}
}
grouping stp-top {
description
"Top-level grouping for spanning-tree model";
container stp {
description
"Top-level container for spanning tree configuration and
state data";
container global {
description
"Global configuration and state data";
uses stp-global-base;
}
container rstp {
description
"Rapid Spanning-tree protocol configuration and operation
data";
uses stp-rstp-top;
}
container mstp {
description
"Multi Spanning-tree protocol configuration and operation
data";
uses stp-mstp-top;
}
container rapid-pvst {
description
"Rapid per vlan Spanning-tree protocol configuration and
operational data";
uses stp-rapid-pvst-top;
}
container interfaces {
description
"Enclosing container for the list of interface references";
uses stp-interface-common-top;
}
}
}
// data definition statements
uses stp-top;
}
| YANG | 5 | bluecatgreen/public | release/models/stp/openconfig-spanning-tree.yang | [
"Apache-2.0"
] |
# This file is part of NIT ( http://www.nitlanguage.org ).
#
# Copyright 2014 Lucas Bajolet <[email protected]>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Sample module for a minimal chat server using Websockets on port 8088
module websocket_server
import websocket
var sock = new WebSocket(8088, 1)
var msg: String
if sock.listener.eof then
print sys.errno.strerror
end
sock.accept
while not sock.listener.eof do
if not sock.connected then sock.accept
if sys.stdin.poll_in then
msg = gets
printn "Received message : {msg}"
if msg == "exit" then sock.close
if msg == "disconnect" then sock.disconnect_client
sock.write(msg)
end
if sock.can_read(10) then
msg = sock.read_line
if msg != "" then print msg
end
end
| Nit | 3 | JavascriptID/sourcerer-app | src/test/resources/samples/langs/Nit/websocket_server.nit | [
"MIT"
] |
t app appmode photo
t app test vin_rotate 90
t app button shutter PR
| AGS Script | 0 | waltersgrey/autoexechack | rotation/Photo/90/autoexec.ash | [
"MIT"
] |
const fs = require('fs');
const process = require('process');
const assert = require('assert');
const buffer = fs.readFileSync(process.argv[2]);
let m = new WebAssembly.Module(buffer);
let list = WebAssembly.Module.exports(m);
console.log('exports', list);
let bad = false;
for (let i = 0; i < list.length; i++) {
const e = list[i];
if (e.name == "foo" || e.kind != "function")
continue;
console.log('unexpected exported symbol:', e.name);
bad = true;
}
if (bad)
process.exit(1);
| JavaScript | 3 | Eric-Arellano/rust | src/test/run-make/wasm-symbols-not-exported/verify-exported-symbols.js | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] |
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#pragma once
#include <memory>
#include <stdio.h>
#include <stdlib.h>
#include "vpx/vpx_encoder.h"
#include "mkvmuxer/mkvmuxer.h"
#include "mkvmuxer/mkvwriter.h"
namespace mozilla {
class WebMFileWriter {
public:
WebMFileWriter(FILE*, vpx_codec_enc_cfg_t* cfg);
~WebMFileWriter();
void writeFrame(const vpx_codec_cx_pkt_t* pkt);
void finish();
private:
vpx_codec_enc_cfg_t* m_cfg = nullptr;
std::unique_ptr<mkvmuxer::MkvWriter> m_writer;
std::unique_ptr<mkvmuxer::Segment> m_segment;
uint64_t m_videoTrackId = 0;
};
} // namespace mozilla
| C | 3 | NareshMurthy/playwright | browser_patches/firefox/juggler/screencast/WebMFileWriter.h | [
"Apache-2.0"
] |
# This file is distributed under the same license as the Django package.
#
# Translators:
# Jannis Leidel <[email protected]>, 2011
# Jonathan Lindén, 2014
msgid ""
msgstr ""
"Project-Id-Version: django\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-01-17 11:07+0100\n"
"PO-Revision-Date: 2017-09-19 16:40+0000\n"
"Last-Translator: Jonathan Lindén\n"
"Language-Team: Swedish (http://www.transifex.com/django/django/language/"
"sv/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: sv\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
msgid "Sessions"
msgstr "Sessioner"
msgid "session key"
msgstr "sessionsnyckel"
msgid "session data"
msgstr "sessionsdata"
msgid "expire date"
msgstr "utgångsdatum"
msgid "session"
msgstr "session"
msgid "sessions"
msgstr "sessioner"
| Gettext Catalog | 3 | jpmallarino/django | django/contrib/sessions/locale/sv/LC_MESSAGES/django.po | [
"BSD-3-Clause",
"0BSD"
] |
output "proxy_ip" {
description = "The static proxy ip address"
value = google_compute_address.proxy_ip.address
}
output "grafana_ip" {
description = "The static grafana ip address"
value = google_compute_address.grafana_ip.address
} | HCL | 3 | zouxifeng/teleport | assets/loadtest/network/outputs.tf | [
"Apache-2.0"
] |
@prefix : <http://www.w3.org/2013/TurtleTests/> .
:s1 :p :o .
[ :p1 :o1 ; :p2 :o2 ] .
:s2 :p :o .
| Turtle | 2 | joshrose/audacity | lib-src/lv2/serd/tests/TurtleTests/turtle-syntax-bnode-10.ttl | [
"CC-BY-3.0"
] |
/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
* Use of this file is governed by the BSD 3-clause license that
* can be found in the LICENSE.txt file in the project root.
*/
using Antlr4.Runtime.Misc;
namespace Antlr4.Runtime.Dfa
{
public class LexerDFASerializer : DFASerializer
{
public LexerDFASerializer(DFA dfa)
: base(dfa, Vocabulary.EmptyVocabulary)
{
}
[return: NotNull]
protected internal override string GetEdgeLabel(int i)
{
return "'" + (char)i + "'";
}
}
}
| C# | 4 | maximmenshikov/antlr4 | runtime/CSharp/src/Dfa/LexerDFASerializer.cs | [
"BSD-3-Clause"
] |
# Bad declaration.
PREFIX ex:ex:ex <http://example/>
ASK{} | SPARQL | 0 | alpano-unibz/ontop | test/sparql-compliance/src/test/resources/testcases-dawg-sparql-1.1/syntax-query/syn-bad-pname-02.rq | [
"Apache-2.0"
] |
dummy0:
network.managed:
- enabled: True
- type: eth
- ipaddr: 10.1.0.1
- netmask: 255.255.255.0
| SaltStack | 3 | byteskeptical/salt | tests/integration/files/file/base/network/managed.sls | [
"Apache-2.0"
] |
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
grammar JsonPath;
tokens {
DELIMITER
}
path
: pathMode pathExpression EOF
;
pathMode
: LAX
| STRICT
;
pathExpression
: accessorExpression #expressionDefault
| sign=('+' | '-') pathExpression #signedUnary
| left=pathExpression operator=('*' | '/' | '%') right=pathExpression #binary
| left=pathExpression operator=('+' | '-') right=pathExpression #binary
;
accessorExpression
: pathPrimary #accessorExpressionDefault
| accessorExpression '.' identifier #memberAccessor
| accessorExpression '.' stringLiteral #memberAccessor
| accessorExpression '.' '*' #wildcardMemberAccessor
| accessorExpression '[' subscript (',' subscript)* ']' #arrayAccessor
| accessorExpression '[' '*' ']' #wildcardArrayAccessor
| accessorExpression '?' '(' predicate ')' #filter
| accessorExpression '.' TYPE '(' ')' #typeMethod
| accessorExpression '.' SIZE '(' ')' #sizeMethod
| accessorExpression '.' DOUBLE '(' ')' #doubleMethod
| accessorExpression '.' CEILING '(' ')' #ceilingMethod
| accessorExpression '.' FLOOR '(' ')' #floorMethod
| accessorExpression '.' ABS '(' ')' #absMethod
| accessorExpression '.' DATETIME '(' stringLiteral? ')' #datetimeMethod
| accessorExpression '.' KEYVALUE '(' ')' #keyValueMethod
;
identifier
: IDENTIFIER
| nonReserved
;
subscript
: singleton=pathExpression
| from=pathExpression TO to=pathExpression
;
pathPrimary
: literal #literalPrimary
| variable #variablePrimary
| '(' pathExpression ')' #parenthesizedPath
;
literal
: numericLiteral
| stringLiteral
| nullLiteral
| booleanLiteral
;
numericLiteral
: MINUS? DECIMAL_VALUE #decimalLiteral
| MINUS? DOUBLE_VALUE #doubleLiteral
| MINUS? INTEGER_VALUE #integerLiteral
;
stringLiteral
: STRING // add unicode (like SqlBase.g4), add quoting in single quotes (')
;
nullLiteral
: NULL
;
booleanLiteral
: TRUE | FALSE
;
variable
: '$' #contextVariable
| NAMED_VARIABLE #namedVariable
| LAST #lastIndexVariable
| '@' #predicateCurrentItemVariable
;
// the following part is dedicated to JSON path predicate
predicate
: predicatePrimary #predicateDefault
| '!' delimitedPredicate #negationPredicate
| left=predicate '&&' right=predicate #conjunctionPredicate
| left=predicate '||' right=predicate #disjunctionPredicate
;
predicatePrimary
: delimitedPredicate #predicatePrimaryDefault
| left=pathExpression comparisonOperator right=pathExpression #comparisonPredicate
| base=pathExpression LIKE_REGEX pattern=stringLiteral ( FLAG flag=stringLiteral )? #likeRegexPredicate
| whole=pathExpression STARTS WITH (string=stringLiteral | NAMED_VARIABLE) #startsWithPredicate
| '(' predicate ')' IS UNKNOWN #isUnknownPredicate
;
delimitedPredicate
: EXISTS '(' pathExpression ')' #existsPredicate
| '(' predicate ')' #parenthesizedPredicate
;
comparisonOperator
: '==' | '<>' | '!=' | '<' | '>' | '<=' | '>='
;
// there shall be no reserved words in JSON path
nonReserved
: ABS | CEILING | DATETIME | DOUBLE | EXISTS | FALSE | FLAG | FLOOR | IS | KEYVALUE | LAST | LAX | LIKE_REGEX | MINUS | NULL | SIZE | STARTS | STRICT | TO | TRUE | TYPE | UNKNOWN | WITH
;
ABS: 'abs';
CEILING: 'ceiling';
DATETIME: 'datetime';
DOUBLE: 'double';
EXISTS: 'exists';
FALSE: 'false';
FLAG: 'flag';
FLOOR: 'floor';
IS: 'is';
KEYVALUE: 'keyvalue';
LAST: 'last';
LAX: 'lax';
LIKE_REGEX: 'like_regex';
MINUS: '-';
NULL: 'null';
SIZE: 'size';
STARTS: 'starts';
STRICT: 'strict';
TO: 'to';
TRUE: 'true';
TYPE: 'type';
UNKNOWN: 'unknown';
WITH: 'with';
DECIMAL_VALUE
: DIGIT+ '.' DIGIT*
| '.' DIGIT+
;
DOUBLE_VALUE
: DIGIT+ ('.' DIGIT*)? EXPONENT
| '.' DIGIT+ EXPONENT
;
INTEGER_VALUE
: DIGIT+
;
STRING
: '"' ( ~'"' | '""' )* '"'
;
IDENTIFIER
: (LETTER | '_') (LETTER | DIGIT | '_')*
;
NAMED_VARIABLE
: '$' IDENTIFIER
;
fragment EXPONENT
: ('E' | 'e') [+-]? DIGIT+
;
fragment DIGIT
: [0-9]
;
fragment LETTER
: [a-z] | [A-Z]
;
WS
: [ \r\n\t]+ -> channel(HIDDEN)
;
// Catch-all for anything we can't recognize.
UNRECOGNIZED: .;
| ANTLR | 4 | hitjl/trino | core/trino-parser/src/main/antlr4/io/trino/jsonpath/JsonPath.g4 | [
"Apache-2.0"
] |
c scnrm2sub.f
c
c The program is a fortran wrapper for scnrm2.
c Witten by Keita Teranishi. 2/11/1998
c
subroutine scnrm2sub(n,x,incx,nrm2)
c
external scnrm2
real scnrm2,nrm2
integer n,incx
complex x(*)
c
nrm2=scnrm2(n,x,incx)
return
end
| FORTRAN | 3 | dnoan/OpenBLAS | lapack-netlib/CBLAS/src/scnrm2sub.f | [
"BSD-3-Clause"
] |
/*!40103 SET TIME_ZONE='+00:00' */;
INSERT INTO `t_access3` VALUES
('@P&FLASHSHA');
INSERT INTO `t_access3` VALUES
('\Z');
| SQL | 2 | cuishuang/tidb | br/tests/lightning_issue_282/data/issue282.t_access3.sql | [
"Apache-2.0"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.