Tuesday, 10 September 2013

Eclipse java - how to add full line with double quotes

Eclipse java - how to add full line with double quotes

I'm programming in Eclipse and i have a SQL script that got multiple lines:
SELECT * FROM
.... (bla bla)
... (bla bla )..
... (bla bla bla bla)
I have to add the double quotes like this:
" SELECT * FROM "
+ ".... (bla bla) "
+ "... (bla bla ).."
+ "... (bla bla bla bla) "
Is there any SHORTCUT to do this in Eclipse?

How to export 0.5 million rows to excel/csv (performance issue)?

How to export 0.5 million rows to excel/csv (performance issue)?

Currently we are using NPOI for exporting some large data to
excel(environment--asp.net mvc-4.0 ). Its taking us around a minute to
export 30000 rows to excel. Now the requirement has changed and we want
500000 which is more then 10 times the current rows. NPOI serializer has
some limitations which is having drastic performance
issue..http://npoi.codeplex.com/discussions/443655 ...So after trying lot
of alternatives we decided that we will export this huge chunk of data to
csv file. Before starting with this code change I wanted to get an expert
opinion on how to handle this scenario where you have to deal with such a
massive number of rows export... Is exporting to CSV a better option???
Can any one point out a code sample or an article that has a solution to
data export to csv/excel for more the 0.5 million rows within a 1 min
timeframe..

Wordpress menu CSS Classes is not working

Wordpress menu CSS Classes is not working

I want to change the color of one of the tabs of the menu bar in Wordpress
using menu CSS Classes, I added the class name in my style file, but when
I add the class name in the CSS Classes in the Admin->Menu page it's not
working. that's the class name in the style file it's very simple.
.red{
color: #ff0000;
}

curve fitting using multiple starting points for every variable

curve fitting using multiple starting points for every variable

Given a random parametric function with n parameters used to fit
datapoints. You define you're parametric function by heigthmodel You're n
startingvalues are defined as initial values For the fitting you use
lsqcurvefit(heigthmodel,initialvalues,...
Is there a way you can give more then one startingvalue for every
parameter. So that you add another string of startingvalues and the model
will start from both startingvalues and will return the best result?
I've already setup something like this:
Heightmodel = ....
Startingvalues = a1 a2 a3 a4 a5
Startingvalues = b1 b2 b3 b4 b5
options=optimoptions(numberofvariables,2) % based on the TypicalX function.
lsqcurvefit(heightmodel,startingvalues,...,options)
It would be interesting to know if I could make this work and if so if I
could add more startingvalues. So I will have p strings of startingvalues
and numberofvariables,p
Also is there a way to present these startingvalues in a matrix form? So
that for the first variable the fitting can choose to start from both a1
or b1, for the second variable from both a2 or b2? ...
Greetings

Displaying value only once

Displaying value only once

I am new to jquery and js. I have this simple thing trying to achieve but
is not working.
Basically I am getting a collection of records and for age I want it to
display only once..
<tr>

<td>
</tr>
This works fine, but it displays value of age multiple times because of
#each. I tried to remove #each etc. nothing works. Please help. Thanks

Monday, 9 September 2013

Hide a folder from file sharing

Hide a folder from file sharing

I have an app that is link with pdf documents. If the user open a pdf
document in a browser, my app will be listed in the Open in... menu. This
file is downloaded automatically in a folder called Inbox, which I didn't
create, located in the Documents directory. However, I don't want this
folder to appear in iTunes when file sharing is enabled. I don't want to
allow the user to delete or modify neither the folder nor its contents.
Is there any way I can change the properties of this folder to hide it
from iTunes?

item cannot be resolved or is not a field--Android Phone App Developing

item cannot be resolved or is not a field--Android Phone App Developing

I am trying to follow a manual (which had some bugs and I fixed it)
however I am receiving this error btstart cannot be resolved or is not a
field and I don't know how to fix it. Here's the LINK to that manual (but
I have done changes in layout as well as string xml files) Here is the
MainActivity.java code :
package com.example.stopwatch;
import com.example.stopwatch.R;
import android.app.Activity;
import android.os.Bundle;
import android.os.SystemClock;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.Chronometer;
public class MainActivity extends Activity implements OnClickListener {
private Button start;
private Button stop;
private Button reset;
private Chronometer mydChronometer;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
uI();
}
public void uI() {
start = (Button) findViewById(R.id.btstart);
start.setOnClickListener(this);
stop = (Button) findViewById(R.id.btstop);
stop.setOnClickListener(this);
reset = (Button) findViewById(R.id.btreset);
reset.setOnClickListener(this);
mydChronometer = (Chronometer) findViewById(R.id.chronometer1);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is
present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
@Override
public void onClick(View v) {
if (v == start) {
mydChronometer.start();
} else if (v == stop) {
mydChronometer.stop();
} else if (v== reset) {
mydChronometer.setBase(SystemClock.elapsedRealtime());
}
}
}
Here comes my "activity_main.xml" :
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".MainActivity" >
<ImageView
android:id="@+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/chronometer1"
android:layout_centerHorizontal="true"
android:layout_marginTop="67dp"
android:src="@drawable/myd" />
<Chronometer
android:id="@+id/chronometer1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="28dp"
android:gravity="center"
android:text="Chronometer"
android:textSize="35dp" />
<Button
android:id="@+id/btstart"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/imageView1"
android:layout_below="@+id/chronometer1"
android:layout_marginTop="18dp"
android:text="@string/start" />
<Button
android:id="@+id/btreset"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/btstop"
android:layout_alignBottom="@+id/btstop"
android:layout_toRightOf="@+id/btstop"
android:text="@string/reset" />
<Button
android:id="@+id/btstop"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/btstart"
android:layout_alignBottom="@+id/btstart"
android:layout_toRightOf="@+id/btstart"
android:text="@string/stop" />
</RelativeLayout>
And here's the "strings.xml" file:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">stopwatch</string>
<string name="btn1">Start</string>
<string name="btn2">Stop</string>
<string name="btn3">Reset</string>
<string name="menu_settings">Settings</string>
<string name="start">Start</string>
<string name="reset">Reset</string>
<string name="reset">Stop</string>
</resources>
Could you please let me know what am I missing and what's the fix to this
error?
P.S.: I am receiving similar error for these lines: btstop cannot be
resolved or is not a field in stop = (Button) findViewById(R.id.btstop);,
and btreset cannot be resolved or is not a field in reset = (Button)
findViewById(R.id.btreset); , as well as chronometer1 cannot be resolved
or is not a field in mydChronometer = (Chronometer)
findViewById(R.id.chronometer1);. Thanks a ton.