Search Results

Search found 1169 results on 47 pages for 'da coder'.

Page 5/47 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • how to store assembly in memory

    - by da cheng
    Hi, I have a question about how to store the assembly language in memory,when I compile the C-code in assembly, and run by "step", I can see the address of each instruction, but is there a way to change the start address of the code in the memory? Second question is, can I break the assembly code into two? I am curious about how the machine store the assembly code. BTW, I am working on a MACBOOK Pro, duo core. Thank you. -da

    Read the article

  • opengl problem works on droid but not droid eris and others.

    - by nathan
    This GlRenderer works fine on the moto droid, but does not work well at all on droid eris or other android phones does anyone know why? package com.ntu.way2fungames.spacehockeybase; import java.io.DataInputStream; import java.io.IOException; import java.nio.Buffer; import java.nio.FloatBuffer; import javax.microedition.khronos.egl.EGLConfig; import javax.microedition.khronos.opengles.GL10; import com.ntu.way2fungames.LoadFloatArray; import com.ntu.way2fungames.OGLTriReader; import android.content.res.AssetManager; import android.content.res.Resources; import android.opengl.GLU; import android.opengl.GLSurfaceView.Renderer; import android.os.Handler; import android.os.Message; public class GlRenderer extends Thread implements Renderer { private float drawArray[]; private float yoff; private float yoff2; private long lastRenderTime; private float[] yoffs= new float[10]; int Width; int Height; private float[] pixelVerts = new float[] { +.0f,+.0f,2, +.5f,+.5f,0, +.5f,-.5f,0, +.0f,+.0f,2, +.5f,-.5f,0, -.5f,-.5f,0, +.0f,+.0f,2, -.5f,-.5f,0, -.5f,+.5f,0, +.0f,+.0f,2, -.5f,+.5f,0, +.5f,+.5f,0, }; @Override public void run() { } private float[] arenaWalls = new float[] { 8.00f,2.00f,1f,2f,2f,1f,2.00f,8.00f,1f,8.00f,2.00f,1f,2.00f,8.00f,1f,8.00f,8.00f,1f, 2.00f,8.00f,1f,2f,2f,1f,0.00f,0.00f,0f,2.00f,8.00f,1f,0.00f,0.00f,0f,0.00f,10.00f,0f, 8.00f,8.00f,1f,2.00f,8.00f,1f,0.00f,10.00f,0f,8.00f,8.00f,1f,0.00f,10.00f,0f,10.00f,10.00f,0f, 2f,2f,1f,8.00f,2.00f,1f,10.00f,0.00f,0f,2f,2f,1f,10.00f,0.00f,0f,0.00f,0.00f,0f, 8.00f,2.00f,1f,8.00f,8.00f,1f,10.00f,10.00f,0f,8.00f,2.00f,1f,10.00f,10.00f,0f,10.00f,0.00f,0f, 10.00f,10.00f,0f,0.00f,10.00f,0f,0.00f,0.00f,0f,10.00f,10.00f,0f,0.00f,0.00f,0f,10.00f,0.00f,0f, 8.00f,6.00f,1f,8.00f,4.00f,1f,122f,4.00f,1f,8.00f,6.00f,1f,122f,4.00f,1f,122f,6.00f,1f, 8.00f,6.00f,1f,122f,6.00f,1f,120f,7.00f,0f,8.00f,6.00f,1f,120f,7.00f,0f,10.00f,7.00f,0f, 122f,4.00f,1f,8.00f,4.00f,1f,10.00f,3.00f,0f,122f,4.00f,1f,10.00f,3.00f,0f,120f,3.00f,0f, 480f,10.00f,0f,470f,10.00f,0f,470f,0.00f,0f,480f,10.00f,0f,470f,0.00f,0f,480f,0.00f,0f, 478f,2.00f,1f,478f,8.00f,1f,480f,10.00f,0f,478f,2.00f,1f,480f,10.00f,0f,480f,0.00f,0f, 472f,2f,1f,478f,2.00f,1f,480f,0.00f,0f,472f,2f,1f,480f,0.00f,0f,470f,0.00f,0f, 478f,8.00f,1f,472f,8.00f,1f,470f,10.00f,0f,478f,8.00f,1f,470f,10.00f,0f,480f,10.00f,0f, 472f,8.00f,1f,472f,2f,1f,470f,0.00f,0f,472f,8.00f,1f,470f,0.00f,0f,470f,10.00f,0f, 478f,2.00f,1f,472f,2f,1f,472f,8.00f,1f,478f,2.00f,1f,472f,8.00f,1f,478f,8.00f,1f, 478f,846f,1f,472f,846f,1f,472f,852f,1f,478f,846f,1f,472f,852f,1f,478f,852f,1f, 472f,852f,1f,472f,846f,1f,470f,844f,0f,472f,852f,1f,470f,844f,0f,470f,854f,0f, 478f,852f,1f,472f,852f,1f,470f,854f,0f,478f,852f,1f,470f,854f,0f,480f,854f,0f, 472f,846f,1f,478f,846f,1f,480f,844f,0f,472f,846f,1f,480f,844f,0f,470f,844f,0f, 478f,846f,1f,478f,852f,1f,480f,854f,0f,478f,846f,1f,480f,854f,0f,480f,844f,0f, 480f,854f,0f,470f,854f,0f,470f,844f,0f,480f,854f,0f,470f,844f,0f,480f,844f,0f, 10.00f,854f,0f,0.00f,854f,0f,0.00f,844f,0f,10.00f,854f,0f,0.00f,844f,0f,10.00f,844f,0f, 8.00f,846f,1f,8.00f,852f,1f,10.00f,854f,0f,8.00f,846f,1f,10.00f,854f,0f,10.00f,844f,0f, 2f,846f,1f,8.00f,846f,1f,10.00f,844f,0f,2f,846f,1f,10.00f,844f,0f,0.00f,844f,0f, 8.00f,852f,1f,2.00f,852f,1f,0.00f,854f,0f,8.00f,852f,1f,0.00f,854f,0f,10.00f,854f,0f, 2.00f,852f,1f,2f,846f,1f,0.00f,844f,0f,2.00f,852f,1f,0.00f,844f,0f,0.00f,854f,0f, 8.00f,846f,1f,2f,846f,1f,2.00f,852f,1f,8.00f,846f,1f,2.00f,852f,1f,8.00f,852f,1f, 6f,846f,1f,4f,846f,1f,4f,8f,1f,6f,846f,1f,4f,8f,1f,6f,8f,1f, 6f,846f,1f,6f,8f,1f,7f,10f,0f,6f,846f,1f,7f,10f,0f,7f,844f,0f, 4f,8f,1f,4f,846f,1f,3f,844f,0f,4f,8f,1f,3f,844f,0f,3f,10f,0f, 474f,8f,1f,474f,846f,1f,473f,844f,0f,474f,8f,1f,473f,844f,0f,473f,10f,0f, 476f,846f,1f,476f,8f,1f,477f,10f,0f,476f,846f,1f,477f,10f,0f,477f,844f,0f, 476f,846f,1f,474f,846f,1f,474f,8f,1f,476f,846f,1f,474f,8f,1f,476f,8f,1f, 130f,10.00f,0f,120f,10.00f,0f,120f,0.00f,0f,130f,10.00f,0f,120f,0.00f,0f,130f,0.00f,0f, 128f,2.00f,1f,128f,8.00f,1f,130f,10.00f,0f,128f,2.00f,1f,130f,10.00f,0f,130f,0.00f,0f, 122f,2f,1f,128f,2.00f,1f,130f,0.00f,0f,122f,2f,1f,130f,0.00f,0f,120f,0.00f,0f, 128f,8.00f,1f,122f,8.00f,1f,120f,10.00f,0f,128f,8.00f,1f,120f,10.00f,0f,130f,10.00f,0f, 122f,8.00f,1f,122f,2f,1f,120f,0.00f,0f,122f,8.00f,1f,120f,0.00f,0f,120f,10.00f,0f, 128f,2.00f,1f,122f,2f,1f,122f,8.00f,1f,128f,2.00f,1f,122f,8.00f,1f,128f,8.00f,1f, 352f,8.00f,1f,358f,8.00f,1f,358f,2.00f,1f,352f,8.00f,1f,358f,2.00f,1f,352f,2.00f,1f, 358f,2.00f,1f,358f,8.00f,1f,360f,10.00f,0f,358f,2.00f,1f,360f,10.00f,0f,360f,0.00f,0f, 352f,2.00f,1f,358f,2.00f,1f,360f,0.00f,0f,352f,2.00f,1f,360f,0.00f,0f,350f,0.00f,0f, 358f,8.00f,1f,352f,8.00f,1f,350f,10.00f,0f,358f,8.00f,1f,350f,10.00f,0f,360f,10.00f,0f, 352f,8.00f,1f,352f,2.00f,1f,350f,0.00f,0f,352f,8.00f,1f,350f,0.00f,0f,350f,10.00f,0f, 350f,0.00f,0f,360f,0.00f,0f,360f,10.00f,0f,350f,0.00f,0f,360f,10.00f,0f,350f,10.00f,0f, 358f,6.00f,1f,472f,6.00f,1f,470f,7.00f,0f,358f,6.00f,1f,470f,7.00f,0f,360f,7.00f,0f, 472f,4.00f,1f,358f,4.00f,1f,360f,3.00f,0f,472f,4.00f,1f,360f,3.00f,0f,470f,3.00f,0f, 472f,4.00f,1f,472f,6.00f,1f,358f,6.00f,1f,472f,4.00f,1f,358f,6.00f,1f,358f,4.00f,1f, 472f,848f,1f,472f,850f,1f,358f,850f,1f,472f,848f,1f,358f,850f,1f,358f,848f,1f, 472f,848f,1f,358f,848f,1f,360f,847f,0f,472f,848f,1f,360f,847f,0f,470f,847f,0f, 358f,850f,1f,472f,850f,1f,470f,851f,0f,358f,850f,1f,470f,851f,0f,360f,851f,0f, 350f,844f,0f,360f,844f,0f,360f,854f,0f,350f,844f,0f,360f,854f,0f,350f,854f,0f, 352f,852f,1f,352f,846f,1f,350f,844f,0f,352f,852f,1f,350f,844f,0f,350f,854f,0f, 358f,852f,1f,352f,852f,1f,350f,854f,0f,358f,852f,1f,350f,854f,0f,360f,854f,0f, 352f,846f,1f,358f,846f,1f,360f,844f,0f,352f,846f,1f,360f,844f,0f,350f,844f,0f, 358f,846f,1f,358f,852f,1f,360f,854f,0f,358f,846f,1f,360f,854f,0f,360f,844f,0f, 352f,852f,1f,358f,852f,1f,358f,846f,1f,352f,852f,1f,358f,846f,1f,352f,846f,1f, 128f,846f,1f,122f,846f,1f,122f,852f,1f,128f,846f,1f,122f,852f,1f,128f,852f,1f, 122f,852f,1f,122f,846f,1f,120f,844f,0f,122f,852f,1f,120f,844f,0f,120f,854f,0f, 128f,852f,1f,122f,852f,1f,120f,854f,0f,128f,852f,1f,120f,854f,0f,130f,854f,0f, 122f,846f,1f,128f,846f,1f,130f,844f,0f,122f,846f,1f,130f,844f,0f,120f,844f,0f, 128f,846f,1f,128f,852f,1f,130f,854f,0f,128f,846f,1f,130f,854f,0f,130f,844f,0f, 130f,854f,0f,120f,854f,0f,120f,844f,0f,130f,854f,0f,120f,844f,0f,130f,844f,0f, 122f,848f,1f,8f,848f,1f,10f,847f,0f,122f,848f,1f,10f,847f,0f,120f,847f,0f, 8f,850f,1f,122f,850f,1f,120f,851f,0f,8f,850f,1f,120f,851f,0f,10f,851f,0f, 8f,850f,1f,8f,848f,1f,122f,848f,1f,8f,850f,1f,122f,848f,1f,122f,850f,1f, 10f,847f,0f,120f,847f,0f,124.96f,829.63f,-0.50f,10f,847f,0f,124.96f,829.63f,-0.50f,19.51f,829.63f,-0.50f, 130f,844f,0f,130f,854f,0f,134.55f,836.34f,-0.50f,130f,844f,0f,134.55f,836.34f,-0.50f,134.55f,826.76f,-0.50f, 350f,844f,0f,350f,854f,0f,345.45f,836.34f,-0.50f,350f,844f,0f,345.45f,836.34f,-0.50f,345.45f,826.76f,-0.50f, 360f,847f,0f,470f,847f,0f,460.49f,829.63f,-0.50f,360f,847f,0f,460.49f,829.63f,-0.50f,355.04f,829.63f,-0.50f, 470f,7.00f,0f,360f,7.00f,0f,355.04f,24.37f,-0.50f,470f,7.00f,0f,355.04f,24.37f,-0.50f,460.49f,24.37f,-0.50f, 350f,10.00f,0f,350f,0.00f,0f,345.45f,17.66f,-0.50f,350f,10.00f,0f,345.45f,17.66f,-0.50f,345.45f,27.24f,-0.50f, 130f,10.00f,0f,130f,0.00f,0f,134.55f,17.66f,-0.50f,130f,10.00f,0f,134.55f,17.66f,-0.50f,134.55f,27.24f,-0.50f, 473f,844f,0f,473f,10f,0f,463.36f,27.24f,-0.50f,473f,844f,0f,463.36f,27.24f,-0.50f,463.36f,826.76f,-0.50f, 7f,10f,0f,7f,844f,0f,16.64f,826.76f,-0.50f,7f,10f,0f,16.64f,826.76f,-0.50f,16.64f,27.24f,-0.50f, 120f,7.00f,0f,10.00f,7.00f,0f,19.51f,24.37f,-0.50f,120f,7.00f,0f,19.51f,24.37f,-0.50f,124.96f,24.37f,-0.50f, 120f,7.00f,0f,130f,10.00f,0f,134.55f,27.24f,-0.50f,120f,7.00f,0f,134.55f,27.24f,-0.50f,124.96f,24.37f,-0.50f, 10.00f,7.00f,0f,7f,10f,0f,16.64f,27.24f,-0.50f,10.00f,7.00f,0f,16.64f,27.24f,-0.50f,19.51f,24.37f,-0.50f, 350f,10.00f,0f,360f,7.00f,0f,355.04f,24.37f,-0.50f,350f,10.00f,0f,355.04f,24.37f,-0.50f,345.45f,27.24f,-0.50f, 473f,10f,0f,470f,7.00f,0f,460.49f,24.37f,-0.50f,473f,10f,0f,460.49f,24.37f,-0.50f,463.36f,27.24f,-0.50f, 473f,844f,0f,470f,847f,0f,460.49f,829.63f,-0.50f,473f,844f,0f,460.49f,829.63f,-0.50f,463.36f,826.76f,-0.50f, 360f,847f,0f,350f,844f,0f,345.45f,826.76f,-0.50f,360f,847f,0f,345.45f,826.76f,-0.50f,355.04f,829.63f,-0.50f, 130f,844f,0f,120f,847f,0f,124.96f,829.63f,-0.50f,130f,844f,0f,124.96f,829.63f,-0.50f,134.55f,826.76f,-0.50f, 7f,844f,0f,10f,847f,0f,19.51f,829.63f,-0.50f,7f,844f,0f,19.51f,829.63f,-0.50f,16.64f,826.76f,-0.50f, 19.51f,829.63f,-0.50f,124.96f,829.63f,-0.50f,136.47f,789.37f,-2f,19.51f,829.63f,-0.50f,136.47f,789.37f,-2f,41.56f,789.37f,-2f, 134.55f,826.76f,-0.50f,134.55f,836.34f,-0.50f,145.09f,795.41f,-2f,134.55f,826.76f,-0.50f,145.09f,795.41f,-2f,145.09f,786.78f,-2f, 345.45f,826.76f,-0.50f,345.45f,836.34f,-0.50f,334.91f,795.41f,-2f,345.45f,826.76f,-0.50f,334.91f,795.41f,-2f,334.91f,786.78f,-2f, 355.04f,829.63f,-0.50f,460.49f,829.63f,-0.50f,438.44f,789.37f,-2f,355.04f,829.63f,-0.50f,438.44f,789.37f,-2f,343.53f,789.37f,-2f, 460.49f,24.37f,-0.50f,355.04f,24.37f,-0.50f,343.53f,64.63f,-2f,460.49f,24.37f,-0.50f,343.53f,64.63f,-2f,438.44f,64.63f,-2f, 345.45f,27.24f,-0.50f,345.45f,17.66f,-0.50f,334.91f,58.59f,-2f,345.45f,27.24f,-0.50f,334.91f,58.59f,-2f,334.91f,67.22f,-2f, 134.55f,27.24f,-0.50f,134.55f,17.66f,-0.50f,145.09f,58.59f,-2f,134.55f,27.24f,-0.50f,145.09f,58.59f,-2f,145.09f,67.22f,-2f, 463.36f,826.76f,-0.50f,463.36f,27.24f,-0.50f,441.03f,67.22f,-2f,463.36f,826.76f,-0.50f,441.03f,67.22f,-2f,441.03f,786.78f,-2f, 16.64f,27.24f,-0.50f,16.64f,826.76f,-0.50f,38.97f,786.78f,-2f,16.64f,27.24f,-0.50f,38.97f,786.78f,-2f,38.97f,67.22f,-2f, 124.96f,24.37f,-0.50f,19.51f,24.37f,-0.50f,41.56f,64.63f,-2f,124.96f,24.37f,-0.50f,41.56f,64.63f,-2f,136.47f,64.63f,-2f, 124.96f,24.37f,-0.50f,134.55f,27.24f,-0.50f,145.09f,67.22f,-2f,124.96f,24.37f,-0.50f,145.09f,67.22f,-2f,136.47f,64.63f,-2f, 19.51f,24.37f,-0.50f,16.64f,27.24f,-0.50f,38.97f,67.22f,-2f,19.51f,24.37f,-0.50f,38.97f,67.22f,-2f,41.56f,64.63f,-2f, 345.45f,27.24f,-0.50f,355.04f,24.37f,-0.50f,343.53f,64.63f,-2f,345.45f,27.24f,-0.50f,343.53f,64.63f,-2f,334.91f,67.22f,-2f, 463.36f,27.24f,-0.50f,460.49f,24.37f,-0.50f,438.44f,64.63f,-2f,463.36f,27.24f,-0.50f,438.44f,64.63f,-2f,441.03f,67.22f,-2f, 463.36f,826.76f,-0.50f,460.49f,829.63f,-0.50f,438.44f,789.37f,-2f,463.36f,826.76f,-0.50f,438.44f,789.37f,-2f,441.03f,786.78f,-2f, 355.04f,829.63f,-0.50f,345.45f,826.76f,-0.50f,334.91f,786.78f,-2f,355.04f,829.63f,-0.50f,334.91f,786.78f,-2f,343.53f,789.37f,-2f, 134.55f,826.76f,-0.50f,124.96f,829.63f,-0.50f,136.47f,789.37f,-2f,134.55f,826.76f,-0.50f,136.47f,789.37f,-2f,145.09f,786.78f,-2f, 16.64f,826.76f,-0.50f,19.51f,829.63f,-0.50f,41.56f,789.37f,-2f,16.64f,826.76f,-0.50f,41.56f,789.37f,-2f,38.97f,786.78f,-2f, }; private float[] backgroundData = new float[] { // # ,Scale, Speed, 300 , 1.05f, .001f, 150 , 1.07f, .002f, 075 , 1.10f, .003f, 040 , 1.12f, .006f, 20 , 1.15f, .012f, 10 , 1.25f, .025f, 05 , 1.50f, .050f, 3 , 2.00f, .100f, 2 , 3.00f, .200f, }; private float[] triangleCoords = new float[] { 0, -25, 0, -.75f, -1, 0, +.75f, -1, 0, 0, +2, 0, -.99f, -1, 0, .99f, -1, 0, }; private float[] triangleColors = new float[] { 1.0f, 1.0f, 1.0f, 0.05f, 1.0f, 1.0f, 1.0f, 0.5f, 1.0f, 1.0f, 1.0f, 0.5f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 0.5f, 1.0f, 1.0f, 1.0f, 0.5f, }; private float[] drawArray2; private FloatBuffer drawBuffer2; private float[] colorArray2; private static FloatBuffer colorBuffer; private static FloatBuffer triangleBuffer; private static FloatBuffer quadBuffer; private static FloatBuffer drawBuffer; private float[] backgroundVerts; private FloatBuffer backgroundVertsWrapped; private float[] backgroundColors; private Buffer backgroundColorsWraped; private FloatBuffer backgroundColorsWrapped; private FloatBuffer arenaWallsWrapped; private FloatBuffer arenaColorsWrapped; private FloatBuffer arena2VertsWrapped; private FloatBuffer arena2ColorsWrapped; private long wallHitStartTime; private int wallHitDrawTime; private FloatBuffer pixelVertsWrapped; private float[] wallHit; private FloatBuffer pixelColorsWrapped; //private float[] pitVerts; private Resources lResources; private FloatBuffer pitVertsWrapped; private FloatBuffer pitColorsWrapped; private boolean arena2; private long lastStartTime; private long startTime; private int state=1; private long introEndTime; protected long introTotalTime =8000; protected long introStartTime; private boolean initDone= false; private static int stateIntro = 0; private static int stateGame = 1; public GlRenderer(spacehockey nspacehockey) { lResources = nspacehockey.getResources(); nspacehockey.SetHandlerToGLRenderer(new Handler() { @Override public void handleMessage(Message m) { if (m.what ==0){ wallHit = m.getData().getFloatArray("wall hit"); wallHitStartTime =System.currentTimeMillis(); wallHitDrawTime = 1000; }else if (m.what ==1){ //state = stateIntro; introEndTime= System.currentTimeMillis()+introTotalTime ; introStartTime = System.currentTimeMillis(); } }}); } public void onSurfaceCreated(GL10 gl, EGLConfig config) { gl.glShadeModel(GL10.GL_SMOOTH); gl.glClearColor(.01f, .01f, .01f, .1f); gl.glClearDepthf(1.0f); gl.glEnable(GL10.GL_DEPTH_TEST); gl.glDepthFunc(GL10.GL_LEQUAL); gl.glHint(GL10.GL_PERSPECTIVE_CORRECTION_HINT, GL10.GL_NICEST); } private float SumOfStrideI(float[] data, int offset, int stride) { int sum= 0; for (int i=offset;i<data.length-1;i=i+stride){ sum = (int) (data[i]+sum); } return sum; } public void onDrawFrame(GL10 gl) { if (state== stateIntro){DrawIntro(gl);} if (state== stateGame){DrawGame(gl);} } private void DrawIntro(GL10 gl) { startTime = System.currentTimeMillis(); if (startTime< introEndTime){ float ptd = (float)(startTime- introStartTime)/(float)introTotalTime; float ptl = 1-ptd; gl.glClear(GL10.GL_COLOR_BUFFER_BIT);//dont move gl.glMatrixMode(GL10.GL_MODELVIEW); int setVertOff = 0; gl.glEnableClientState(GL10.GL_VERTEX_ARRAY); gl.glEnableClientState(GL10.GL_COLOR_ARRAY); gl.glColorPointer(4, GL10.GL_FLOAT, 0, backgroundColorsWrapped); for (int i = 0; i < backgroundData.length / 3; i = i + 1) { int setoff = i * 3; int setVertLen = (int) backgroundData[setoff]; yoffs[i] = (backgroundData[setoff + 2]*(90+(ptl*250))) + yoffs[i]; if (yoffs[i] > Height) {yoffs[i] = 0;} gl.glPushMatrix(); //gl.glTranslatef(0, -(Height/2), 0); //gl.glScalef(1f, 1f+(ptl*2), 1f); //gl.glTranslatef(0, +(Height/2), 0); gl.glTranslatef(0, yoffs[i], i+60); gl.glVertexPointer(3, GL10.GL_FLOAT, 0, backgroundVertsWrapped); gl.glDrawArrays(GL10.GL_TRIANGLES, (setVertOff * 2 * 3) - 0, (setVertLen * 2 * 3) - 1); gl.glTranslatef(0, -Height, 0); gl.glDrawArrays(GL10.GL_TRIANGLES, (setVertOff * 2 * 3) - 0, (setVertLen * 2 * 3) - 1); setVertOff = (int) (setVertOff + setVertLen); gl.glPopMatrix(); } gl.glDisableClientState(GL10.GL_VERTEX_ARRAY); gl.glDisableClientState(GL10.GL_COLOR_ARRAY); }else{state = stateGame;} } private void DrawGame(GL10 gl) { lastStartTime = startTime; startTime = System.currentTimeMillis(); long moveTime = startTime-lastStartTime; gl.glClear(GL10.GL_COLOR_BUFFER_BIT);//dont move gl.glMatrixMode(GL10.GL_MODELVIEW); int setVertOff = 0; gl.glEnableClientState(GL10.GL_VERTEX_ARRAY); gl.glEnableClientState(GL10.GL_COLOR_ARRAY); gl.glColorPointer(4, GL10.GL_FLOAT, 0, backgroundColorsWrapped); for (int i = 0; i < backgroundData.length / 3; i = i + 1) { int setoff = i * 3; int setVertLen = (int) backgroundData[setoff]; yoffs[i] = (backgroundData[setoff + 2]*moveTime) + yoffs[i]; if (yoffs[i] > Height) {yoffs[i] = 0;} gl.glPushMatrix(); gl.glTranslatef(0, yoffs[i], i+60); gl.glVertexPointer(3, GL10.GL_FLOAT, 0, backgroundVertsWrapped); gl.glDrawArrays(GL10.GL_TRIANGLES, (setVertOff * 6) - 0, (setVertLen *6) - 1); gl.glTranslatef(0, -Height, 0); gl.glDrawArrays(GL10.GL_TRIANGLES, (setVertOff * 6) - 0, (setVertLen *6) - 1); setVertOff = (int) (setVertOff + setVertLen); gl.glPopMatrix(); } //arena frame gl.glPushMatrix(); gl.glVertexPointer(3, GL10.GL_FLOAT, 0, arenaWallsWrapped); gl.glColorPointer(4, GL10.GL_FLOAT, 0, arenaColorsWrapped); gl.glColor4f(.1f, .5f, 1f, 1f); gl.glTranslatef(0, 0, 50); gl.glDrawArrays(GL10.GL_TRIANGLES, 0, (int)(arenaWalls.length / 3)); gl.glPopMatrix(); //arena2 frame if (arena2 == true){ gl.glLoadIdentity(); gl.glVertexPointer(3, GL10.GL_FLOAT, 0, pitVertsWrapped); gl.glColorPointer(4, GL10.GL_FLOAT, 0, pitColorsWrapped); gl.glTranslatef(0, -Height, 40); gl.glDrawArrays(GL10.GL_TRIANGLES, 0, (int)(pitVertsWrapped.capacity() / 3)); } if (wallHitStartTime != 0) { float timeRemaining = (wallHitStartTime + wallHitDrawTime)-System.currentTimeMillis(); if (timeRemaining>0) { gl.glPushMatrix(); float percentDone = 1-(timeRemaining/wallHitDrawTime); gl.glLoadIdentity(); gl.glVertexPointer(3, GL10.GL_FLOAT, 0, pixelVertsWrapped); gl.glColorPointer(4, GL10.GL_FLOAT, 0, pixelColorsWrapped); gl.glTranslatef(wallHit[0], wallHit[1], 0); gl.glScalef(8, Height*percentDone, 0); gl.glDrawArrays(GL10.GL_TRIANGLES, 0, 12); gl.glPopMatrix(); } else { wallHitStartTime = 0; } } gl.glDisableClientState(GL10.GL_VERTEX_ARRAY); gl.glDisableClientState(GL10.GL_COLOR_ARRAY); } public void init(GL10 gl) { if (arena2 == true) { AssetManager assetManager = lResources.getAssets(); try { // byte[] ba = {111,111}; DataInputStream Dis = new DataInputStream(assetManager .open("arena2.ogl")); pitVertsWrapped = LoadFloatArray.FromDataInputStream(Dis); pitColorsWrapped = MakeFakeLighting(pitVertsWrapped.array(), .25f, .50f, 1f, 200, .5f); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } if ((Height != 854) || (Width != 480)) { arenaWalls = ScaleFloats(arenaWalls, Width / 480f, Height / 854f); } arenaWallsWrapped = FloatBuffer.wrap(arenaWalls); arenaColorsWrapped = MakeFakeLighting(arenaWalls, .03f, .16f, .33f, .33f, 3); pixelVertsWrapped = FloatBuffer.wrap(pixelVerts); pixelColorsWrapped = MakeFakeLighting(pixelVerts, .03f, .16f, .33f, .10f, 20); initDone=true; } public void onSurfaceChanged(GL10 gl, int nwidth, int nheight) { Width= nwidth; Height = nheight; // avoid division by zero if (Height == 0) Height = 1; // draw on the entire screen gl.glViewport(0, 0, Width, Height); // setup projection matrix gl.glMatrixMode(GL10.GL_PROJECTION); gl.glLoadIdentity(); gl.glOrthof(0, Width, Height, 0, 100, -100); // gl.glOrthof(-nwidth*2, nwidth*2, nheight*2,-nheight*2, 100, -100); // GLU.gluPerspective(gl, 180.0f, (float)nwidth / (float)nheight, // 1000.0f, -1000.0f); gl.glEnable(GL10.GL_BLEND); gl.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA); System.gc(); if (initDone == false){ SetupStars(); init(gl); } } public void SetupStars(){ backgroundVerts = new float[(int) SumOfStrideI(backgroundData,0,3)*triangleCoords.length]; backgroundColors = new float[(int) SumOfStrideI(backgroundData,0,3)*triangleColors.length]; int iii=0; int vc=0; float ascale=1; for (int i=0;i<backgroundColors.length-1;i=i+1){ if (iii==0){ascale = (float) Math.random();} if (vc==3){ backgroundColors[i]= (float) (triangleColors[iii]*(ascale)); }else if(vc==2){ backgroundColors[i]= (float) (triangleColors[iii]-(Math.random()*.2)); }else{ backgroundColors[i]= (float) (triangleColors[iii]-(Math.random()*.3)); } iii=iii+1;if (iii> triangleColors.length-1){iii=0;} vc=vc+1; if (vc>3){vc=0;} } int ii=0; int i =0; int set =0; while(ii<backgroundVerts.length-1){ float scale = (float) backgroundData[(set*3)+1]; int length= (int) backgroundData[(set*3)]; for (i=0;i<length;i=i+1){ if (set ==0){ AddVertsToArray(ScaleFloats(triangleCoords, scale,scale*.25f), backgroundVerts, (float)(Math.random()*Width),(float) (Math.random()*Height), ii); }else{ AddVertsToArray(ScaleFloats(triangleCoords, scale), backgroundVerts, (float)(Math.random()*Width),(float) (Math.random()*Height), ii);} ii=ii+triangleCoords.length; } set=set+1; } backgroundVertsWrapped = FloatBuffer.wrap(backgroundVerts); backgroundColorsWrapped = FloatBuffer.wrap(backgroundColors); } public void AddVertsToArray(float[] sva,float[]dva,float ox,float oy,int start){ //x for (int i=0;i<sva.length;i=i+3){ if((start+i)<dva.length){dva[start+i]= sva[i]+ox;} } //y for (int i=1;i<sva.length;i=i+3){ if((start+i)<dva.length){dva[start+i]= sva[i]+oy;} } //z for (int i=2;i<sva.length;i=i+3){ if((start+i)<dva.length){dva[start+i]= sva[i];} } } public FloatBuffer MakeFakeLighting(float[] sa,float r, float g,float b,float a,float multby){ float[] da = new float[((sa.length/3)*4)]; int vertex=0; for (int i=0;i<sa.length;i=i+3){ if (sa[i+2]>=1){ da[(vertex*4)+0]= r*multby*sa[i+2]; da[(vertex*4)+1]= g*multby*sa[i+2]; da[(vertex*4)+2]= b*multby*sa[i+2]; da[(vertex*4)+3]= a*multby*sa[i+2]; }else if (sa[i+2]<=-1){ float divisor = (multby*(-sa[i+2])); da[(vertex*4)+0]= r / divisor; da[(vertex*4)+1]= g / divisor; da[(vertex*4)+2]= b / divisor; da[(vertex*4)+3]= a / divisor; }else{ da[(vertex*4)+0]= r; da[(vertex*4)+1]= g; da[(vertex*4)+2]= b; da[(vertex*4)+3]= a; } vertex = vertex+1; } return FloatBuffer.wrap(da); } public float[] ScaleFloats(float[] va,float s){ float[] reta= new float[va.length]; for (int i=0;i<va.length;i=i+1){ reta[i]=va[i]*s; } return reta; } public float[] ScaleFloats(float[] va,float sx,float sy){ float[] reta= new float[va.length]; int cnt = 0; for (int i=0;i<va.length;i=i+1){ if (cnt==0){reta[i]=va[i]*sx;} else if (cnt==1){reta[i]=va[i]*sy;} else if (cnt==2){reta[i]=va[i];} cnt = cnt +1;if (cnt>2){cnt=0;} } return reta; } }

    Read the article

  • data source does not support server-side data paging uisng asp.net Csharp

    - by Aamir Hasan
    Yesterday some one mail me and ask about data source does not support server side data paging.So i write the the solution here please if you have got this problem read this article and see the example code this will help you a Lot.The only change you have to do is in the DataBind().Here you have used the SqlDataReader to read data retrieved from the database, but SqlDataReader is forward only. You can not traverse back and forth on it.So the solution for this is using DataAdapter and DataSet.So your function may change some what like this private void DataBind(){//for grid viewSqlCommand cmdO;string SQL = "select * from TABLE ";conn.Open();cmdO = new SqlCommand(SQL, conn);SqlDataAdapter da = new SqlDataAdapter(cmdO);DataSet ds = new DataSet();da.Fill(ds);GridView1.Visible = true;GridView1.DataSource = ds;GridView1.DataBind();ds.Dispose();da.Dispose();conn.Close();} This surely works. The reset of your code is fine. Enjoy coding.

    Read the article

  • OPN PartnerCasts com Stein Surlin

    - by Claudia Costa
      Desde de Abril 2009  Stein Surlin - Senior VP Alliances& Channels EMEA, tem realizado diversas  entrevistas com executivos da Oracle EMEA, em que se têm discutido temas acerca da organização Oracle EMEA, de como está alinhada em trabalhar em conjunto com os seus  parceiros e em apoiá-los na obtenção de novas oportunidades de negócio . Neste link poderá assistir aos OPN PartnerCasts. Aqui poderá encontrar as notícias mais actualizadas sobre a estratégia de parceiros da Oracle, oportunidades de negócio, estratégias de produtos e muito mais! Fique atento ao Portal OPN Partner Casts, mais podcasts estão a caminho!        

    Read the article

  • Which web site gives the most accurate indication of a programmer's capabilities?

    - by Jerry Coffin
    If you were hiring programmers, and could choose between one of (say) the top 100 coders on topcoder.com, or one of the top 100 on stackoverflow.com, which would you choose? At least to me, it would appear that topcoder.com gives a more objective evaluation of pure ability to solve problems and write code. At the same time, despite obvious technical capabilities, this person may lack any hint of social skills -- he may be purely a "lone coder", with little or no ability to help/work with others, may lack mentoring ability to help transfer his technical skills to others, etc. On the other hand, stackoverflow.com would at least appear to give a much better indication of peers' opinion of the coder in question, and the degree to which his presence and useful and helpful to others on the "team". At the same time, the scoring system is such that somebody who just throws up a lot of mediocre (or even poor answers) will almost inevitably accumulate a positive total of "reputation" points -- a single up-vote (perhaps just out of courtesy) will counteract the effects of no fewer than 5 down-votes, and others are discouraged (to some degree) from down-voting because they have to sacrifice their own reputation points to do so. At the same time, somebody who makes little or no technical contribution seems unlikely to accumulate a reputation that lands them (even close to) the top of the heap, so to speak. So, which provides a more useful indication of the degree to which this particular coder is likely to be useful to your organization? If you could choose between them, which set of coders would you rather have working on your team?

    Read the article

  • How do you price your work?

    - by Dr.Kameleon
    Well, let me explain : This has really been an issue for me, for such a long time. And what is worse - since coding is something I simply ADORE (I would definitely do it, even if there was no payment involved whatsoever..) - is that I always end up feeling somewhat awkward... Anyway... So, here's the deal : You start working on a project, you may have something in your mind, and even if you're lucky enough and the client needs no "cost estimates" beforehand, sooner or later you'll face the ultimate dilemma of pricing your own work. So, how do YOU do it? By estimating the time you put into it? (obviously, this is not exact, 'coz perhaps a more capable coder will need much less time for the very same thing than a not-so-competent coder + even the very same coder may not "perform" equally at all times) By the Lines of code you've written? (obviously, this is not a measure either : a 10-line script that does exactly the same with a 1000-line script is, at least for me, "better") By taking into account the level of complexity of the project and, perhaps, how specialised the subject is? By taking into account other factors? (e.g. the value of the project for your customer)

    Read the article

  • How to convert an NSArray of NSManagedObjects to NSData

    - by carok
    Hi, I'm new to Objective C and was wondering if anyone can help me. I am using core data with a sqlite database to hold simple profile objects which have a name and a score attribute (both of which are of type NSString). What I want to do is fetch the profiles and store them in an NSData object, please see my code below: NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init]; NSEntityDescription *entity = [NSEntityDescription entityForName:@"GamerProfile" inManagedObjectContext:managedObjectContext]; [fetchRequest setEntity:entity]; NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"Name" ascending:YES]; NSArray *sortDecriptors = [[NSArray alloc] initWithObjects:sortDescriptor, nil]; [fetchRequest setSortDescriptors:sortDecriptors]; [sortDescriptor release]; [sortDecriptors release]; NSError *error; NSArray *items = [self.managedObjectContext executeFetchRequest:fetchRequest error:&error]; NSData *data = [NSKeyedArchiver archivedDataWithRootObject:items]; [self SendData:data]; [fetchRequest release]; When I run the code I'm getting the error "Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '* -[GamerProfile encodeWithCoder:]: unrecognized selector sent to instance 0x3f4b530'" I presume I have to add an encodeWithCoderClass to my core data NSManagedObject object (GamerProfile) but I'm not sure how to do this even after reading the documentation, My attempt at doing this is below. I'm not sure if I'm going along the right lines with this as get a warning stating "NSManagedObject" may not respond to '-encodeWithCoder'" I would really, really appreciate it if someone could point me in the right direction!! Thanks C Here is the code for my GamerProfile (CoreData NSManagedObject Object) with my attempt at adding an encodeWithCoder method... Header File #import <CoreData/CoreData.h> @interface GamerProfile : NSManagedObject <NSCoding> { } @property (nonatomic, retain) NSString * GamerScore; @property (nonatomic, retain) NSString * Name; - (void)encodeWithCoder:(NSCoder *)coder; @end Code File #import "GamerProfile.h" @implementation GamerProfile @dynamic GamerScore; @dynamic Name; - (void)encodeWithCoder:(NSCoder *)coder { [super encodeWithCoder:coder]; [coder encodeObject:GamerScore forKey:@"GamerScore"]; [coder encodeObject:Name forKey:@"Name"]; }

    Read the article

  • How to correctly filter a datatable (datatable.select)

    - by Phil
    Dim dt As New DataTable Dim da As New SqlDataAdapter(s, c) c.Open() If Not IsNothing(da) Then da.Fill(dt) dt.Select("GroupingID = 0") End If GridView1.DataSource = dt GridView1.DataBind() c.Close() When I call da.fill I am inserting all records from my query. I was then hoping to filter them to display only those where the GroupingID is equal to 0. When I run the above code. I am presented with all the data, the filter did not work. Please can you tell me how to get this working correctly. Thanks.

    Read the article

  • how to find the directory already is there or not in php

    - by zahir hussain
    hi i want know find the directory is already there or not... if not i would like to create the directory... my coding is below... $da = getdate(); $dat = $da["year"]."-".$da["mon"]."-".$da["mday"]; $m = md5($url)."xml"; if(is_dir($dat)) { chdir($dat); $fh = fopen($m, 'w'); fwrite($fh, $xml); fclose($fh); echo "yes"; } else { mkdir($dat,0777,true); chdir($dat); $fh = fopen($m, 'w'); fwrite($fh, $xml); fclose($fh); echo "not"; } thanks and advance

    Read the article

  • radgridview delete update in asp.net

    - by abhi
    i have written the follwing to display data from the datagrid and den insert new rows but how do i perform update and delete plss help here's my code using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using Telerik.Web.UI; using System.Data.SqlClient; public partial class Default6 : System.Web.UI.Page { string strQry, strCon; SqlDataAdapter da; SqlConnection con; DataSet ds; protected void Page_Load(object sender, EventArgs e) { strCon = "Data Source=MINETDEVDATA; Initial Catalog=ML_SuppliersProd; User Id=sa; Password=@MinetApps7;"; con = new SqlConnection(strCon); strQry = "SELECT * FROM table1"; da = new SqlDataAdapter(strQry, con); SqlCommandBuilder cmdbuild = new SqlCommandBuilder(da); ds = new DataSet(); da.Fill(ds, "table1"); RadGrid1.DataSource = ds.Tables["table1"]; RadGrid1.DataBind(); Label3.Visible = false; Label4.Visible = false; Label5.Visible = false; txtFname.Visible = false; txtLname.Visible = false; txtDesignation.Visible = false; } protected void Submit_Click(object sender, EventArgs e) { Label3.Visible = true; Label4.Visible = true; Label5.Visible = true; txtFname.Visible = true; txtLname.Visible = true; txtDesignation.Visible = true; } protected void Button2_Click(object sender, EventArgs e) { DataSet ds = new DataSet("EmployeeSet"); da.Fill(ds, "table1"); DataTable EmployeeTable = ds.Tables["table1"]; DataRow row = EmployeeTable.NewRow(); row["Fname"] = txtFname.Text.ToString(); row["Lname"] = txtLname.Text.ToString(); row["Designation"] = txtDesignation.Text.ToString(); EmployeeTable.Rows.Add(row); da.Update(ds, "table1"); //RadGrid1.DataSource = ds.Tables["table1"]; //RadGrid1.DataBind(); txtFname.Text = ""; txtLname.Text = ""; txtDesignation.Text = ""; } protected void RadGrid1_DeleteCommand(object source, GridCommandEventArgs e) { } } }

    Read the article

  • Update data table on ASMX Service side

    - by Paul
    Hi, I need advice. On Web Service side a I hav this method : public DataSet GetDs(string id) { SqlConnection conn = null; SqlDataAdapter da = null; DataSet ds; try { string sql = "SELECT * FROM Tab1"; string connStr = WebConfigurationManager.ConnectionStrings["Employees"].ConnectionString; conn = new SqlConnection(connStr); conn.Open(); da = new SqlDataAdapter(sql, conn); ds = new DataSet(); da.Fill(ds, "Tab1"); return ds; } catch (Exception ex) { throw ex; } finally { if (conn != null) conn.Close(); if (da != null) da.Dispose(); } } It return dataset to client app. I client application is dataset binding in datagridview. Client can insert,update,delete row from table. If client finish his work, I want accept change in data table on web service side. I can sent clients all dataset na update table on web service side, but I want sent only changed data. Any advice? Thank u.

    Read the article

  • drop down list checked

    - by KareemSaad
    I had Drop down list which execute code when specific condition and I tried to check it through selected value but it get error protected void DDLProductFamily_SelectedIndexChanged(object sender, EventArgs e) { if (DDLProductFamily.Items.FindByText("Name").Selected == true) using (SqlConnection Con = Connection.GetConnection()) { SqlCommand Com = new SqlCommand("GetListViewByProductCategory", Con); Com.CommandType = CommandType.StoredProcedure; Com.Parameters.Add(Parameter.NewInt("@ProductCategory_Id", DDLProductFamily.SelectedValue.ToString())); SqlDataAdapter DA = new SqlDataAdapter(Com); DA.Fill(dt); DataList1.DataSource = dt; DataList1.DataBind(); } else if (DDLProductFamily.Items.FindByText("ProductFamilly").Selected == true) { using (SqlConnection Con = Connection.GetConnection()) { SqlCommand Com = new SqlCommand("GetListViewByProductFamily", Con); Com.CommandType = CommandType.StoredProcedure; Com.Parameters.Add(Parameter.NewInt("@ProductFamily_Id", DDLProductFamily.SelectedValue.ToString())); SqlDataAdapter DA = new SqlDataAdapter(Com); DA.Fill(dt); DataList1.DataSource = dt; DataList1.DataBind(); } } }

    Read the article

  • initWithCoder and initWithNibName

    - by vodkhang
    I am trying to encode some data state in a UITableViewController. In the first time, I init the object with Nibname without any problem. However, when I initWithCoder, the UITableViewController still loads but when I clicked on a cell, the application crash and the debugger tells me about EXEC_BAD_ACCESS, something wrong with my memory, but I do not know Here is my code: - (id) init { if(self = [self initWithNibName:@"DateTableViewController" bundle:nil]) { self.dataArray = [[NSMutableArray alloc] initWithObjects:@"1", @"2", @"3", nil]; } return self; } // Customize the appearance of table view cells. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; } // Set up the cell... int index = indexPath.row; cell.textLabel.text = [self.dataArray objectAtIndex:index];; return cell; } - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section { return @"Test Archiver"; } - (void)encodeWithCoder:(NSCoder *)coder { [super encodeWithCoder:coder]; [coder encodeObject:self.dataArray]; } - (id)initWithCoder:(NSCoder *)coder { return [self init]; } - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { int index = indexPath.row; [self.dataArray addObject:[NSString stringWithFormat:@"Hello %d", index]]; [self.tableView reloadData]; }

    Read the article

  • Restore and preserve UIViewController pushed from UINavigationController, no storyboard

    - by user2908112
    I try to restore a simple UIViewController that I pushed from my initial view controller. The first one is preserved, but the second one just disappear when relaunched. I don't use storyboard. I implement the protocol in every view controller and add the restorationIdentifier and restorationClass to each one of them. The second viewController inherit from a third viewController and is initialized from a xib file. I'm not sure if I need to implement the UIViewControllerRestoration to this third since I don't use it directly. My code looks like typically like this: - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; if (self) { // Custom initialization self.restorationIdentifier = @"EditNotificationViewController"; self.restorationClass = [self class]; } return self; } -(void)encodeRestorableStateWithCoder:(NSCoder *)coder { } -(void)decodeRestorableStateWithCoder:(NSCoder *)coder { } +(UIViewController *)viewControllerWithRestorationIdentifierPath:(NSArray *)identifierComponents coder:(NSCoder *)coder { EditNotificationViewController* envc = [[EditNotificationViewController alloc] initWithNibName:@"SearchFormViewController" bundle:nil]; return envc; } Should perhaps the navigationController be subclassed so it too can inherit from UIViewControllerRestoration?

    Read the article

  • Backbone.js "model" query

    - by Novice coder
    I'm a learning coder trying to understand this code from a sample MVC framework. The below code is from a "model" file. I've done research on Backbone.js, but I'm still confused as to exactly how this code pull information from the app's database. For example, how are base_url, Model.prototype, and Collection.prototype being used to retrieve information from the backend? Any help would be greatly appreciated. exports.definition = { config : { "defaults": { "title": "-", "description": "-" }, "adapter": { "type": "rest", "collection_name": "schools", "base_url" : "/schools/", } }, extendModel: function(Model) { _.extend(Model.prototype, { // Extend, override or implement Backbone.Model urlRoot: '/school/', name:'school', parse: function(response, options) { response.id = response._id; return response; }, }); return Model; }, extendCollection: function(Collection) { _.extend(Collection.prototype, { // Extend, override or implement Backbone.Collection urlRoot: '/schools/', name: 'schools', }); return Collection; } }

    Read the article

  • What does it mean when a User-Agent has another User-Agent inside it?

    - by Erx_VB.NExT.Coder
    Basically, sometimes the user-agent will have its normal user-agent displayed, then at the end it will have teh "User-Agent: " tag displayed, and right after it another user-agent is shown. Sometimes, the second user-agent is just appended to the first one without the "User-Agent: " tag. Here are some samples I've seen: The first few contain the "User-Agent: " tag in the middle somewhere, and I've changed its font to make it easier to to see. Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; Trident/4.0; GTB6; User-agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1); SLCC1; .NET CLR 2.0.50727; .NET CLR 3.0.04506) Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; GTB6; MRA 5.10 (build 5339); User-agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1); .NET CLR 1.1.4322; .NET CLR 2.0.50727) Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; User-agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1); .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729) Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; User-agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1); .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152) Here are some without the "User-Agent: " tag in the middle, but just two user agents that seem stiched together. Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1); .NET CLR 3.5.30729) Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; GTB6; IPMS/6568080A-04A5AD839A9; TCO_20090713170733; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1); InfoPath.2) Now, just to add a few notes to this. I understand that the "User-Agent: " tag is normally a header, and what follows a typical "User-Agent: " string sequence is the actual user agent that is sent to servers etc, but normally the "User-Agent: " string should not be part of the actual user agent, that is more like the pre-fix or a tag indicating that what follows will be the actual user agent. Additionally, I may have thought, hey, these are just two user agents pasted together, but on closer inspection, you realize that they are not. On all of these dual user agent listings, if you look at the opening bracket "(" just before the "compatible" keyword, you realize the pair to that bracket ")" is actually at the very end, the end of the second user agent. So, the first user agents closing bracket ")" never occurs before the second user agent begins, it's always right at the end, and therefore, the second user agent is more like one of the features of the first user agent, like: "Trident/4.0" or "GTB6" etc etc... The other thing to note that the second user agent is always MSIE 6.0 (Internet Explorer 6.0), interesting. What I had initially thought was it's some sort of Virtual Machine displaying the browser in use & the browser that is installed, but then I thought, what'd be the point in that? Finally, right now, I am thinking, it's probably soem sort of "Compatibility View" type thing, where even if MSIE 7.0 or 8.0 is installed, when my hypothetical the "Display In Internet Explorer 6.0" mode is turned on, the user agent changes to something like this. That being, IE 8.0 is installed, but is rendering everything as IE 6.0 would. Is there or was there such a feature in Internet Explorer? Am I on to something here? What are your thoughts on this? If you have any other ideas, please feel free to let us know. At the moment, I'm just trying to understand if these are valid User Agents, or if they are invalid. In a list of about 44,000 User Agents, I've seen this type of Dual User Agent about 400 times. I've closely inspected 40 of them, and every single one had MSIE 6.0 as the "second" user agent (and the first user agent a higher version of MSIE, such as 7 or 8). This was true for all except one, where both user agents were MSIE 8.0, here it is: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; Mozilla/4.0 (compatible; MSIE 8.0; Win32; GMX); GTB0.0) This occured once in my 40 "close" inspections. I've estimated the 400 in 44,000 by taking a sample of the first 4,400 user agents, and finding 40 of these in the MSIE/Windows user agents, and extrapolated that to estimate 40. There were also similar things occuring for non MSIE user agents where there were two Mozilla's in one user agent, the non MSIE ones would probably add another 30% on top of the ones I've noted. I can show you samples of them if anyone would like. There we have it, this is where I'm at, what do you guys think?

    Read the article

  • Writing/discussions about the aesthetics of code?

    - by dilettante.coder
    I'm looking for considerations of the questions "Can code be beautiful?" and "What makes code beautiful?" Examples would include: This academic paper: Obfuscation, Weird Languages, and Code Aesthetics This blog post: Hamon or the Skin Deep Beauty of Code Please note that I'm not trying to start a discussion here, or asking for opinions about what makes code beautiful, or for code you think is beautiful; I'm trying to find stuff that has already been published. Thanks for your help.

    Read the article

  • UppercuT &ndash; Custom Extensions Now With PowerShell and Ruby

    - by Robz / Fervent Coder
    Arguably, one of the most powerful features of UppercuT (UC) is the ability to extend any step of the build process with a pre, post, or replace hook. This customization is done in a separate location from the build so you can upgrade without wondering if you broke the build. There is a hook before each step of the build has run. There is a hook after. And back to power again, there is a replacement hook. If you don’t like what the step is doing and/or you want to replace it’s entire functionality, you just drop a custom replacement extension and UppercuT will perform the custom step instead. Up until recently all custom hooks had to be written in NAnt. Now they are a little sweeter because you no longer need to use NAnt to extend UC if you don’t want to. You can use PowerShell. Or Ruby.   Let that sink in for a moment. You don’t have to even need to interact with NAnt at all now. Extension Points On the wiki, all of the extension points are shown. The basic idea is that you would put whatever customization you are doing in a separate folder named build.custom. Each step Let’s take a look at all we can customize: The start point is default.build. It calls build.custom/default.pre.build if it exists, then it runs build/default.build (normal tasks) OR build.custom/default.replace.build if it exists, and finally build.custom/default.post.build if it exists. Every step below runs with the same extension points but changes on the file name it is looking for. NOTE: If you include default.replace.build, nothing else will run because everything is called from default.build.    * policyChecks.step    * versionBuilder.step NOTE: If you include build.custom/versionBuilder.replace.step, the items below will not run.      - svn.step, tfs.step, or git.step (the custom tasks for these need to go in build.custom/versioners)    * generateBuildInfo.step    * compile.step    * environmentBuilder.step    * analyze.step NOTE: If you include build.custom/analyze.replace.step, the items below will not run.      - test.step (the custom tasks for this need to go in build.custom/analyzers) NOTE: If you include build.custom/analyzers/test.replace.step, the items below will not run.        + mbunit2.step, gallio.step, or nunit.step (the custom tasks for these need to go in build.custom/analyzers)      - ncover.step (the custom tasks for this need to go in build.custom/analyzers)      - ndepend.step (the custom tasks for this need to go in build.custom/analyzers)      - moma.step (the custom tasks for this need to go in build.custom/analyzers)    * package.step NOTE: If you include build.custom/package.replace.step, the items below will not run.      - deploymentBuilder.step Customize UppercuT Builds With PowerShell UppercuT can now be extended with PowerShell (PS). To customize any extension point with PS, just add .ps1 to the end of the file name and write your custom tasks in PowerShell. If you are not signing your scripts you will need to change a setting in the UppercuT.config file. This does impose a security risk, because this allows PS to now run any PS script. This setting stays that way on ANY machine that runs the build until manually changed by someone. I’m not responsible if you mess up your machine or anyone else’s by doing this. You’ve been warned. Now that you are fully aware of any security holes you may open and are okay with that, let’s move on. Let’s create a file called default.replace.build.ps1 in the build.custom folder. Open that file in notepad and let’s add this to it: write-host "hello - I'm a custom task written in Powershell!" Now, let’s run build.bat. You could get some PSake action going here. I won’t dive into that in this post though. Customize UppercuT Builds With Ruby If you want to customize any extension point with Ruby, just add .rb to the end of the file name and write your custom tasks in Ruby.  Let’s write a custom ruby task for UC. If you were thinking it would be the same as the one we just wrote for PS, you’d be right! In the build.custom folder, lets create a file called default.replace.build.rb. Open that file in notepad and let’s put this in there: puts "I'm a custom ruby task!" Now, let’s run build.bat again. That’s chunky bacon. UppercuT and Albacore.NET Just for fun, I wanted to see if I could replace the compile.step with a Rake task. Not just any rake task, Albacore’s msbuild task. Albacore is a suite of rake tasks brought about by Derick Bailey to make building .NET with Rake easier. It has quite a bit of support with developers that are using Rake to build code. In my build.custom folder, I drop a compile.replace.step.rb. I also put in a separate file that will contain my Albacore rake task and I call that compile.rb. What are the contents of compile.replace.step.rb? rake = 'rake' arguments= '-f ' + Dir.pwd + '/../build.custom/compile.rb' #puts "Calling #{rake} " + arguments system("#{rake} " + arguments) Since the custom extensions call ruby, we have to shell back out and call rake. That’s what we are doing here. We also realize that ruby is called from the build folder, so we need to back out and dive into the build.custom folder to find the file that is technically next to us. What are the contents of compile.rb? require 'rubygems' require 'fileutils' require 'albacore' task :default => [:compile] puts "Using Ruby to compile UppercuT with Albacore Tasks" desc 'Compile the source' msbuild :compile do |msb| msb.properties = { :configuration => :Release, :outputpath => '../../build_output/UppercuT' } msb.targets [:clean, :build] msb.verbosity = "quiet" msb.path_to_command = 'c:/Windows/Microsoft.NET/Framework/v3.5/MSBuild.exe' msb.solution = '../uppercut.sln' end We are using the msbuild task here. We change the output path to the build_output/UppercuT folder. The output path has “../../” because this is based on every project. We could grab the current directory and then point the task specifically to a folder if we have projects that are at different levels. We want the verbosity to be quiet so we set that as well. So what kind of output do you get for this? Let’s run build.bat custom_tasks_replace:      [echo] Running custom tasks instead of normal tasks if C:\code\uppercut\build\..\build.custom\compile.replace.step exists.      [exec] (in C:/code/uppercut/build)      [exec] Using Ruby to compile UppercuT with Albacore Tasks      [exec] Microsoft (R) Build Engine Version 3.5.30729.4926      [exec] [Microsoft .NET Framework, Version 2.0.50727.4927]      [exec] Copyright (C) Microsoft Corporation 2007. All rights reserved. If you think this is awesome, you’d be right!   With this knowledge you shall build.

    Read the article

  • Symbolic Regular Expression Exploration

    - by Robz / Fervent Coder
    This is a pretty sweet little tool. Rex (Regular Expression Exploration) is a tool that allows you to give it a regular expression and it returns matching strings. The example below creates10 strings that start and end with a number and have at least 2 characters: > rex.exe "^\d.*\d$" /k:10 This is something I could use to validate/generate the Regular Expressions I have created with both UppercuT and RoundhousE. Check out the video below: Margus Veanes - Rex - Symbolic Regular Expression Exploration Margus Veanes, a Researcher from the RiSE group at Microsoft Research, gives an overview of Rex, a tool that generates matching string from .NET regular expressions. Rex turns regular expres...

    Read the article

  • Chuck Norris Be Thy Name

    - by Robz / Fervent Coder
    Chuck Norris doesn’t program with a keyboard. He stares the computer down until it does what he wants. All things need a name. We’ve tossed around a bunch of names for the framework of tools we’ve been working on, but one we kept coming back to was Chuck Norris. Why did we choose Chuck Norris? Well Chuck Norris sort of chose us. Everything we talked about, the name kept drawing us closer to it. We couldn’t escape Chuck Norris, no matter how hard we tried. So we gave in. Chuck Norris can divide by zero. What is the Chuck Norris Framework? @drusellers and I have been working on a variety of tools: WarmuP - http://github.com/chucknorris/warmup (Template your entire project/solution and create projects ready to code - From Zero to a Solution with everything in seconds. Your templates, your choices.) UppercuT - http://projectuppercut.org (Build with Conventions - Professional Builds in Moments, Not Days!) | Code also at http://github.com/chucknorris/uppercut DropkicK - http://github.com/chucknorris/dropkick (Deploy Fluently) RoundhousE - http://projectroundhouse.org (Professional Database Management with Versioning) | Code also at http://github.com/chucknorris/roundhouse SidePOP - http://sidepop.googlecode.com (Does your application need to check email?) HeadlocK - http://github.com/chucknorris/headlock (Hash a directory so you can later know if anything has changed) Others – still in concept or vaporware People ask why we choose such violent names for each tool of our framework? At first it was about whipping your code into shape, but after awhile the naming became, “How can we relate this to Chuck Norris?” People also ask why we uppercase the last letter of each name. Well, that’s more about making you ask questions…but there are a few reasons for it. Project managers never ask Chuck Norris for estimations…ever. The class object inherits from Chuck Norris Chuck Norris doesn’t need garbage collection because he doesn’t call .Dispose(), he calls .DropKick() So what are you waiting for? Join the Google group today, download and play with the tools. And lastly, welcome to Chuck Norris. Or should I say Chuck Norris welcomes you…

    Read the article

  • Professional iOS Development as a Backup Career [closed]

    - by New Coder
    I am a research chemist by day and I am a self-taught hobbyist iOS programmer by night. I am in the process of developing a moderately complex iOS app and hope to launch it within a month or two. I love everything about iOS development (and programming in general). I want to know if iOS development could become a backup career for me if I loose my job. My question: Let's say I had a couple of apps in the app store, a solid foundation in objective-C and the apple frameworks and basic knowledge on network integrated apps. Without a formal CS degree, what other experience/knowledge would I need to land a job as a professional iOS developer? Forgive me if this question is out of bounds for this forum. If it is, suggestions on where to post such a question would be appreciated.

    Read the article

  • Coders For Charities

    - by Robz / Fervent Coder
    Last weekend I had the opportunity to give back to the community doing what I love. As geeks we don’t usually have this opportunity. The event is called Coders 4 Charities (C4C) and it’s a grueling weekend of coding for nearly 30 hours over the weekend. When you finish you get to present to the charity and all of the other groups what you have completed. From the site: Coders For Charities is a 3-day charity event that pairs charities and local software developers. Charities often do not have the funds to implement a new website or intranet or database solution. Software developers often do not volunteer for charities because their skills do not apply. This event is the perfect marriage of these two needs; software developers volunteering their time to help charities better serve their community though the latest technology! The actual event was lined with multiple charities and about 50 developers, designers, business analysts, etc, each working with a different charity to come up with a solution that they could implement in less than 3 days. C4C provided a place and food for us so that we wouldn’t have to leave much during the time we had to implement our solution. They also provided games like Rock Band so we could get away and clear our minds for a few moments if necessary. I don’t think we made it down there to play, but the food and drinks were a huge help for us. The charity we we picked was Harvest Home. They had a need for an online intranet site where they could track membership and gardening. Over the next few days we worked on a site we could give them. Below is a screen shot with private data marked out. It was an awesome and humbling experience to be able to give back to a charity and I’m happy I was a part of it. I would definitely do it again. How often do we get to use our abilities to volunteer our time to a charity?

    Read the article

  • Puppet: Making Windows Awesome Since 2011

    - by Robz / Fervent Coder
    Originally posted on: http://geekswithblogs.net/robz/archive/2014/08/07/puppet-making-windows-awesome-since-2011.aspxPuppet was one of the first configuration management (CM) tools to support Windows, way back in 2011. It has the heaviest investment on Windows infrastructure with 1/3 of the platform client development staff being Windows folks.  It appears that Microsoft believed an end state configuration tool like Puppet was the way forward, so much so that they cloned Puppet’s DSL (domain-specific language) in many ways and are calling it PowerShell DSC. Puppet Labs is pushing the envelope on Windows. Here are several things to note: Puppet x64 Ruby support for Windows coming in v3.7.0. An awesome ACL module (with order, SIDs and very granular control of permissions it is best of any CM). A wealth of modules that work with Windows on the Forge (and more on GitHub). Documentation solely for Windows folks - https://docs.puppetlabs.com/windows. Some of the common learning points with Puppet on Windows user are noted in this recent blog post. Microsoft OpenTech supports Puppet. Azure has the ability to deploy a Puppet Master (http://puppetlabs.com/solutions/microsoft). At Microsoft //Build 2014 in the Day 2 Keynote Puppet Labs CEO Luke Kanies co-presented with Mark Russonivich (http://channel9.msdn.com/Events/Build/2014/KEY02  fast forward to 19:30)! Puppet has a Visual Studio Plugin! It can be overwhelming learning a new tool like Puppet at first, but Puppet Labs has some resources to help you on that path. Take a look at the Learning VM, which has a quest-based learning tool. For real-time questions, feel free to drop onto #puppet on freenode.net (yes, some folks still use IRC) with questions, and #puppet-dev with thoughts/feedback on the language itself. You can subscribe to puppet-users / puppet-dev mailing lists. There is also ask.puppetlabs.com for questions and Server Fault if you want to go to a Stack Exchange site. There are books written on learning Puppet. There are even Puppet User Groups (PUGs) and other community resources! Puppet does take some time to learn, but with anything you need to learn, you need to weigh the benefits versus the ramp up time. I learned NHibernate once, it had a very high ramp time back then but was the only game on the street. Puppet’s ramp up time is considerably less than that. The advantage is that you are learning a DSL, and it can apply to multiple platforms (Linux, Windows, OS X, etc.) with the same Puppet resource constructs. As you learn Puppet you may wonder why it has a DSL instead of just leveraging the language of Ruby (or maybe this is one of those things that keeps you up wondering at night). I like the DSL over a small layer on top of Ruby. It allows the Puppet language to be portable and go more places. It makes you think about the end state of what you want to achieve in a declarative sense instead of in an imperative sense. You may also find that right now Puppet doesn’t run manifests (scripts) in order of the way resources are specified. This is the number one learning point for most folks. As a long time consternation of some folks about Puppet, manifest ordering was not possible in the past. In fact it might be why some other CMs exist! As of 3.3.0, Puppet can do manifest ordering, and it will be the default in Puppet 4. http://puppetlabs.com/blog/introducing-manifest-ordered-resources You may have caught earlier that I mentioned PowerShell DSC. But what about DSC? Shouldn’t that be what Windows users want to choose? Other CMs are integrating with DSC, will Puppet follow suit and integrate with DSC? The biggest concern that I have with DSC is it’s lack of visibility in fine-grained reporting of changes (which Puppet has). The other is that it is a very young Microsoft product (pre version 3, you know what they say :) ). I tried getting it working in December and ran into some issues. I’m hoping that newer releases are there that actually work, it does have some promising capabilities, it just doesn’t quite come up to the standard of something that should be used in production. In contrast Puppet is almost a ten year old language with an active community! It’s very stable, and when trusting your business to configuration management, you want something that has been around awhile and has been proven. Give DSC another couple of releases and you might see more folks integrating with it. That said there may be a future with DSC integration. Portability and fine-grained reporting of configuration changes are reasons to take a closer look at Puppet on Windows. Yes, Puppet on Windows is here to stay and it’s continually getting better folks.

    Read the article

  • Ajax application: using SOAP vs REST ?

    - by coder
    I'm building an ajax heavy application (client-side strictly html/css/js) which will be getting all the data and using server business logic via webservices. I know REST seems to be the hot topic but I can't find any good arguments. The main argument seems to be its "light-weight". My impression so far is that wsdl/soap based services are more expressive and allow for more a more complex transfer of data. It appears that soap would be more useful in the application I'm building where the only code consuming the services will be the js downloaded in the client browser. REST on the other hand seems to have a smaller entry barrier and so can be more useful for services like twitter in allowing other developers to consume these services easily. Also, REST seems to Te better suited for simple data transfers. So in summary SOAP is useful for complex data transfer and REST is useful in simple data transfer. I'm currently under the impression that using SOAP would be best due to the complexity of the messages but perhaps there's other factors. What are your thoughts on the pros/cons of soap/rest for a heavy ajax web app? EDIT: While the wsdl is in xml, the data I'm transferring back and forth is actually in JSON. It just appears more natural to use wsdl/soap here due to the nature of the app. The verbs GET and POST may not be enough. I may want to say something like: processQueue, or executeTimer. This is why my conclusion has been wsdl/soap would be good for bridging a complex layer between two applications (client and server) whereas REST would be better (due to its simplicity) for allowing many developer-users to consume resources programmatically. So you could say the choice falls along two lines Will the app be verb-oriented (completing tasks: use soap) or noun-oriented (consuming resources: use REST) Will the api be consumed by few developers or many developers (REST is strong for many developers)? Since such an ajax heavy app would potentially use many verbs and would only be used by the client developer it appears soap/wsdl would be the best fit.

    Read the article

  • Microsoft C# Most Valuable Professional

    - by Robz / Fervent Coder
    Recently I was awarded the Microsoft Most Valuable Professional (MVP) for Visual C#. For those that don’t know it’s an annual award based on nominations from peers and Microsoft. Although there are just over 4,000 MVPs worldwide from all kinds of specializations, there are less than 100 C# MVPs in the US. There is more information at the site: https://mvp.support.microsoft.com The Microsoft MVP Award is an annual award that recognizes exceptional technology community leaders worldwide who actively share their high quality, real world expertise with users and Microsoft. With fewer than 5,000 awardees worldwide, Microsoft MVPs represent a highly select group of experts. MVPs share a deep commitment to community and a willingness to help others. To recognize the contributions they make, MVPs from around the world have the opportunity to meet Microsoft executives, network with peers, and position themselves as technical community leaders. Here is my profile: https://mvp.support.microsoft.com/default.aspx/profile/rob.reynolds I want to thank those that nominated me, without nominations this would never have happened. Thanks to Microsoft for liking me and finding my achievements and contributions to the community to be worth something. It’s good to know when you put in a lot of hard work that you get rewarded! I also want to thank many of the people I have worked with over the last 7 years. You guys have been great and I’m definitely standing on the shoulders of giants! Thanks to KDOT for giving me that first shot into professional programming and the experience and all of the training! A special thanks to @drusellers for kick starting me when I went stale in my learning back in 2007 and for always pushing me and bouncing ideas off of me. Without you I don’t think I would have made it this far. Thanks Alt.NET for keeping it fresh and funky! A very special thank you goes out to my wife for supporting me and locking me in the basement to work on all of my initiatives!

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >