text:
Q: Android - Generate CSV file from table values I have a database containing one table, i want to generate CSV file with values of this table.
Actually, I want to email this CSV file as an attachment. I know about sending file as an attachment in email intent(ACTION_SEND), but I don't know the procedure of creating or the method by which i can create CSV formatted file.
Please give me suggestions or ideas.

A: You can use opencsv for this
Download the library from here:
http://sourceforge.net/projects/opencsv/
In this you can find jar file.
Inside your activity use this:
CSVWriter writer = null;
try
{
    writer = new CSVWriter(new FileWriter("/sdcard/myfile.csv"), ',');
    String[] entries = "first#second#third".split("#"); // array of your values
    writer.writeNext(entries);
    writer.close();
}
catch (IOException e)
{
    //error
}

A: This looks really promising.  It will take any Java object and convert it to a CSV file:
http://supercsv.sourceforge.net/
It also might be possible to retrieve the data from the database in CSV format.

A: THis might be helpfull.I needed ';' as seperator in between the feild values. Please use ',' accordingly for CSV generation.
Thanks,
Darshan
private void exportTheDB() throws IOException
{
        File myFile;
    Calendar cal = Calendar.getInstance();
    SimpleDateFormat sdf = new SimpleDateFormat("MM-dd-yyyy");
    String TimeStampDB = sdf.format(cal.getTime());

    try {

        myFile = new File(extStorageDirectory+"/Export_"+TimeStampDB+".csv");
        myFile.createNewFile();
        FileOutputStream fOut = new FileOutputStream(myFile);
        OutputStreamWriter myOutWriter = new OutputStreamWriter(fOut);
        myOutWriter.append("Start time;End time;Elapse;Sports type");
        myOutWriter.append("\n");
        sampleDB = this.openOrCreateDatabase(DB_NAME,MODE_PRIVATE, null);

        Cursor c = sampleDB.rawQuery("SELECT * FROM  Sport_Records ", null);

        if (c != null) {
            if (c.moveToFirst()) {
                do {

                    String start_Time = c.getString(c.getColumnIndex("startTimeDate"));
                    String end_Time = c.getString(c.getColumnIndex("endTimeDate"));
                    String elapse_Time = calculateTimeDifferece(end_Time, start_Time);
                    String sport_Name = c.getString(c.getColumnIndex("label"));

                    myOutWriter.append(start_Time+";"+end_Time+";"+elapse_Time+";"+sport_Name);
                    myOutWriter.append("\n");
                }

                while (c.moveToNext());
            }

            c.close();
            myOutWriter.close();
            fOut.close();

        }
    } catch (SQLiteException se)
    {
        Log.e(getClass().getSimpleName(),"Could not create or Open the database");
    }

    finally {

        sampleDB.close();

    }

}

A: Adding to @Cocos2dx answer:
When querying from db you may have null fields, in my case i use a Controller to fetch the data in an object list, but either if you don`t you should check for null or empty values and proper format them (or they can make your table look weird):
String[] details = {
        replaceNull(someObject.getId()),
        replaceNull(someObject.getName())
};

public static String replaceNull(String input) {
    return ((input == null || input.isEmpty()) ? " " : input);
}

writer.writeNext(details);

A: In case of using Kotlin, I recommend kotlin-csv library.
Just get the list of DB table objects, go through all of them and add the column values to CSV rows, one by one, like this:
csvWriter().open(csvFile) {
    // Header
    writeRow(listOf("[id]", "[name]", "[age]"))

    peopleList.forEachIndexed { index, person ->
        writeRow(listOf(index, person.fullName, person.age))
    }
}

I explain the whole process of creating csv file here.


text:
Q: NoMethodError in StaticPages#home I get the following error.  Can someone help me figure this out for me, please?
Showing /home/bdme551/bdme21/app/views/layouts/application.html.erb where line #4 raised:

undefined method `full_title' for #<#<Class:0x000000048c7d60>:0x000000048be210>

Please let me know, if you additional info.
From application.html.erb
<title><%= full_title(yield(:title)) %></title>

A: From the information you provided. You have not defined the method full_title you should define the method in helpers/application_helper.rb so the method will be accessible throughout your pages.
application_helper.rb
  def full_title(title)
    default_title = "My Website 2.0"
    if title.empty?
      default_title
    else
      "#{title}"
    end
  end

application.html.erb
<title><%= full_title(yield(:title)) %></title>

To change the title page call provide
<% provide(:title, "Inbox") %>

hope that helps!

redpajama_set_name: RedPajamaStackExchange


text:
Q: D3 brush & zoom: if zoom multiple times the 2+ transforms are based on original parameters and not updated I trying to create an interactive zoomable map using D3 that have hoverable points.  The user can drag a rectangle on the map to zoom into that area.
So far I've implemented it so the first brushing and zooming works, and once zoomed if I click on the "reset zoom" button to reset it, then brush and zoom again, that works too.
The part that doesn't work is if I brush and zoom, then once it's already zoomed, I brush and zoom again. It seems like in this case the brush detects the svg at its pre-zoomed extent while updated extent, and I'm not sure how to handle it so it actually zooms into the brushed area.
Here is the codepen with the example: https://codepen.io/jhjanicki-the-scripter/pen/ExeWgML
here is the relevant code
(data = json of the points, land = geojson of the land area)
let width = 1200;
let height = 800;

const svg = d3
  .select("#chart1")
  .append("svg")
  .attr("width", width)
  .attr("height", height)

const projection = d3.geoMercator()
  .scale(width / 2.5 / Math.PI)
  .rotate([0, 0])
  .center([0, 0])
  .translate([width / 2, height / 2]);

const path = d3.geoPath().projection(projection);

const colorScale =
  d3.scaleOrdinal().domain(["class1","class2","class3","class4","class5"])
  .range(["#a6cee3", "#1f78b4", "#b2df8a", "#33a02c", "#fb9a99"]);

let brush = d3.brush()
  .on('brush', brushMove)
  .on("end", brushEnd);

let brushExtent;
let brushedSufficient = true; //check if dragged area big enough

const zoom = d3.zoom()
  .scaleExtent([1, Infinity])
  .translateExtent([[0, 0], [width, height]])
  .extent([[0, 0], [width, height]])
  .on("zoom", zoomed);

function initBrush() {
  svg.call(brush);
}

//brushMove related functions
function brushMove(e) {
  brushExtent = e.selection;
  //update points style within the rect
  svg.selectAll("circle.point")
    .attr("fill", d => isInBrushExtent(d) ? 'white' : colorScale(d.cat))
    .raise(); // in order to be able to hover

  brushedSufficient = isSufficient();
}

function isInBrushExtent(d) {
  return brushExtent &&
    projection([d.lon, d.lat])[0] >= brushExtent[0][0] &&
    projection([d.lon, d.lat])[0] <= brushExtent[1][0] &&
    projection([d.lon, d.lat])[1] >= brushExtent[0][1] &&
    projection([d.lon, d.lat])[1] <= brushExtent[1][1];
}

//
function isSufficient() { // make sure user can't zoom by clicking
  return brushExtent[1][0] - brushExtent[0][0] > 10 && brushExtent[1][1] - brushExtent[0][1] > 10;
}

//brushEnd function
function brushEnd() {

  //get the four corner coordinates
  const x0 = brushExtent[0][0];
  const x1 = brushExtent[1][0];
  const y0 = brushExtent[0][1];
  const y1 = brushExtent[1][1];

  if (brushedSufficient) {

    const x = -(x0 + x1) / 2;
    const y = -(y0 + y1) / 2;
    const k = Math.min(8, 0.9 / Math.max((x1 - x0) / width, (y1 - y0) / height));

    svg.transition().duration(750).call(
      zoom.transform,
      d3.zoomIdentity
        .translate(width / 2, height / 2)
        .scale(k)
        .translate(x, y),
    )
  }

}

function zoomed(e) {

  const transform = e.transform; //k,x,y
  svg.selectAll('path')
    .attr('transform', transform)
    .attr("stroke-width", 1 / transform.k);
  svg.selectAll("circle")
    .attr('transform', transform)
    .attr('r', 5 / transform.k)
    .attr("fill", d => colorScale(d.cat));

}

function resetZoom() {
  svg.transition()
    .duration(750)
    .call(zoom.transform, d3.zoomIdentity)
}

d3.select("#resetZoom").on("click", resetZoom);

svg.selectAll("path.land")
  .data(land.features)
  .join("path")
  .attr("class", "land")
  .attr("id", "land")
  .attr("fill", "white")
  .attr("stroke", "#808080")
  .attr("d", path);

//need to come before points

svg.append("g")
  .attr("class", "brush")
  .call(brush);

// draw points
svg.selectAll("circle.point")
  .data(data)
  .join("circle")
  .attr("class", "point")
  .attr("id", d => "id" + d.id)
  .attr("cx", d => projection([d.lon, d.lat])[0])
  .attr("cy", d => projection([d.lon, d.lat])[1])
  .attr("stroke-width", 1)
  .attr("r", 5)
  .attr("fill", d => colorScale(d.cat))
  .attr("cursor", "pointer")
  .on("mouseover", (e, d) => console.log(d.name))

A: I had the same issue with the brush, so I built my own brush.
You can zoom the chart on the x axis and brush on the chart area.

    var data = [2,3,5,7];

    var width = 600;
    var height = 400;

    var margin = {
        left: 30,
        top: 30,
        bottom: 30,
        right: 15
    };

setTimeout(function() {v12()},200);

