How to stretch first column to fill the screen in android tablelayout?

In my android app, I have a table layout of 2 columns.

I want to stretch the first column width to fill the screen as much as possible. However in this code, it just wraps the width as much as possible...

Does anyone know what's wrong here?

Thanks

    TableLayout mytable = (TableLayout)findViewById(R.id.studentContainer);

    TableRow tablerow = new TableRow(this);
    tablerow.setOrientation(TableRow.VERTICAL);
    EditText g = new EditText(this);
    g.setText("AAAAA");
    g.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.FILL_PARENT, TableRow.LayoutParams.WRAP_CONTENT));
    EditText g2 = new EditText(this);
    g2.setText("BBBBB");
    g2.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.WRAP_CONTENT, TableRow.LayoutParams.WRAP_CONTENT));
    tablerow.addView(g);
    tablerow.addView(g2);
    mytable.addView(tablerow, new TableLayout.LayoutParams(TableLayout.LayoutParams.FILL_PARENT, TableLayout.LayoutParams.WRAP_CONTENT));

    TableRow tablerow2 = new TableRow(this);
    tablerow2.setOrientation(TableRow.VERTICAL);
    EditText g4 = new EditText(this);
    g4.setText("AAAAA");
    g4.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.FILL_PARENT, TableRow.LayoutParams.WRAP_CONTENT));
    EditText g5 = new EditText(this);
    g5.setText("BBBBB");
    g5.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.WRAP_CONTENT, TableRow.LayoutParams.WRAP_CONTENT));
    tablerow2.addView(g4);
    tablerow2.addView(g5);
    mytable.addView(tablerow2, new TableLayout.LayoutParams(TableLayout.LayoutParams.FILL_PARENT, TableLayout.LayoutParams.WRAP_CONTENT));

XML

            <TableLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:stretchColumns="0"
                android:orientation="vertical"
                android:id="@+id/studentContainer" >
            </TableLayout >


How to skip "Welcome Page" in Chrome using adb

I am trying to open a URL in Google Chrome using adb command line. Have set "--no-first-run" using following command -

adb shell 'echo "chrome --no-first-run" > /data/local/tmp/chrome-command-line'

Have taken the command line switch from the following website - http://peter.sh/experiments/chromium-command-line-switches/

Then I execute the following commands,

adb -s TA99300UFC shell am set-debug-app com.android.chrome
adb -s TA99300UFC shell am start -n com.android.chrome/com.google.android.apps.chrome.Main -d 'http://wikipedia.org'

Still the "Welcome Page" shows up.

How can I skip this and go directly to the website URL passed in command?


getting a black screen when using setRequestedOrientation()

I have a FragmentActivity with some fragments in them.  When I go from the fragment I am on (Fragment A) which I have the phone in the portrait position to the next fragment (Fragment B) which I have set in the code setOrientation() to Landscape I get a black screen when I hold the phone in portrait and the layout will not show on the second fragment until I turn my phone to Landscape.  I was under the impression that no matter how you are holding the phone that when you do setRequestedOrientation() it should forcefully show the layout you provided

Visual:

-----------         -----------
|         |         |         |                         ---------------
|         |         |         |                         |             |
| Frag A  |   ->    | Frag B  |   -> Until I turn  ->   |   Frag B    |
|         |(then to)| (black) |     it to Landscape     | (not black  |
|         |         |         |                         |   anymore)  |
|         |         |         |                         ---------------
-----------         -----------

Code:

MainActivity which holds the orientation changes:

    // Set Orientation of the Activity.
public void setOrientation(int sensor) {
    if (sensor == 1) {
        setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_FULL_SENSOR);
    } else if (sensor == 2) {
        setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT);
    } else if (sensor == 3) {
        setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE);
    } else if (sensor == 4) {
        setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
    } else if (sensor == 5) {
        setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
    }
}

FragA:

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
        Bundle savedInstanceState) {

    // Set the orientation to be in portrait and landscape.
    ((MainActivity) getActivity()).setOrientation(1);
    ...
}

FragB:

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
        Bundle savedInstanceState) {

    // Set the orientation to be in landscape.
    ((MainActivity) getActivity()).setOrientation(5);
    ...
}


{{ }} is not getting parsed by pyjade as expected with django

I have line of pyjade

 a.js-track(data-track-data="{\"Job ID\":\"{{ job_details|get_or_na:'id' }}\",\"Job Title\":\"{{ job_details|get_or_na:'title' }}\",\"Company Name\":\"{{ job_details|get_or_na:'organization'|get_or_na:'name' }}\"}", data-track-dynamic-attrs="[\"Stakeholder\"]",href="{% url 'job_detail' job_details.title|slugify job_details.id %}")

which is being rendered as

<a href="/job/operations-manager/b1ac846e-6834-40c4-8bcf-122c093820b1/" data-track-data="{"Job ID":"{{ job_details|get_or_na:'id' }}","Job Title":"{{ job_details|get_or_na:'title' }}","Company Name":"{{ job_details|get_or_na:'organization'|get_or_na:'name' }}"}" data-track-dynamic-attrs="["Stakeholder"]" class="js-track">

I expect it to {{ }} being replaced by intended values rather than being rendered with html.

I am using 4.0.0 version of pyjade here as templating language.


How to append NSString wiht number?

I'm new in Cocoa.

I have NSString - (e.g)  MUSIC . I want to add some new NSString in Array,
And want to check something like this

if MUSIC already contained in Array, add Music_1 , after Music_2  and so on.

So I need to be able read that integer from NSString, and append it +1 .

Thanks


Dynamically Inserting <script> tags into HTML on Page Load

I'm trying to dynamically insert the Tweetmeme button using Javascript. I'm currently using jQuery throughout the site. Here's the script that I'm using. I basically want to cycle through all the blog entries with a class of journal-entry and append the following JavaScript to the end. This Javascript comes straight from tweetmeme.com. This doesn't work for me though and it has something to do with the code between append(). It doesn't like the second set of script tags.

<script type="text/javascript">
$(document).ready(function() {

$('.journal-entry').each(function(index) {
    $(this).append('<script type="text/javascript" src="http://tweetmeme.com/i/scripts/button.js"></script>');
   });

});
</script>

Any help is appreciated.
Thanks.


Is it possible to process and query mondrian cubes without deploying to pentaho bi-server?

If yes, please give a reference. I did a little googling with no result.
I want to use olap4j to query the cubes and use the result in a web application. But, I don't need any of the features of bi-server.
According to tutorials, the olap schemas have to be published on an instance of bi-server. So isn't it really possible to have cubes built, processed and queried independently?


Calling function C#

How would I call this function

    public void AdvertisingBot(Player player, PlayerTextPacket packet)
    {
        string name = "Bot";
        var plr = player.Manager.FindPlayer(name);

        if (packet.Text.Contains("servernameexample"))
        {
            plr.Manager.Chat.Say(plr, "Please do not avertise, I'm watching..");
        }
    }

doesnt really matter what the code does i dont think but if you have to know, it just looks for the player in-game named Bot and when a player says whats in the quote, the Bot will send a message saying no advertising.


Delete from one, add to another Listbox and vice versa with the same sorting like before

I have to small events to delete the selected items from one list and add them to another and vice versa and it works fine.
The Problem is that when i delete the items from the second list and add them again to the first list that the sorting is add the end of the list.
Is it possible to save the "position" to add them on the same place like before?

Solutions like list.sort() wouldn't work because its a database with all tables and triggers and so on...

        private void LstSelectedDbTables_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
    {
        if (lstSelectedDbTables.SelectedIndex != -1)
            if (e.KeyValue == (char) Keys.Delete || e.KeyValue == (char) Keys.Back)
            {
                var selectedItems = lstSelectedDbTables.SelectedItems;
                var bdHashSet = new List<string>(lstSourceDatabaseTables.Items.Cast<string>());
                for (int i = selectedItems.Count - 1; i >= 0; i--)
                {
                    bdHashSet.Add(selectedItems[i].ToString());
                    lstSelectedDbTables.Items.Remove(selectedItems[i]);
                }
                lstSourceDatabaseTables.DataSource = bdHashSet;
            }
    }

    private void lstSourceDatabaseTables_DoubleClick(object sender, EventArgs e)
    {
        if (lstSourceDatabaseTables.SelectedIndex != -1)
        {
            var bdHashSet = new HashSet<string>(lstSourceDatabaseTables.Items.Cast<string>());
            var selectedItems = lstSourceDatabaseTables.SelectedItems;

            for (int i = selectedItems.Count - 1; i >= 0; i--)
            {
                lstSelectedDbTables.Items.Add(selectedItems[i]);
                bdHashSet.Remove(selectedItems[i].ToString());
            }
            lstSourceDatabaseTables.DataSource = bdHashSet.ToList();
        }
    }


getting the click event in a kendo grid

I'm trying to get the click event for a Kendo Grid so I can bind stuff to shift and ctrl clicking.  I can't use the inherent multiselect Kendo provides because it doesn't support drag and drop.  When I create a function after the dataBound event, my function gets called on clicking, but it's not the typical click event.

var onDataBound = function () {
    selectItem.apply(this);
}

grid.dataBound = onDataBound;

var selectItem.apply = function (e) {
    console.log(e);
}

Any thoughts?  Thanks in advance.


Is possible to acessing a SSL certified page using Phonegap Application?

I know this is a duplicate post..

I want to knew,android or phonegap application is preferrable for an banking application with Webservice to acess the  SSL certified page to acess the private details (account number, Account details etc) ?

1.What are the pros and cons for acessing a SSL certified page (Android Vs Phonegap)?

2.What are security issues?

3.How to resolve this problem?(Guide to attain this goal)

Need some helpfull documentation to clear my doubts...Thanks in Advance


Error in gridviewUpdating asp.net with a timestamp update

