Question on Ruby collect method 2016-09-19    5

I have an array of hashes Eg: cars = [{:company => "Ford", :type => "SUV"}, {:company => "Honda", :type => "Sedan"}, {:company => "Toyota", :type => "Sedan"}] # i want to fetch

get number of bytes a DataOutputStream wrapped around Socket.getOutputStream wrote 2016-09-19    2

I have a server-client application and using java Sockets API. The server will send bytes to the client by calling DataOutputStream's write(bytes[] b), the DataOutputStream is wrapped around client.getOutputStream directly(no Buffer here). This is a

Get ArrayIndexOutOfBoundsException error when try to display data from jtable to the console 2016-09-19    1

I got ArrayIndexOutOfBoundsException error when I try to display data which put into Vector from Jtable to the console Here the error: Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException: 3 >= 3 at java.util.Vector

Google play requires 4132500 - with any google-play-service library version imported 2016-09-19    1

Trying to work with an emulator using the google maps V2 api I've stumbled upon many solution which resorted to importing some version of the play-service-lib and the associated apk files of the maps and store. Example Everytime I get the same error

Execution failed for task ':Project:processDebugResources 2016-09-18    1

Execution failed for task ':Project:processDebugResources
This is my error:- org.gradle.process.internal.ExecException: Process 'command '/home/user/Desktop/android-sdk-linux/build-tools/22.0.1/aapt'' finished with non-zero exit value 1 How to resolve this pr

Cannot install thin on windows 2016-09-18    6

I cannot install thin gem on windows. Something happen during build of native extensions. Do anybody face same issues? Here is the stack trace: >gem install thin --no-ri --no-rdoc Temporarily enhancing PATH to include DevKit... Building native extens

Why does this assignment and each loop return just 1 attribute and not the entire object I expect? 2016-09-18    1

I have a method on my Node model that looks like this: def users_tagged @node = self @tags = @node.user_tag_list @users = @tags.each do |tag| User.find_by email: tag end end What I would like to happen is for the @users object to be a collection of U

.map(&:dup) Calculations Slow 2016-09-17    2

I have an ActiveRecord query, and am using to duplicate the result. This is so that I can loop through each Loan (100+ times) and run several calculations. These calculations take several seconds longer compared to wh

Ruby array: change string element format 2016-09-17    3

I have an array of string which contains the "firstname.lastname" strings: customers = ["aaa.bbb", "ccc.ddd", "www.uuu", "iii.oooo", ...] Now, I would like to transfer each element's string format in the a

android layout overlay issue 2016-09-17    3

android layout overlay issue
I am a beginner in android.I made a flash game android app using a webview and integrated admob ad banner but it is overlaying the webview.I need it to appear like this pic this is my code : <?xml version="1.0" encoding="utf-8"?>

Getting an “ArrayIndexOutOfBoundsException” when trying to automatically increment data 2016-09-17    1

I'm having a ArrayIndexOutOfBoundsException: 0 error because i is equal to 0 and not automatically incrementing. How can I fix this code so it can work as expected? I want it to automatically increment each line of data read in the file read with Arr

Can't setup Google play service library for Google Drive in eclipse 2016-09-17    2

Can't setup Google play service library for Google Drive in eclipse
I want to integrate Google Drive api in my app. I follow this tutorial to setup an example and this link to setup Google Play Service library. The problem is when I link Google play service library to my project, I got these issues: @integer/google_p

Settings to move to end of line using tmux 2016-09-16    2

Annoying question to have to ask! In bash (or anywhere.. like when editing this question) I can do CTRL + left|right to move left left or right to different bits of whitespace. With tmux running.. this does work.. it doesn't do anything. How do you d

Decimal Format Issue Java 2016-09-15    3

I wrote a program and I can't figure out how i should do the decimal format? I thought i was doing it right, apparently i can't do decimal format correctly. Can, someone help me with the decimal format? Here is my code: import java.text.DecimalFormat

What is variable p in open uri module in ruby? [duplicate] 2016-09-15    2

This question already has an answer here: What is “p” in Ruby? 5 answers I am currently trying to parse a file in ruby and I ran into this example in the open uri module documentation (

FTP folders mounted locally used for SVN repository 2016-09-15    1

I would like to create a SVN repository remotely using FTP protocol. Is it advisable to do the following steps mount the FTP directory as local with culftpfs create a repository as if it is local with svnadmin create use it like in everyday life? Do

Selected tab on TextMate almost un-noticeable 2016-09-15    1

Selected tab on TextMate almost un-noticeable
For some reason the selected tab on TextMate is almost un-noticeable, I really cannot make it out, they all look the same to me. When I switch tab I notice it changing color, so I guess it's very very very slightly different, but that doesn't help mu

Parsing an XML file in Objective-C 2016-09-15    3

I have following xml file with same tags for the generic implementation .I want to parse this file .Can I parse this in iOS. xml file: <?xml version="1.0"?> <node name="bkl"> <childrens> <node name="A building

Ember.js array as model's property 2016-09-15    3

Cheers! I have some model, and one attribute of it is an array, but for some reasons (I use mongoDB on the server and it's problem with embedded models and ember-data) I can't do somthing like this: App.Foo = DS.Model.extend({ ... numbers: DS.hasMany

what is qt framebuffer work mechanism? 2016-09-15    1

How does Qt embedded work with Linux framebuffer driver? I think directly write to /dev/fb0 will cause image flickering. Use double buffer will solve flickering problem, but, what is the strategy of copying data from Qt buffer to framebuffer memory?