function v12() {

    var graph = {};

    graph.rectWidth = width - margin.left - margin.right;
    graph.rectHeight = height - margin.top - margin.bottom;

    graph.xScale = d3.scaleLinear()
        .domain([0,data.length-1])
        .range([0,graph.rectWidth]);

    graph.xAxis = d3.axisBottom(graph.xScale)
        //.scale(xScale)
        //.orient("bottom")
        .ticks( 5)
        .tickSize(-graph.rectHeight);

    graph.yScale = d3.scaleLinear()
        .domain([d3.min(data, function(d) { return d;}), d3.max(data,function(d) { return d})])
        .range([graph.rectHeight,0]);

    graph.yAxis = d3.axisLeft(graph.yScale)
        //.scale(yScale)
        //.orient("left")
        .ticks( 5)
        .tickSize(-graph.rectWidth);

    graph.lineFunction = d3.line()
        .x( function(d, i) { return graph.xScaleTemp(i);})
        .y( function(d) { return graph.yScaleTemp(d);});

    graph.zoomXY = d3.zoom()
    //.x(xScale)
    //.y(yScale)
        .scaleExtent([-10, 1000])
        .on("zoom", zoomed);

    graph.zoomX = d3.zoom()
    //.x(xScale)
    //.y(yScale)
        .scaleExtent([-10, 1000])
        .on("zoom", function() { zoomed("x")});

    graph.zoomY = d3.zoom()
    //.x(xScale)
    //.y(yScale)
        .scaleExtent([-10, 1000])
        .on("zoom", function() { zoomed("y")});

    graph.svg = d3.select("div")
        .append("svg")
        .attr("width", width)
        .attr("height", height)
        .style("border", "1px solid black");

    graph.svg.append("text")
        .text("Graph: Axis Zooming and Focus")
        .attr("x", 10)
        .attr("y", 20);

    graph.svg.append("clipPath")
        .attr("id", "clip")
        .append("rect")
        .attr("x", 0)
        .attr("y", 0)
        .attr("width", graph.rectWidth)
        .attr("height", graph.rectHeight);

    graph.g = graph.svg
        .append("g")
        .attr("class", "main")
        .attr("transform", function() { return "translate(" + margin.left + "," + margin.top + ")";});

    graph.dataClip = graph.g
        .append("g")
        .attr("clip-path", "url(#clip)");   //append clip path to limit visibility

    //group element for data
    graph.dataGroup = graph.dataClip
        .append("g")
        .attr("class", "data-group")
        .attr("clip-path", "url(#clip)");

    graph.focus = graph.dataClip.append("g")                                // **********
        .style("display", "none");

    // append the circle at the intersection               // **********
    graph.focus.append("circle")                                 // **********
        .attr("class", "y")                                // **********
        .style("fill", "none")                             // **********
        .style("stroke", "steelblue")
        .attr("stroke-width", "3")// **********
        .attr("r", 10);

    graph.focus.append("line")
        .attr("stroke", "steelblue")
        .attr("stroke-width", "3")
        .attr("x0",0)
        .attr("x1", 0)
        .attr("y0",0)
        .attr("y1", graph.rectHeight);

    graph.xAxisElem = graph.g
        .append("g")
        .attr("class","axis x")
        .style("transform", function() {
            return "translate(0," + graph.rectHeight + "px)"; })
        .call(graph.xAxis);

    graph.yAxisElem = graph.g
        .append("g")
        .attr("class","axis y")
        .style("transform", "translate(0,0)")
        .call(graph.yAxis);

    graph.dataGroup.selectAll(".data-point")
        .data(data)
        .enter()
        .append("circle")
        .attr("class", "data-point")
        .attr("fill", "none")
        .attr("cx", 20)
        .attr("r", 5)
        .attr("stroke", "steelblue")
        .attr("stroke-width", 2);

    graph.dataGroup.append("path")
        .attr("class", "data-line")
        .style("stroke", "steelblue")
        .attr("stroke-width", "1");

   /* // append the rectangle to capture mouse               // **********
    graph.svg.append("rect")                                     // **********
        .attr("width", width)                              // **********
        .attr("height", height)                            // **********
        .style("fill", "none")                             // **********
        .style("pointer-events", "all")                    // **********
        .on("mouseover", function() { graph.focus.style("display", null); })
        .on("mouseout", function() { graph.focus.style("display", "none"); })
        .on("mousemove", mousemove);
*/

    graph.overlayX = graph.g//.select(".axis.x")
        .append("rect")
        .attr("fill", "rgba(255,0,0,0.5)")
        .attr("width", graph.rectWidth)
        .attr("height", 15)
        .attr("y", graph.rectHeight)
        .call(graph.zoomXY);

    graph.overlayY = graph.g//.select(".axis.y")
        .append("rect")
        .attr("fill", "rgba(255,0,0,0.5)")
        .attr("width", 150)
        .attr("height", graph.rectHeight)
        .attr("x", -150)
        //.call(graph.zoomXY)
        .on("mousedown.move", mousedowned);

    //append the rectangle to capture zoom
    graph.overlayRect = graph.g.append("rect")
        .attr("class", "overlay-rect")
        .attr("width", graph.rectWidth)
        .attr("height", graph.rectHeight)
        .style("fill", "none")                             // **********
        .style("pointer-events", "all")                    // **********
        .on("mouseover", function() { graph.focus.style("display", null); })
        .on("mouseout", function() { graph.focus.style("display", "none"); })
        .on("mousemove", mousemove)
        //.call(graph.zoomXY)
        .on("dblclick.zoom", function() {
            resetZoom();
        } )
        .on("mousedown.rectZoom", rectZoom);

    //console.log(graph.overlayRect.on("mousedown.zoom"));

    getZoomedScales();
    updateGraph();

    function updateGraph() {
        updateData();
        updateAxes();
        updateTooltip();
    }

    function getZoomedScales() {

        var transformX = d3.zoomTransform(graph.overlayX.node());
        var transformY = d3.zoomTransform(graph.overlayY.node());
        var transformXY = d3.zoomTransform(graph.overlayRect.node());

        graph.yScaleTemp = transformXY.rescaleY(transformY.rescaleY(graph.yScale));
        graph.xScaleTemp = transformXY.rescaleX(transformX.rescaleX(graph.xScale));

    }

    function updateData() {

        graph.dataGroup.select(".data-line")
            .attr("d", graph.lineFunction(data));

        graph.dataGroup.selectAll(".data-point")
            .data(data)
            .attr("cy", function( d, i) {
                return graph.yScaleTemp(d);
            })
            .attr("cx", function( d, i) {
                return graph.xScaleTemp(i);
            });
    }

    function updateAxes() {
        graph.xAxisElem.call(graph.xAxis.scale(graph.xScaleTemp));
        graph.yAxisElem.call(graph.yAxis.scale(graph.yScaleTemp));
    }

    function resetZoom() {
        graph.overlayRect
            .transition()
            .duration(750)
            .call(graph.zoomXY.transform, d3.zoomIdentity);

        graph.overlayX
            .transition()
            .duration(750)
            .call(graph.zoomX.transform, d3.zoomIdentity);

        graph.overlayY
            .transition()
            .duration(750)
            .call(graph.zoomY.transform, d3.zoomIdentity);

        setTimeout(function() {
            getZoomedScales();
            getTooltipPos();
            updateTooltip();
        },700);
    }

    function zoomed() {

        getZoomedScales();
        updateGraph();

    }

    function updateTooltip() {
        if(graph.pos !== undefined) {

            var i = graph.pos;

            if (i < 0) i = 0;
            else if (i >= data.length) i = data.length - 1;

            graph.focus.
                attr("transform", "translate(" + graph.xScaleTemp(i) + ",0)");

            graph.focus.select("circle.y")
                .attr("transform", "translate(0," + graph.yScaleTemp(data[i]) + ")");

        }

    }

    function getTooltipPos() {
        var x0 = graph.xScaleTemp.invert(graph.mousePos);
        graph.pos = Math.round(x0);
    }

    function mousemove() {
        graph.mousePos = d3.mouse(this)[0];

        getTooltipPos();
        updateTooltip();

    }

    function mousedowned() {
        var transformY = d3.zoomTransform(graph.overlayY.node());
        graph.yScaleTemp = (transformY.rescaleY(graph.yScale));
    }

    function rectZoom(d, i) {
                var element = this;
                var mouseOrigin = d3.mouse(element);
                var rect = graph.g.append("rect")
                    .attr("fill", "rgba(255, 255, 0, 0.8)")
                    .attr("stroke", "red");

                mouseOrigin[0] = Math.max(0, Math.min(graph.rectWidth, mouseOrigin[0]));
                mouseOrigin[1] = Math.max(0, Math.min(graph.rectHeight, mouseOrigin[1]));

                d3.select(window)
                    .on("mousemove.zoomRect", function() {
                        let m = d3.mouse(element);

                        m[0] = Math.max(0, Math.min(graph.rectWidth, m[0]));
                        m[1] = Math.max(0, Math.min(graph.rectHeight, m[1]));

                        rect.attr("x", Math.min(mouseOrigin[0], m[0]))
                            .attr("y", Math.min(mouseOrigin[1], m[1]))
                            .attr("width", Math.abs(m[0] - mouseOrigin[0]))
                            .attr("height", Math.abs(m[1] - mouseOrigin[1]));
                    })
                    .on("mouseup.zoomRect", function() {
                        d3.select(window).on("mousemove.zoomRect", null).on("mouseup.zoomRect", null);

                        var m = d3.mouse(element);

                        m[0] = Math.max(0, Math.min(graph.rectWidth, m[0]));
                        m[1] = Math.max(0, Math.min(graph.rectHeight, m[1]));

                        if (m[0] !== mouseOrigin[0] && m[1] !== mouseOrigin[1]) {

                                var zoomRectWidth = Math.abs(m[0] - mouseOrigin[0]);
                            var scaleFactor = graph.rectWidth / zoomRectWidth;

                            var e = graph.overlayX;
                                                        var t = d3.zoomTransform(e.node());
                            var k = t.k;
                            var x = t.x;
                            var translateX = Math.min(m[0], mouseOrigin[0]);

                            e.transition()
                                .duration(750)
                                .call(graph.zoomXY.transform, d3.zoomIdentity
                                    .scale(scaleFactor)
                                    .translate(-translateX, 0)

                                    .translate(x, 0)
                                    .scale(k)
                                );

                            var zoomRectHeight = Math.abs(m[1] - mouseOrigin[1]);
                            var scaleFactor = graph.rectHeight / zoomRectHeight;

                            var e = graph.overlayY;
                            var t = d3.zoomTransform(e.node());
                            var k = t.k;
                            var y = t.y;
                            var translateY = Math.min(m[1], mouseOrigin[1]);

                            e.transition()
                                .duration(750)
                                .call(graph.zoomXY.transform, d3.zoomIdentity
                                    .scale(scaleFactor)
                                    .translate(0, -translateY)

                                    .translate(0, y)
                                    .scale(k)
                                );

                        }
                        rect.remove();
                    }, true);

                d3.event.stopPropagation();
            };
}
    .axis path {
        fill: none;
        stroke: steelblue;
        stroke-width: 0.3;
    }

    .axis line {
        fill: none;
        stroke: steelblue;
        stroke-width:1px;
        stroke-opacity:0.3;
    }

    .axis text {
        fill: steelblue;
    }

    .data-group path {
        stroke: red;
        fill: none;
    }
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/4.12.2/d3.min.js"></script>
<body>
<div>

</div>

</body>
</html>

A: Actually, I managed to solve it by selecting the brush and applying the transform on the brush in the zoomed function, here is the working example: https://codepen.io/jhjanicki-the-scripter/pen/eYLWMGo
and the code:
function zoomed(e) {

      const transform = e.transform; //k,x,y

      svg.selectAll('path')
        .attr('transform', transform)
        .attr("stroke-width", 1 / transform.k);
      svg.selectAll("circle")
        .attr('transform', transform)
        .attr('r', 5 / transform.k)
        .attr("fill", d => colorScale(d.cat));

      // HERE
      svg.select('.brush')
        .attr('transform', transform)
        .attr("stroke-width", 1 / transform.k);
    }


text:
Q: $_POST on localserver (openserver) doesn't work I working with Retrofit2, Volley(android libraries) and tried to make $_POST request on server. Firstly i thought some errors in my android application code, but when i tested it on Postman, i realised that error is on server. I don't have any idea what problem is it, but when i using $_GET request it works fine. The problem is only on local server, because when i worked on some paid hosting i didn't saw any of those problems.
echo var_dump($_POST);

This row displays empty array.


text:
Q: Save bitmaps from gif / video I would like to save individual images (bitmap) of a GIF file and a video file. I want 5 pictures of each file. Depending on the length (seconds) of the files, the pictures should take pictures at regular intervals, so that there are 5 pictures. I hope someone can help me, thanks!

A: I found a good solution (for gifs) with Glide:
 Glide.with(Activity.this)
                                .asGif()
                                .load(picturePath)
                                .into(new SimpleTarget<GifDrawable>() {
                                    @Override
                                    public void onResourceReady(@NonNull GifDrawable resource, @Nullable Transition<? super GifDrawable> transition) {
                                        try {
                                            Object GifState = resource.getConstantState();
                                            Field frameLoader = GifState.getClass().getDeclaredField("frameLoader");
                                            frameLoader.setAccessible(true);
                                            Object gifFrameLoader = frameLoader.get(GifState);

                                            Field gifDecoder = gifFrameLoader.getClass().getDeclaredField("gifDecoder");
                                            gifDecoder.setAccessible(true);
                                            StandardGifDecoder standardGifDecoder = (StandardGifDecoder) gifDecoder.get(gifFrameLoader);
                                            for (int i = 0; i < standardGifDecoder.getFrameCount(); i++) {

                                                standardGifDecoder.advance();

                                                if (i == 4) {
                                                    bitmap1 = standardGifDecoder.getNextFrame();
                                                } else if (i == standardGifDecoder.getFrameCount() / 3) {
                                                    bitmap2 = standardGifDecoder.getNextFrame();
                                                } else if (i == standardGifDecoder.getFrameCount() / 2) {
                                                    bitmap3 = standardGifDecoder.getNextFrame();
                                                } else if (i == standardGifDecoder.getFrameCount() - 4) {
                                                    bitmap4 = standardGifDecoder.getNextFrame();
                                                }

                                            }

                                        } catch (Exception ex) {
                                            ex.printStackTrace();
                                        }

                                    }
                                });