I have two buttons, SetIn and SetOut. They both have the commandName UPDATE ( I have two buttons as I'd like the text to be different on the button depending on the value of one field in the row.

I'm getting a problem in that when I run the update SQL statement, it throws an error at me. It says:

An exception of type 'System.Data.SqlClient.SqlException' occurred in System.Data.dll but was not handled in user code

  Additional information: Incorrect syntax near '14'.

This means that there is an issue with the date and time stamp that I am trying to update the row with (I'm making the update at 14.02pm).

My aspx.cs page code is:

  protected void GridView1_RowUpdating(object sender, System.Web.UI.WebControls.GridViewUpdateEventArgs e)
{
     Label id = GridView1.Rows[e.RowIndex].FindControl("lbl_Index") as Label;
     int rowToUpdate = Int32.Parse(id.Text);
     con = new SqlConnection(cs);

     int scopeValue;
     con = new SqlConnection(cs);
     cmd = new SqlCommand();

     cmd.CommandText = "SELECT in_scope FROM " + databaseName + " WHERE id = '" + rowToUpdate + "'";
     cmd.Parameters.AddWithValue("@id", rowToUpdate);
     cmd.Connection = con;

     try
     {
         con.Open();
         scopeValue = Convert.ToInt32(cmd.ExecuteScalar());
         //database_entries.Text = recordCount.ToString();
     }
     finally
     {
         con.Close();
     }

    string modifiedBy = userManagement.getWeldID();
    string updateDate = DateTime.UtcNow.ToString("dd/MMM/yyyy HH:mm:ss");
    {
        if (scopeValue == 1)
        {
           // Label id = GridView1.Rows[e.RowIndex].FindControl("lbl_Index") as Label;
            string sqlStatement = "";
            con = new SqlConnection(cs);
           // SqlCommand cmd = new SqlCommand();
            sqlStatement = @"update dbo.Fair_Use_InScope_MIF_Alex_temp set in_scope = '0', modified_by = " + modifiedBy + ", date_updated = " + updateDate + " where id = '" + rowToUpdate + "'";

            con.Open();
            cmd = new SqlCommand(sqlStatement, con);
            cmd.ExecuteNonQuery();
            con.Close();
            ShowData();
        }
        if (scopeValue == 0)
        {
           // Label id = GridView1.Rows[e.RowIndex].FindControl("lbl_Index") as Label;
            string sqlStatement = "";
            con = new SqlConnection(cs);
           // SqlCommand cmd = new SqlCommand();
            sqlStatement = @"update dbo.Fair_Use_InScope_MIF_Alex_temp set in_scope = '1', modified_by = " + modifiedBy + ", date_updated = " + updateDate + " where id = '" + rowToUpdate + "'";
            con.Open();
            cmd = new SqlCommand(sqlStatement, con);
            cmd.ExecuteNonQuery();
            con.Close();
            ShowData();
        }
    }
}

I'm basically trying to get the scopeValue (0 or 1) of the row, and if the Update command is called, and the scopeValue was previously 0, set it to 1 now and vice versa. I also need to update the time that the change was made and who made the change in that row. (these are both displayed in the gridview)

Any help would be much appreciated as I am a beginner to ASP.NET and C# and SQL SERVER!!


SUM of Multiple columns of MySQL table

This is tbl_user:

-----------------
ID    | Username
-----------------
1       user one
2       user two

This is tbl_x1:

-------------------------
ID    | User_id | Sum
-------------------------
1       1         10
2       1         20
3       2         30

This is tbl_x2:

-------------------------
ID    | User_id | Sum
-------------------------
1       1         10
2       1         20
3       1         30

This is tbl_y:

-------------------------
ID    | User_id | Days
-------------------------
1       1         10

I want to select sum(x1.sum + x2.sum) and sum(y.Days).

In other words, I want the following result:

-------------------------------------
ID    |  Username  |  Sum  |  Days
-------------------------------------
1       user one        90     10
2       user two        30     0

I tried with this code:

select u.id as ID, u.username as Username, sum(y.days) as Days,(ifnull(sum( x1.sum), 0) + ifnull(sum( x2.sum), 0)) as Sum from tbl_user u left join tbl_x1 x1 on u.id = x1.user_id left join tbl_x2 g on u.id = x2.user_id left join tbl_y y on u.id = y.user_id group by u.id

But i get the wrong result.


Page in Page View Controller has a sudden dropping down motion

I have 2 pages in my app that are transitioned with a UIPageViewController.
The first page loads fine but the second page will have a 'dropping' motion similar to the .gif image below.

This will only occur once when the page is loaded.
I am not really sure what causes this but my suspicions could be the constraints. It seems to be applying the constraints when the page is loaded.

I am currently looking at a solution to pre-load the pages first and if this works, i will expand the solution to pre-load only the previous and next page (if any). If there are any better solutions out there, do share with me.


MySQL table schema help needed

I've a problem deciding where to place a certain table field within my database.
The database is for a classified ads website.
I want registered and non-registered users to be able to post ads. If an unregistered user posts an ad, the site should ask him for the contact phone, if the user is already registered, then the contact phone stored in the users' table should be used.

Now my question is, would it be possible to store the contact phone for both registered and unregistered users in the same table field?
If so, where should that field be put, in the Classified ads table, or in the users' table (noting that each user within the table has a unique Id, thus, filling the users' table with unregistered users just to get their contact phone will just fill the table with useless data)

Thanks in advance !


CUDA Separate compilation issues using cmake

I have a CUDA project which I compile with cmake. It worked fine until I wanted to add a new class containing a device function described in new files (.cu and .cuh). This is the CMakeList file :

project(SINS)

cmake_minimum_required(VERSION 2.8)

# CUDA
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "./")

find_package(CUDA) # This command includes a lot of new stuff, see FindCUDA.cmake for details

include_directories(${CUDA_INCLUDE_DIRS}/include)

set(CUDA_LIBRARIES ${CUDA_LIBRARIES} "$ENV{CUDA_BIN_PATH}/lib64/libcurand.so")

[find ODEINT stuff]

include_directories(${PROJECT_SOURCE_DIR}/code/src)
include_directories(${PROJECT_SOURCE_DIR}/code/include)

set(SINS_SRC
    code/src/SINS_constants.cu
    code/src/SINS_IOManager.cu
    code/src/SINS_statistics.cu
    code/src/SINS_bufferGas.cu
)

set(SINS_HEADER
    code/include/SINS_constants.cuh
    code/include/SINS_IOManager.cuh
    code/include/SINS_statistics.cuh
    code/include/SINS_ODEINT.cuh
    code/include/SINS_bufferGas.cuh
)

set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} "-arch=sm_20;--compiler-bindir=/usr/bin/g++;-DSINS_COMPUTE_ON_GPU")

# Compile application
CUDA_ADD_EXECUTABLE(SINS code/SINS_core.cu ${SINS_SRC} ${SINS_HEADER})

# Link it to CUDA
target_link_libraries(SINS ${CUDA_LIBRARIES})

In SINS_ODEINT.cuh :

#include "SINS_bufferGas.cuh"

struct motion_system
{
    struct motion_functor
    {
        void operator()(T zippedStates) const
        {
            [...]
            SINS_bufferGas::doTheRobot(y);
            [...]
        }
    };
}

In SINS_bufferGas.cuh :

#ifndef SINS_bufferGas_H
#define SINS_bufferGas_H

#include "SINS_constants.cuh"

class SINS_bufferGas
{
    public:
        __host__ __device__ static void doTheRobot(value_type &x);
};

#endif

in SINS_bufferGas.cu :

#include "SINS_bufferGas.cuh"
__host__ __device__ void SINS_bufferGas::doTheRobot(value_type &x) {x = -666.666;}

The compilation yields :

ptxas fatal   : Unresolved extern function '_ZN14SINS_bufferGas10doTheRobotERd'

I tried adding -dc in the CUDA_NVCC_FLAGS, setting on the variable CUDA_SEPARABLE_COMPILATION coming from FindCUDA.cmake, multiple combinations of what is suggested in this post, trying to understand what is here (no cmake) to no avail...

I am using CUDA 5.0, have access to 2.0 compute capability and cmake 2.8.7 - I would really appreciate an explanation of what is going on and how I can fix it nicely. Thank you for any advice.

EDIT : Added informations asked by David Kernin.

CMake output :

-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done

~~~ CUDA ~~~
CUDA_BIN_PATH set to /usr/local/cuda-5.0.
-- Found CUDA: /usr/local/cuda-5.0 (found version "5.0")

~~~ ODEINT ~~~
ODEINT_PATH environment variable found and set to : /a/given/path/software/odeint

~~~ ROOT ~~~
-- Found ROOT 5.34/01 in /opt/cern/root/root_v5.34.01

~~~ Host or device ? ~~~
Simulation will be computed on GPUs.
-arch=sm_20;--compiler-bindir=/usr/bin/g++;-DSINS_COMPUTE_ON_GPU

~~~ Double or short precision ? ~~~
Double precision will be used.

~~~ Stepper ? ~~~
Fixed controlled step size will be used.

~~~ Electric field ? ~~~
Trapping field ON

~~~ Space charge ? ~~~
Space charge OFF

~~~ Buffer gas ? ~~~
Buffer gas cooling ON (EXPERIMENTAL)

-- Configuring done
-- Generating done
-- Build files have been written to: /a/path/workdir

And the full output of make :

