Skip to content

Instantly share code, notes, and snippets.

View bbarker's full-sized avatar

Brandon Elam Barker bbarker

View GitHub Profile
@bbarker
bbarker / OI_packaging_discussion.md
Last active November 12, 2023 18:31
OI packaging discussion 11/12/2023
  • https://repology.org/
    • doesn’t notify maintainers
    • provides a view of which packages are out of date
      • Till has a prototype that will bump versions “the forge” / activity pub
  • Docs - priority is to guide new people into the process of contributing in various ways process
  • OminoOS uses a patched version of illumos, including patches for linux branded zones
    • These apparently did not meet the requirements of getting upstreamed to illumos
  • Two diverging versions of IPS (with OI and OmniOS), but only two directories are a problem.
    • Dependency trees wouldn’t resolve
  • Rust version is on the backburner - as it was figured out what the slow issue was in IPS
@bbarker
bbarker / build.sbt
Created February 13, 2022 15:34
JitPack Resolvers in SBT
resolvers ++= Seq(
"jitpack.io" at "https://jitpack.io/",
),
@bbarker
bbarker / build.sbt
Created February 13, 2022 15:33
Jitpack dependency in SBT
"io.github.bbarker" %% "zio-diffx" % "0.0.4" % Test
@bbarker
bbarker / Example3h.java
Last active December 12, 2021 05:21
This example has the same result in Scala 2, though in Java there is one difference that relates to the fact that Java (unlike Scala) does not support declaration-site variance
ArrayList<JavaBean<Object>> beanList1 = new ArrayList(Arrays.asList(bean1, bean2, bean3));
public <A> void polySetAllBeansToFirst(List<JavaBean<A>> beanList) {
beanList.forEach((bean) -> bean.setTheA(beanList.get(0).getTheA()));
}
polySetAllBeansToFirst(beanList1);
// ^ We can't do this in Scala, because we can't even construct beanList1
@bbarker
bbarker / Example3g.scala
Created December 12, 2021 05:02
let's try and be slightly more clever and use an element contained in the list
def exSetAllBeansToFirst(beanList: List[ScalaBean[?]]): Unit =
val firstBean = beanList.head // bad: don't use head if the list may be empty
beanList.foreach{bean =>
bean.setTheA(firstBean.getTheA)
// ❌ Found: firstBean.A
// Required: bean.A
}
@bbarker
bbarker / Example3f.scala
Created December 12, 2021 05:00
Scala won't even let us try it (good!)
def exSetAllBeansTo(beanList: List[ScalaBean[?]], initBean: ScalaBean[?]): Unit =
beanList.foreach{bean =>
bean.setTheA(initBean.getTheA)
// ❌ Found: initBean.A
// Required: bean.A
}
@bbarker
bbarker / Example3e.scala
Created December 12, 2021 04:57
try to set values. Let's try making such a function
def polySetAllBeansTo[A](beanList: List[ScalaBean[A]], initBean: ScalaBean[A]): Unit =
beanList.foreach{bean =>
bean.setTheA(initBean.getTheA)
}
polySetAllBeansTo(beanList3, bean1)
// everything is now set to bean1's value
println(beanList2.map(_.getTheA))
polySetAllBeansTo(beanList2, bean1)
@bbarker
bbarker / Example3d.scala
Created December 12, 2021 04:54
incrementation worked as expected
List(1, 2)
List(2, 3)
@bbarker
bbarker / Example3c.scala
Created December 12, 2021 04:50
do something with its members
println(beanList3.map(_.getTheA))
beanList3.foreach{bean =>
bean.setTheA(bean.getTheA+1)
}
println(beanList3.map(_.getTheA))
val anyBean: ScalaBean[Any] = bean1