A: you can use Android-Ndk-Gif library to handle your needs, and here's a full example of how to get each bitmap from GIF, you can change gifDecoder.frameNum() to 4 so you can get the first 5 frames from your GIF
 GifDecoder gifDecoder = new GifDecoder();
 boolean isSucceeded = gifDecoder.load(Path); // PATH OF YOUR IMAGE
 ArrayList<BitmapGIFUtil> arrayListBitmaps = new ArrayList<>();

 for (int i = 0; i < gifDecoder.frameNum(); ++i) {
                Bitmap bitmap = gifDecoder.frame(i);
                int GIFDelay = gifDecoder.delay(i);
                arrayListBitmaps.add(new BitmapGIFUtil(bitmap, GIFDelay));
     }

BitmapGIFUtil.java
public class BitmapGIFUtil {
    private Bitmap bitmap;
    private int Delay;

    public BitmapGIFUtil() {
    }

    public BitmapGIFUtil(Bitmap bitmap, int delay) {

        this.bitmap = bitmap;
        Delay = delay;
    }

    public Bitmap getBitmap() {
        return bitmap;
    }

    public void setBitmap(Bitmap bitmap) {
        this.bitmap = bitmap;
    }

    public int getDelay() {
        return Delay;
    }

    public void setDelay(int delay) {
        Delay = delay;
    }
}

After filling your arrayListBitmaps you can save each bitmap into your gallery

A: And here is a solution (for videos) with MediaMetadataRetriever:
            MediaMetadataRetriever retriever = new MediaMetadataRetriever();
            retriever.setDataSource(videoFile.getAbsolutePath());
            MediaPlayer mp = MediaPlayer.create(getBaseContext(), vidUri);
            mp.release();
            String strLength = retriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_DURATION);
            long time=Long.valueOf(strLength)*1000;

                bitmap1 = retriever.getFrameAtTime(time/10*2,MediaMetadataRetriever.OPTION_CLOSEST_SYNC);
                bitmap2 = retriever.getFrameAtTime(time/10*4,MediaMetadataRetriever.OPTION_CLOSEST_SYNC);
                bitmap3 = retriever.getFrameAtTime(time/10*6,MediaMetadataRetriever.OPTION_CLOSEST_SYNC);
                bitmap4 = retriever.getFrameAtTime(time/10*8,MediaMetadataRetriever.OPTION_CLOSEST_SYNC);


text:
Q: Adding Annotation with Hebrew letters in Itext When i add annotaion using:
PdfAnnotation.createFileAttachment(writer,null,null , null,  , "שם קובץ", "שם קובץ");

the Hebrew letters in the annotaion are not shown.
Is there a way to fix it?

A: *

