Uno scrittoio digitale …

27 giugno 2017

Gedit for Mac Osx

Archiviato in: Senza categoria — Tag:, — admin @ 21:18

download from
https://blogs.gnome.org/jessevdk/2014/09/02/gedit-3-14-for-os-x-preview/
( see http://ftp.gnome.org/pub/GNOME/binaries/mac/gedit/beta/ )

add
alias gedit=”open -a gedit”
to ~/.bash_profile

6 giugno 2017

Enterprisify your Java Class Names!

Archiviato in: Senza categoria — Tag: — admin @ 18:26

java class name

6 febbraio 2017

TestPyramid

Archiviato in: code — Tag:, — admin @ 09:34

remember what MF says

23 gennaio 2017

to be seen

Archiviato in: java — Tag: — admin @ 09:41

custom collectors in java
jmh for java
Simple performance framework for java

29 dicembre 2016

NPE Java8 Stream

Archiviato in: code — Tag:, , — admin @ 17:40

Volendo convertire una lista in una mappa … c’è un metodo sicuramente sbagliato:

	final Map data = new HashMap<>();
	data.put(1, "uno");

	System.out.println("1.");
	System.out.println(
		IntStream.rangeClosed(1, 2).boxed()
			.collect(
				HashMap::new,
				(map, i) -> map.put(i, data.get(i)),
				HashMap::putAll
			)
	);

	System.out.println("2.");
	//questa implementazione si basa sul metodo HashMap.merge (che lancia exception)
	System.out.println(
		IntStream.rangeClosed(1, 2).boxed()
			.collect(Collectors.toMap(
				i -> i, i -> data.get(i)
			))
	);

ottengo a console:

1.
{1=uno, 2=null}
2.
Exception in thread "main" java.lang.NullPointerException
	at java.util.HashMap.merge(HashMap.java:1224)
	at java.util.stream.Collectors.lambda$toMap$58(Collectors.java:1320)
	at java.util.stream.ReduceOps$3ReducingSink.accept(ReduceOps.java:169)
	at java.util.stream.IntPipeline$4$1.accept(IntPipeline.java:250)
	at java.util.stream.Streams$RangeIntSpliterator.forEachRemaining(Streams.java:114)
	at java.util.Spliterator$OfInt.forEachRemaining(Spliterator.java:693)
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
	at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
	at com.contactlab.at.Errors.main(Errors.java:28)

24 dicembre 2016

Stay tuned with

Archiviato in: Senza categoria — Tag: — admin @ 00:48

http://benjiweber.co.uk/
http://blog.revathskumar.com/

:D

25 settembre 2016

graphicsjs

Archiviato in: web — admin @ 19:37

http://www.graphicsjs.org/

25 luglio 2016

React communication between component

Archiviato in: web — Tag:, , , — admin @ 23:40

see

7 luglio 2016

java mysql driver

Archiviato in: code, java — Tag:, — admin @ 10:10

avoid OutOfMemory with simulated streaming:


            conn = DriverManager.getConnection(ds.getJdbcUrl(), ds.getUser(), ds.getPassword());
            stmt = conn.createStatement(java.sql.ResultSet.TYPE_FORWARD_ONLY, java.sql.ResultSet.CONCUR_READ_ONLY);
            stmt.setFetchSize(Integer.MIN_VALUE);

1 luglio 2016

Cecorator pattern with Modules

Archiviato in: rails — admin @ 08:26

class Tattoo
  def price
    300
  end
end

module ColourTattoo
  def price
    super + 150
  end
end

module BigTattoo
  def price
    super + 200
  end
end

tattoo = Tattoo.new
tattoo.extend(ColourTattoo)
tattoo.extend(BigTattoo)

Ruby on Rails Documentation

Archiviato in: Senza categoria — admin @ 08:18

For all versions of Rails

9 giugno 2016

can I access session variable in model

Archiviato in: rails — Tag: — admin @ 10:13

Yes you could access the session variable in model. Paste the below
code in application.rb
————–

  around_filter :you_dont_have_bloody_clue

  protected

  def you_dont_have_bloody_clue
    klasses = [ActiveRecord::Base, ActiveRecord::Base.class]
    methods = ["session", "cookies", "params", "request"]

    methods.each do |shenanigan|
      oops = instance_variable_get(:"@_#{shenanigan}")

      klasses.each do |klass|
        klass.send(:define_method, shenanigan, proc { oops })
      end
    end

    yield

    methods.each do |shenanigan|
      klasses.each do |klass|
        klass.send :remove_method, shenanigan
      end
    end

  end

————–

Now continue using the session variable in model. It works for me.
Thanks,
Sadeesh.

3 giugno 2016

Advanced ROR

Archiviato in: rails, sapere è potere, web — Tag:, — admin @ 16:47

https://gist.github.com/mnutt/566725
https://signalvnoise.com/posts/3091-pssst-your-rails-application-has-a-secret-to-tell-you
http://rubyjunky.com/cleaning-up-rails-4-production-logging.html
http://www.spacevatican.org/2011/4/28/adding-to-rails-log-file-performance-breakdown/

ROR Api
Notifications
Concern
Instrumentation
LogSubscriber

24 maggio 2016

msgpack

Archiviato in: code — Tag:, , , , — admin @ 09:18

It’s like JSON. but fast and small.

18 maggio 2016

Team organization

Archiviato in: Senza categoria — Tag:, , — admin @ 19:18

Kaizen
Ciclo_di_Deming
Lean_Organization

Spunti da approfondire per una buona gestione delle risorse all’interno di un tem.

6 maggio 2016

OpenSSL lib

Archiviato in: Senza categoria — Tag: — admin @ 10:03

un pò di casi d’uso di openssh lib … qua

4 maggio 2016

Prima scrittura di Lorenzo

Archiviato in: sapere è potere — admin @ 21:59

editor: nano
contenuto:
ouiwebfoued wrf
aeflj f wipef piwefbasdf
awdfasdfalsk fljasfasdfasd f
7wsdf7′asdnfals dfòasdbfaisdfasb df7asdf
asdfyasd fajs dgfffffjdhsdtdskdujdgh

yyyyyyyyyyyhhhhhhhhhhhhhhhhhhhhhhhh e4w4y
wsxz

Write ntfs from yosemite

Archiviato in: Senza categoria — Tag:, , — admin @ 17:01

suppose you have already installed homebrew

$> brew update
$> brew install Caskroom/cask/osxfuse
$> brew install homebrew/fuse/ntfs-3g

restart your mac … and the magic is done!

14 aprile 2016

Classic programmer paintings

Archiviato in: code — Tag:, — admin @ 14:03

http://classicprogrammerpaintings.tumblr.com/

30 marzo 2016

ebook search engine (and download)

Archiviato in: Senza categoria — Tag: — admin @ 18:04

http://it-ebooks-search.info/

Articoli precedenti »

Funziona con WordPress