Unit and Widget Testing in Flutter
30:06
Пікірлер
@aozyhuang5847
@aozyhuang5847 5 күн бұрын
.value function should be revised to err = item.Value(func(val []byte) error { //get value lastHash = val //copy the value return nil })
@TensorProgramming
@TensorProgramming 5 күн бұрын
Sure, this was recorded 5 years ago and the APIs have changed. I believe the github repo reflects these changes.
@C__OmShirke
@C__OmShirke 6 күн бұрын
As this is a relatively old tutorial, do you think i should still follow this or things are outdated here??@TensorProgramming
@joewrose
@joewrose 10 күн бұрын
Great video! However, just wanted to leave a few pointers here for anyone else who stumbles across this video. The first thing to mention is that a u16, which is the value we use to hold our port when getting it from the CLI, can only hold values from 0 (the u in u16 , means unsigned, meaning it can't be negative) to 2^16=65535. As a result the guard statements created in this video (at least in my testing) will never be violated as the u16 value is incapable of holding values which violate our guard rules. This means that when you type an incorrect port into the CLI, you get a generic error generated by bpaf (I assume). Also, it's my preference to put the print statement saying a port is alive within the thread as this allows you to clean up the code a bit and also means that the code doesn't just sit not outputting anything for a few minutes while it goes through all the ports.
@monkeyrater
@monkeyrater 14 күн бұрын
hey Tensor, I miss your videos a lot. I currently watch programming on Twitch, a lot of good Rust programmers who stream there. My favorites are kuviman and lcolonq who are both very good. Maybe you could stream there once in a while, you can stay anonymous there. lcolonq is totally anonymous.
@fatcat2054
@fatcat2054 20 күн бұрын
thank you!
@panthercapenha
@panthercapenha 29 күн бұрын
I'm really enjoying the tutorial so far, but at this point i don't understand the WHY part. I hope to figure this out, but is there any theorycraft behind building it exactly this way? What I mean, is okay we have this TrimmedCopy used in Sign and Verify, but why exactly we should use trimmed copy? why the verify function is like this? :) I'm a complete newbie to this so I'm trying to understand every detail but of course that's hard to explain in this level of detail, that'd take hours and hours. maybe you could share some readings that i could read to understand this better?
@TensorProgramming
@TensorProgramming 28 күн бұрын
Trimmed copy is just a means of making it so that you aren't loading the entire transaction into memory every time you copy it. It would be too expensive to load all of that data instead of just the inputs and outputs. Since you only need the inputs and outputs to track the flow of the currency, it makes sense to trim out the rest of the metadata for that purpose. Block verification is somewhat straight forward once you get past all of the cryptography. First, we take some publicly known data, in this case, its the block header. We add a counter to it, then we get the hash of the data plus the counter and check to see if that hash meets certain requirements. If it does, you are done, if it doesn't you move on to the next counter and keep incrementing until you find a hash that satisfies the conditions. For verifying transactions, we want to verify the signatures of the transaction inputs. Its basically just a simple ecdsa verification and if it succeeds, we know the blockchain hasn't been tampered with. If you have any more questions, feel free to ask. I may remake this tutorial series at some point, but for now there isn't much else I can do but answer your questions.
@panthercapenha
@panthercapenha 28 күн бұрын
​@@TensorProgramming thank you for your reply! I hope you do remake this tutorial for the current state of things :) this is very very informative. Unfortunately it takes a lot of time for me to figure out the technical implementation for blockchain, but luckily there's this tutorial so i can dive deep into it :)
@dr3w979
@dr3w979 Ай бұрын
if findunspenttransactions already takes an address , why do we have to check wether the out can be unlocked by the same address in the FindUtxo function ?, seems redundant
@dr3w979
@dr3w979 Ай бұрын
Because some of the outputs in the transaction may not belong to the address, my bad
@crusader_
@crusader_ Ай бұрын
LOVE IT
@crusader_
@crusader_ Ай бұрын
LOVE IT
@Motorvator
@Motorvator Ай бұрын
Hmm. looks like Java except its been "Pythonified". I subscribed, maybe this is the language to do a android app in.
@TensorProgramming
@TensorProgramming Ай бұрын
Many android devs use Kotlin these days. Its cleaner than Java though I wouldn't say it takes queues from python as much as its just more like C# with some hints of bits of Scala, Groovy, JavaScript and Gosu in there.
@shaiquekhan1222
@shaiquekhan1222 Ай бұрын
thanks for this outstanding tutorial
@TensorProgramming
@TensorProgramming Ай бұрын
glad you liked the content.
@dr3w979
@dr3w979 Ай бұрын
Hello sir, i noticed your proof of work algorithm run pretty fast. what are your cpu specs ? Am running on a mac m1 16GB RAM and its not that fast.
@TensorProgramming
@TensorProgramming Ай бұрын
The speed is going to be based on the difficulty you set. Given I built this blockchain almost 5 years ago, I would have either been using a 3960X threadripper or an amd fx 8350. It was around this time that I replaced my CPU.
@HerculesZhan
@HerculesZhan Ай бұрын
THANK YOU FOR THE VIDEOS ON GO
@yash1152
@yash1152 2 ай бұрын
6:57 i just noticed that every indent level is differently colored... kinda neat are u still using this? and which extension did u use for this?
@TensorProgramming
@TensorProgramming 2 ай бұрын
I am using indenticator mixed with indent-rainbow. The later is the one that is giving them all different colors.
@Rishabh0501
@Rishabh0501 2 ай бұрын
Great Explanation. But I'm having some issues in understanding it properly. Is there any resource you would like to suggest that help me better understand? Thanks!
@TensorProgramming
@TensorProgramming 2 ай бұрын
For Genserver specifically? The Hex Docs on it are pretty comprehensive and do a good job explaining what the abstraction is about. Just keep in mind, its basically just a pattern that you can follow to easily make processes and message passing APIs. Elixir School would be another resource that also has some good explanations on GenServer and other OTP concepts.
@Rishabh0501
@Rishabh0501 2 ай бұрын
Thanks for this video. It's a great learning experience. I have question about the size of the process. Size of the process will change based on the amount of processing, right? Or it will be around 2kb irrespective of the required processing.
@TensorProgramming
@TensorProgramming 2 ай бұрын
Each of the processes on the BEAM starts at 2kb and then increases from there based on the data structures that you assign to their heap. They can get pretty large depending on how stateful they are. Fortunately, you have per process garbage collection which you can invoke manually if you really need to. That being said, I've only really had to do this on one app that was pulling millions of timeseries entries from an influxdb. Eventually, I ended up using a process pool for this task and just dumped the process after it was finished instead of using the GC directly. This is also an effective way to keep the processes low in cost; killing them and passing the state off to a new one after minimizing its size. Its almost always useful to treat your elixir/erlang processes as disposable. You can see the process size using the observer and the IEX repl.
@Rishabh0501
@Rishabh0501 2 ай бұрын
@@TensorProgramming Thanks a lot Tensor for such a great explanation!
@TensorProgramming
@TensorProgramming 2 ай бұрын
@@Rishabh0501 Not a problem. As an amendment to said explanation, each process has its own isolated heap. I kind of implied as much but thats how they can start at 2kb.
@saranshrana9404
@saranshrana9404 2 ай бұрын
hello sir can i start learning go with your blockchain video as i am beginer in go lang
@TensorProgramming
@TensorProgramming 2 ай бұрын
Well, good luck. I do recommend maybe going through some of the fundamental videos first however as you will need to learn fundamental golang concepts to get into this program.
@djeragon6544
@djeragon6544 2 ай бұрын
Is there a way to make this but with P2P ?
@TensorProgramming
@TensorProgramming 2 ай бұрын
You'd want to swap over to UDP instead of TCP and then you would need some kind of relay system to find the peers. Raft for example would be very easy to implement on top of this code.
@philosophia5577
@philosophia5577 2 ай бұрын
Tensor, amazing quality tutorials as always.. Dart ecosystem has evolved a lot, specially in server side. We have Shelf, Frog, Serverpod, Celest and what not!!! There is no tutorial which teaches how to create a production ready backend from shelf or any such guide and I am sort of new... If you can invest some time in Server Side Dart, I would really really love that! Thanks for the amazing tutorials you make man!!
@TensorProgramming
@TensorProgramming 2 ай бұрын
Thats something I've been meaning to do for awhile and its certainly still on my Todo list. Dart is a powerful language even outside of flutter but many people just overlook it.
@Moddingmonster-v6f
@Moddingmonster-v6f 2 ай бұрын
What consensus algo used in this series
@TensorProgramming
@TensorProgramming 2 ай бұрын
Proof of work.
@Moddingmonster-v6f
@Moddingmonster-v6f 2 ай бұрын
@@TensorProgramming can you please tell me how can I add pos
@TensorProgramming
@TensorProgramming 2 ай бұрын
@@Moddingmonster-v6f Thats not really something that I can describe in a KZbin comment as its vastly different from PoW.
@yinatech1871
@yinatech1871 2 ай бұрын
Thanks, but why do you use []*BLock on the chain, does the pointer here have importance?
@kyleaustin2728
@kyleaustin2728 3 ай бұрын
It’s obvious that you’re very intelligent and conveying information very well; but then I see it’s filmed at past 11pm and realize you’re also a savage. Bravo.
@TensorProgramming
@TensorProgramming 3 ай бұрын
Good o' insomnia...
@Malpekar-mo4wb
@Malpekar-mo4wb 3 ай бұрын
yes very nice video
@TensorProgramming
@TensorProgramming 3 ай бұрын
Glad you found the content useful.
@brandbreaker6468
@brandbreaker6468 3 ай бұрын
is this still relevent @Tensor programming
@TensorProgramming
@TensorProgramming 3 ай бұрын
It should be. I will be replacing it at some point soon though.
@VishalSharma-f4n
@VishalSharma-f4n 3 ай бұрын
Thanks for creating such lucid videos on blockchain.
@TensorProgramming
@TensorProgramming 3 ай бұрын
Glad you like the content. I should maybe do a rerelease of this project at some point.
@manishgautam2424
@manishgautam2424 4 ай бұрын
need more such videos , why not you create a product like serverpod with support of gRPC
@TensorProgramming
@TensorProgramming 4 ай бұрын
I don't see the point. Serverpod is plenty fast and you could add gRPC endpoints to your serverpod instance.
@beaj8206
@beaj8206 4 ай бұрын
what is your keyboard, please let me know
@TensorProgramming
@TensorProgramming 4 ай бұрын
I use a glove80. But was using a corsair keyboard when I wrote this video.
@flflflflflfl
@flflflflflfl 4 ай бұрын
You mixed up ports and adapters in the diagram
@TensorProgramming
@TensorProgramming 4 ай бұрын
Not really sure what you mean.
@flflflflflfl
@flflflflflfl 4 ай бұрын
@@TensorProgramming There is a diagram in the thumbnail with boxes labeled "Port" and "Adapter". The adapters live on the very edge of the system, providing access to the ports for a given scenario (e.g. a "web" adapter accepting HTTP request and forwarding the data to the "create order" port). But in your diagram, the ports are on the outside, and the adapters are on the inside.
@TensorProgramming
@TensorProgramming 4 ай бұрын
@@flflflflflfl Ahh right I see what you are saying. If I recall, I just grabbed the diagram off of google to make the thumbnail. Unfortunately, that means someone else made the mistake and is proliferating that bad information. Its so small that I am surprised you noticed but yes you are right. Ports are the boundaries of the application where as adapters are the components that allow the application to interact with specific technologies. I'm not sure its worth fixing as my explanation should be correct in the video and again the image is so small in the thumbnail.
@danielvega646
@danielvega646 4 ай бұрын
Wow, msgpack looks really easy to handle. Shall it be a good practice to always supersede json with msgpack? since it would be less bandwidth throughout communications!
@TensorProgramming
@TensorProgramming 4 ай бұрын
It really just depends on the usecase. Msgpack might be generally faster and smaller but thats not always the main concern. Json APIs tend to be easier to implement since you have access to many different libraries.
@danielvega646
@danielvega646 4 ай бұрын
Fell in love with that logger and the fact that both client and server can see the error. A marvellous API!
@TensorProgramming
@TensorProgramming 4 ай бұрын
Definitely a nice setup for debugging. Obviously you would want a filter if you pushed something like this to prod so that you don't flood the client with information that they don't need.
@danielvega646
@danielvega646 4 ай бұрын
Stately!
@danielvega646
@danielvega646 4 ай бұрын
What I want to know is... Another company has a regular API on RESTful architecture, is it possible to send a POST request from my gRPC API? And if not, is it worth it the process of passing my gRPC request through some proxy that converts it into regular REST request and viceversa? The JSON response from the REST api is it worth it to translate it into protobuff for my gRPC API? Or I wouldn't notice an improvement in performance and just a regular REST APIs connection would be enough?
@TensorProgramming
@TensorProgramming 4 ай бұрын
You can call rest apis from a gRPC client via certain plugins. Theres one that lets you encode the data to/from Json. You won't get the advantages of using protobuf from these calls, but it doesn't add any extra overhead to a normal rest call. In other words, you don't really need to build your own logic for this, just use one of the many plugins.
@danielvega646
@danielvega646 4 ай бұрын
@@TensorProgramming wow, I must admit, I feel honored for receiving a response from you and so quickly! Really appreciate, master. gRPC feels so cool and I am just going through your go microservices series. And I was thinking... I have a microservices system: a client app that sends through graphQL requests to my main server which does of gateway for my microservices through gRPC and thus, my microservice that consumes a vendor REST API gets touched from gRPC. I was thinking... Well, I just need to do the regular REST JSON HTTP 1.0 POST request to the vendors API inside my microservice gRPC method, retrieve the response and propagate it back through gRPC to my gateway server and then it can answer to my client graphQL request. Does that architecture make sense? I am new to this, I am sorry if what I am saying sounds stupid.
@danielvega646
@danielvega646 4 ай бұрын
@@TensorProgramming Thank you so much for your response, I feel honored.
@abubakarfarooq13
@abubakarfarooq13 4 ай бұрын
it's worthy @Tensor Programming in 2024?
@TensorProgramming
@TensorProgramming 4 ай бұрын
Elixir doesn't change that much; nothing in this tutorial is depreciated.
@abubakarfarooq13
@abubakarfarooq13 4 ай бұрын
@@TensorProgramming Thank you sir 💚
@bobert286
@bobert286 4 ай бұрын
This was excellent - thank you for actually detailing the nuances!
@TensorProgramming
@TensorProgramming 4 ай бұрын
Glad you found the content useful.
@robbybruce3619
@robbybruce3619 5 ай бұрын
Thank you, I love your content, this series has been fantastic! Your voice reminds me of a very relaxed Jonah Hill, and I’ve appreciated listening to you nearly as much as I’ve appreciated what you’ve actually said.
@TensorProgramming
@TensorProgramming 5 ай бұрын
I usually get Norm McDonald but I suppose I could hear some Jonah Hill in there as well. Thanks mate, glad you found the content useful.
@hugoandres5480
@hugoandres5480 5 ай бұрын
What vscode theme are you using? thanks
@TensorProgramming
@TensorProgramming 5 ай бұрын
Spacemacs dark with fira code font.
@JieZhao2011
@JieZhao2011 5 ай бұрын
How is the larger equal sign in the code? Is that something special for elixir?
@TensorProgramming
@TensorProgramming 5 ай бұрын
No, its just code ligatures. Ligatures are just a means of taking multiple font characters and combining them into a single character. In this case, either 2 or more equal signs.
@JG-nm9zk
@JG-nm9zk 5 ай бұрын
Still useful 6 years later. I'm making a layout engine in lua to be embedded into a game. I don't think I would have jumped into the documentation without this. Everything was simple until I started making boxes lol.
@TensorProgramming
@TensorProgramming 5 ай бұрын
Nice, glad you found it useful.
@Matthew-pl2gi
@Matthew-pl2gi 5 ай бұрын
Thank you! This is great foundation for learning.
@consoledoterror971
@consoledoterror971 5 ай бұрын
more like wrapper pattern
@TensorProgramming
@TensorProgramming 5 ай бұрын
In go they are very similar.
@joshuaejike3777
@joshuaejike3777 6 ай бұрын
this is a wonderful video for me for everyone that want to learn module
@shaharts8333
@shaharts8333 6 ай бұрын
Nice
@Chemaclass
@Chemaclass 6 ай бұрын
awesome tutorial, thanks!
@tronganhnguyenthanh1157
@tronganhnguyenthanh1157 6 ай бұрын
How does Elixir convert from 0xFF into 255 and 3.0e-2 into 0.03 ?
@TensorProgramming
@TensorProgramming 6 ай бұрын
It just has to do with the basic conversion that happens inside of the repl for the sake of simplicity. In reality, all of these values have equivalencies as far as data goes.
@tronganhnguyenthanh1157
@tronganhnguyenthanh1157 6 ай бұрын
This is weird on Elixir. Why does it have to appear the code x = 10 twice, but it doesn't print the number 10 directly when we type x = 10 for the first time ? x = 10 x = 10 10 But not x = 10 10.
@TensorProgramming
@TensorProgramming 6 ай бұрын
Its showing the input and the output. The first line is just what I typed where as the 2nd line is the input in the repl and the 3rd line is the output. If you did this in the CLI instead of emacs, it would just show one line for input and one for output.
@Chemaclass
@Chemaclass 6 ай бұрын
Super useful! Thank you so much
@munecochester
@munecochester 6 ай бұрын
Hey dude this is a nice course, congrats for that, you have to make an update on this one
@TensorProgramming
@TensorProgramming 6 ай бұрын
Elm as a language hasn't really changed that much. I believe the version is still 0.19.1 which is the release that came out after this series.
@saurabhranjan4951
@saurabhranjan4951 6 ай бұрын
I am currently in the middle of migrating a monolithic server into microservices and came across this. Good video series, appreciate the effort.
@TensorProgramming
@TensorProgramming 6 ай бұрын
Glad you found it useful. Good luck, that kind of migration can get hairy if you aren't careful.
@ruan800
@ruan800 6 ай бұрын
Your Elixir videos and this one has been extremely useful as a more hands on approach. Coming from Erlang things were slighly different 👍
@TensorProgramming
@TensorProgramming 6 ай бұрын
I hear you. I went from Elixir to erlang and it definitely was different.
@Seanomarachain
@Seanomarachain 6 ай бұрын
Another fantastic explanation. Pground.print(10) 1 2 3 4 5 6 7 8 9 10 When you have def print(0), do: :ok def print(n) do print(n - 1) IO.puts(n) end
@TensorProgramming
@TensorProgramming 6 ай бұрын
Right, its the magic of editing.