*You're using Hebrew characters in your code. That's not safe. Please replace them with a unicode notation (you'll need to know their unicode value; for instance \u00a0 is the value for a non-breaking space). If you don't do this, compilers could interpret the characters incorrectly (see the remarks that were given).

*It appears to me that you don't have the correct number of parameters in the method. I assume that you're using this method.

*You're using a 'short-cut' method that assumes that the characters aren't Unicode characters. Please don't. Use the method where you create a PdfFileSpecification object, and use methods such as setUnicodeFileName() with the unicode parameter set to true. This way, iText knows that the characters should be interpreted as Unicode characters.

*You probably want the characters to appear from right to left. I don't know if this is supported in PDF. I browsed ISO-32000-1 and looked at Table 44 (Entries in a file specification dictionary), but all I saw was: Unicode text string that provides file specification of the form described in 7.11.2, "File Specification Strings." This is a text string encoded using PDFDocEncoding or UTF-16BE with a leading byte-order marker (as defined in 7.9.2.2, "Text String Type"). You'll have to dig into those sections if you want to know more.

*You pass null as value for the Rectangle. That doesn't make sense. Are you sure you want to add a file attachment annotation? Based on your code I would assume that you want to add a document-level attachment instead. That's done like this: writer.addFileAttachment(fs); with fs an instance of the FileSpecification class.


text:
Q: How to use rownum I have a employee table in oracle with name,salary and other details.
I am trying to get the second highest salary but not able to fetch.
This one working fine
with e_salary as (select distinct salary from employee)
select salary from e_salary
order by salary desc

And gives output:
450000

61000

60000

50000

40000

30000

20000

6000

but when i am using the same query to fetch second highest row not getting any output
select salary
  from ( with e_salary as (select distinct salary from employee)
         select salary from e_salary order by salary desc)
 where rownum = 2

but as i replace the rownum=2 with rownum<2 it gives output of first two records. Please someone explain why rownum=2 is not working

A: This will work:

select salary from ( select salary , rownum as rn from (select salary
  from e_salary order by salary desc)) where rn = 2;

Why it doesn't work:
When assigning ROWNUM to a row, Oracle starts at 1 and only only increments the value when a row is selected; that is, when all conditions in the WHERE clause are met. Since our condition requires that ROWNUM is greater than 2, no rows are selected and ROWNUM is never incremented beyond 1.
Hope u are clear right now.

A: select ename  ,sal  ,rank() over (order by sal desc) ranking from emp;

Try this one.
Follow this link, all the things regarding nth highest row is given over here in oracle:
http://www.oratable.com/nth-highest-salary-in-oracle/

A: Use of rownum is a tricky affair. Safest bet is to use it only when you want to limit the number of results to be shown. For example rownum<2 or rownum<=5.
Why rownum=2 will not work?
Read here - http://www.oracle.com/technetwork/issue-archive/2006/06-sep/o56asktom-086197.html
In summary, this is how oracle execute a query

*

*The FROM/WHERE clause goes first.

*ROWNUM is assigned and incremented to each output row from the FROM/WHERE clause.

*SELECT is applied.

*GROUP BY is applied.

*HAVING is applied.

*ORDER BY is applied.

rownum<=2 clause will get converted to
ROWNUM = 1
for x in
( select * from emp )
loop
    exit when NOT(ROWNUM <= 2)
    OUTPUT record to temp
    ROWNUM = ROWNUM+1
end loop
SORT TEMP

if you change  exit when NOT(ROWNUM <= 2) with rownnum=2, you can see it will fail in the first run itself
So if I cannot use rownum, what can I use. Try using row_number() http://docs.oracle.com/cd/B19306_01/server.102/b14200/functions137.htm
It works something like
SELECT last_name FROM
   (SELECT last_name, ROW_NUMBER() OVER (ORDER BY last_name) R FROM employees)
   WHERE R BETWEEN 51 and 100;

A: rownum in a condition stops evaluating the first time it fails. On the first row returned, rownum is 1, therefore it fails the rownum = 2 test and stops trying. There's an excellent post about it here.
To get the second-highest salary, use the Oracle analytical DENSE_RANK function:
SELECT DISTINCT Salary FROM (
  SELECT Salary, DENSE_RANK() OVER (ORDER BY Salary DESC) AS SalaryRank
  FROM e_salary)
WHERE SalaryRank = 2

Note that if there's a tie for second, the query could return more than one value. That's why the outer SELECT is a SELECT DISTINCT.

A: First you should understand what the rownum is. Let me give you an example,
 you want to get data with a filter and rownum=2,
 first Oracle executes the sql with filter and get the first record,
 give it the rownum 1,
 and then compare it the rownum filter rownum=2, which doesn't match, so discard record,
 then get second record, give it rownum=1(if the first record is matched then the rownum will  be 2)  too, then do the compare............

So you can find the reason.

A: Without using rownum command you can get the second highest salary by using this query:
select MAX(Salary) from Employee
WHERE Salary NOT IN
(select MAX(Salary) from Employee )

or,
select MAX(Salary) from Employee
WHERE Salary <>
(select MAX(Salary) from Employee )

query for nth highest:
SELECT * FROM Employee Emp1
WHERE (N-1) =
(SELECT COUNT(DISTINCT(Emp2.Salary))FROM Employee Emp2
WHERE Emp2.Salary > Emp1.Salary)

A: From what I understand, rownum numbers the rows in a result set.
So, in your example:
select * from table1 where rownum=2
How many rows are there going to be in the result set? Therefore, what rownum would be assigned to such a row? Can you see now why no result is actually returned?
In general, you should avoid relying on rownum, or any features that imply an order to results. Try to think about working with the entire set of results.
With that being said, I believe the following would work:
select * from (select rownum as rn,table1.* from table1) as t where t.rn = 2
Because in that case, you're numbering the rows within the subquery.


text:
Q: Hodge decomposition thm. Why $\Delta(E^p)=d\delta(E^p)\oplus\delta d(E^p)=d(E^{p-1})\oplus\delta(E^{p+1})?$ $\DeclareMathOperator{Img}{Im}$
In Warner's "Foundations of differentiable manifolds and Lie groups" we read that
$$E^p\stackrel{(1)}{=}\Delta(E^p)\oplus H^p\stackrel{(2)}{=}d\delta(E^p)\oplus\delta d(E^p)\oplus H^p\stackrel{(3)}{=}d(E^{p-1})\oplus\delta(E^{p+1})\oplus H^p,$$
Where $E^p$ are smooth $p-$forms on given compact oriented Riemannian manifold $M.$
He states that it is sufficient to prove the decompositon in $(1),$ for $(2)$ and $(3)$ follow from three facts:
$$\Delta=\delta d+d\delta\hspace{10pt}<d\alpha,\beta>=<\alpha,\delta\beta>\hspace{10pt}\Delta\alpha=0\iff d\alpha=0\wedge\delta\alpha=0$$
So I conclude, that he means
$$\Delta(E^p)=d\delta(E^p)\oplus\delta d(E^p)=d(E^{p-1})\oplus\delta(E^{p+1})\hspace{20pt}(*)$$
follows from above three facts. However I do not see how to prove it. I only have following inclusions based on the knowledge about non-degenerated bilinear forms:
$$\Img\Delta\subset(\ker\Delta)^\perp=(\ker d\delta\cap\ker\delta d)^\perp\supset(\ker d\delta)^\perp+(\ker\delta d)^\perp\supset(\Img d\delta)^\perp+(\Img\delta d)^\perp$$
I used above fact that $\Delta,d\delta$ and $\delta d$ are self adjoint.

So I ask how to prove $(*)?$

A: (1) $d\delta E^p,\ \delta dE^p$ are orthogonal :
$$ (d\delta x, \delta d y)=(dd
\delta x,dy) =0 $$
In further we have $ \Delta E^p = V_1\oplus V_2,\ V_1:=d\delta E^p,\ V_2:= \delta
 d E^p $
(2) Note that $V_1\subset W_1:=dE^{p-1},\ V_2\subset W_2:= \delta E^{p+1}\ \ast$ are orthogonal
(3) Hodge proved first equality So second is followed. We will use $E_p=V_1\oplus
 V_2\oplus H^p\ \ast\ast$ : If $dx\in W_1,\ y\in H^p$, then $$ (dx,y)=(x,\delta y)=0 $$
(Note that $H^p=\{ x| dx=\delta x=0 \}$) That is, $W_1\oplus
W_2\oplus H^p\subset E_p$ So from this and $\ast,\ \ast\ast$ we
complete the proof


text:
Q: How to interpret dummy variables and interactions terms on dummy variables in a regression? Suppose I have a linear regression form of
$$
\log(Y) = \beta_0 + \beta_1X_2 + \beta_2X_3 + \beta_3X_1Z + \beta_4X_2Z + \epsilon
$$
where $X_1, X_2, X_3$ are binary and $X_1$ is omitted as a reference variable. Suppose $Z$ is also binary 0-1. I am wondering how  we would be interpret $\beta_1$ and $\beta_2$?

A: You can interpret $\beta_1$ as the percent change in Y when the treatment effect $X_2$ is applied, when you're holding other variables constant, in this case that is Z.
You can scale this interpretation to other $\beta_s$ as well.
Hope this helps.


text:
Q: HttpContext.Response.Redirect .NET Core returns 404 I'm using .Net Core Api as back-end, and Angular 8 as front-end. I need to implement redirect to front-end login page when user sends request to back-end API without cookie (using  context.HttpContext.Response.Redirect and Authorize attribute). But after redirect my front-end returns 404.
My .net Core code:

And result:

Otherwise, when i call this address from browser it works:


text:
Q: How to update entity in Entity-Framework? I have built an ASP.NET MVC web application that uses Entity Framework. To provide the view with correct data I have created special view classes that represent parts of the model classes.
I have 2 questions about this.

*

*How do I best convert data from the view object to the model object? For now I am doing this manually in methods like ViewClass.ToModel() and ViewClass.FromModel(ModelClass). However if the model is updated then this conversion may have to be updated. Do I really have to do this manually?

*When converting a viewobject to a modelobject it can happen that some of the properties is not set so the value will be null or string.empty. The problem with this is that when running refresh(in entityframework) this empty(not set) properties will be overwriting the real data. How should I handle this?
One solution may be to get the modelobject from database and then only transfare the peroperties that have been set to the modelobject? Problem with this might be that a value on a property could be set to null, how do I know if this propertie is set or not? Or do I have to write special update methods depending on the action?
BestRegards

A:
How do I best convert data from the view object to the model object?

AutoMapper

When converting a viewobject to a
  modelobject it can happen that some of
  the properties is not set so the value
  will be null or string.empty. The
  problem with this is that when running
  refresh(in entityframework) this
  empty(not set) properties will be
  overwriting the real data. How should
  I handle this?

If your data access layer (no matter what technology it is using, Entity Framework, NHibernate, ...) is not capable of handling this scenario you might need to have specially tailored update methods that work for those cases.


text:
Q: How to join two tables from different databases How to join two tables from different databases.  One database is localhost, the other is in online.
$connectA = mysql_connect('localhost','root','','abc');
$connectB = mysql_connect('xxx','yyy','zzz','xyz');

I want to join department_name from table department which is having database abc and xyz.

A: You cannot as long as by join you mean using SQL JOINS. It is, because SQL query is always sent to specific database or server.
You need to send two independent queries, one for each database and then provide some logic in PHP to join them either by array_merge (full join) or some more advanced scripting.
Can't help more without seeing some code of your own.

A: If the MySQL user has access to both databases and they are on the same host (i.e. both DBs are accessible from the same connection) you could:

*

*Keep one connection open and call mysql_select_db() to swap between as necessary. I am not sure this is a clean solution and you could end up querying the wrong database.

*Specify the database name when you reference tables within your queries (e.g. SELECT * FROM database2.tablename). This is likely to be a pain to implement.
Also please read troelskn's answer because that is a better approach if you are able to use PDO rather than the older extensions.

A: As already has been said, it is not possible.
I would save the database connections and switch between the databases.
Just a simple example (and with mysqli)
$db1 = mysqli_connect("localhost", "my_user", "my_password", "world");
$db2 = mysqli_connect("localhost2", "my_user2", "my_password2", "world2");

And then when you want to execute a query
mysqli_query($db1, "SELECT * ...");

or other database
mysqli_query($db2, "SELECT * ...");

Save the results from your query's in arrays and then use for example array_merge to join them.
http://php.net/manual/en/function.array-merge.php

A: Use can use database federation (data virtualization) technologies like Teiid http://teiid.io and join the tables across the databases or even data from files and web services.


text:
Q: How can I create a pie-chart with gnuplot? I want to create a pie-chart. Is that possible with gnuplot and how to realize that?

A: Here's an example of a pie-chart created with gnuplot. Also, on the same site, you can find another example, including the script used for creating the pie-chart.

A: Gnuplot is a "function plotting program". If you can come up with a function that has pie-like characteristics, Gnuplot will plot it for you. But I doubt that this would be done easily.
I'm afraid the answer is: No, that's not possible.
Edit: Apparently, that's also what the Gnuplot FAQ says.


text:
Q: I'm trying to add content into table on every click itextsharp Here are two ways on adding content into table on every button click
Example1
PdfPRow row1 = new PdfPRow(someArrayOfCells);
table.Rows.Add(row1);

Example2
 table.AddCell(Cell1);
 table.AddCell(Cell2);
 table.AddCell(Cell3);
 table.AddCell(Cell4);
 table.AddCell(Cell5);
 table.AddCell(Cell6);

Example 2 is doing the job for me, but example 1 not, can someone explain me why? I'm new in iTextSharp so if anyone could explain to me.


text:
Q: How do I get the size( gb , mb ) of a video in python? class videos(models.Model):
    caption = models.CharField(max_length=200,null=True)
    videoes = models.FileField(default='Product.png', null=True, validators=[validators.FileExtensionValidator(allowed_extensions=['mp4','mkv']), validators.MaxLengthValidator(limit_value=(10))])
    created = models.DateTimeField(auto_now_add=True)


text:
Q: Adding a new property to an Object that exists in an Array, using .map() I'm trying to conditionally add a property to an object in an array using .map(), but I seem to be missing something. My array of objects remains unchanged after the map is complete. All of this is the result of trying to resolve the ESLint error 'no-param-reassign' if that helps understand why I'm doing this.
I've made a rudimentary example of what I'm trying to accomplish here: jsfiddle.
var aList = [{
    Title: "Enders Game",
    Rating: 8
  },
  {
    Title: "Harry Potter",
    Rating: 10
  }];

console.log('before', aList);

aList.map(function(book) {
    if(book.Title == "Enders Game"){
    console.log({ ...book, completed: true })
    return { ...book, completed: true };
  }
  console.log({ ...book, completed: false })
  return { ...book, completed: false };
});

console.log('after', aList);

A: You could use Array#forEach, because you are not using the result of Array#map.

var aList = [{ Title: "Enders Game", Rating: 8 }, { Title: "Harry Potter", Rating: 10 }];

aList.forEach(function(book) {
    book.completed = book.Title == "Enders Game";
});

console.log(aList);
.as-console-wrapper { max-height: 100% !important; top: 0; }

For an all new array, you could use Array#map and use the result of it. For adding a new property to an object, you could use Object.assign, which mutates and returns the object at the first parameter.

var aList = [{ Title: "Enders Game", Rating: 8 }, { Title: "Harry Potter", Rating: 10 }],
    newList = aList.map(book => Object.assign({}, book, {completed: book.Title == "Enders Game"}));

console.log(aList);
console.log(newList);
.as-console-wrapper { max-height: 100% !important; top: 0; }

A: I think, it could be written much cleaner and readable in that way.
  const aList = [{ Title: 'Enders Game', Rating: 8 }, { Title: 'Harry Potter', Rating: 10 }];
  const newList = aList.map((book) => (
    {
      ...book,
      completed: book.Title === 'Enders Game',
    }));


text:
Q: how to rectify the validation_errors(); function's error message in password field? I am learning codeigniter 3(pursuing Edwin Diaz's CI Course and i am coding a login system. I have two controller methods called index and login . I am using form_validation library for this. But my problem lies in showing error messages in the password field . it is always showing the error message **The Password field is required.**even if i submit password. I am pasting the code below :
public function login(){
 $this->form_validation->set_rules('name','Username','trim|required|min_length[3]');
 $this->form_validation->set_rules('password','Password','trim|required|min_length[3]');

 if($this->form_validation->run() == FALSE){

 $data = array('errors'=> validation_errors() );
   $this->session->set_flashdata($data);
    redirect('home/index');

 }
 else{

 }

here is login_view.php code

Login Form

<?php $attributes= array('id' =>'login_form' ,'class'=>'form-horizontal' ); ?>
<?php if($this->session->flashdata('errors'):?>
      <?php echo $this->session->flashdata('errors');?>
 <?php endif; ?>

<?php echo form_open('home/login',$attributes);?>
    <?php echo form_label("Username") ;?>

    <?php $data = array('class'=>'form-control','name'=>'name','placeholder'=>'enter username');?>
    <?php echo form_input($data); ?>

    <?php echo form_label("Password") ;?>

    <?php $data = array('class'=>'form-control','password'=>'password','placeholder'=>'enter password');?>
    <?php echo form_password($data); ?>

<?php
$data = array('class'=>'btn btn-primary','name'=>'submit','value'=>'login');?>
    <?php echo form_submit($data); ?>

<?php echo form_close(); ?>

can anyone please say why the password field is doing these and how to rectify this ?
P.S :Many are saying codeigniter 3 does not support php version 7.3.12 while the same code is
running perfectly on php version 7.2.5

A: Looks like you haven't set the name for your password input.

HINT: View your HTML Source Code via your web browser to see what was
  generated. This always gives you a good clue as to what's not working.

So you need to change 'password'=> 'password' to 'name'=>'password
Your original line
<?php $data = array('class'=>'form-control','password'=>'password','placeholder'=>'enter password');?>

Should become
<?php $data = array('class'=>'form-control','name'=>'password','placeholder'=>'enter password');?>


text:
Q: Is this schematic correct? I'm working on an Arduino project and before I set off to build it completely I wanted to see if my schematic works or if something would go wrong.
The goal of the project is to be a sort of ball launcher, where the LCD holds a counter of how many balls launched, the distance sensor detects if anything is in front of it, a servo to stop the ball.
To launch the ball I have a 12V 3A DC motor like this one and i'm using a IRF3205 to control the speed of the motor through the analogWrite() function of the Arduino. I originally tried this with a smaller 5V motor and a TIP120 like in the picture.

And while it did work I read someone recommending the IRF3708 instead of the Darlington Transistor (I got the IRF3205 because I couldn't get the other one, I read it was very similar but I could be wrong).

This is my attempt at the schematic for this project but i'm not sure if something there is wrong or if I should add something else.
This are some of the components i'm using:

*

*Arduino Nano

*12V 3A Power Supply connected to a DC-005 Jack

*IRF3205 Mosfet

*MR506 600V 3A Diode

*2.2k Resistor

*12V 3A DC Motor

*Mp1584 Buck Converter

*LCD

*HC-SR04 Distance Sensor

*MG90S Servo

I'm pretty new to this so any help would be really appreciated, thanks!

A: As stated in the comments: Q1 needs to be redrawn. Hope this helps. Which FET, MOSFET, Etc. is something for someone with more knowledge than mine. I'm just showing you Q1. Hopefully I didn't mess it up. Lots of cut/paste in photoshop.


text:
Q: SIGSEGV at Android boot I recently installed (with Odin) the latest stock ROM for my SGS2 without wiping data.
After that I put a rooted kernel and started using.
I found out that:
- if I boot the phone, let it get to the lock screen (the first to appear after Samsung logo) and then turn off screen with power button, all goes fine
- if I don't turn screen off, the boot proccess goes wrong and all freeze; I can only force boot it again.
I took logcat of both boots and found these errors in the faulty one.
NB: I cut some parts of the SIGSEGV to remain within 30000 characters limit.
Can anybody help fix the problem?
Thank you!!!
E/UsimServiceTable: isActive for service 51 fails, max service is 40
E/UsimServiceTable: isSSTAvailable for service 51 fails, max service is 80
E/UsimServiceTable: isActive for service 51 fails, max service is 40
E/UsimServiceTable: isSSTAvailable for service 51 fails, max service is 80
E/UsimServiceTable: isActive for service 52 fails, max service is 40
E/UsimServiceTable: isSSTAvailable for service 52 fails, max service is 80
E/UsimServiceTable: isActive for service 52 fails, max service is 40
E/UsimServiceTable: isSSTAvailable for service 52 fails, max service is 80
E/UsimServiceTable: isActive for service 53 fails, max service is 40
E/UsimServiceTable: isSSTAvailable for service 53 fails, max service is 80
E/UsimServiceTable: isActive for service 53 fails, max service is 40
E/UsimServiceTable: isSSTAvailable for service 53 fails, max service is 80
E/UsimServiceTable: isActive for service 54 fails, max service is 40
E/UsimServiceTable: isSSTAvailable for service 54 fails, max service is 80
E/UsimServiceTable: isActive for service 54 fails, max service is 40
E/UsimServiceTable: isSSTAvailable for service 54 fails, max service is 80
E/UsimServiceTable: isActive for service 55 fails, max service is 40
E/UsimServiceTable: isSSTAvailable for service 55 fails, max service is 80
E/UsimServiceTable: isActive for service 55 fails, max service is 40
E/UsimServiceTable: isSSTAvailable for service 55 fails, max service is 80

E/android.os.Debug: !@Dumpstate > dumpstate -k -t -z -d -o /data/log/dumpstate_sys_watchdog
E/Watchdog: WATCHDOG caused by com.android.server.am.ActivityManagerService

E/AndroidRuntime: Error reporting crash
E/AndroidRuntime: android.os.DeadObjectException
E/AndroidRuntime:   at android.os.BinderProxy.transact(Native Method)
E/AndroidRuntime:   at android.app.ActivityManagerProxy.handleApplicationCrash(ActivityManagerNative.java:3305)
E/AndroidRuntime:   at com.android.internal.os.RuntimeInit$UncaughtHandler.uncaughtException(RuntimeInit.java:121)
E/AndroidRuntime:   at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:693)
E/AndroidRuntime:   at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:690)
E/AndroidRuntime:   at dalvik.system.NativeStart.main(Native Method)
W/Sensors : sensorservice died [0x4c38d570]

E/AndroidRuntime: java.lang.SecurityException: Neither user 10012 nor current process has android.permission.ACCESS_COARSE_LOCATION.
E/AndroidRuntime:   at android.os.Parcel.readException(Parcel.java:1425)
E/AndroidRuntime:   at android.os.Parcel.readException(Parcel.java:1379)
E/AndroidRuntime:   at com.android.internal.telephony.ITelephony$Stub$Proxy.getCellLocation(ITelephony.java:1261)
E/AndroidRuntime:   at android.telephony.TelephonyManager.getCellLocation(TelephonyManager.java:267)
E/AndroidRuntime:   at ekv.a(SourceFile:53)
E/AndroidRuntime:   at com.google.android.location.os.real.SdkSpecific8.a(SourceFile:62)
E/AndroidRuntime:   at ekl.handleMessage(SourceFile:187)
E/AndroidRuntime:   at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime:   at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime:   at eko.run(SourceFile:804)
E/AndroidRuntime:   at java.lang.Thread.run(Thread.java:856)

E/BootAnimation: sequence and loop RBG type's are different. seqeunce:7,loop:6

E/BootAnimation: /sys/class/sec/led/led_pattern: open error, fd = -1

E/SECHWC_LOG: int hwc_device_open(const hw_module_t*, char const*, hw_device_t**)::window_set_pos is failed : Bad address
E/SECHWC_LOG: int destroyMem(s3c_mem_t*)::invalied fd(0) fail
E/SECHWC_LOG: int hwc_device_open(const hw_module_t*, char const*, hw_device_t**)::destroyMem() fail
E/SurfaceFlinger: composer device failed to initialize (Invalid argument)
D/SurfaceFlinger: About to give-up screen, flinger = 0x4193cd78
F/libc    : Fatal signal 11 (SIGSEGV) at 0x00002900 (code=1), thread 4408 (SurfaceFlinger)
I/SurfaceFlinger: EventThread ready to run.
I/BootAnimation: ret=2, fps:12, interval:83333
E/BootAnimation: sequence and loop RBG type's are different. seqeunce:7,loop:6
I/BootAnimation: createSurface BGRA8888
I/ServiceManager: service 'nfc' died
I/ServiceManager: service 'iphonesubinfo' died
I/ServiceManager: service 'com.orange.authentication.simcard' died
I/ServiceManager: service 'isms' died
I/ServiceManager: service 'phoneext' died
I/ServiceManager: service 'phone' died
I/ServiceManager: service 'sip' died
I/ServiceManager: service 'simphonebook' died
V/AudioPolicyManagerBase: releaseOutput() 2
I/DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEBUG   : Build fingerprint: 'samsung/GT-I9100P/GT-I9100P:4.1.2/JZO54K/I9100PXXLSK:user/release-keys'
I/DEBUG   : pid: 4403, tid: 4408, name: SurfaceFlinger  >>> /system/bin/surfaceflinger <<<
I/DEBUG   : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00002900
D/dalvikvm: Note: class Landroid/app/ActivityManagerNative; has 155 unimplemented (abstract) methods
I/DEBUG   :     r0 41953580  r1 00000001  r2 419442e8  r3 00000000
I/DEBUG   :     r4 419531c0  r5 00002901  r6 00000001  r7 4193d730
I/DEBUG   :     r8 4105ecac  r9 00000001  sl 4193d72c  fp 0000000d
I/DEBUG   :     ip 401d0168  sp 4105ec60  lr 400c33bf  pc 00002900  cpsr 20000030
I/DEBUG   :     d0  3f00000000000000  d1  00000000437f0000
I/DEBUG   :     d2  437f00003f000000  d3  437f8000000000ff
I/DEBUG   :     d4  c0000000437f0000  d5  3f800000bf800000
I/DEBUG   :     d6  3f8000003f800000  d7  00ffffff3f800000
I/DEBUG   :     d8  0000000000000000  d9  0000000000000000
I/DEBUG   :     d10 0000000000000000  d11 0000000000000000
I/DEBUG   :     d12 0000000000000000  d13 0000000000000000
I/DEBUG   :     d14 0000000000000000  d15 0000000000000000
I/DEBUG   :     d16 7fffffffffffffff  d17 7fffffffffffffff
I/DEBUG   :     d18 0000000000000000  d19 3fe0000000000000
I/DEBUG   :     d20 3fe000000000946f  d21 0000000000000000
I/DEBUG   :     d22 0000000000000000  d23 0000000000000000
I/DEBUG   :     d24 0000000000000000  d25 0000000000000000
I/DEBUG   :     d26 0000000000000000  d27 0000000000000000
I/DEBUG   :     d28 0000000000000000  d29 0000000000000000
I/DEBUG   :     d30 0000000000000000  d31 0000000000000000
I/DEBUG   :     scr 60000010
I/DEBUG   :
I/DEBUG   : backtrace:
I/DEBUG   :     #00  pc 00002900  <unknown>
I/DEBUG   :     #01  pc 000203bd  /system/lib/libsurfaceflinger.so (android::HWComposer::commit() const+14)
I/DEBUG   :     #02  pc 0001fd05  /system/lib/libsurfaceflinger.so (android::DisplayHardware::flip(android::Region const&) const+60)
I/DEBUG   :     #03  pc 00022f8f  /system/lib/libsurfaceflinger.so (android::SurfaceFlinger::onScreenReleased()+70)
I/DEBUG   :     #04  pc 00022fb9  /system/lib/libsurfaceflinger.so
I/DEBUG   :     #05  pc 00020d4b  /system/lib/libsurfaceflinger.so (android::MessageBase::handleMessage(android::Message const&)+12)
I/DEBUG   :     #06  pc 000149e3  /system/lib/libutils.so (android::Looper::pollInner(int)+426)
I/DEBUG   :     #07  pc 00014b01  /system/lib/libutils.so (android::Looper::pollOnce(int, int*, int*, void**)+104)
I/DEBUG   :     #08  pc 000210d9  /system/lib/libsurfaceflinger.so (android::MessageQueue::waitMessage()+40)
I/DEBUG   :     #09  pc 00021991  /system/lib/libsurfaceflinger.so (android::SurfaceFlinger::threadLoop()+4)
I/DEBUG   :     #10  pc 0001104f  /system/lib/libutils.so (android::Thread::_threadLoop(void*)+114)
I/DEBUG   :     #11  pc 00010bb5  /system/lib/libutils.so
I/DEBUG   :     #12  pc 00012e00  /system/lib/libc.so (__thread_entry+48)
I/DEBUG   :     #13  pc 00012558  /system/lib/libc.so (pthread_create+172)
I/DEBUG   :
I/DEBUG   : stack:
I/DEBUG   :          4105ec20  41944370  [heap]
I/DEBUG   :          4105ec24  410942d0  /system/lib/egl/libGLESv1_CM_mali.so (_gles_clear+1148)
I/DEBUG   :          4105ec28  00000001
I/DEBUG   :          4105ec2c  00000001
I/DEBUG   :          4105ec30  00000001
I/DEBUG   :          4105ec34  41943a10  [heap]
I/DEBUG   :          4105ec38  0000ff00
I/DEBUG   :          4105ec3c  00000000
I/DEBUG   :          4105ec40  00000000
I/DEBUG   :          4105ec44  00000000
I/DEBUG   :          4105ec48  00000000
I/DEBUG   :          4105ec4c  ff000000
I/DEBUG   :          4105ec50  00000000
I/DEBUG   :          4105ec54  00000000
I/DEBUG   :          4105ec58  df0027ad
I/DEBUG   :          4105ec5c  00000000
I/DEBUG   :     #00  4105ec60  41953580  [heap]
I/DEBUG   :          ........  ........
I/DEBUG   :     #01  4105ec60  41953580  [heap]
I/DEBUG   :          4105ec64  4193db00  [heap]
I/DEBUG   :          4105ec68  419442e8  [heap]
I/DEBUG   :          4105ec6c  400c2d09  /system/lib/libsurfaceflinger.so (android::DisplayHardware::flip(android::Region const&) const+64)
I/DEBUG   :     #02  4105ec70  4193db00  [heap]
I/DEBUG   :          4105ec74  4105ecac
I/DEBUG   :          4105ec78  00000007
I/DEBUG   :          4105ec7c  40241d00  /system/lib/libui.so
I/DEBUG   :          4105ec80  4193db00  [heap]
I/DEBUG   :          4105ec84  4193cd78  [heap]
I/DEBUG   :          4105ec88  400c3d3f  /system/lib/libsurfaceflinger.so (android::MessageBase::handleMessage(android::Message const&))
I/DEBUG   :          4105ec8c  4193d730  [heap]
I/DEBUG   :          4105ec90  40193ebe  /system/lib/libutils.so
I/DEBUG   :          4105ec94  400c5f93  /system/lib/libsurfaceflinger.so (android::SurfaceFlinger::onScreenReleased()+74)
I/DEBUG   :
I/DEBUG   : memory near r0:

[.........................]
I/DEBUG   :
I/DEBUG   : memory map around fault addr 00002900:
I/DEBUG   :     (no map below)
I/DEBUG   :     (no map for address)
I/DEBUG   :     4000e000-4000f000 /system/lib/libstdc++.so
I/SamplingProfilerIntegration: Profiling disabled.
I/Zygote  : !@beginofpreloadClasses()
I/Zygote  : Preloading classes...
D/dalvikvm: WAIT_FOR_CONCURRENT_GC blocked 0ms
I/Zygote  : !@beginofpreloadResources()
D/dalvikvm: GC_EXPLICIT freed 40K, 80% free 528K/2560K, paused 0ms+0ms, total 3ms
D/dalvikvm: WAIT_FOR_CONCURRENT_GC blocked 2ms
D/dalvikvm: GC_EXPLICIT freed <1K, 80% free 527K/2560K, paused 10ms+0ms, total 13ms
E/installd: eof
E/installd: failed to read size
I/installd: closing connection
I/Zygote  : Preloading resources...
I/Zygote  : Number of total Classes to prelaod: 2309
I/Zygote  : Classes to load for thread1 0~830
I/Zygote  : Classes to load for thread2 831~2308
W/Zygote  : Class not found for preloading: android.view.InputQueue$FinishedCallback
I/DEBUG   : !@dumpstate -k -t -z -d -o /data/log/dumpstate_app_native -m 4403
I/dumpstate: begin
D/dalvikvm: GC_FOR_ALLOC freed 83K, 63% free 956K/2560K, paused 14ms, total 14ms
W/Zygote  : Class not found for preloading: android.animation.ValueAnimator$2
W/Zygote  : Class not found for preloading: android.animation.ValueAnimator$3
W/Zygote  : Class not found for preloading: android.animation.ValueAnimator$4
W/Zygote  : Class not found for preloading: android.animation.ValueAnimator$5
D/dalvikvm: GC_FOR_ALLOC freed 28K, 44% free 1439K/2560K, paused 14ms, total 14ms
D/dalvikvm: GC_FOR_ALLOC freed 74K, 27% free 1870K/2560K, paused 14ms, total 14ms
W/Zygote  : Class not found for preloading: android.view.ViewRootImpl$3
V/BluetoothAudioGateway.cpp: classInitNative
V/BT HSHFP: classInitNative
D/dalvikvm: GC_FOR_ALLOC freed 40K, 10% free 2312K/2560K, paused 18ms, total 18ms
D/dalvikvm: GC_FOR_ALLOC freed 8K, 8% free 2361K/2560K, paused 15ms, total 15ms
D/dalvikvm: GC_FOR_ALLOC freed <1K, 7% free 2982K/3203K, paused 8ms, total 8ms
W/Zygote  : Class not found for preloading: android.content.res.Resources$1
D/dalvikvm: GC_FOR_ALLOC freed 15K, 2% free 3659K/3715K, paused 15ms, total 15ms
D/dalvikvm: GC_FOR_ALLOC freed 6K, 2% free 4027K/4099K, paused 15ms, total 15ms
D/dalvikvm: GC_FOR_ALLOC freed 1K, 3% free 5049K/5187K, paused 5ms, total 6ms
I/dalvikvm: threadid=1: recursive native library load attempt (/system/lib/libwebcore.so)
D/dalvikvm: No JNI_OnLoad found in /system/lib/libchromium_net.so 0x0, skipping init
D/dalvikvm: GC_FOR_ALLOC freed 14K, 1% free 6325K/6339K, paused 15ms, total 15ms
D/dalvikvm: GC_FOR_ALLOC freed 30K, 2% free 7019K/7107K, paused 17ms, total 17ms
I/Zygote  : ...preloaded 279 resources in 604ms.
I/Zygote  : ...preloaded 31 resources in 7ms.
I/Zygote  : !@End of preloadResources()
D/TextLayoutCache: Using debug level = 0 - Debug Enabled = 0
W/Zygote  : Class not found for preloading: android.widget.EdgeGlow
W/Zygote  : Class not found for preloading: android.database.sqlite.SQLiteCompiledSql
W/Zygote  : Class not found for preloading: android.database.sqlite.SQLiteDatabase$DatabaseReentrantLock
W/Zygote  : Class not found for preloading: android.media.AudioManager$2
I/dalvikvm: threadid=6: recursive native library load attempt (/system/lib/libmedia_jni.so)
D/MtpDeviceJNI: register_android_mtp_MtpDevice
I/dalvikvm: threadid=6: recursive native library load attempt (/system/lib/libmedia_jni.so)
I/dalvikvm: threadid=6: recursive native library load attempt (/system/lib/libmedia_jni.so)
W/Zygote  : Class not found for preloading: android.media.IRemoteControlClientDispatcher
W/Zygote  : Class not found for preloading: android.media.IRemoteControlClientDispatcher$Stub
D/su      : su invoked.
D/su      : Allowing shell.
D/su      : 2000 /system/bin/dumpstate executing 0 lsof using binary lsof : lsof
W/Zygote  : Class not found for preloading: android.widget.TextView$Blink
W/Zygote  : Class not found for preloading: android.widget.TextView$EasyEditSpanController
W/Zygote  : Class not found for preloading: android.widget.TextView$InputContentType
W/Zygote  : Class not found for preloading: android.widget.TextView$InputMethodState
W/Zygote  : Class not found for preloading: android.widget.TextView$TextAlign
E/PhonePolicy: Could not preload class for phone policy: com.android.internal.policy.impl.PhoneWindow$ContextMenuCallback
D/dalvikvm: GC_FOR_ALLOC freed 308K, 4% free 8526K/8835K, paused 10ms, total 10ms
W/Zygote  : Class not found for preloading: android.os.Power
V/BluetoothEventLoop.cpp: classInitNative
V/BluetoothService.cpp: classInitNative
W/Zygote  : Class not found for preloading: android.text.TextDirectionHeuristics$CharCount
W/Zygote  : Class not found for preloading: android.text.method.WordIterator$1
W/Zygote  : Class not found for preloading: android.view.InputHandler
I/Zygote  : ...preloaded 831 classes in 1146ms.
I/System  : Loaded time zone names for  in 312ms (309ms in ICU)
I/System  : Loaded time zone names for en_US in 93ms (89ms in ICU)
I/System  : Loaded time zone names for it_IT in 101ms (97ms in ICU)
D/dalvikvm: GC_FOR_ALLOC freed 977K, 10% free 9650K/10627K, paused 24ms, total 25ms
I/Zygote  : ...preloaded 1478 classes in 1495ms.
I/Zygote  : !@EndofpreloadClasses()
D/dalvikvm: WAIT_FOR_CONCURRENT_GC blocked 0ms
D/dalvikvm: GC_EXPLICIT freed 327K, 12% free 9360K/10627K, paused 1ms+2ms, total 21ms
D/dalvikvm: WAIT_FOR_CONCURRENT_GC blocked 0ms
D/dalvikvm: GC_EXPLICIT freed 21K, 13% free 9339K/10627K, paused 1ms+2ms, total 18ms
D/dalvikvm: WAIT_FOR_CONCURRENT_GC blocked 0ms
D/dalvikvm: GC_EXPLICIT freed <1K, 13% free 9339K/10627K, paused 1ms+2ms, total 17ms
I/dalvikvm: System server process 4440 has been created
I/Zygote  : Accepting command socket connections
D/dalvikvm: WAIT_FOR_CONCURRENT_GC blocked 0ms
W/ResourceType: Failure getting entry for 0x7f020003 (t=1 e=3) in package 0 (error -75)
W/ResourceType: Failure getting entry for 0x7f020000 (t=1 e=0) in package 0 (error -75)
W/ResourceType: Failure getting entry for 0x7f020001 (t=1 e=1) in package 0 (error -75)
W/ResourceType: Failure getting entry for 0x7f020001 (t=1 e=1) in package 0 (error -75)
D/dalvikvm: GC_CONCURRENT freed 109K, 13% free 9750K/11143K, paused 12ms+12ms, total 84ms
D/dalvikvm: WAIT_FOR_CONCURRENT_GC blocked 21ms
D/dalvikvm: WAIT_FOR_CONCURRENT_GC blocked 21ms
D/dalvikvm: WAIT_FOR_CONCURRENT_GC blocked 21ms
D/dalvikvm: WAIT_FOR_CONCURRENT_GC blocked 20ms
D/dalvikvm: WAIT_FOR_CONCURRENT_GC blocked 7ms
I/sysproc : !@beginofsystem_init1()
W/ResourceType: Failure getting entry for 0x7f020005 (t=1 e=5) in package 0 (error -75)
I/sysproc : Entered system_init()
I/sysproc : ServiceManager: 0x4c24d3c8
D/SensorService: nuSensorService starting...
W/ResourceType: Failure getting entry for 0x7f0201f5 (t=1 e=501) in package 0 (error -75)
I/AKMD2   : open_accelerometer
W/ResourceType: Failure getting entry for 0x7f0201f5 (t=1 e=501) in package 0 (error -75)
W/ResourceType: Failure getting entry for 0x7f0201f4 (t=1 e=500) in package 0 (error -75)
W/ResourceType: Failure getting entry for 0x7f020001 (t=1 e=1) in package 0 (error -75)
W/ResourceType: Failure getting entry for 0x7f020004 (t=1 e=4) in package 0 (error -75)
W/ResourceType: Failure getting entry for 0x7f020007 (t=1 e=7) in package 0 (error -75)
I/PackageParser: com.orange.authentication.simcard.permission: compat added android.permission.WRITE_EXTERNAL_STORAGE android.permission.READ_PHONE_STATE
W/ResourceType: Failure getting entry for 0x7f02001b (t=1 e=27) in package 0 (error -75)
W/ResourceType: Failure getting entry for 0x7f02001b (t=1 e=27) in package 0 (error -75)
W/ResourceType: Failure getting entry for 0x7f040001 (t=3 e=1) in package 0 (error -75)
W/ResourceType: Failure getting entry for 0x7f02001d (t=1 e=29) in package 0 (error -75)
W/ResourceType: Failure getting entry for 0x7f040000 (t=3 e=0) in package 0 (error -75)
W/ResourceType: Failure getting entry for 0x7f020007 (t=1 e=7) in package 0 (error -75)
D/dalvikvm: GC_CONCURRENT freed 168K, 13% free 10138K/11591K, paused 23ms+3ms, total 60ms
D/dalvikvm: WAIT_FOR_CONCURRENT_GC blocked 15ms
D/dalvikvm: WAIT_FOR_CONCURRENT_GC blocked 16ms
D/dalvikvm: WAIT_FOR_CONCURRENT_GC blocked 16ms
D/dalvikvm: WAIT_FOR_CONCURRENT_GC blocked 17ms
W/ResourceType: Failure getting entry for 0x7f02025f (t=1 e=607) in package 0 (error -75)
W/ResourceType: Failure getting entry for 0x7f02032c (t=1 e=812) in package 0 (error -75)
W/ResourceType: Failure getting entry for 0x7f02032f (t=1 e=815) in package 0 (error -75)
W/ResourceType: Failure getting entry for 0x7f02022c (t=1 e=556) in package 0 (error -75)
D/dalvikvm: GC_CONCURRENT freed 215K, 13% free 10473K/11975K, paused 37ms+2ms, total 55ms
D/dalvikvm: WAIT_FOR_CONCURRENT_GC blocked 32ms
D/dalvikvm: WAIT_FOR_CONCURRENT_GC blocked 35ms
D/dalvikvm: WAIT_FOR_CONCURRENT_GC blocked 23ms
D/dalvikvm: WAIT_FOR_CONCURRENT_GC blocked 26ms
W/ResourceType: Failure getting entry for 0x7f02022c (t=1 e=556) in package 0 (error -75)
I/SensorService: K3DH Acceleration Sensor
I/SensorService: AK8975 Magnetic field Sensor
I/SensorService: AK8975 Orientation Sensor
I/SensorService: CM3663 Light Sensor
I/SensorService: CM3663 Proximity Sensor
I/SensorService: K3G Gyroscope Sensor
W/ResourceType: Failure getting entry for 0x7f0204f6 (t=1 e=1270) in package 0 (error -75)
I/RemoteDesktopService: RemoteDesktopService started (pid=4440)
W/ResourceType: Failure getting entry for 0x7f0204f6 (t=1 e=1270) in package 0 (error -75)
W/ResourceType: Failure getting entry for 0x7f0204f6 (t=1 e=1270) in package 0 (error -75)
W/ResourceType: Failure getting entry for 0x7f110062 (t=16 e=98) in package 0 (error -75)
W/ResourceType: Failure getting entry for 0x7f020000 (t=1 e=0) in package 0 (error -75)
W/ResourceType: Failure getting entry for 0x7f110062 (t=16 e=98) in package 0 (error -75)
D/dalvikvm: GC_FOR_ALLOC freed 259K, 13% free 10749K/12295K, paused 30ms, total 31ms
D/SensorService: nuSensorService thread starting...
W/ResourceType: Failure getting entry for 0x7f02000c (t=1 e=12) in package 0 (error -75)
W/ResourceType: Failure getting entry for 0x7f02001a (t=1 e=26) in package 0 (error -75)
W/ResourceType: Failure getting entry for 0x7f0203c1 (t=1 e=961) in package 0 (error -75)
W/ResourceType: Failure getting entry for 0x7f0203c1 (t=1 e=961) in package 0 (error -75)
W/ResourceType: Failure getting entry for 0x7f03003b (t=2 e=59) in package 0 (error -75)
I/PackageParser: com.monotype.android.font.helvneuelt: compat added android.permission.WRITE_EXTERNAL_STORAGE android.permission.READ_PHONE_STATE
D/dalvikvm: GC_CONCURRENT freed 252K, 13% free 11009K/12551K, paused 11ms+2ms, total 43ms
D/dalvikvm: WAIT_FOR_CONCURRENT_GC blocked 14ms
D/dalvikvm: WAIT_FOR_CONCURRENT_GC blocked 15ms
D/dalvikvm: WAIT_FOR_CONCURRENT_GC blocked 14ms
D/dalvikvm: WAIT_FOR_CONCURRENT_GC blocked 15ms
W/ResourceType: Failure getting entry for 0x7f020000 (t=1 e=0) in package 0 (error -75)
W/ResourceType: Failure getting entry for 0x7f020000 (t=1 e=0) in package 0 (error -75)
W/ResourceType: Failure getting entry for 0x7f020000 (t=1 e=0) in package 0 (error -75)
D/su      : su invoked.
W/ResourceType: Failure getting entry for 0x7f020004 (t=1 e=4) in package 0 (error -75)
D/su      : Allowing shell.
D/su      : 2000 /system/bin/dumpstate executing 0 sqlite3 using binary sqlite3 : sqlite3 /data/data/com.android.providers.settings/databases/settings.db pragma user_version; select * from system; select * from secure;
E/su      : exec failed with 2: No such file or directory
D/dalvikvm: GC_CONCURRENT freed 241K, 12% free 11274K/12807K, paused 1ms+4ms, total 26ms
D/dalvikvm: WAIT_FOR_CONCURRENT_GC blocked 2ms
D/dalvikvm: WAIT_FOR_CONCURRENT_GC blocked 3ms
D/dalvikvm: WAIT_FOR_CONCURRENT_GC blocked 3ms
W/ResourceType: Failure getting entry for 0x7f020332 (t=1 e=818) in package 0 (error -75)
W/ResourceType: Failure getting entry for 0x7f020334 (t=1 e=820) in package 0 (error -75)
W/ResourceType: Failure getting entry for 0x7f020334 (t=1 e=820) in package 0 (error -75)
W/ResourceType: Failure getting entry for 0x7f020334 (t=1 e=820) in package 0 (error -75)
W/ResourceType: Failure getting entry for 0x7f020333 (t=1 e=819) in package 0 (error -75)
W/ResourceType: Failure getting entry for 0x7f020333 (t=1 e=819) in package 0 (error -75)
W/ResourceType: Failure getting entry for 0x7f020333 (t=1 e=819) in package 0 (error -75)
W/ResourceType: Failure getting entry for 0x7f020009 (t=1 e=9) in package 0 (error -75)
W/ResourceType: Failure getting entry for 0x7f02001d (t=1 e=29) in package 0 (error -75)
W/ResourceType: Failure getting entry for 0x7f020333 (t=1 e=819) in package 0 (error -75)
W/ResourceType: Failure getting entry for 0x7f10004b (t=15 e=75) in package 0 (error -75)
W/ResourceType: Failure getting entry for 0x7f02035d (t=1 e=861) in package 0 (error -75)
D/su      : su invoked.
D/su      : Allowing shell.
D/su      : 2000 /system/bin/dumpstate executing 0 netcfg using binary netcfg : netcfg
W/ResourceType: Failure getting entry for 0x7f020319 (t=1 e=793) in package 0 (error -75)
W/ResourceType: Failure getting entry for 0x7f020319 (t=1 e=793) in package 0 (error -75)
D/dalvikvm: GC_CONCURRENT freed 294K, 13% free 11541K/13127K, paused 12ms+3ms, total 53ms
D/dalvikvm: WAIT_FOR_CONCURRENT_GC blocked 17ms
D/dalvikvm: WAIT_FOR_CONCURRENT_GC blocked 18ms
D/dalvikvm: WAIT_FOR_CONCURRENT_GC blocked 18ms
W/ResourceType: Failure getting entry for 0x7f020331 (t=1 e=817) in package 0 (error -75)
W/ResourceType: Failure getting entry for 0x7f020328 (t=1 e=808) in package 0 (error -75)
W/ResourceType: Failure getting entry for 0x7f020328 (t=1 e=808) in package 0 (error -75)
W/ResourceType: Failure getting entry for 0x7f020328 (t=1 e=808) in package 0 (error -75)
W/ResourceType: Failure getting entry for 0x7f02014e (t=1 e=334) in package 0 (error -75)
D/dalvikvm: GC_CONCURRENT freed 280K, 12% free 11809K/13383K, paused 11ms+3ms, total 45ms
D/dalvikvm: WAIT_FOR_CONCURRENT_GC blocked 18ms
W/ResourceType: Failure getting entry for 0x7f0e004d (t=13 e=77) in package 0 (error -75)
W/ResourceType: Failure getting entry for 0x7f0e004e (t=13 e=78) in package 0 (error -75)
I/BootTime: Prefetch Time Taken:1050
D/su      : su invoked.
D/su      : Allowing shell.
D/su      : 2000 /system/bin/dumpstate executing 0 iptables using binary iptables : iptables -L -nvx
D/su      : su invoked.
D/su      : Allowing shell.
D/su      : 2000 /system/bin/dumpstate executing 0 ip6tables using binary ip6tables : ip6tables -L -nvx
D/su      : su invoked.
D/su      : Allowing shell.
D/su      : 2000 /system/bin/dumpstate executing 0 iptables using binary iptables : iptables -t nat -L -nvx
D/su      : su invoked.
D/su      : Allowing shell.
D/su      : 2000 /system/bin/dumpstate executing 0 iptables using binary iptables : iptables -t raw -L -nvx
D/su      : su invoked.
D/su      : Allowing shell.
D/su      : 2000 /system/bin/dumpstate executing 0 ip6tables using binary ip6tables : ip6tables -t raw -L -nvx
D/su      : su invoked.
D/su      : Allowing shell.
D/su      : 2000 /system/bin/dumpstate executing 0 wpa_cli using binary wpa_cli : wpa_cli list_networks
E/su      : exec failed with 2: No such file or directory
D/VoldCmdListener: asec list
D/su      : su invoked.
D/su      : Allowing shell.
D/su      : 2000 /system/bin/dumpstate executing 0 cat using binary cat : cat /data/system/packages.xml
D/su      : su invoked.
D/su      : Allowing shell.
D/su      : 2000 /system/bin/dumpstate executing 0 cat using binary cat : cat /proc/4403/maps
I/dumpstate: done
I/ServiceManager: service 'SurfaceFlinger' died
I/ServiceManager: service 'SecTVOutService' died
F/libc    : Fatal signal 11 (SIGSEGV) at 0x00000010 (code=1), thread 4423 (BootAnimation)
D/BootAnimation: SurfaceFlinger died, exiting...
F/libc    : Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1), thread 4440 (system_server)
I/ServiceManager: service 'sensorservice' died
I/DEBUG   : unexpected waitpid response: n=4440, status=00000009
I/DEBUG   : ptrace detach from 4440 failed: No such process
I/DEBUG   : debuggerd committing suicide to free the zombie!
I/DEBUG   : debuggerd: Mar  7 2013 21:50:41


text:
Q: What is the time complexity of this hash function? I have a hashing function and I want to know if it is constant.  Since the length of the array word is constant, does that mean the function is constant in Big O notation?
public int hash(String s) {
    if (s.length() > 7)
        return -1;

    for (int i = 0; i < word.length; ++i) {
        if (word[i].compareTo(s) == 0)
            return i;
    }

    return -1;
}

A:
Since the length of the array word is constant, does that mean the function is constant in Big O notation?

Big O is used to describe how the run time or memory consumption of a process grows as its input grows. If your array is of constant length, then it will not grow and have an effect. Therefore, you can in this context consider hash() to run in O(1), assuming that the string comparisons are done in relatively constant time.
One way to think about it would be to say that since the length of the array is not variable, it should always be possible to "unroll" that loop so as to have a fixed number of O(1) comparisons one after the other, which all-in-all will still be O(1). Again, this presumes that the time taken to compare the strings is also constant (which in reality may not be the case if you have very large strings of varying lengths). Of course, if you know that the contents of the array will also be constant in addition to its length, then you can say for certain that the function will be O(1).

A: The time required to compare two strings of lengths m and n is O(min{m, n} + 1).  Let's suppose that k is the length of the word array and that m is the length of the longest word in word and n is the length of the input string.  In this case, the function does O(k) string comparisons, each of which take time O(min{m, n} + 1).  Therefore, the runtime is O(k min{m, n} + m).
Now, since m is known to be a constant, we can simplify this and say that the runtime will be O(min{m, n} + 1).  If all of the strings in word are fixed constants, then m is a constant and the runtime is O(min{1, n} + 1) = O(1) and your hash function runs in constant time.  Otherwise, if they're unboundedly long, the only thing you can claim is that the runtime is O(min{m, n} + 1).
Hope this helps!

A: your function has complexity O(N2), as it has 2 inputs:

*

*s - your string (length N1)

*word - array (length N2)

so, you complexity will be O(N1*N2), which can be simplified to O(N2)
if length N2 is really const, then function will have complexity O(N1) in worst case.
if length N1 also consts - then we have O(1) complexity

A: This function is O(1) if word is constant.
s.length() runs in constant time regardless of the length of s.
The time it takes to run word[i].compareTo(s) is bounded by the length of word[i].  As long as word doesn't change, this means there is an upper bound for the time it takes to run the entire for loop.
So there's an upper bound on the time this function takes to run, and the function is O(1).
If word can change, I believe this function would be O(n) where n is the size of word.  However, if the elements of word have increasing lengths, word[i].compareTo(s) will be bounded by larger and larger numbers, so the length of s might begin to matter.  Perhaps the complexity is actually O(n^2).  I don't know, and now I'm curious myself.


text:
Q: default values for salt, iteration count and key length for PBEKeySpec http://docs.oracle.com/javase/7/docs/api/javax/crypto/spec/PBEKeySpec.html
Per that the salt, iteration count and key length are optional parameters. What are the defaults if they're not specified?
For algorithms with fixed key lengths the key length is easy enough to figure out but algorithms like AES can have multiple key lengths.
Any ideas?

A: You can find the source code here: http://developer.classpath.org/doc/javax/crypto/spec/PBEKeySpec-source.html
The default values are the default values set by the JVM for their types (empty array and 0).


text:
Q: how to set onclicklistener to items in current page? I have an application where i want to add onclicklistener to my individual items in pager.
Below is my screen shot . please some one tell me how to add onclicklistener to individual image in this current page .

Thanks
below is my code for pager view.
 here when 1st time run the app initialize the every view page, when i try to click on image it return only last image info. But i want the current image info.
    scroller = ((Pager)findViewById(R.id.scrollView));
    indicator = ((PageIndicator)findViewById(R.id.indicator));
    indicator.setPager(scroller);
   // Pager pager = new Pager(this, attrs)

    //indicator.getActivePage();

    LayoutInflater layoutInflater = (LayoutInflater) this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    View pageView = null;
    for (int i = 0; i < NUM_PAGES; i++) {
         pageView = layoutInflater.inflate(R.layout.page, null);
       // ((TextView) pageView.findViewById(R.id.pageText)).setText("Page " + (i+1));
          c=4*i;
         imageView1 = (ImageView) pageView.findViewById(R.id.imageView1);
         imageView1.setImageResource(icons[c]);
         imageView2 = (ImageView) pageView.findViewById(R.id.imageView2);
         imageView2.setImageResource(icons[c+1]);
         imageView3 = (ImageView) pageView.findViewById(R.id.imageView3);
         imageView3.setImageResource(icons[c+2]);
         imageView4 = (ImageView) pageView.findViewById(R.id.imageView4);
         imageView4.setImageResource(icons[c+3]);

       // pageView.setBackgroundColor(COLORS[i % COLORS.length]);
        imageView1.setOnClickListener(new OnClickListener() {

            @Override
            public void onClick(View v) {
                System.out.println("helo i clicked==>"+c);

            }
        });
        imageView2.setOnClickListener(new OnClickListener() {

            @Override
            public void onClick(View v) {
                System.out.println("helo i clicked==>"+c);
            }
        });
       imageView3.setOnClickListener(new OnClickListener() {

            @Override
            public void onClick(View v) {
                System.out.println("helo i clicked==>"+c);
            }
        });
       imageView4.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            System.out.println("helo i clicked==>"+c);
        }
    });
        scroller.addPage(pageView);
    }