/usr/bin/cmake -H/data/pieges/fabian/SINS -B/data/pieges/fabian/SINS/workdir --check-build-system CMakeFiles/Makefile.cmake 0
/usr/bin/cmake -E cmake_progress_start /data/pieges/fabian/SINS/workdir/CMakeFiles /data/pieges/fabian/SINS/workdir/CMakeFiles/progress.marks
make -f CMakeFiles/Makefile2 all
make[1]: entrant dans le répertoire « /data/pieges/fabian/SINS/workdir »
make -f CMakeFiles/SINS.dir/build.make CMakeFiles/SINS.dir/depend
make[2]: entrant dans le répertoire « /data/pieges/fabian/SINS/workdir »
/usr/bin/cmake -E cmake_progress_report /data/pieges/fabian/SINS/workdir/CMakeFiles 5
/usr/bin/cmake -E cmake_progress_report /data/pieges/fabian/SINS/workdir/CMakeFiles 1
/usr/bin/cmake -E cmake_progress_report /data/pieges/fabian/SINS/workdir/CMakeFiles 2
/usr/bin/cmake -E cmake_progress_report /data/pieges/fabian/SINS/workdir/CMakeFiles 3
/usr/bin/cmake -E cmake_progress_report /data/pieges/fabian/SINS/workdir/CMakeFiles 4
[ 40%] [ 80%] [100%] [100%] [100%] Building NVCC (Device) object CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_bufferGas.cu.o
cd /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src && /usr/bin/cmake -E make_directory /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/.
Building NVCC (Device) object CMakeFiles/SINS.dir/code/./SINS_generated_SINS_core.cu.o
cd /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code && /usr/bin/cmake -E make_directory /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/.
Building NVCC (Device) object CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_constants.cu.o
Building NVCC (Device) object CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_IOManager.cu.o
Building NVCC (Device) object CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_statistics.cu.o
cd /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src && /usr/bin/cmake -E make_directory /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/.
cd /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src && /usr/bin/cmake -E make_directory /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/.
cd /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src && /usr/bin/cmake -E make_directory /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/.
cd /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src && /usr/bin/cmake -D verbose:BOOL=1 -D build_configuration:STRING= -D generated_file:STRING=/data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_IOManager.cu.o -D generated_cubin_file:STRING=/data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_IOManager.cu.o.cubin.txt -P /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_IOManager.cu.o.cmake
cd /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src && /usr/bin/cmake -D verbose:BOOL=1 -D build_configuration:STRING= -D generated_file:STRING=/data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_bufferGas.cu.o -D generated_cubin_file:STRING=/data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_bufferGas.cu.o.cubin.txt -P /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_bufferGas.cu.o.cmake
cd /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src && /usr/bin/cmake -D verbose:BOOL=1 -D build_configuration:STRING= -D generated_file:STRING=/data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_constants.cu.o -D generated_cubin_file:STRING=/data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_constants.cu.o.cubin.txt -P /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_constants.cu.o.cmake
cd /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src && /usr/bin/cmake -D verbose:BOOL=1 -D build_configuration:STRING= -D generated_file:STRING=/data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_statistics.cu.o -D generated_cubin_file:STRING=/data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_statistics.cu.o.cubin.txt -P /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_statistics.cu.o.cmake
cd /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code && /usr/bin/cmake -D verbose:BOOL=1 -D build_configuration:STRING= -D generated_file:STRING=/data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/./SINS_generated_SINS_core.cu.o -D generated_cubin_file:STRING=/data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/./SINS_generated_SINS_core.cu.o.cubin.txt -P /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/SINS_generated_SINS_core.cu.o.cmake
-- Removing /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_constants.cu.o
-- Removing /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_IOManager.cu.o
-- Removing /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_bufferGas.cu.o
-- Removing /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_statistics.cu.o
-- Removing /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/./SINS_generated_SINS_core.cu.o
/usr/bin/cmake -E remove /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_constants.cu.o
/usr/bin/cmake -E remove /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/./SINS_generated_SINS_core.cu.o
/usr/bin/cmake -E remove /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_bufferGas.cu.o
/usr/bin/cmake -E remove /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_IOManager.cu.o
/usr/bin/cmake -E remove /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_statistics.cu.o
-- Generating dependency file: /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/SINS_generated_SINS_core.cu.o.NVCC-depend
-- Generating dependency file: /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_statistics.cu.o.NVCC-depend
-- Generating dependency file: /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_IOManager.cu.o.NVCC-depend
-- Generating dependency file: /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_bufferGas.cu.o.NVCC-depend
-- Generating dependency file: /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_constants.cu.o.NVCC-depend
/usr/local/cuda-5.0/bin/nvcc -M -D__CUDACC__ /data/pieges/fabian/SINS/code/src/SINS_bufferGas.cu -o /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_bufferGas.cu.o.NVCC-depend -m64 -DHAS_ROOT -DSINS_DO_ELECTRIC_FIELD -DSINS_DO_BUFFER_GAS -Xcompiler ,\"-g\" -arch=sm_20 --compiler-bindir=/usr/bin/g++ -DSINS_COMPUTE_ON_GPU -DNVCC -I/usr/local/cuda-5.0/include -I/usr/local/cuda-5.0/include/include -I/home/fabian/software/odeint -I/opt/cern/root/root_v5.34.01/include -I/data/pieges/fabian/SINS/code/src -I/data/pieges/fabian/SINS/code/include -I/usr/local/cuda-5.0/include
/usr/local/cuda-5.0/bin/nvcc -M -D__CUDACC__ /data/pieges/fabian/SINS/code/src/SINS_constants.cu -o /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_constants.cu.o.NVCC-depend -m64 -DHAS_ROOT -DSINS_DO_ELECTRIC_FIELD -DSINS_DO_BUFFER_GAS -Xcompiler ,\"-g\" -arch=sm_20 --compiler-bindir=/usr/bin/g++ -DSINS_COMPUTE_ON_GPU -DNVCC -I/usr/local/cuda-5.0/include -I/usr/local/cuda-5.0/include/include -I/home/fabian/software/odeint -I/opt/cern/root/root_v5.34.01/include -I/data/pieges/fabian/SINS/code/src -I/data/pieges/fabian/SINS/code/include -I/usr/local/cuda-5.0/include
/usr/local/cuda-5.0/bin/nvcc -M -D__CUDACC__ /data/pieges/fabian/SINS/code/src/SINS_IOManager.cu -o /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_IOManager.cu.o.NVCC-depend -m64 -DHAS_ROOT -DSINS_DO_ELECTRIC_FIELD -DSINS_DO_BUFFER_GAS -Xcompiler ,\"-g\" -arch=sm_20 --compiler-bindir=/usr/bin/g++ -DSINS_COMPUTE_ON_GPU -DNVCC -I/usr/local/cuda-5.0/include -I/usr/local/cuda-5.0/include/include -I/home/fabian/software/odeint -I/opt/cern/root/root_v5.34.01/include -I/data/pieges/fabian/SINS/code/src -I/data/pieges/fabian/SINS/code/include -I/usr/local/cuda-5.0/include
/usr/local/cuda-5.0/bin/nvcc -M -D__CUDACC__ /data/pieges/fabian/SINS/code/SINS_core.cu -o /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/SINS_generated_SINS_core.cu.o.NVCC-depend -m64 -DHAS_ROOT -DSINS_DO_ELECTRIC_FIELD -DSINS_DO_BUFFER_GAS -Xcompiler ,\"-g\" -arch=sm_20 --compiler-bindir=/usr/bin/g++ -DSINS_COMPUTE_ON_GPU -DNVCC -I/usr/local/cuda-5.0/include -I/usr/local/cuda-5.0/include/include -I/home/fabian/software/odeint -I/opt/cern/root/root_v5.34.01/include -I/data/pieges/fabian/SINS/code/src -I/data/pieges/fabian/SINS/code/include -I/usr/local/cuda-5.0/include
/usr/local/cuda-5.0/bin/nvcc -M -D__CUDACC__ /data/pieges/fabian/SINS/code/src/SINS_statistics.cu -o /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_statistics.cu.o.NVCC-depend -m64 -DHAS_ROOT -DSINS_DO_ELECTRIC_FIELD -DSINS_DO_BUFFER_GAS -Xcompiler ,\"-g\" -arch=sm_20 --compiler-bindir=/usr/bin/g++ -DSINS_COMPUTE_ON_GPU -DNVCC -I/usr/local/cuda-5.0/include -I/usr/local/cuda-5.0/include/include -I/home/fabian/software/odeint -I/opt/cern/root/root_v5.34.01/include -I/data/pieges/fabian/SINS/code/src -I/data/pieges/fabian/SINS/code/include -I/usr/local/cuda-5.0/include
-- Generating temporary cmake readable file: /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_bufferGas.cu.o.depend.tmp
-- Generating temporary cmake readable file: /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_constants.cu.o.depend.tmp
-- Generating temporary cmake readable file: /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_statistics.cu.o.depend.tmp
/usr/bin/cmake -D input_file:FILEPATH=/data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_constants.cu.o.NVCC-depend -D output_file:FILEPATH=/data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_constants.cu.o.depend.tmp -P /usr/share/cmake-2.8/Modules/FindCUDA/make2cmake.cmake
/usr/bin/cmake -D input_file:FILEPATH=/data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_bufferGas.cu.o.NVCC-depend -D output_file:FILEPATH=/data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_bufferGas.cu.o.depend.tmp -P /usr/share/cmake-2.8/Modules/FindCUDA/make2cmake.cmake
/usr/bin/cmake -D input_file:FILEPATH=/data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_statistics.cu.o.NVCC-depend -D output_file:FILEPATH=/data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_statistics.cu.o.depend.tmp -P /usr/share/cmake-2.8/Modules/FindCUDA/make2cmake.cmake
-- Generating temporary cmake readable file: /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_IOManager.cu.o.depend.tmp
/usr/bin/cmake -D input_file:FILEPATH=/data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_IOManager.cu.o.NVCC-depend -D output_file:FILEPATH=/data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_IOManager.cu.o.depend.tmp -P /usr/share/cmake-2.8/Modules/FindCUDA/make2cmake.cmake
-- Copy if different /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_constants.cu.o.depend.tmp to /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_constants.cu.o.depend
-- Copy if different /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_statistics.cu.o.depend.tmp to /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_statistics.cu.o.depend
-- Copy if different /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_bufferGas.cu.o.depend.tmp to /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_bufferGas.cu.o.depend
/usr/bin/cmake -E copy_if_different /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_constants.cu.o.depend.tmp /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_constants.cu.o.depend
/usr/bin/cmake -E copy_if_different /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_statistics.cu.o.depend.tmp /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_statistics.cu.o.depend
/usr/bin/cmake -E copy_if_different /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_bufferGas.cu.o.depend.tmp /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_bufferGas.cu.o.depend
-- Removing /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_constants.cu.o.depend.tmp and /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_constants.cu.o.NVCC-depend
-- Removing /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_statistics.cu.o.depend.tmp and /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_statistics.cu.o.NVCC-depend
-- Removing /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_bufferGas.cu.o.depend.tmp and /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_bufferGas.cu.o.NVCC-depend
/usr/bin/cmake -E remove /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_constants.cu.o.depend.tmp /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_constants.cu.o.NVCC-depend
/usr/bin/cmake -E remove /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_statistics.cu.o.depend.tmp /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_statistics.cu.o.NVCC-depend
-- Copy if different /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_IOManager.cu.o.depend.tmp to /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_IOManager.cu.o.depend
/usr/bin/cmake -E remove /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_bufferGas.cu.o.depend.tmp /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_bufferGas.cu.o.NVCC-depend
/usr/bin/cmake -E copy_if_different /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_IOManager.cu.o.depend.tmp /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_IOManager.cu.o.depend
-- Generating /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_constants.cu.o
-- Generating /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_statistics.cu.o
-- Generating /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_bufferGas.cu.o
/usr/local/cuda-5.0/bin/nvcc /data/pieges/fabian/SINS/code/src/SINS_constants.cu -c -o /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_constants.cu.o -m64 -DHAS_ROOT -DSINS_DO_ELECTRIC_FIELD -DSINS_DO_BUFFER_GAS -Xcompiler ,\"-g\" -arch=sm_20 --compiler-bindir=/usr/bin/g++ -DSINS_COMPUTE_ON_GPU -DNVCC -I/usr/local/cuda-5.0/include -I/usr/local/cuda-5.0/include/include -I/home/fabian/software/odeint -I/opt/cern/root/root_v5.34.01/include -I/data/pieges/fabian/SINS/code/src -I/data/pieges/fabian/SINS/code/include -I/usr/local/cuda-5.0/include
/usr/local/cuda-5.0/bin/nvcc /data/pieges/fabian/SINS/code/src/SINS_statistics.cu -c -o /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_statistics.cu.o -m64 -DHAS_ROOT -DSINS_DO_ELECTRIC_FIELD -DSINS_DO_BUFFER_GAS -Xcompiler ,\"-g\" -arch=sm_20 --compiler-bindir=/usr/bin/g++ -DSINS_COMPUTE_ON_GPU -DNVCC -I/usr/local/cuda-5.0/include -I/usr/local/cuda-5.0/include/include -I/home/fabian/software/odeint -I/opt/cern/root/root_v5.34.01/include -I/data/pieges/fabian/SINS/code/src -I/data/pieges/fabian/SINS/code/include -I/usr/local/cuda-5.0/include
-- Removing /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_IOManager.cu.o.depend.tmp and /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_IOManager.cu.o.NVCC-depend
/usr/local/cuda-5.0/bin/nvcc /data/pieges/fabian/SINS/code/src/SINS_bufferGas.cu -c -o /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_bufferGas.cu.o -m64 -DHAS_ROOT -DSINS_DO_ELECTRIC_FIELD -DSINS_DO_BUFFER_GAS -Xcompiler ,\"-g\" -arch=sm_20 --compiler-bindir=/usr/bin/g++ -DSINS_COMPUTE_ON_GPU -DNVCC -I/usr/local/cuda-5.0/include -I/usr/local/cuda-5.0/include/include -I/home/fabian/software/odeint -I/opt/cern/root/root_v5.34.01/include -I/data/pieges/fabian/SINS/code/src -I/data/pieges/fabian/SINS/code/include -I/usr/local/cuda-5.0/include
/usr/bin/cmake -E remove /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_IOManager.cu.o.depend.tmp /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_IOManager.cu.o.NVCC-depend
-- Generating /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_IOManager.cu.o
/usr/local/cuda-5.0/bin/nvcc /data/pieges/fabian/SINS/code/src/SINS_IOManager.cu -c -o /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_IOManager.cu.o -m64 -DHAS_ROOT -DSINS_DO_ELECTRIC_FIELD -DSINS_DO_BUFFER_GAS -Xcompiler ,\"-g\" -arch=sm_20 --compiler-bindir=/usr/bin/g++ -DSINS_COMPUTE_ON_GPU -DNVCC -I/usr/local/cuda-5.0/include -I/usr/local/cuda-5.0/include/include -I/home/fabian/software/odeint -I/opt/cern/root/root_v5.34.01/include -I/data/pieges/fabian/SINS/code/src -I/data/pieges/fabian/SINS/code/include -I/usr/local/cuda-5.0/include
/opt/cern/root/root_v5.34.01/include/TMap.h(134): warning: unrecognized GCC pragma

