Is there something like a null-stream in Ruby?

If you want the full behavior of streams, the best is probably to use: File.open(File::NULL, “w”) Note that File::NULL is new to Ruby 1.9.3; you can use my backports gem: require ‘backports/1.9.3/file/null’ # => Won’t do anything in 1.9.3+ File.open(File::NULL, “w”) # => works even in Ruby 1.8.6 You could also copy the relevant code … Read more

Are there free realtime financial data feeds since the demise of OpenQuant? [closed]

I think you’ll find all you need to know by looking at this question: source of historical stock data I don’t know of any free data feeds other than Yahoo!, but it doesn’t offer tick-by-tick data, it only offers 1 minute intervals with a 15 minute delay. If you want to use an already existing … Read more

cstdio streams vs iostream streams?

The C and C++ standards make no requirements on how things are implemented, just on what the effect of certain operations is. For the <stdio> vs. <iostream> functionality this means that one could wrap the other, both could be essentially the same, or that they are either entirely independent. Technically, using a common implementation would … Read more

InputStreamReader vs FileReader

First, InputStreamReader can handle all input streams, not just files. Other examples are network connections, classpath resources and ZIP files. Second, FileReader until Java 11 did not allow you to specify an encoding and instead only used the plaform default encoding, which made it pretty much useless as using it would result in corrupted data … Read more

“Parameter not valid” exception loading System.Drawing.Image

I had the same problem and apparently is solved now, despite this and some other gdi+ exceptions are very misleading, I found that actually the problem was that the parameter being sent to a Bitmap constructor was not valid. I have this code: using (System.IO.FileStream fs = new System.IO.FileStream(inputImage, System.IO.FileMode.Open, System.IO.FileAccess.ReadWrite)) { try { using … Read more

Decode large stream JSON

There is an example of this sort of thing in encoding/json documentation: package main import ( “encoding/json” “fmt” “log” “strings” ) func main() { const jsonStream = ` [ {“Name”: “Ed”, “Text”: “Knock knock.”}, {“Name”: “Sam”, “Text”: “Who’s there?”}, {“Name”: “Ed”, “Text”: “Go fmt.”}, {“Name”: “Sam”, “Text”: “Go fmt who?”}, {“Name”: “Ed”, “Text”: “Go fmt … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)