A: It seem to be you didn't read information available at android developers.
Use below  code to add onClickListener for images. I don't know whether you are using ImageView or ImageButton. I took ImageView.
ImageView iv = new ImageView(/**Context you have to pass**/);

iv.setOnClickListener(new View.OnClickListener) {

        @Override
        public void onClick(View v) {
            // TODO Auto-generated method stub
            // do whatever you want
        }
    });

I hope it may help you.

A: set this on your images..or button
in the xml such that
<Button [...]
   android:onClick: "onClick" [...]
 />

"onClick": name this whatever you want your method name that handles clicks to be

A: This can be done by assigning onClickListeners to Image Buttons. You can use Image buttons to display these images and set onClickListeners on them. Perhaps something like this can help?
   ImageButton   button = (ImageButton) findViewById(R.id.imageButton1);
    button.setOnClickListener(new OnClickListener() {

        public void onClick(View v) {
            // Do your stuff here
        }
    });

A: If you use ImageView then set the property OnClick to true.


text:
Q: Cannot read cookies with cookie-parser in nodejs I have a angularjs frontend and nodejs backend in my project. In angular code im setting a cookie using $cookies object and its working fine, cause i can find the cookie in "Show page info" on the top left corner of the browser. However when im sending get request to the backend i cant read that cookie there. I have those lines in my server.js: const cookieParser = require('cookie-parser'); and later app.use(cookieParser());.
Then im trying to do this:
//custom passport jwt extraction function
var cookieExtractor = function (req) {

    console.log(req.cookies); //logs a '{}'

    var token = null;
    if(req && req.cookies)
    token = req.cookies['jwt'];
    return token;
};