/opt/cern/root/root_v5.34.01/include/TMap.h(135): warning: unrecognized GCC pragma

/opt/cern/root/root_v5.34.01/include/TMap.h(176): warning: unrecognized GCC pragma

-- Generating temporary cmake readable file: /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/SINS_generated_SINS_core.cu.o.depend.tmp
/usr/bin/cmake -D input_file:FILEPATH=/data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/SINS_generated_SINS_core.cu.o.NVCC-depend -D output_file:FILEPATH=/data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/SINS_generated_SINS_core.cu.o.depend.tmp -P /usr/share/cmake-2.8/Modules/FindCUDA/make2cmake.cmake
/opt/cern/root/root_v5.34.01/include/TMap.h(134): warning: unrecognized GCC pragma

/opt/cern/root/root_v5.34.01/include/TMap.h(135): warning: unrecognized GCC pragma

/opt/cern/root/root_v5.34.01/include/TMap.h(176): warning: unrecognized GCC pragma

-- Copy if different /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/SINS_generated_SINS_core.cu.o.depend.tmp to /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/SINS_generated_SINS_core.cu.o.depend
/usr/bin/cmake -E copy_if_different /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/SINS_generated_SINS_core.cu.o.depend.tmp /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/SINS_generated_SINS_core.cu.o.depend
-- Removing /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/SINS_generated_SINS_core.cu.o.depend.tmp and /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/SINS_generated_SINS_core.cu.o.NVCC-depend
/usr/bin/cmake -E remove /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/SINS_generated_SINS_core.cu.o.depend.tmp /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/SINS_generated_SINS_core.cu.o.NVCC-depend
-- Generating /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/./SINS_generated_SINS_core.cu.o
/usr/local/cuda-5.0/bin/nvcc /data/pieges/fabian/SINS/code/SINS_core.cu -c -o /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/./SINS_generated_SINS_core.cu.o -m64 -DHAS_ROOT -DSINS_DO_ELECTRIC_FIELD -DSINS_DO_BUFFER_GAS -Xcompiler ,\"-g\" -arch=sm_20 --compiler-bindir=/usr/bin/g++ -DSINS_COMPUTE_ON_GPU -DNVCC -I/usr/local/cuda-5.0/include -I/usr/local/cuda-5.0/include/include -I/home/fabian/software/odeint -I/opt/cern/root/root_v5.34.01/include -I/data/pieges/fabian/SINS/code/src -I/data/pieges/fabian/SINS/code/include -I/usr/local/cuda-5.0/include
Generated /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_bufferGas.cu.o successfully.
Generated /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_constants.cu.o successfully.
Generated /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_IOManager.cu.o successfully.
Generated /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_statistics.cu.o successfully.
/opt/cern/root/root_v5.34.01/include/TMap.h(134): warning: unrecognized GCC pragma

/opt/cern/root/root_v5.34.01/include/TMap.h(135): warning: unrecognized GCC pragma

/opt/cern/root/root_v5.34.01/include/TMap.h(176): warning: unrecognized GCC pragma

/data/pieges/fabian/SINS/code/SINS_core.cu(316): warning: variable "collisionTable" is used before its value is set

/data/pieges/fabian/SINS/code/SINS_core.cu(215): warning: variable "dummy" was set but never used

/opt/cern/root/root_v5.34.01/include/TMap.h(134): warning: unrecognized GCC pragma

/opt/cern/root/root_v5.34.01/include/TMap.h(135): warning: unrecognized GCC pragma

/opt/cern/root/root_v5.34.01/include/TMap.h(176): warning: unrecognized GCC pragma

/data/pieges/fabian/SINS/code/SINS_core.cu(316): warning: variable "collisionTable" is used before its value is set

/data/pieges/fabian/SINS/code/SINS_core.cu(215): warning: variable "dummy" was set but never used

ptxas fatal   : Unresolved extern function '_ZN14SINS_bufferGas10doTheRobotERd'
-- Removing /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/./SINS_generated_SINS_core.cu.o
/usr/bin/cmake -E remove /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/./SINS_generated_SINS_core.cu.o
CMake Error at SINS_generated_SINS_core.cu.o.cmake:256 (message):
  Error generating file
  /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/./SINS_generated_SINS_core.cu.o

make[2]: *** [CMakeFiles/SINS.dir/code/./SINS_generated_SINS_core.cu.o] Erreur 1
make[2]: quittant le répertoire « /data/pieges/fabian/SINS/workdir »
make[1]: *** [CMakeFiles/SINS.dir/all] Erreur 2
make[1]: quittant le répertoire « /data/pieges/fabian/SINS/workdir »
make: *** [all] Erreur 2


Why isn't the following function selecting all the checkboxes inside this directive?

The following directive has two tabels: one with checkboxes and another without checkboxes. It also has a function which selects all the checkboxes:

  .directive('tableList', function() {
    return {
      restrict: 'EA',
      template: '<button ng-if="listAll" type="button" class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal">' +
      'Launch demo modal' +
    '</button>' +
    '<table class="table table-stripped">' +
    '<thead>' +
        '<th>SOME CODE</th>' +
      '</tr>' +
    '</thead>' +
    '<tbody>' +
      '<tr ng-repeat="item in listThis">' +
        '<th scope="row">{{$index + 1}}</th>' +
        '<td><a href="#/groups/{{item.id}}">{{item.name}}</a></td>' +
        '<td>SOME CODE</td>' +
      '</tr>' +
    '</tbody>' +
      '</table>' +
      '<div ng-if="listAll" class="" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">' +
    '<div class="modal-dialog">' +
      '<div class="modal-content">' +
        '<div class="modal-header">' +
          '<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>' +
          '<h4 class="modal-title">Modal title</h4>' +
        '</div>' +
        '<div class="modal-body">' +
          '<table class="table table-stripped list-all">' +
        '<thead>' +
          '<tr>' +
            '<th><input type="checkbox" ng-model="selectedAll" ng-click="checkAll()" /></th>' +
            '<th>SOME CODE</th>' +
          '</tr>' +
        '</thead>' +
        '<tbody>' +
          '<tr ng-repeat="item in listAll">' +
            '<th scope="row"><input type="checkbox" value="0" ng-model="item.selected"></th>' +
            '<td><a href="#/groups/{{item.id}}">{{item.name}}</a></td>' +
            '<td>SOME CODE</td>' +
          '</tr>' +
        '</tbody>' +
          '</table>' +
        '</div>' +
        '<div class="modal-footer">' +
          '<button type="button" class="btn btn-primary">Save changes</button>' +
        '</div>' +
      '</div><!-- /.modal-content -->' +
    '</div><!-- /.modal-dialog -->' +
      '</div><!-- /.modal -->',
      scope: {
    listThis: "=",
    listAll: "=",
    submit: "&"
      },
      controller: function() {
      },
      link: function(scope, elem, attr, ctrl) {
    scope.checkAll = function() {
      if (scope.selectedAll) {
        scope.selectedAll = true
      } else {
        scope.selectedAll = false
      }
      angular.forEach(scope.listAll, function (item) {
        item.selected = scope.selectedAll
      })
    }
      }
  };
})

