Replacing “Programmers:” with “Program:” is more accurate.
spoiler
Tower of Hanoi is actually easy to write program for. Executing it on the other hand…
Replacing “Programmers:” with “Program:” is more accurate.
Tower of Hanoi is actually easy to write program for. Executing it on the other hand…
I don’t know either, but from what I know, bureaucracy and corruption is often a result of bad organizational structure. Some “designated officer” raises a finger which gets approved by the Secretary who is appointed by the minister who is appointed by the PM who is nominated by the Lok Sabha, and we lose yet another privacy protecting service. I think we should have more direct control in these matters.
For now, if we cannot expect a proper functioning web, they cannot expect stability under their seats. Vote them out.
They never will, we have to vote them out.
Hmm… Maybe I should adjust my priorities.
I was confused for a moment, because intuitively a CPU fan would look in the same direction as it blows air, so it should look into the heatsink. The fan looking away from the heatsink seems weird to me.
Or the owner installed the fan in the wrong direction.
I was thinking along the lines of
Plenty of libraries can build the XML using structs/classes. e.g. with serde:
//Data type for row
#[derive(serde::Serialize)]
pub struct Foo {
pub status: String,
pub name: String,
}
//Example row
let ent = Foo {
status: "paid".into(),
name: "bob".into(),
}
//Example execution
sqlx::query(&serde_xml_rs::to_string(&InsertStmt{
table: "foo".into(),
value: &ent,
})?).execute(&conn)?;
Or with jackson-dataformat-xml:
//Data type for row
public class Foo {
public string status;
public string name;
}
//Example row
Foo ent = new Foo();
foo.status = "paid";
foo.value = "bob";
//Example execution
XmlMapper xmlMapper = new XmlMapper();
String xml = xmlMapper.writeValueAsString(new InsertStmt("foo", ent));
try (Statement stmt = conn.createStatement()) {
stmt.executeUpdate(xml)
}
I don’t do JS (yet) but maybe JSX could also do similar things with XML queries.
No more matching $1, $2, … (or ?
for mysql) with individual columns, I could dump entire structs/objects into a query and it would work.
1 a : to propel oneself in water by natural means (such as movements of the limbs, fins, or tail) b : to play in the water (as at a beach or swimming pool) 2 : to move with a motion like that of swimming : glide a cloud swam slowly across the moon 3 a : to float on a liquid : not sink b : to surmount difficulties : not go under sink or swim, live or die, survive or perish— Daniel Webster 4 : to become immersed in or flooded with or as if with a liquid potatoes swimming in gravy 5 : to have a floating or reeling appearance or sensation
https://www.merriam-webster.com/dictionary/swim
Apparently, swimming inherently requires a liquid.
Better than parameterized queries. Yes, we have stuff like query("INSERT INTO table(status, name) VALUES ($1, $2);").bind(ent.status).bind(ent.name).execute...
, but that’s kind of awful isn’t it?
With XML queries, we could use any of the XML libraries we have to create and manipulate XML queries without risking ‘XML injection’. e.g we could convert ordinary structs/classes into column values automatically without having to use any ORM.
I actually like this. This would allow reuse of all the infrastructure we have around XML. No more SQL injection and dealing with query parameters? Sign me up!
We can say default is and
and add an Or
node for or
. Similar to SoP notation, you only write +
.
TPM stores the encryption key against secure boot. That way, if attacker disables/alters secure boot then TPM won’t unseal the key. I use clevis to decrypt the drive.
Thank you… I had to learn kubernetes for work and it was around 2 weeks of time investment and then I figured out I could use it to fix my docker-compose pains at home.
If you run a lot of services, I can attest that kubernetes is definitely not overkill, it is a good tool for managing complexity. I have 8 services on a single-node kubernetes and I like how I can manage configuration for each service independent of each other and also the underlying infrastructure.
don’t create one network with Gitlab, Redmine and OpenLDAP - do two, one with Gitlab and OpenLDAP, and one with Redmine and OpenLDAP.
This was the setup I had, but now I am already using kubernetes with no intention to switch back.
I was writing my own compose files, but see my response to a sibling comment for the issue I had.
If one service needs to connect to another service then I have to add a shared network between them. In that case, the services essentially shared a common namespace regarding DNS. DNS resolution would routinely leak from one service to another and cause outages, e.g if I connect Gitlab container and Redmine container with OpenLDAP container then sometimes Redmine’s nginx container would access Gitlab container instead of Redmine container and Gitlab container would access Redmine’s DB instead of its own DB.
I maintained some workarounds, like starting Gitlab after starting Redmine would work fine but starting them other way round would have this issue. But switching to Kubernetes and replacing the cross-service connections with network policies solved the issue for me.
Nothing will ever top “Galaxy Note 7”. Super fun in planes, especially if they’re flying.
As someone who is operating kubernetes for 2 years in my home server, using containers is much more maintainable compared to installing everything directly on the server.
I tried using docker-compose first to manage my services. It works well for 2-3 services, but as the number of services grew they started to interfere with each other, at that point I switched to kubernetes.
All these are just silly stereotypes that almost nobody fits into.
You have rust.
You get a horse and arrive at the castle within seconds but the horse is too old and doesn’t work with the castle.
You remove the horse, destructure the castle and rescue the princess within seconds, but now you have no horse.
While you’re finding a compatible horse and thinking whether you should write your own horse, Bowser recaptures the princess and moves her to another castle.
I didn’t know the answer either, but usually you can compose solution from solutions of smaller problems.
solution(0): There are no disks. Nothing to do. solution(n): Let’s see if I can use solution(n-1) here. I’ll use solution(n-1) to move all but last disk A->B, just need to rename the pins. Then move the largest disk A->C. Then use solution(n-1) to move disks B->C by renaming the pins. There we go, we have a stack based solution running in exponential time.
It’s one of the easiest problem in algorithm design, but running the solution by hand would give you a PTSD.