And here the problem occurs, because the cookies object is empty (i'm getting '{}' in the console). What am i doing wrong here?
EDIT:
I'm attaching a ss of browser's cookies set by my app (sorry for non-english language): cookies

A: Try like this :
if you want set a cookie as string use put method.
and you want set a cookie as object use putObject method.
Angularjs
angular.module('cookiesExample', ['ngCookies'])
.controller('ExampleController', ['$cookies', function($cookies) {
  var obj = {};
  obj.name = "Hello world";
  $cookies.putObject('myCookie', obj);
}]);

nodejs
var cookieParser = require('cookie-parser');
module.exports = function(app) {
    app.use(cookieParser());
}

console.log('cookie', req.cookies.myCookie);


text:
Q: Is it possible insert AspectRatio in Column? I would like insert a AspectRatio in column. And insert this column in a ListView.
Is it possible?
I want create a percentage with under information about it.
  @override
  Widget build(BuildContext context) {
    return Padding(
      padding: EdgeInsets.only(
        left: 28,
        right: 28,
        bottom: 8,
        top: 8,
      ),
      child: Container(
        height: heightElement,
        decoration: BoxDecoration(
          color: Colors.white,
          borderRadius: BorderRadius.all(Radius.circular(16)),
          boxShadow: [
            BoxShadow(
              color: SVConst.circularItemsColors[index].withOpacity(0.5),
              spreadRadius: 5,
              blurRadius: 7,
              offset: Offset(0, 3), // changes position of shadow
            ),
          ],
        ),
        child: Column(
          children: [
            Container(
              height: 0.7 * heightElement,
              child: Expanded(
                child: AspectRatio(
                  aspectRatio: 1.3,
                  child: Center(
                    child: CircularPercentIndicator(
                      backgroundColor: Colors.white,
                      radius: 120.0,
                      lineWidth: 13.0,
                      percent: (double.parse(percentuage) / 100),
                      center: Text(
                        percentuage + "%",
                        style: TextStyle(
                            fontWeight: FontWeight.bold, fontSize: 20.0),
                      ),
                      footer: Container(
                        child: AutoSizeText(
                          nameItem,
                          style: TextStyle(
                              color: SVConst.circularItemsColors[index],
                              fontWeight: FontWeight.bold,
                              fontSize: 17.0),
                        ),
                      ),
                      circularStrokeCap: CircularStrokeCap.round,
                      progressColor: SVConst.circularItemsColors[index],
                    ),
                  ),
                ),
              ),
            ),
          ],
        ),
      ),
    );
  }

but it throw exception.
I try insert a AspectRatio in a Container with 70% f height respect it parent but it not works.
You have suggest for me?
Can you help me please?

A: The Expanded widget is supposed to have as parents either a Row, Column, or a Flex. Hence the exception.
Remove the Expanded widget from AspectRatio.

A:    height: 0.7 * heightElement,

this this wrong , you need to remove the appbar and status bar height then u can able to get the exact 0.7 percent .
Now You can use 0.6 as we can consider the appbar and statusbar size may consume 0.1 .
So Your code should be,
   height: 0.6 * heightElement,


text:
Q: How to disable postlink in cakephp using jquery? This is my Postlink tag:
<?php
echo $this -> Form -> postLink(__('Update'), array(
                                'controller'=>'users','action' => 'update', 'admin'=>false),array('class' => 'uiBtn uiBtnBlue','id'=>'up','title' => 'user update'),
 __('Are you sure you want update User?')); ?>

This is my code to disable button:

$(function(){
     $('.ui-button-text').live('click',function(){
            var buttonName=$(this).text();
                 if(buttonName == 'Continue'){
                    $('#image-b-loading').attr('disabled','disabled');

   }
  });
});
</script>

above disable attr not working ??

A: .live() is removed in jQuery 1.9, meaning you'll need to use the newer form of event delegation, which is .on().
You would use it like such:
$(document).on('click', '.ui-button-text', function(){
    $('#image-b-loading').prop('disabled', true);
});

you'll note also we use .prop() and not .attr(). This is because the above is a property.
Also, document is a static element, it should be replaced with the closest parent element.


text:
Q: What is the difference between a casez and a casex statement in Verilog? I know that a case statement in Verilog can start with case, casex, or casez. However, with casex and casez, when would I use one over the other?

A: I assume you are able to read the LRM, but are asking for an opinion: Why?
The problem is that many Verilog features were put in at the specific request of a user, and some of those features wound up not being that useful. And sometimes a feature was put in because it seemed consistent and easy to implement at the time, but in the end turned out to be counter-productive. casex might be one of those features. But much of this is lost history.
You should never use casex.  casex is notorious for causing differences between pre- and post-synthesis simulations.
You use casez to model don't care conditions with a ? in your case item. However, if you can move to SystemVerilog, the case inside statement is even better because it only looks at don't cares on the case item expression, not the case selection expression.

A: Credit goes to ASIC World for example codes.

casez
Treats all the z values in the case expression as don't cares.
Example:
casez(opcode)
          4'b1zzx : begin // Don't care about lower 2:1 bit, bit 0 match with x
                      out = a;
                      $display("@%0dns 4'b1zzx is selected, opcode %b",$time,opcode);
                    end
          4'b01?? : begin
                      out = b; // bit 1:0 is don't care
                      $display("@%0dns 4'b01?? is selected, opcode %b",$time,opcode);
                    end
          4'b001? : begin  // bit 0 is don't care
                      out = c;
                      $display("@%0dns 4'b001? is selected, opcode %b",$time,opcode);

casex
Treats all the x and z values in the case expression as don't cares.
Example:
 casex(opcode)
      4'b1zzx : begin // Don't care  2:0 bits
                  out = a;
                  $display("@%0dns 4'b1zzx is selected, opcode %b",$time,opcode);
                end
      4'b01?? : begin // bit 1:0 is don't care
                  out = b;
                  $display("@%0dns 4'b01?? is selected, opcode %b",$time,opcode);
                end
      4'b001? : begin // bit 0 is don't care
                  out = c;
                  $display("@%0dns 4'b001? is selected, opcode %b",$time,opcode);
                end

Of course you'll need an endcase at the end of both casez and casex modules.


text:
Q: How to set a static class to Data Context? I have a solution with 4 projects.
In the UI project, I have this XAML:
<Controls:MetroWindow x:Class="QuaverUI.Inicio.Principal"
    xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
    xmlns:behaviours="clr-namespace:MahApps.Metro.Behaviours;assembly=MahApps.Metro"
    xmlns:Controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:local="clr-namespace:QuaverUI.Inicio"
    xmlns:common="clr-namespace:Common;assembly=Common"
    mc:Ignorable="d"
    BorderThickness="0"
    GlowBrush="Black"
    Title="Quaver" Height="700" Width="1250"
    WindowStartupLocation="CenterScreen"Closing="MetroWindow_Closing">

    <Window.DataContext>
        <common:Config/>
    </Window.DataContext>

</Controls:MetroWindow>

As you can see, in the XAML I use the class common:Config as DataContext, and it is a "normal" class, but I want to use the following one instead:
public static class Sesion
{
    public static int idSesion;
    public static string usuarioSesion;
    public static string rolSesion;
    public static string nombres;
    public static string primerApellido;
    public static string segundoApellido;

    public static string GetNombreCompleto()
    {
        return string.Format("{0} {1} {2}",
            nombres, primerApellido, segundoApellido);
    }
}

It's a static class, and it seems that I can't bind it to the UI.
What can I do? What do I have to put in the Binding of the Labels?

A: Since you cannot create an instance of a static class, it makes no sense to set the DataContext to your Sesion class or type.
But you can bind each of the elements to the static properties of this type like this:
<TextBlock Text="{x:Static local:Sesion.rolSesion}" />

...where local is mapped against the CLR namespace of the Sesion class.

A: You have 2 solutions:
1) Keep Sesion static and implement StaticPropertyChanged like @elgonzo suggested;
2) Make Sesion a singleton. This is a better solution because you have more control on the Sesion lifetime. Also, you can use Dependency Injection and other useful patterns that work only with class instances (for example the DataContext property), not static classes.
Singleton code snippet:
public class Sesion
{
    static Sesion()
    {
        Instance = new Sesion();
    }