The checkboxes work. This is how it looks like if I check the first item:

[
  {
    "id": "1",
    "name": "User 1",
    "selected": true
  },
  {
    "id": "2",
    "name": "User 2",
    "selected": false
  },
  {
    "id": "3",
    "name": "User 3",
    "selected": false
  }
]

But when I click the checkboxe that checks all the items nothing happens:

What could be the problem?

This is how I'm using the directive:

  <table-list
list-this="users"
list-all="users"
submit="submit(event)">
  </table-list>


why do i need EventQueue to start a new thread in java EDT? (JAVA)

Did I get it right? EDT is the main thread of GUI. To start a long operation, it's preferred to run it in new thread. So why do we need to use EventQueue for that? Why can't we simply create and run new thread just like in non-Swing programs?


Rails has_many, habtm SQL join not returning any results

I'm trying to get an array of customers who have purchase at least two items. The associations are pretty simple, but I'm just not getting any results in my test. Maybe another set of eyes can see what I'm missing.

# customer.rb
class Customer < Person
  has_many :orders, foreign_key: 'person_id'
  has_many :items, through: :orders

  # This is what I'm needing help with:
  def self.min_2_orders
    joins(:items).group('items_orders.item_id').having('COUNT(items_orders.item_id) >= ?', 2)
  end
end

-

# order.rb
class Order < ActiveRecord::Base
  belongs_to :customer, foreign_key: 'person_id'
  has_and_belongs_to_many :items
end

-

# item.rb
class Item < ActiveRecord::Base
    has_and_belongs_to_many :orders
end

-

# customer_spec.rb
it "finds customers who have ordered a min of 2 items" do
  @order1, @order2  = FactoryGirl.create_list(:order, 2) #returns 2 created orders

  @order2.items << FactoryGirl.create_list(:item, 2) #returns 2 created items

  @customer1  = @order2.customer
  @customer2  = @order1.customer

  ## Debug tests
    Order.count.should            == 2 #pass
    Customer.count.should         == 2 #pass
    Item.count.should             == 2 #pass
    @order_min.items.count.should == 2 #pass
    @customer1.items.count.should == 2 #pass

    puts Order.all.to_yaml    # debug. see below
    puts Customer.all.to_yaml # debug. see below
    puts Item.all.to_yaml     # debug. see below
  # End debugging

  # The final test
  Customer.min_2_orders.should == [@customer1]  # FAIL. returns []
end

Here are the debugging logs (the sql query, and the YAML db data):

"SELECT 'people'.* FROM 'people'
  INNER JOIN 'orders' ON 'orders'.'person_id' = 'people'.'id'
  INNER JOIN 'items_orders' ON 'items_orders'.'order_id' = 'orders'.'id'
  INNER JOIN 'items' ON 'items'.'id' = 'items_orders'.'item_id'
WHERE 'people'.'type' IN ('Customer')
  GROUP BY items_orders.item_id
  HAVING COUNT(items_orders.item_id) >= 2"

---
- !ruby/object:Order
  attributes:
    id: 1
    person_id: 1
    created_at: 2013-06-18 16:42:17.558683000 Z
    updated_at: 2013-09-17 16:42:17.597082000 Z
- !ruby/object:Order
  attributes:
    id: 2
    person_id: 2
    created_at: 2013-09-17 16:42:17.600267000 Z
    updated_at: 2013-09-17 16:42:17.600267000 Z
---
- !ruby/object:Customer
  attributes:
    id: 1
    first_name: Wes
    type: Customer
    created_at: 2013-09-17 16:42:17.565677000 Z
    updated_at: 2013-09-17 16:42:17.565677000 Z
- !ruby/object:Customer
  attributes:
    id: 2
    first_name: Wes
    type: Customer
    created_at: 2013-09-17 16:42:17.599013000 Z
    updated_at: 2013-09-17 16:42:17.599013000 Z
---
- !ruby/object:Item
  attributes:
    id: 1
    name: Product 1
    created_at: 2013-09-17 16:42:17.632347000 Z
    updated_at: 2013-09-17 16:42:17.632347000 Z
- !ruby/object:Item
  attributes:
    id: 2
    name: Product 2
    created_at: 2013-09-17 16:42:17.633920000 Z
    updated_at: 2013-09-17 16:42:17.633920000 Z


Adding a 0 in a Date variable

Im doing a report via Reporting Services. One of my textbox have an expression that is receving a parameter that is basically a string that contains a date for example '20110410' and I need to convert this string to date, add the / and place the day first,month,year.

This has been done already. But the thing is that I need to add a 0 after the day and month when these are below 10, so instead of having 1/4/2011 I want 01/04/2011.

I dont know how to use the Tag code so sorry in advance if the code is not showing properly.

=IIF(Parameters!Uperiodo.Value = "Día",
IIF(Day(FormatDateTime(
CDate(mid(Parameters!Desde.Value,5,2) & "/" & mid(Parameters!Desde.Value,1,4) & "/" & mid(Parameters!Desde.Value,7,2)),DateFormat.ShortDate))<10,
"0"+Day(FormatDateTime(
CDate(mid(Parameters!Desde.Value,5,2) & "/" & mid(Parameters!Desde.Value,1,4) & "/" & mid(Parameters!Desde.Value,7,2)),DateFormat.ShortDate)),
(Day(FormatDateTime(
CDate(mid(Parameters!Desde.Value,5,2) & "/" & mid(Parameters!Desde.Value,1,4) & "/" & mid(Parameters!Desde.Value,7,2)),DateFormat.ShortDate))))
& "/" &
Month(FormatDateTime(
CDate(mid(Parameters!Desde.Value,5,2) & "/" & mid(Parameters!Desde.Value,1,4) & "/" & mid(Parameters!Desde.Value,7,2)),DateFormat.ShortDate))
& "/" &
Year(FormatDateTime(
CDate(mid(Parameters!Desde.Value,5,2) & "/" & mid(Parameters!Desde.Value,1,4) & "/" & mid(Parameters!Desde.Value,7,2)),DateFormat.ShortDate))
,
Month(FormatDateTime(
CDate(mid(Parameters!Desde.Value,5,2) & "/" & mid(Parameters!Desde.Value,1,4) & "/" & mid(Parameters!Desde.Value,7,2)),DateFormat.ShortDate))
& "/" &
Year(FormatDateTime(
CDate(mid(Parameters!Desde.Value,5,2) & "/" & mid(Parameters!Desde.Value,1,4) & "/" & mid(Parameters!Desde.Value,7,2)),DateFormat.ShortDate))
)

Thanks!

EDIT: Sorry I did not explain why we do this. We need to do this as the server where the report needs to be downloaded have an english format (mm/dd/yyyy).

Best Regards,


Creating a segue for a TableViewController cell's detail accessory button

I'm trying to implement segueing from a tableview controller when the user taps the cell's accessory button.

I've searched on here and have some new things to try but I just wanted to ask whether in the storyboard you can actually create the segues from the accessory button, or whether you just need to create them from the tableviewcontroller.

It'll be within the accessoryButtonTappedForRowWithIndexPath that I'll want to act on the tap, but I see some answers on here say that you have to just go from the tableviewcontroller when creating your segues where as another answer said that the sender within prepare for segue would be set to the cell that contains your accessory view.

Whenever I try to ctrl drag from the accessory button in my prototype cell it just gets rid of the already existing on-selected segue I'd setup for that cell.

Just wanted to know for sure, what the best practice was before I started making all my detail accessory segues just go from the root TableViewController and passing through accessoryButtonTappedForRowWithIndexPath's indexPath (or it's row) as the sender to my prepareForSegue.

Cheers


Javascript sums total with addrow

First of all, sorry for my bad english language.

So, I want to sums my 2 coloumn, but i have add.row condition.
Here my code :

<script>
$(function(){
  $('.qty, .unit').on('blur', function(e){
    var qty = parseFloat( $('.qty').val() ),
        unit = parseFloat( $('.unit').val() );

    if( isNaN(qty) || isNaN(unit) ) {
      $('.result').text('');
      return false;
    }

    var total = qty * unit;
    $('.result').text( total );
  });
});
</script>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<td><input type="text" class="form-control qty" name="p_qty[]" /></td>
<td><input type="text" class="form-control unit" name="p_harga[]" /></td>
<td><strong><span class="result" name="p_jumlah[]"></span></strong></td>

here my screenshoot
Screenshoot

when im run, this code success but only in row 1 and not work in row 2++
how can i fix it?

Thank you so much.


Render Apostrophe of Twitter feed is not correct in IE

Check out this page using IE : http://search.twitter.com/search?q=%23testvoorklant
You will find out the apostrophe is rendered as & apos ;!

If I want to use these feeds in my website, how should I handle this problem?

Regards


JavaScript Pass Function Argument Out Along With Return Value

How do I pass out the function argument of an ajax get in Java Script along with the return value?

In the example below, I want to bring through the value of the GetServer function argument id and make it accessible to the function returnValue

function getServerList(id) {
        $.ajax({
            type: "GET",
            url: "/BackEndFunction/" + id,
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            success: returnValue
        });
}

function returnValue(Data) {
    var _size = 0;
    var id= id // passed from getserverlist
    for (var i = 0; i< Data.length; i++) {
        _size += Data[i]._size;
    }
    data_dictionary[id] = _size;
}


Is it possible to /manipulate/ functions as it is strings?

var myString = '';
myString += 'foo';
myString += 'bar';
myString = myString.replace(/oba/, 'qux');

console.log(myString) // produces "foquxr"

Is there any way to likewise tinker around with functions, like, say, turning function(a) { a += 'b'; return a; } info function(a) { a += 'b'; console.log(a); return a + 'c'; }?


How to display slide full screen image from SD card in Android

Need help!
I want to display images on full screen in Android and change by sliding.

When the application will run, it will load all images from SD card and direct display on the screen. and the user can change image by swipe.

I am following the tutorial but can't see the image since its very complex: click here

If someone please help me? You can download my code from here please: Dropbox


How to modify a function for different dim?