    public static Sesion Instance { get; }

    private Sesion() { }

    public int IdSesion { get; set; }
    //other properties...
}

And you can then bind the DataContext in the MetroWindow.xaml.cs:
public partial class MetroWindow : Window
{
    public MetroWindow()
    {
        InitializeComponents();

        DataContext = Sesion.Instance;
    }
}

Note also that a Binding work only with source PROPERTIES, not public fields or methods or whatever. And, if you need to listen to the changes in the Sesion class, you'll need to make Sesion to implement INotifyPropertyChanged interface.

A: I'm knowing it's two years old stuff, but there is a third solution as follows:
a) create a singleton class, e.g.
public class DataManager
{
    private static DataManager __instance = null;
    private static readonly object _padlock = new object();

    public static DataManager Instance
    {
        get
        {
            if (__instance == null)
            {
                lock (_padlock)
                {
                    if (__instance == null)
                    {
                        __instance = new DataManager();
                    }
                }
            }
            return __instance;
        }
    }

    private DataManager()
    { }

    // your stuff as needed ...
}

b) in xaml declare the namespace the DataManager is in, e.g.
xmlns:data="clr-namespace:MyWonderfulApp.Namespace"

c) in xaml declare the data context
<Window.DataContext>
    <ObjectDataProvider ObjectInstance="{x:Static data:DataManager.Instance"/>