I have got a function which was used for his data dim(1000*1000).My data are the same but with different dim (500*1300).How Can I adapt the function to my dims?

 image.arr = array(dim = c(1000, 1000, 20)))
 interpolated.lst = vector(mode = "list", length = 1000)
 system.time(
 {
    for(i in 1:1200){
        interpolated.lst[[i]] =
            apply(image.arr[i, , ], 1,
                  FUN = function(x){
                      imageSpline(x = dates, y = x, xout = 1:365)$y
                  }
                  )
    }
}
)


asp.net core can't get xml data from url

I'm using Amazon API to generate request for ItemLookup. After signing the request I got a url:

http://webservices.amazon.com/onca/xml?AWSAccessKeyId=[AccessKey]&AssociateTag=[AssociateTag]&ItemId=B06XBCY6DW&Operation=ItemLookup&ResponseGroup=Images%2CItemAttributes%2COffers%2CReviews&Service=AWSECommerceService&Timestamp=2050-02-13T12:00:00Z&Version=2016-02-12&Signature=[Signature]

Which I use in browser and I can see nice xml with item's data, but When I try to get that data with c# I get error

The Uri parameter must be a file system relative or absolute path.

The method I'm using to get data is:

var itemXml = XElement.Load(url);

How can I get that xml in c#??


How do I overload `__eq__` to compare pandas DataFrames and Series?

For clarity I will extract an excerpt from my code and use general names.  I have a class Foo() that stores a DataFrame to an attribute.

import pandas as pd
import pandas.util.testing as pdt

class Foo():

    def __init__(self, bar):
        self.bar = bar                                     # dict of dicts
        self.df = pd.DataFrame(bar)                        # pandas object

    def __eq__(self, other):
        if isinstance(other, self.__class__):
            return self.__dict__ == other.__dict__
        return NotImplemented

    def __ne__(self, other):
        result = self.__eq__(other)
        if result is NotImplemented:
            return result
        return not result

However, when I try to compare two instances of Foo, I get an excepetion related to the ambiguity of comparing two DataFrames (the comparison should work fine without the 'df' key in Foo.__dict__).

d1 = {'A' : pd.Series([1, 2], index=['a', 'b']),
      'B' : pd.Series([1, 2], index=['a', 'b'])}
d2 = d1.copy()

foo1 = Foo(d1)
foo2 = Foo(d2)

foo1.bar                                                   # dict
foo1.df                                                    # pandas DataFrame

foo1 == foo2                                               # ValueError

[Out] ValueError: The truth value of a DataFrame is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().

Fortunately, pandas has utility functions for asserting whether two DataFrames or Series are true.  I'd like to use this function's comparison operation if possible.

pdt.assert_frame_equal(pd.DataFrame(d1), pd.DataFrame(d2)) # no raises

There are a few options to resolve the comparison of two Foo instances:

compare a copy of __dict__, where new_dict lacks the df key

delete the df key from __dict__ (not ideal)

don't compare __dict__, but only parts of it contained in a tuple

overload the __eq__ to facilitate pandas DataFrame comparisons

The last option seems the most robust in the long-run, but I am not sure of the best approach. In the end, I would like to refactor __eq__ to compare all items from Foo.__dict__, including DataFrames (and Series).  Any ideas on how to accomplish this?


How to redirect with htaccess to https while adding a language paramterer

I have two domains example.com and example.de. Bot are pointing to the same server with the same website.
If somebody is opening the site he should be redirected to use https://example.com regardless of the queried domain.

Until now I'm using the following htacces code:

RewriteEngine On
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} !^example\.com$ [NC]
RewriteRule ^(.*) https://example.com/$1 [R=301,NE,L]

But now I want that everybody who was initially querying example.com is "redirected" to use the language parameter ?l=2 and everybode who opened example.de to use ?l=1.

It would be great if anybody knows how to combine that with https.


passport js authentication not working between node front end and backend server

I have 2 different express servers, one for front end serving react js files and another backend server.

Frontend server runs on the port:3003, backend server runs on the port:8000.

When i am firing a request from frontend server for login using Local Strategy, it returns me the user details but for further requests i have to login again.

This is not the case when i have both frontend and backend code running on in same server.

Similarly Facebook and Google Login Doesn't work.

Is it not supported to have different servers for frontend backend in passportJS?

Can some please suggest how to make it work


Storing multiple selected cells of type string from a datagridview to a list

I am working on a C# windows application where I have a DataGridView some some data on it.
Now, I am trying to select multiple cells and want to access the values in the selected cells and store them in a list. I was able to store one cell in a variable but not sure I can get multiple cell values to a list

I used the following lines to store cell value in a variable

 string product = dataGridViewIndex.CurrentCell.Value.ToString();

May I know a way to solve this?


Enable monitoring mode for RTL8188CUS via USB on Raspbian

I am trying to enable monitoring mode for a USB wifi dongle with the RTL8188CUS chipset on a raspberry pi model b+ (or any raspberry pi for that matter).

$ lsusb
Bus 001 Device 005: ID 0bda:8176 Realtek Semiconductor Corp. RTL8188CUS 802.11n WLAN Adapter
$ sudo iwconfig wlan0 mode monitor
Error for wireless request "Set Mode" (8B06) :
    SET failed on device wlan0 ; Invalid argument.

According to github/raspberrypi/linux/issues/369, you need to enable the rtlwifi/rtl8192cu kernel module that is included with the kernel distribution but not compiled.  This requires minor modifications to some files as diff'ed below in 'STEP 2'.

The USB issue mentioned in that thread has been resolved as of 4.1.6+, so the rtlwifi driver should work.

Steps to recreate on a fresh raspberry pi (model B+)...

STEP 0: Update existing modules and kernel to latest

$ sudo apt-get update
$ sudo rpi-update
$ uname -a
Linux raspberrypi 4.1.7+ #815 PREEMPT Thu Sep 17 17:59:24 BST 2015 armv6l GNU/Linux

STEP 1:  Get the raspbian kernel source and add missing dependencies

$ git clone --depth=1 https://github.com/raspberrypi/linux
$ sudo apt-get install bc lshw

STEP 2:  Enable the rtlwifi (kernel) drivers for RTL8188CUS (RTL8192)

edit linux/drivers/net/wireless/Kconfig
-#source "drivers/net/wireless/rtlwifi/Kconfig"
-source "drivers/net/wireless/rtl8192cu/Kconfig"
+source "drivers/net/wireless/rtlwifi/Kconfig"
+#source "drivers/net/wireless/rtl8192cu/Kconfig"

(Wheezy) edit linux/drivers/net/wireless/Makefile
-#obj-$(CONFIG_RTLWIFI)         += rtlwifi/
+obj-$(CONFIG_RTLWIFI)          += rtlwifi/

(Jessie) edit linux/drivers/net/wireless/realtek/Makefile
-#obj-$(CONFIG_RTLWIFI)         += rtlwifi/
+obj-$(CONFIG_RTLWIFI)          += rtlwifi/

STEP 3: Compile and install kernel (took many hours)

Summarized from kernel building documentation .

$ cd linux
$ KERNEL=kernel
$ make bcmrpi_defconfig