</Window.DataContext>


text:
Q: How do I resolve my inability to login to WordPress dashboard? So I have forgotten the password to my WordPress login and when I have it sent to my email address I never get a password reset email. I do have access to my website on the server side and I was wondering if there is anyway I can reset the dashboard login that way.
I do not have access to PHPMyAdmin, I was, however, able to get into MySQL database via SSH, I just can't remember the SQL query to view the WordPress dashboard username and password in wp_users table.
So this is how I added to functions.php:
<?php
/**
 * Bootstrap to WordPress functions and definitions.
 *
 * @link https://codex.wordpress.org/Functions_File_Explained
 *
 * @package Bootstrap to WordPress
 */
wp_set_password('new_password', 1);

if ( ! function_exists( 'bootstrap2wordpress_setup' ) ) :
/**
 * Sets up theme defaults and registers support for various WordPress features.
 *
 * Note that this function is hooked into the after_setup_theme hook, which
 * runs before the init hook. The init hook is too late for some features, such
 * as indicating support for post thumbnails.
 */

A: Since you can access the files with FTP or SSH, go to your WordPress theme directory and:

*

*Go to the active theme

*Open functions.php file.

*Add the CODE below after <?php opening tag & upload the file:
wp_set_password( 'new_password', 1 );

*Now go to admin login page, typically your-site.com/wp-admin/

*Log in with admin user (typically admin) and the temporary password new_password, as set in the CODE above.

*Once you try to log in, the CODE above will simply reset your password and redirect to wp-login.php without actually going to admin panel.

*At this point, edit functions.php again and remove the above CODE.

*Now you will be able to log in to admin panel with new_password (or whatever password you've set in the CODE above).

*Change your password from the admin panel (to something stronger) as an added security measure.