$ make zImage modules dtbs
$ sudo make modules_install
$ sudo cp arch/arm/boot/dts/*.dtb /boot/
$ sudo cp arch/arm/boot/dts/overlays/*.dtb* /boot/overlays/
$ sudo cp arch/arm/boot/dts/overlays/README /boot/overlays/
$ sudo scripts/mkknlimg arch/arm/boot/zImage /boot/$KERNEL.img

STEP 4: Reboot

$ sudo reboot

STEP 5: Check that the rtlwifi/rtl8192cu module is loaded

$ lsmod | fgrep rtl8192cu
rtl8192cu             100806  0
rtl_usb                14781  1 rtl8192cu
rtl8192c_common        72091  1 rtl8192cu
rtlwifi               101122  3 rtl_usb,rtl8192c_common,rtl8192cu
mac80211              623281  3 rtl_usb,rtlwifi,rtl8192cu
$
$ lshw
  *-network:0
       description: Ethernet interface
       physical id: 1
       bus info: usb@1:1.3
       logical name: wlan0
       serial: 00:0b:81:94:e9:a3
       capabilities: ethernet physical
       configuration: broadcast=yes driver=rtl8192cu driverversion=4.1.7+ firmware=N/A link=no multicast=yes

STEP 6: Try to activate monitoring mode

$ sudo iwconfig wlan0 mode monitor
Error for wireless request "Set Mode" (8B06) :
    SET failed on device wlan0 ; Operation not supported.

What did i miss?

Issue 369 seems to indicate that it can work with the rtlwifi driver?


Java - Trying to generate factorials

I'm making a calculator, and am adding a few more complicated buttons. The one I can't get my head around is factorial. I know what it is, but can't seem to make it. When I look at other people's questions, the code - for me anyway - doesn't work (Btw this is not a homework question). Here is the bit of code around where the algorithm (is that the word for it?) for the factorial:

} else if (oper.equals("shriek")) {

                resultm.setText("" + answer);
                resultl.setText("");
                resultr.setText("");
                oper = "";
                currentNuml = "";
                currentNumr = "";
            }

NB: The gap between

} else if (oper.equals("shriek")) {

and

resultm.setText("" + answer);

is where the algorithm would go.
Thanks, any help would be appreciated!


When reading CSV with `pd.read_csv`, the decimal places change (Pandas)

excel = pd.read_csv("EH_damages.csv")

Hello!
I used the above code to read a csv file into python. However 0.289798953 in original excel changed to 0.289799. Even when I saved the number to text mode in the excel, python still read it as float and the number has fewer digits like 0.289799.

What is wrong with my code? THANKS!!


Can a Wordpress plugin (Blogroll) work on a non-Wordpress webpage?

Specifically, we would like to have a Blogroll plugin on the Wordpress page, but have that also appear on a website. So when we update info in the Blogroll, that automatically appears on the website too.  Both the website and Wordpress are on the same server.  Would there be a specific Blogroll plugin that would do this, or is it generally possible with plugins?


How can I 301 Redirect and Change Url with .htaccess?

I just discovered that I have some duplicate pages that I need to remove but some pages that should not exist are indexed and generating small amounts of traffic.  I want to redirect those urls to the original ones.

http://www.example.com/buy-something.php

to

http://www.example.com/something.php

I basically need to remove the "buy-" in the urls and make sure the page is redirected to the proper page.  Here is what I have so far:

#301 Redirect buy- to none
RewriteRule ^([a-zA-Z\.]+).php$  /buy-$1.php  [L,R=301]

But this does nothing to the pages that should be redirected and adds a loop of buy-buy-buy-buy-buy-buy- to other pages and causes them to time out.  I have tried a few other variations but to no prevail.

Your help is greatly appreciated.


How do I read the last line in the console output?

So im trying to make a Java program that uses adb and fastboot to root my Nexus 6P. I have a class that can run the commands, but I need to capture the device ID from the output. when I run adb or fastboot the output either looks like one of the three options below

List of devices attached
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
5VT7N16324000434          device

or

List of devices attached
5VT7N16324000434          device

or

5VT7N16324000434          device

Now I need to capture the 5VT7N16324000434 and save it to a string. Though it will not always be the same. I have searched for hours with nothing helpful, and have no idea where to even start.

I run adb with this class

import java.io.BufferedReader;
import java.io.InputStreamReader;

public class ExecuteShellCommand {

public static void main(String inputCommand) {

    ExecuteShellCommand obj = new ExecuteShellCommand();

    String command = inputCommand;

    String output = obj.executeCommand(command);

    System.out.println(output);

}

private String executeCommand(String command) {

    StringBuffer output = new StringBuffer();

    Process p;
    try {
        p = Runtime.getRuntime().exec(command);
        p.waitFor();
        BufferedReader reader =
                new BufferedReader(new InputStreamReader(p.getInputStream()));

        String line = "";
        while ((line = reader.readLine())!= null) {
            output.append(line + "\n");
        }

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

    return output.toString();

}

}

I then need to read the out put for 5VT7N16324000434 or any string that could be in that place.


Unable to connect to Web Developers built in web server

When I yesterday returned to Visual Web Developer I was no longer able to run/debug my projects. Clicking the green play button launches ASP.NET Development Server (and it shows up in the systray) but the browser only shows the error message "Firefox is not able to connect to localhost:58127" (translated from Swedish). IE7 says "Cannot show web page".

I cannot figure out why this happens. It worked a couple of weeks back. Could there be a Windows setting that mess things up? (I've tried to disable the firewall without any change.)


ExtJS 6 gridStore.model.setFields not a function

I used to work with ExtJS 4.2 and I used to work using:

gridStore.model.setFields(...);

Now in ExtJS 6 I tried to used that and I get:

Any clue on what can I use now?


Drawing lines in part of a UIViewController

Drawing in a UIView works but it uses the entire screen. I have a UIViewController with a lot of text and results being displayed. I want to add draw some lines showing the tilt and roll angle of a a ship.I could do this with some CGAffineTransform rotate but would prefer not to.

What I have not worked out is how to implement CG components in a UIViewController where it is only addressing part of the screen.

Is this allowed?


Limiting a Lua script's memory usage?

I've seen it said multiple times that there is no way to limit a Lua script's memory usage, including people jumping through hoops to prevent Lua scripts from creating functions and tables. But given that lua_newstate allows you to pass a custom allocator, couldn't one just use that to limit memory consumption? At worst, one could use an arena-based allocator and put a hard limit even on the amount of memory that could be used by fragmentation.

Am I missing something here?


Most efficent way of determing if a value is in a table

I often run into the situation where I want to determine if a value is in a table. Queries often happen often in a short time period and with similar values being searched therefore I want to do this the most efficient way. What I have now is

if($statment = mysqli_prepare($link, 'SELECT name FROM inventory WHERE name = ? LIMIT 1'))//name and inventory are arbitrarily chosen for this example
{
    mysqli_stmt_bind_param($statement, 's', $_POST['check']);
    mysqli_stmt_execute($statement);
    mysqli_stmt_bind_result($statement, $result);
    mysqli_stmt_store_result($statement);//needed for mysqli_stmt_num_rows
    mysqli_stmt_fetch($statement);
}
if(mysqli_stmt_num_rows($statement) == 0)
        //value in table
else
        //value not in table

Is it necessary to call all the mysqli_stmt_* functions? As discussed in this question for mysqli_stmt_num_rows() to work the entire result set must be downloaded from the database server. I'm worried this is a waste and takes too long as I know there is 1 or 0 rows. Would it be more efficient to use the SQL count() function and not bother with the mysqli_stmt_store_result()? Any other ideas?

I noticed the prepared statement manual says "A prepared statement or a parametrized statement is used to execute the same statement repeatedly with high efficiency". What is highly efficient about it and what does it mean same statement? For example if two separate prepared statements evaluated to be the same would it still be more efficient?

By the way I'm using MySQL but didn't want to add the tag as a solution may be non-MySQL specific.


What is a lightweight CMS plugin with web interface?

I have an ASP.NET website with several standard pages like an About page, FAQ pages, Contact Info pages, etc. I would like to make the content on those pages easily editable by a few users through a backend web interface. The editor does not need to be fancy, or WYSIWYG, in fact I would prefer it use some sort of wiki markup, as long as there is a web interface which can be setup on a subdomain of the website. I don't have a preference as to how the content is stored, I can go for an XML or a SQL Server store. I would like to be able to place a control on the part of the page that needs the editable content, and not integrate the rest of the page with the CMS. I don't need extensive workflow functions, maybe just edit logging with the user who made the edit.


Trouble passing the graphics class

I have a very simple Game Engine that I am trying to set up and I am clueless as to why it is throwing an exception but I'm not very experienced so I understand I'm probably doing something wrong.

I want to draw directly to a JFrame with a buffer strategy using the Graphics class. Everything works until I try to pass the Graphics g in to another class and then I get a thread error. Here is what I have:

import java.awt.Dimension;
import java.awt.Toolkit;
import javax.swing.JFrame;

@SuppressWarnings("serial")
public class GameFrame extends JFrame implements Runnable {

    public static final int WIDTH = 1280;
    public static final int HEIGHT = WIDTH * 9 / 16;
    private final int FPS = 60;

    private Thread thread;
    private long lastTime;

    private Game game;

    public GameFrame() {
        game = new Game(this);
        setLocation((int) ((Toolkit.getDefaultToolkit().getScreenSize().getWidth() - WIDTH) / 2), (int) ((Toolkit.getDefaultToolkit().getScreenSize().getHeight() - HEIGHT) / 2));
        setSize(new Dimension(WIDTH, HEIGHT));
        setResizable(false);
        thread = new Thread(this);
        setVisible(true);
        createBufferStrategy(3);
        setDefaultCloseOperation(EXIT_ON_CLOSE);
        thread.start();
    }

    public void run() {
        lastTime = System.currentTimeMillis();

        while (true) {
            long time = System.currentTimeMillis();
            if ((time - lastTime) * FPS > 1000) {
                lastTime = time;
                tick();
                draw();
                getBufferStrategy().show();
            }
        }
    }

    private void tick() {
        game.tick();
    }

    private void draw() {
        game.draw();
    }

    public static void main(String[] args) {
        new GameFrame();
    }

}

and

import java.awt.Graphics2D;

public class Game {

    private GameFrame frame;
    private Map map;

    public Game(GameFrame frame) {
        this.frame = frame;
    }

    public void tick() {

    }

    public void draw() {
        Graphics2D g = (Graphics2D) frame.getBufferStrategy().getDrawGraphics();
        g.fillRect(0, 0, 50, 50);
        map.draw(g);
        g.dispose();
    }

}

The rectangle from the draw method inside of Game will work but if I pass g to my Map class (which will be drawing the same thing) it causes a thread NullPointerException.

Thanks so much in advance for any help with this or any additional comments you can provide!


Multiple Infinite While Loops

When given this snippet of code:

while(true){
 ...
}

How many times can this be asynchronously performed?

I've written this to test and how it interacts with Google's JavaScript V8 Engine and only one while loop is active at a time.

var cycles = 0;
var counter = new Date();
var OpsStore = [];
var threads = [];

for(var i = 0; i < 10; i++){
  setTimeout(newThread(i),0);
}
function renew(){
    if (secondPassed(counter, new Date())){
        counter = new Date();
        Ops();
    }
    cycles++;
}

function newThread(id){
    threads.push({id: id, active: true});
    return function(){
        while(true){
            console.log(id);
            threads[id].active = true;
            renew();
        }
    }
}

function Ops(){
    OpsStore.push(cycles);
    console.log(cycles, ' avg: ', getAvgOps());
    console.log(threads);
    cycles = 0;
    for(var i = 0; i < threads.length; i++){
        threads[i].active = false;
    }
}

function secondPassed(d1, d2){
    return ((d2 - d1) >= 1000);
}

function getAvgOps(){
    var sum = 0;
    for (var i = 0; i < OpsStore.length; i++){
        sum += OpsStore[i];
    }
    return sum / OpsStore.length;
}

Result:

4147371 ' avg: ' 4147371
[ { id: 0, active: true },
  { id: 1, active: true },
  { id: 2, active: true },
  { id: 3, active: true },
  { id: 4, active: true },
  { id: 5, active: true },
  { id: 6, active: true },
  { id: 7, active: true },
  { id: 8, active: true },
  { id: 9, active: true } ]
4071504 ' avg: ' 4109437.5
[ { id: 0, active: true },
  { id: 1, active: false },
  { id: 2, active: false },
  { id: 3, active: false },
  { id: 4, active: false },
  { id: 5, active: false },
  { id: 6, active: false },
  { id: 7, active: false },
  { id: 8, active: false },
  { id: 9, active: false } ]

For educational purposes, is it possible to have more than ONE while loop constantly iterating in JavaScript?


Rendering in looping using django

The goal is rendering data to html using django every 5 second, but the problem is the looping does not working. This is the code:

view.py

def form(request):
try:
    file_name = request.FILES['files'].name
    nama = "uploads/" + file_name
    seq_act, num_obsv, observer, list_obsv = pr.readexcel(nama,0)
    p, A, B = pr.make_initial(observer,num_obsv)
    p_lampau, A_lampau, B_lampau = pr.baum_welch(p, A, B, seq_act)

    while True:
        if len(temp)==0:
            break
        seq_act_test = list(temp)
        temp[:] = []

        real_seq, repair_seq = pr.process(p_lampau, A_lampau, B_lampau,
                                          seq_act_test, observer_test,
                                          num_obsv)
        return render(request,'main/form2.html',{'real_seq' : real_seq,
                                                 'repair_seq': repair_seq})
        time.sleep(5)

except:
    return redirect('/main/awal')

form2.html

<html>
<head>
    {% load staticfiles %}
    <link rel="stylesheet" type="text/css" href="{% static 'main/vis.css' %}" />
    <script type="text/javascript" src="{% static 'main/vis.js' %}"></script>
    <link href="{% static 'main/css/prism.css' %}" rel="stylesheet">
    <link href="{% static 'main/css/ghpages-materialize.css' %}" type="text/css" rel="stylesheet" media="screen,projection">
    <link href="http://fonts.googleapis.com/css?family=Inconsolata" rel="stylesheet" type="text/css">
    <link href="http://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
    <style type="text/css">
        #mynetwork {
            width: 100%;
            height: 600px;
            border: 1px solid lightgray;
        }
    </style>
</head>
</html>
<body>
    <div>
    <center>
        <b> {{ real_seq }}<br>
        <b>{{ repair_seq }}
    </center>
    </div>
</body>

Thanks for everybody who looking and helping to solve the problem.


ORMLite Android and ForeignCollection the bind value at index 1 is null

I have a problems with organizing many-to-many relations with ORMLite, which I cannot overcome. I have a users and want to establish friendship relations between them, so I user the following code:
I have class User.java:

public class User {

    @DatabaseField(id = true, columnName = "_id")
    public long id;
    @ForeignCollectionField(columnName = COLUMN_FRIENDS, foreignFieldName = "user")
    public ForeignCollection<UserFriendship> friends;
}

Then I try to build many-to-many relations between users with UserFriendship

@DatabaseTable
public class UserFriendship {
    public static final String USER_1_FIELD_NAME = "user";
    public static final String USER_2_FIELD_NAME = "friend";
    @DatabaseField(columnName = USER_1_FIELD_NAME, foreign = true, uniqueCombo = true)
    public  User        user;
    public  User friend;
    @DatabaseField(columnName = BaseColumns._ID, generatedId = true)
    private long        id;
}

I have created a simple test to check everything is OK:

public testUserFriendship() {
        User user = weClient.getEntityFactory().createUser();
        user.id = 101;
        user.nickName = "user";
        User friend = weClient.getEntityFactory().createUser();
        friend.id = 102;
        friend.nickName = "user2";

        user.friends.add(new UserFriendship(user, friend));
        dao.getUserDAO().createOrUpdate(user);
        dao.getUserDAO().createOrUpdate(friend);

        User user2;
        user2 = dao.getUserDAO().queryForId(user.id);

        assertEquals(user.friends.size(), user2.friends.size());
}

The test return the error and here is a backtrace:

java.lang.IllegalArgumentException: the bind value at index 1 is null
09-25 10:39:26.509    8101-8114/? W/System.err﹕ at android.database.sqlite.SQLiteProgram.bindString(SQLiteProgram.java:164)
09-25 10:39:26.509    8101-8114/? W/System.err﹕ at android.database.sqlite.SQLiteProgram.bindAllArgsAsStrings(SQLiteProgram.java:200)
09-25 10:39:26.509    8101-8114/? W/System.err﹕ at android.database.sqlite.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDriver.java:47)
09-25 10:39:26.509    8101-8114/? W/System.err﹕ at android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1314)
09-25 10:39:26.509    8101-8114/? W/System.err﹕ at android.database.sqlite.SQLiteDatabase.rawQuery(SQLiteDatabase.java:1253)
09-25 10:39:26.509    8101-8114/? W/System.err﹕ at com.j256.ormlite.android.compat.JellyBeanApiCompatibility.rawQuery(JellyBeanApiCompatibility.java:21)
09-25 10:39:26.509    8101-8114/? W/System.err﹕ at com.j256.ormlite.android.AndroidCompiledStatement.getCursor(AndroidCompiledStatement.java:180)
09-25 10:39:26.509    8101-8114/? W/System.err﹕ at com.j256.ormlite.android.AndroidCompiledStatement.runQuery(AndroidCompiledStatement.java:65)
09-25 10:39:26.509    8101-8114/? W/System.err﹕ at com.j256.ormlite.stmt.SelectIterator.<init>(SelectIterator.java:55)
09-25 10:39:26.509    8101-8114/? W/System.err﹕ at com.j256.ormlite.stmt.StatementExecutor.buildIterator(StatementExecutor.java:247)
09-25 10:39:26.509    8101-8114/? W/System.err﹕ at com.j256.ormlite.dao.BaseDaoImpl.createIterator(BaseDaoImpl.java:964)
09-25 10:39:26.509    8101-8114/? W/System.err﹕ at com.j256.ormlite.dao.BaseDaoImpl.iterator(BaseDaoImpl.java:533)
09-25 10:39:26.509    8101-8114/? W/System.err﹕ at com.j256.ormlite.dao.LazyForeignCollection.seperateIteratorThrow(LazyForeignCollection.java:313)
09-25 10:39:26.509    8101-8114/? W/System.err﹕ at com.j256.ormlite.dao.LazyForeignCollection.iteratorThrow(LazyForeignCollection.java:71)
09-25 10:39:26.509    8101-8114/? W/System.err﹕ at com.j256.ormlite.dao.LazyForeignCollection.closeableIterator(LazyForeignCollection.java:60)
09-25 10:39:26.509    8101-8114/? W/System.err﹕ at com.j256.ormlite.dao.LazyForeignCollection.iterator(LazyForeignCollection.java:47)
09-25 10:39:26.509    8101-8114/? W/System.err﹕ at com.j256.ormlite.dao.LazyForeignCollection.size(LazyForeignCollection.java:106)
09-25 10:39:26.509    8101-8114/? W/System.err﹕ at co.wecommunicate.test.ORMTest.testUserFriendship(ORMTest.java:179)enter code here

Data from tables show no problems:

sqlite> select * from user;
|user|0|101|0.0|0.0|0|0|0|0
|user2|0|102|0.0|0.0|0|0|0|0
sqlite> select * from userfriendship;
102|101|1

When I started debugging the library, I found that


C# Problem with a List Displaying in a Textbox

I have a small application that has several checkboxes, a submit button, and a textbox. I want the user to be able to check what they want, click the submit button, and have the results display in the textbox. The application runs but instead of the values displaying I get "System.Collections.Generic.List`1[System.String]" displayed in the textbox. I am very new to this and would appreciate any help. My code is as follows...

namespace MY_App
{

public partial class Form1 : Form
{

    public Form1()
    {
        InitializeComponent();
    }

    List<string> ls = new List<string>();

    private void Checkbox1_CheckedChanged(object sender, EventArgs e)
    {
                ls.Add( "P.C. ");
    }

    private void Checkbox2_CheckedChanged(object sender, EventArgs e)
    {
            ls.Add( "WYSE Terminal" );
    }

    private void Checkbox3_CheckedChanged(object sender, EventArgs e)
    {

        ls.Add("Dual Monitors ");
    }

    private void button1_Click(object sender, EventArgs e)
    {
        string line = string.Join(",", ls.ToString());
        textBoxTEST.Text = line;

    }

    private void textBoxTEST_TextChanged(object sender, EventArgs e)
    {

    }


OpenCV - Distance for each pixel

This is the flow of creation of Disparity map:

Take pictures of stereo camera.

Correct distortion based on calibration information and collimate (initUndistortRectifyMap, remap).

Create a disparity map (stereoBM or stereoSGBM).

Calculate the distance map (reprojectImageTo3D).

I would like to assign a distance for each pixel of the left image of step 1, but am unsure how to do this.

Can you do this after step 4?

Is it possible to create a disparity map for the left image in Step 3?

Or is there a better way to do it?


matrix inside data.frame in R or other nested structure

I need to construct a data structure in R containing a matrix (or data.frame) for each observation. Ideally, it would be a matrix inside a data.frame. So far, I can only think of nested lists, to achieve it, but then I am afraid to have poor performance.

Example

For example, for the data.frame element

df <- data.frame(start=c("A", "B", "C"), end=c("A", "B", "C"))

I would like to add a column containing a matrix in each cell (resulting from the distance function). For example for element start=="A", end=="B" it could be the matrix (or data.frame)

haversineStart haversineEnd tripLengthDiff startCountry endCountry truckDiff
160.5408     308.1947        198.745            1          1         1
152.4168     308.1947         20.710            1          1         1
273.7599    2228.3508       2903.212            0          1         1

Theoretically, it would just be some kind of 3d data structure. In Python, it would be list of lists containing a NumPy-array. Is something like that possible in R?

Background

I want to perform knn with a custom distance function and I need to normalize the distances before performing the knn


ggsn global map scale bar looks wrong

I need to add a scale bar to a global map made in ggplot2 in R, and the easiest way seemed to be via the ggsn package.

But the scale bar doesn't look right when I eyeball the map - e.g., it's ~4000km across Australia E-W, and a bit less than that across Africa at the equator. The 2000km scale bar looks wider than Africa at the equator and almost as wide as Australia.

Thanks for your thoughts!

Reproducible code:

library(ggplot2)
library(ggsn)
library(dplyr)

GG.GlobalMap = map_data("world") %>%
  filter(region != "Antarctica")

ggplot(GG.GlobalMap, aes(long, lat, group = group)) +
  geom_path(color = "black") +
  scalebar(data = GG.GlobalMap, dist = 1000, dd2km = TRUE, model = "WGS84",
           st.size = 3, location = "bottomright") +
  theme_void()


After reverting to Windows 7, Visual Studio and IIS were broken

It's taken me two days of debugging to fix this, so I thought I would share it with anyone having the same problem.

I decided to upgrade my Win7 Pro development system to Win 10, and discovered that various important stuff didn't work, so decided to revert back to Win 7 Pro.  Most stuff started working again, but Visual Studio 2013 Ultimate could not debug web applications.  I didn't save the exact error message but it came from global.asax and was something like "Parser error message: Cannot load type 'myclass.MvcApplication'"  It was basically the same for Forms projects.

I rebuilt the project, tried various fixes that I found here and other places like moving to /bin, but nothing worked.  Fortunately I have another system with VS, and by sharing the disk was able to create a working project on that disk with the other system, and then see it fail with my development system, so I knew that the compile and code was ok.  Then I tried running just with IIS, no VS, and when it failed too that told me that it wasn't really VS, it was deeper.