PostId
int64 13
11.8M
| PostCreationDate
stringlengths 19
19
| OwnerUserId
int64 3
1.57M
| OwnerCreationDate
stringlengths 10
19
| ReputationAtPostCreation
int64 -33
210k
| OwnerUndeletedAnswerCountAtPostTime
int64 0
5.77k
| Title
stringlengths 10
250
| BodyMarkdown
stringlengths 12
30k
| Tag1
stringlengths 1
25
⌀ | Tag2
stringlengths 1
25
⌀ | Tag3
stringlengths 1
25
⌀ | Tag4
stringlengths 1
25
⌀ | Tag5
stringlengths 1
25
⌀ | PostClosedDate
stringlengths 19
19
⌀ | OpenStatus
stringclasses 5
values | unified_texts
stringlengths 47
30.1k
| OpenStatus_id
int64 0
4
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3,835,919 |
10/01/2010 01:19:00
| 372,743 |
06/22/2010 03:12:10
| 107 | 15 |
Java Classpath at Runtime
|
I am importing `import org.apache.commons.httpclient.*;` in a program, but whenever I go to run it, I have to include the JAR in the classpath. Why is this necessary? Are there any ways around this?
|
java
|
import
|
classpath
| null | null | null |
open
|
Java Classpath at Runtime
===
I am importing `import org.apache.commons.httpclient.*;` in a program, but whenever I go to run it, I have to include the JAR in the classpath. Why is this necessary? Are there any ways around this?
| 0 |
4,509,327 |
12/22/2010 12:50:25
| 555,221 |
12/04/2010 11:25:11
| 1 | 0 |
Android Text View
|
0 down vote favorite
I am creating a pop up window in click event,inside that pop up window there are text view and Button... If i create a Id in XML and set the text by TextView txt=(TextView)findViewById(R.id.text)
txt.setText("Message");
I ma getting Null pointer Exception same for Button..
Here is my code
package com.examples;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.List;
import java.util.Locale;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.text.format.DateFormat;
import android.util.Log;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.View.OnClickListener;
import android.widget.AdapterView;
import android.widget.BaseAdapter;
import android.widget.Button;
import android.widget.GridView;
import android.widget.ImageView;
import android.widget.PopupWindow;
import android.widget.TextView;
import android.widget.Toast;
import android.widget.AdapterView.OnItemClickListener;
public class Main extends Activity implements OnClickListener
{
private final String[] months = { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" };
private static final String tag = "Main";
private Button selectedDayMonthYearButton;
private Button currentMonth;
private ImageView prevMonth;
private ImageView nextMonth;
private GridView calendarView;
private GridCellAdapter adapter;
private Calendar _calendar;
private int month, year;
private final DateFormat dateFormatter = new DateFormat();
private static final String dateTemplate = "MMMM yyyy";
private PopupWindow pw;
TextView txt1;
static ViewHolder holder;
private void getRequestParameters()
{
Intent intent = getIntent();
if (intent != null)
{
Bundle extras = intent.getExtras();
if (extras != null)
{
if (extras != null)
{
Log.d(tag, "+++++----------------->" + extras.getString("params"));
}
}
}
}
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.simple_calendar_view);
_calendar = Calendar.getInstance(Locale.getDefault());
month = _calendar.get(Calendar.MONTH);
Log.v("Months", ""+month);
year = _calendar.get(Calendar.YEAR);
Log.v("YEAR", ""+year);
selectedDayMonthYearButton = (Button) this.findViewById(R.id.selectedDayMonthYear);
selectedDayMonthYearButton.setText("Selected: ");
prevMonth = (ImageView) this.findViewById(R.id.prevMonth);
prevMonth.setOnClickListener(this);
currentMonth = (Button) this.findViewById(R.id.currentMonth);
currentMonth.setText(dateFormatter.format(dateTemplate, _calendar.getTime()));
nextMonth = (ImageView) this.findViewById(R.id.nextMonth);
nextMonth.setOnClickListener(this);
calendarView = (GridView) this.findViewById(R.id.calendar);
// Initialised
adapter = new GridCellAdapter(getApplicationContext(), R.id.day_gridcell, month, year);
adapter.notifyDataSetChanged();
calendarView.setAdapter(adapter);
}
@Override
public void onClick(View v)
{
if (v == prevMonth)
{
if (month <= 1)
{
month = 11;
year--;
} else
{
month--;
}
adapter = new GridCellAdapter(getApplicationContext(), R.id.day_gridcell, month, year);
_calendar.set(year, month, _calendar.get(Calendar.DAY_OF_MONTH));
currentMonth.setText(months[_calendar.get(Calendar.MONTH)] + "-" +_calendar.get(Calendar.YEAR));
//currentMonth.setText(_calendar.getTime().toString());
adapter.notifyDataSetChanged();
calendarView.setAdapter(adapter);
}
if (v == nextMonth)
{
if (month >= 11)
{
month = 0;
year++;
} else
{
month++;
}
adapter = new GridCellAdapter(getApplicationContext(), R.id.day_gridcell, month, year);
_calendar.set(year, month, _calendar.get(Calendar.DAY_OF_MONTH));
currentMonth.setText(months[_calendar.get(Calendar.MONTH)] + "-" +_calendar.get(Calendar.YEAR));
//currentMonth.setText(_calendar.getTime().toString());
adapter.notifyDataSetChanged();
calendarView.setAdapter(adapter);
}
}
// Inner Class
public class GridCellAdapter extends BaseAdapter implements OnClickListener
{
private static final String tag = "GridCellAdapter";
private final Context _context;
private final List<String> list;
private final String[] weekdays = new String[] { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" };
private final int[] daysOfMonth = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
private final int month, year;
int daysInMonth, prevMonthDays;
private final int currentDayOfMonth;
private Button gridcell;
// Days in Current Month
public GridCellAdapter(Context context, int textViewResourceId, int month, int year)
{
super();
this._context = context;
this.list = new ArrayList<String>();
this.month = month;
this.year = year;
Log.d(tag, "Month: " + month + " " + "Year: " + year);
Calendar calendar = Calendar.getInstance();
currentDayOfMonth = calendar.get(Calendar.DAY_OF_MONTH);
printMonth(month, year);
}
public String getItem(int position)
{
return list.get(position);
}
@Override
public int getCount()
{
return list.size();
}
private void printMonth(int mm, int yy)
{
// The number of days to leave blank at
// the start of this month.
int trailingSpaces = 0;
int leadSpaces = 0;
int daysInPrevMonth = 0;
int prevMonth = 0;
int prevYear = 0;
int nextMonth = 0;
int nextYear = 0;
GregorianCalendar cal = new GregorianCalendar(yy, mm, currentDayOfMonth);
// Days in Current Month
daysInMonth = daysOfMonth[mm];
int currentMonth = mm;
if (currentMonth == 11)
{
prevMonth = 10;
daysInPrevMonth = daysOfMonth[prevMonth];
nextMonth = 0;
prevYear = yy;
nextYear = yy + 1;
} else if (currentMonth == 0)
{
prevMonth = 11;
prevYear = yy - 1;
nextYear = yy;
daysInPrevMonth = daysOfMonth[prevMonth];
nextMonth = 1;
} else
{
prevMonth = currentMonth - 1;
nextMonth = currentMonth + 1;
nextYear = yy;
prevYear = yy;
daysInPrevMonth = daysOfMonth[prevMonth];
}
// Compute how much to leave before before the first day of the
// month.
// getDay() returns 0 for Sunday.
trailingSpaces = cal.get(Calendar.DAY_OF_WEEK) - 1;
if (cal.isLeapYear(cal.get(Calendar.YEAR)) && mm == 1)
{
++daysInMonth;
}
// Trailing Month days
for (int i = 0; i < trailingSpaces; i++)
{
list.add(String.valueOf((daysInPrevMonth - trailingSpaces + 1) + i) + "-GREY" + "-" + months[prevMonth] + "-" + prevYear);
}
// Current Month Days
for (int i = 1; i <= daysInMonth; i++)
{
list.add(String.valueOf(i) + "-WHITE" + "-" + months[mm] + "-" + yy);
}
// Leading Month days
for (int i = 0; i < list.size() % 7; i++)
{
Log.d(tag, "NEXT MONTH:= " + months[nextMonth]);
list.add(String.valueOf(i + 1) + "-GREY" + "-" + months[nextMonth] + "-" + nextYear);
}
}
@Override
public long getItemId(int position)
{
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent)
{
Log.d(tag, "getView ...");
View row = convertView;
if (row == null)
{
// ROW INFLATION
Log.d(tag, "Starting XML Row Inflation ... ");
LayoutInflater inflater = (LayoutInflater) _context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
row = inflater.inflate(R.layout.day_gridcell, parent, false);
Log.d(tag, "Successfully completed XML Row Inflation!");
}
// Get a reference to the Day gridcell
gridcell = (Button) row.findViewById(R.id.day_gridcell);
gridcell.setOnClickListener(this);
// ACCOUNT FOR SPACING
Log.d(tag, "Current Day: " + currentDayOfMonth);
String[] day_color = list.get(position).split("-");
gridcell.setText(day_color[0]);
gridcell.setTag(day_color[0] + "-" + day_color[2] + "-" + day_color[3]);
if (day_color[1].equals("GREY"))
{
gridcell.setTextColor(Color.LTGRAY);
}
if (day_color[1].equals("WHITE"))
{
gridcell.setTextColor(Color.WHITE);
}
if (position == currentDayOfMonth)
{
gridcell.setTextColor(Color.BLUE);
}
return row;
}
@Override
public void onClick(View view)
{
LayoutInflater inflater = (LayoutInflater) Main.this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
// inflate our view from the corresponding XML file
final View layout = inflater.inflate(R.layout.popup, (ViewGroup)findViewById(R.id.popup_menu_root));
String date_month_year = (String) view.getTag();
pw = new PopupWindow(layout, 200,75, true);
holder = new ViewHolder();
holder.text1 = (TextView) view.findViewById(R.id.pop_txt);
//holder.text1.setText("HIIIIIII");
pw.dismiss();
pw.showAtLocation(layout, Gravity.CENTER_VERTICAL, 10, 30);
Toast.makeText(getApplicationContext(), date_month_year, Toast.LENGTH_SHORT).show();
selectedDayMonthYearButton.setText("Selected: " + date_month_year);
Log.v("Button ID",""+R.id.bttn2);
//layout.setVisibility(View.INVISIBLE);
// findViewById(R.id.bttn2).setOnClickListener(
// new OnClickListener() {
////
//// //LayoutInflater inflater = (LayoutInflater) Main.this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
//// // inflate our view from the corresponding XML file
//// // final View layout = inflater.inflate(R.layout.popup, (ViewGroup)findViewById(R.id.popup_menu_root));
////
////
//// @Override
// public void onClick(View arg0) {
//// // TODO Auto-generated method stub
////// pw = new PopupWindow(layout, 200,75, true);
//////
////// pw.dismiss();
////// pw.showAtLocation(layout, Gravity.CENTER_VERTICAL, 10, 30);
////
// }
// });
}
}
static class ViewHolder {
TextView text1;
}
//list.setOnItemClickListener(new OnItemClickListener(){
}
|
android
|
text
|
view
| null | null |
06/21/2011 20:00:50
|
too localized
|
Android Text View
===
0 down vote favorite
I am creating a pop up window in click event,inside that pop up window there are text view and Button... If i create a Id in XML and set the text by TextView txt=(TextView)findViewById(R.id.text)
txt.setText("Message");
I ma getting Null pointer Exception same for Button..
Here is my code
package com.examples;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.List;
import java.util.Locale;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.text.format.DateFormat;
import android.util.Log;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.View.OnClickListener;
import android.widget.AdapterView;
import android.widget.BaseAdapter;
import android.widget.Button;
import android.widget.GridView;
import android.widget.ImageView;
import android.widget.PopupWindow;
import android.widget.TextView;
import android.widget.Toast;
import android.widget.AdapterView.OnItemClickListener;
public class Main extends Activity implements OnClickListener
{
private final String[] months = { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" };
private static final String tag = "Main";
private Button selectedDayMonthYearButton;
private Button currentMonth;
private ImageView prevMonth;
private ImageView nextMonth;
private GridView calendarView;
private GridCellAdapter adapter;
private Calendar _calendar;
private int month, year;
private final DateFormat dateFormatter = new DateFormat();
private static final String dateTemplate = "MMMM yyyy";
private PopupWindow pw;
TextView txt1;
static ViewHolder holder;
private void getRequestParameters()
{
Intent intent = getIntent();
if (intent != null)
{
Bundle extras = intent.getExtras();
if (extras != null)
{
if (extras != null)
{
Log.d(tag, "+++++----------------->" + extras.getString("params"));
}
}
}
}
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.simple_calendar_view);
_calendar = Calendar.getInstance(Locale.getDefault());
month = _calendar.get(Calendar.MONTH);
Log.v("Months", ""+month);
year = _calendar.get(Calendar.YEAR);
Log.v("YEAR", ""+year);
selectedDayMonthYearButton = (Button) this.findViewById(R.id.selectedDayMonthYear);
selectedDayMonthYearButton.setText("Selected: ");
prevMonth = (ImageView) this.findViewById(R.id.prevMonth);
prevMonth.setOnClickListener(this);
currentMonth = (Button) this.findViewById(R.id.currentMonth);
currentMonth.setText(dateFormatter.format(dateTemplate, _calendar.getTime()));
nextMonth = (ImageView) this.findViewById(R.id.nextMonth);
nextMonth.setOnClickListener(this);
calendarView = (GridView) this.findViewById(R.id.calendar);
// Initialised
adapter = new GridCellAdapter(getApplicationContext(), R.id.day_gridcell, month, year);
adapter.notifyDataSetChanged();
calendarView.setAdapter(adapter);
}
@Override
public void onClick(View v)
{
if (v == prevMonth)
{
if (month <= 1)
{
month = 11;
year--;
} else
{
month--;
}
adapter = new GridCellAdapter(getApplicationContext(), R.id.day_gridcell, month, year);
_calendar.set(year, month, _calendar.get(Calendar.DAY_OF_MONTH));
currentMonth.setText(months[_calendar.get(Calendar.MONTH)] + "-" +_calendar.get(Calendar.YEAR));
//currentMonth.setText(_calendar.getTime().toString());
adapter.notifyDataSetChanged();
calendarView.setAdapter(adapter);
}
if (v == nextMonth)
{
if (month >= 11)
{
month = 0;
year++;
} else
{
month++;
}
adapter = new GridCellAdapter(getApplicationContext(), R.id.day_gridcell, month, year);
_calendar.set(year, month, _calendar.get(Calendar.DAY_OF_MONTH));
currentMonth.setText(months[_calendar.get(Calendar.MONTH)] + "-" +_calendar.get(Calendar.YEAR));
//currentMonth.setText(_calendar.getTime().toString());
adapter.notifyDataSetChanged();
calendarView.setAdapter(adapter);
}
}
// Inner Class
public class GridCellAdapter extends BaseAdapter implements OnClickListener
{
private static final String tag = "GridCellAdapter";
private final Context _context;
private final List<String> list;
private final String[] weekdays = new String[] { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" };
private final int[] daysOfMonth = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
private final int month, year;
int daysInMonth, prevMonthDays;
private final int currentDayOfMonth;
private Button gridcell;
// Days in Current Month
public GridCellAdapter(Context context, int textViewResourceId, int month, int year)
{
super();
this._context = context;
this.list = new ArrayList<String>();
this.month = month;
this.year = year;
Log.d(tag, "Month: " + month + " " + "Year: " + year);
Calendar calendar = Calendar.getInstance();
currentDayOfMonth = calendar.get(Calendar.DAY_OF_MONTH);
printMonth(month, year);
}
public String getItem(int position)
{
return list.get(position);
}
@Override
public int getCount()
{
return list.size();
}
private void printMonth(int mm, int yy)
{
// The number of days to leave blank at
// the start of this month.
int trailingSpaces = 0;
int leadSpaces = 0;
int daysInPrevMonth = 0;
int prevMonth = 0;
int prevYear = 0;
int nextMonth = 0;
int nextYear = 0;
GregorianCalendar cal = new GregorianCalendar(yy, mm, currentDayOfMonth);
// Days in Current Month
daysInMonth = daysOfMonth[mm];
int currentMonth = mm;
if (currentMonth == 11)
{
prevMonth = 10;
daysInPrevMonth = daysOfMonth[prevMonth];
nextMonth = 0;
prevYear = yy;
nextYear = yy + 1;
} else if (currentMonth == 0)
{
prevMonth = 11;
prevYear = yy - 1;
nextYear = yy;
daysInPrevMonth = daysOfMonth[prevMonth];
nextMonth = 1;
} else
{
prevMonth = currentMonth - 1;
nextMonth = currentMonth + 1;
nextYear = yy;
prevYear = yy;
daysInPrevMonth = daysOfMonth[prevMonth];
}
// Compute how much to leave before before the first day of the
// month.
// getDay() returns 0 for Sunday.
trailingSpaces = cal.get(Calendar.DAY_OF_WEEK) - 1;
if (cal.isLeapYear(cal.get(Calendar.YEAR)) && mm == 1)
{
++daysInMonth;
}
// Trailing Month days
for (int i = 0; i < trailingSpaces; i++)
{
list.add(String.valueOf((daysInPrevMonth - trailingSpaces + 1) + i) + "-GREY" + "-" + months[prevMonth] + "-" + prevYear);
}
// Current Month Days
for (int i = 1; i <= daysInMonth; i++)
{
list.add(String.valueOf(i) + "-WHITE" + "-" + months[mm] + "-" + yy);
}
// Leading Month days
for (int i = 0; i < list.size() % 7; i++)
{
Log.d(tag, "NEXT MONTH:= " + months[nextMonth]);
list.add(String.valueOf(i + 1) + "-GREY" + "-" + months[nextMonth] + "-" + nextYear);
}
}
@Override
public long getItemId(int position)
{
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent)
{
Log.d(tag, "getView ...");
View row = convertView;
if (row == null)
{
// ROW INFLATION
Log.d(tag, "Starting XML Row Inflation ... ");
LayoutInflater inflater = (LayoutInflater) _context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
row = inflater.inflate(R.layout.day_gridcell, parent, false);
Log.d(tag, "Successfully completed XML Row Inflation!");
}
// Get a reference to the Day gridcell
gridcell = (Button) row.findViewById(R.id.day_gridcell);
gridcell.setOnClickListener(this);
// ACCOUNT FOR SPACING
Log.d(tag, "Current Day: " + currentDayOfMonth);
String[] day_color = list.get(position).split("-");
gridcell.setText(day_color[0]);
gridcell.setTag(day_color[0] + "-" + day_color[2] + "-" + day_color[3]);
if (day_color[1].equals("GREY"))
{
gridcell.setTextColor(Color.LTGRAY);
}
if (day_color[1].equals("WHITE"))
{
gridcell.setTextColor(Color.WHITE);
}
if (position == currentDayOfMonth)
{
gridcell.setTextColor(Color.BLUE);
}
return row;
}
@Override
public void onClick(View view)
{
LayoutInflater inflater = (LayoutInflater) Main.this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
// inflate our view from the corresponding XML file
final View layout = inflater.inflate(R.layout.popup, (ViewGroup)findViewById(R.id.popup_menu_root));
String date_month_year = (String) view.getTag();
pw = new PopupWindow(layout, 200,75, true);
holder = new ViewHolder();
holder.text1 = (TextView) view.findViewById(R.id.pop_txt);
//holder.text1.setText("HIIIIIII");
pw.dismiss();
pw.showAtLocation(layout, Gravity.CENTER_VERTICAL, 10, 30);
Toast.makeText(getApplicationContext(), date_month_year, Toast.LENGTH_SHORT).show();
selectedDayMonthYearButton.setText("Selected: " + date_month_year);
Log.v("Button ID",""+R.id.bttn2);
//layout.setVisibility(View.INVISIBLE);
// findViewById(R.id.bttn2).setOnClickListener(
// new OnClickListener() {
////
//// //LayoutInflater inflater = (LayoutInflater) Main.this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
//// // inflate our view from the corresponding XML file
//// // final View layout = inflater.inflate(R.layout.popup, (ViewGroup)findViewById(R.id.popup_menu_root));
////
////
//// @Override
// public void onClick(View arg0) {
//// // TODO Auto-generated method stub
////// pw = new PopupWindow(layout, 200,75, true);
//////
////// pw.dismiss();
////// pw.showAtLocation(layout, Gravity.CENTER_VERTICAL, 10, 30);
////
// }
// });
}
}
static class ViewHolder {
TextView text1;
}
//list.setOnItemClickListener(new OnItemClickListener(){
}
| 3 |
10,893,796 |
06/05/2012 08:14:15
| 800,910 |
06/16/2011 06:18:24
| 341 | 2 |
Vector declaration globally and in the main class
|
I was writing a code , in which when i declare a vector globally , it gives wrong answer but when i declare it in the main function . it becomes right . so i want to know the difference between the two declarations
Sudhanshu
|
c++
| null | null | null | null |
06/07/2012 10:16:11
|
not a real question
|
Vector declaration globally and in the main class
===
I was writing a code , in which when i declare a vector globally , it gives wrong answer but when i declare it in the main function . it becomes right . so i want to know the difference between the two declarations
Sudhanshu
| 1 |
10,501,910 |
05/08/2012 15:42:34
| 1,381,734 |
05/08/2012 10:00:01
| 1 | 0 |
utiliy of management of dynamics ax
|
> im asking for : What'is the **utility of management** utilies on dynamic ax ?
> When should i use it. i m preparing to install the dynamics ax and i find to minimise environnement. all help suggest to cosh utility of management and don't say what !
|
axapta
|
dynamics
|
ax
| null | null |
05/09/2012 09:18:15
|
not a real question
|
utiliy of management of dynamics ax
===
> im asking for : What'is the **utility of management** utilies on dynamic ax ?
> When should i use it. i m preparing to install the dynamics ax and i find to minimise environnement. all help suggest to cosh utility of management and don't say what !
| 1 |
979,653 |
06/11/2009 06:36:49
| 108,111 |
05/16/2009 10:05:18
| 16 | 0 |
How to convert image to text and text to image in wpf + c#
|
I want to develop an appication which can converts image to text format(some Ascii format) and text to image format. I want this because i need to decrease the size of the image file.
Any suggestion plz.
Thanks in advance,
Ibrahim.
|
c#
|
wpf
| null | null | null | null |
open
|
How to convert image to text and text to image in wpf + c#
===
I want to develop an appication which can converts image to text format(some Ascii format) and text to image format. I want this because i need to decrease the size of the image file.
Any suggestion plz.
Thanks in advance,
Ibrahim.
| 0 |
7,928,096 |
10/28/2011 10:32:52
| 666,953 |
03/19/2011 03:21:20
| 94 | 10 |
Is this a gcc optimization bug?
|
Here's my code:
bool func(const MY_STRUCT *const ptr, some_struct x, int y)
{
printf("IN: %p\n", ptr); // ok
// do something
printf("OUT: %p\n", ptr); // ok
return true;
}
void process(void)
{
... ...
for (i = 0; i < num; ++i) {
MY_STRUCT *ptr = obj->GetPtr(); // success
printf("BEFORE: %p\n", ptr); // ok
if (func(ptr, x, y)) {
continue;
}
printf("AFTER: %p\n", ptr); // <nil> when compile with -O2
printf("%s", ptr->data); // *** segment fault here ***
}
}
If I compile above code with -O0, everything works fine.
However, if I compile it with -O2, after the function `func` is called, the `ptr` become `NULL`!
Is this a gcc bug? Did anyone ever have encountered similar bug?
My gcc version is: `gcc version 3.4.5 20051201 (Red Hat 3.4.5-2)`
Thanks all in advance!
|
c++
|
c
|
gcc
|
gcc3
| null |
10/28/2011 13:35:14
|
not a real question
|
Is this a gcc optimization bug?
===
Here's my code:
bool func(const MY_STRUCT *const ptr, some_struct x, int y)
{
printf("IN: %p\n", ptr); // ok
// do something
printf("OUT: %p\n", ptr); // ok
return true;
}
void process(void)
{
... ...
for (i = 0; i < num; ++i) {
MY_STRUCT *ptr = obj->GetPtr(); // success
printf("BEFORE: %p\n", ptr); // ok
if (func(ptr, x, y)) {
continue;
}
printf("AFTER: %p\n", ptr); // <nil> when compile with -O2
printf("%s", ptr->data); // *** segment fault here ***
}
}
If I compile above code with -O0, everything works fine.
However, if I compile it with -O2, after the function `func` is called, the `ptr` become `NULL`!
Is this a gcc bug? Did anyone ever have encountered similar bug?
My gcc version is: `gcc version 3.4.5 20051201 (Red Hat 3.4.5-2)`
Thanks all in advance!
| 1 |
8,499,843 |
12/14/2011 05:26:21
| 791,756 |
06/09/2011 21:22:56
| 6 | 1 |
I use maven test to run my project but it said I was using JDK 1.3
|
I use ubuntu 10.04 and open-jdk-1.6.0.
This is my mvn -version output:
Apache Maven 2.2.1 (rdebian-1)
Java version: 1.6.0_20
Java home: /usr/lib/jvm/java-6-openjdk/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux" version: "2.6.32-37-generic" arch: "i386" Family: "unix"
But when I run mvn test, there are some errors:
/home/unionx/workspace/java/try-netty/src/test/java/net/bluedash/trynetty/DataTypeTest.java:[3,7] static import declarations are not supported in -source 1.3
(use -source 5 or higher to enable static import declarations)
import static org.junit.Assert.assertEquals;
/home/unionx/workspace/java/try-netty/src/test/java/net/bluedash/trynetty/DataTypeTest.java:[11,2] annotations are not supported in -source 1.3
(use -source 5 or higher to enable annotations)
@Test
/home/unionx/workspace/java/try-netty/src/test/java/net/bluedash/trynetty/ChannelBufferTest.java:[3,7] static import declarations are not supported in -source 1.3
(use -source 5 or higher to enable static import declarations)
import static org.junit.Assert.*;
/home/unionx/workspace/java/try-netty/src/test/java/net/bluedash/trynetty/ChannelBufferTest.java:[11,2] annotations are not supported in -source 1.3
(use -source 5 or higher to enable annotations)
@Test
/home/unionx/workspace/java/try-netty/src/test/java/net/bluedash/trynetty/PathTest.java:[3,7] static import declarations are not supported in -source 1.3
(use -source 5 or higher to enable static import declarations)
import static org.junit.Assert.*;
/home/unionx/workspace/java/try-netty/src/test/java/net/bluedash/trynetty/PathTest.java:[11,2] annotations are not supported in -source 1.3
(use -source 5 or higher to enable annotations)
@Test
I seems that the mvn thought I use java 1.3, perhaps it just support java 1.5?
|
java
|
maven
|
openjdk
| null | null | null |
open
|
I use maven test to run my project but it said I was using JDK 1.3
===
I use ubuntu 10.04 and open-jdk-1.6.0.
This is my mvn -version output:
Apache Maven 2.2.1 (rdebian-1)
Java version: 1.6.0_20
Java home: /usr/lib/jvm/java-6-openjdk/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux" version: "2.6.32-37-generic" arch: "i386" Family: "unix"
But when I run mvn test, there are some errors:
/home/unionx/workspace/java/try-netty/src/test/java/net/bluedash/trynetty/DataTypeTest.java:[3,7] static import declarations are not supported in -source 1.3
(use -source 5 or higher to enable static import declarations)
import static org.junit.Assert.assertEquals;
/home/unionx/workspace/java/try-netty/src/test/java/net/bluedash/trynetty/DataTypeTest.java:[11,2] annotations are not supported in -source 1.3
(use -source 5 or higher to enable annotations)
@Test
/home/unionx/workspace/java/try-netty/src/test/java/net/bluedash/trynetty/ChannelBufferTest.java:[3,7] static import declarations are not supported in -source 1.3
(use -source 5 or higher to enable static import declarations)
import static org.junit.Assert.*;
/home/unionx/workspace/java/try-netty/src/test/java/net/bluedash/trynetty/ChannelBufferTest.java:[11,2] annotations are not supported in -source 1.3
(use -source 5 or higher to enable annotations)
@Test
/home/unionx/workspace/java/try-netty/src/test/java/net/bluedash/trynetty/PathTest.java:[3,7] static import declarations are not supported in -source 1.3
(use -source 5 or higher to enable static import declarations)
import static org.junit.Assert.*;
/home/unionx/workspace/java/try-netty/src/test/java/net/bluedash/trynetty/PathTest.java:[11,2] annotations are not supported in -source 1.3
(use -source 5 or higher to enable annotations)
@Test
I seems that the mvn thought I use java 1.3, perhaps it just support java 1.5?
| 0 |
8,453,310 |
12/10/2011 00:16:41
| 284,681 |
03/02/2010 19:04:58
| 493 | 26 |
Orthographic Projection in Modern OpenGL
|
I'd like to set up an orthographic projection using only modern OpenGL techniques (i.e. no immediate-mode stuff). I'm seeing conflicting info on the web about how to approach this.
Some people are saying that it's still OK to call `glMatrixMode(GL_PROJECTION)` and then `glOrtho`. This has always worked for me in the past, but I'm wondering if this has been deprecated in modern OpenGL.
If so, are vertex shaders the standard way to do an orthographic projection nowadays? Does GLSL provide a handy built-in function to set up an orthographic projection, or do I need to write that math myself in the vertex shader?
|
opengl
|
glsl
|
orthographic
| null | null | null |
open
|
Orthographic Projection in Modern OpenGL
===
I'd like to set up an orthographic projection using only modern OpenGL techniques (i.e. no immediate-mode stuff). I'm seeing conflicting info on the web about how to approach this.
Some people are saying that it's still OK to call `glMatrixMode(GL_PROJECTION)` and then `glOrtho`. This has always worked for me in the past, but I'm wondering if this has been deprecated in modern OpenGL.
If so, are vertex shaders the standard way to do an orthographic projection nowadays? Does GLSL provide a handy built-in function to set up an orthographic projection, or do I need to write that math myself in the vertex shader?
| 0 |
8,336,444 |
12/01/2011 04:11:22
| 1,063,107 |
11/24/2011 02:42:56
| 1 | 0 |
Does video file gets downloaded in parts in video sites
|
I want to ask that suppose if i upload video files on youtube or any other video sharing site.
Then how does it streams the video.
I mean does it gets downloaded first on hard drive and then it plays.
I mean suppose i just dragged the video timline to half. Does that mean that only half video gets downloaded or full video gets downloaded.
because i have uploaded 2 hrs of video and if i want to see just 5 mins of video from half, i don't want that first my system downloads that 800MB file just to see 5 mins
|
google
|
video
|
youtube
|
web
| null |
12/01/2011 04:45:20
|
off topic
|
Does video file gets downloaded in parts in video sites
===
I want to ask that suppose if i upload video files on youtube or any other video sharing site.
Then how does it streams the video.
I mean does it gets downloaded first on hard drive and then it plays.
I mean suppose i just dragged the video timline to half. Does that mean that only half video gets downloaded or full video gets downloaded.
because i have uploaded 2 hrs of video and if i want to see just 5 mins of video from half, i don't want that first my system downloads that 800MB file just to see 5 mins
| 2 |
6,536,950 |
06/30/2011 15:10:23
| 94,278 |
04/22/2009 11:19:40
| 2,429 | 135 |
A question of style: LINQ or XPath to read in XML nodes
|
I am interested to know how to read the following XML in the most elegant / cleanest way possible.
(snippet)
<Config>
<MyTag />
<MyTag />
</Config>
<Config>
<MyTag />
<MyTag />
<MyTag />
</Config>
I want to read in the `MyTag` nodes only. My first thought was LINQ but didn't know if it was cleaner using XPath.
|
c#
|
.net
|
xml
|
linq
|
xpath
|
06/30/2011 15:40:53
|
not constructive
|
A question of style: LINQ or XPath to read in XML nodes
===
I am interested to know how to read the following XML in the most elegant / cleanest way possible.
(snippet)
<Config>
<MyTag />
<MyTag />
</Config>
<Config>
<MyTag />
<MyTag />
<MyTag />
</Config>
I want to read in the `MyTag` nodes only. My first thought was LINQ but didn't know if it was cleaner using XPath.
| 4 |
7,979,043 |
11/02/2011 10:44:48
| 294,813 |
03/16/2010 14:21:43
| 693 | 25 |
Printing full backtrace in c++
|
I want to dump a backtrace from a C++ program in Linux in a similar format as it is done in gdb. I tried to use the backtrace() and backtrace_symbols() functions for this purpose. These returned function names and offsets. I can use the __cxa_demangle() function to get a readable function name.
Is there any way to get the file/line positions too, as it is done by gdb?
|
c++
|
linux
|
g++
|
backtrace
| null | null |
open
|
Printing full backtrace in c++
===
I want to dump a backtrace from a C++ program in Linux in a similar format as it is done in gdb. I tried to use the backtrace() and backtrace_symbols() functions for this purpose. These returned function names and offsets. I can use the __cxa_demangle() function to get a readable function name.
Is there any way to get the file/line positions too, as it is done by gdb?
| 0 |
344,721 |
12/05/2008 18:20:24
| 17,123 |
09/18/2008 02:10:11
| 780 | 27 |
Possible to prevent search engine spiders from infinitely crawling paging links on search results?
|
Our SEO team would like to open up our main dynamic search results page to spiders and remove the 'nofollow' from the meta tags. It is currently accessible to spiders via allowing the path in robots.txt, but with a 'nofollow' clause in the meta tag which prevents spiders from going beyond the first page.
`<meta name="robots" content="index,nofollow">`
I am concerned that if we remove the 'nofollow', the impact to our search system will be catastrophic, as spiders will start crawling through all pages in the result set. I would appreciate advice as to:
1) Is there a way to remove the 'nofollow' from the meta tag, but prevent spiders from following only certain links on the page? I have read mixed opinions on rel="nofollow", is this a viable option?
`<a rel="nofollow" href="http://www.mysite.com/paginglink" >Next Page</a>`
2) Is there a way to control the 'depth' of how far spiders will go? It wouldn't be so bad if they hit a few pages, then stopped.
3) Our search results pages have the standard next/previous links, which would in theory cause spiders to hit pages recursively to infinity, what is the effect of this on SEO?
I understand that different spiders behave differently, but am mainly concerned with the big players, such as Google, Yahoo, MSN.
|
seo
|
spider
|
nofollow
|
robots.txt
|
search-engine-optimizati
| null |
open
|
Possible to prevent search engine spiders from infinitely crawling paging links on search results?
===
Our SEO team would like to open up our main dynamic search results page to spiders and remove the 'nofollow' from the meta tags. It is currently accessible to spiders via allowing the path in robots.txt, but with a 'nofollow' clause in the meta tag which prevents spiders from going beyond the first page.
`<meta name="robots" content="index,nofollow">`
I am concerned that if we remove the 'nofollow', the impact to our search system will be catastrophic, as spiders will start crawling through all pages in the result set. I would appreciate advice as to:
1) Is there a way to remove the 'nofollow' from the meta tag, but prevent spiders from following only certain links on the page? I have read mixed opinions on rel="nofollow", is this a viable option?
`<a rel="nofollow" href="http://www.mysite.com/paginglink" >Next Page</a>`
2) Is there a way to control the 'depth' of how far spiders will go? It wouldn't be so bad if they hit a few pages, then stopped.
3) Our search results pages have the standard next/previous links, which would in theory cause spiders to hit pages recursively to infinity, what is the effect of this on SEO?
I understand that different spiders behave differently, but am mainly concerned with the big players, such as Google, Yahoo, MSN.
| 0 |
9,854,084 |
03/24/2012 17:56:07
| 1,549,741 |
05/13/2011 06:51:53
| 23 | 0 |
Hadoop On Demand
|
Is this Apache project (Hadoop On Demand) still actively being developed? I couldn't find any recent documentation but the concept (or motivation of the project) seems to be quite intriguing. My use case is to build relative large cluster (in-house) and allocate/deallocate portion of it to different users (I am not interested in using ElasticMapReduce or some other cloud service).
If there is any ppl who have used this or something similar, I would like to hear any comments on the experience of using it.
|
hadoop
|
mapreduce
| null | null | null |
03/25/2012 18:33:37
|
off topic
|
Hadoop On Demand
===
Is this Apache project (Hadoop On Demand) still actively being developed? I couldn't find any recent documentation but the concept (or motivation of the project) seems to be quite intriguing. My use case is to build relative large cluster (in-house) and allocate/deallocate portion of it to different users (I am not interested in using ElasticMapReduce or some other cloud service).
If there is any ppl who have used this or something similar, I would like to hear any comments on the experience of using it.
| 2 |
10,622,798 |
05/16/2012 16:32:05
| 1,068,887 |
11/28/2011 07:37:43
| 10 | 0 |
What are some good (open source) django forum applications I can directly integrate into my site?
|
I want to integrate a forum into my Django Project. What are some good, open source, mature applications for that?
I've looked at
http://code.google.com/p/django-forum/
This is not maintained any more..
I'd like to know if it's worth using this.. or if there is something better?
Thank you
|
django
|
forum
| null | null | null |
05/16/2012 17:07:03
|
not constructive
|
What are some good (open source) django forum applications I can directly integrate into my site?
===
I want to integrate a forum into my Django Project. What are some good, open source, mature applications for that?
I've looked at
http://code.google.com/p/django-forum/
This is not maintained any more..
I'd like to know if it's worth using this.. or if there is something better?
Thank you
| 4 |
10,009,475 |
04/04/2012 10:39:11
| 300,675 |
03/24/2010 09:44:35
| 274 | 0 |
cron not running: how to activate it?
|
It seems my cron never runs.
I rebboted the server
When I run :
/etc/init.d/cron restart
I got "unknow file error"
In my /etc/crontab I got
*/1 * * * * root /etc/init.d/theme.sh > /dev/null
and when I run /etc/init.d/theme.sh : evreything works
I even tried to reisntall cron with: emerge vixie-cron
And I tried to find crond with : find -name crond : nothing
Someone can help me with that ?
regards
|
linux
|
cron
|
crontab
| null | null |
04/12/2012 02:57:25
|
off topic
|
cron not running: how to activate it?
===
It seems my cron never runs.
I rebboted the server
When I run :
/etc/init.d/cron restart
I got "unknow file error"
In my /etc/crontab I got
*/1 * * * * root /etc/init.d/theme.sh > /dev/null
and when I run /etc/init.d/theme.sh : evreything works
I even tried to reisntall cron with: emerge vixie-cron
And I tried to find crond with : find -name crond : nothing
Someone can help me with that ?
regards
| 2 |
11,301,906 |
07/02/2012 22:15:17
| 383,283 |
07/04/2010 22:55:56
| 85 | 5 |
Creating a chat room layout in SWT
|
I want to build a chat room UI using eclipse rcp and wonder how to accomplish the heart of the UI, the message display:
Display a timestamp, followed by a right justified nick, followed by a message, e.g.
[01:00:20] <mike> sup
[01:00:25] <benjamin> hi
I currently use StyledText#setTabStops to get at least:
[01:00:20] <mike> sup
[01:00:25] <benjamin> hi
And wordwrap like this
[01:00:20] <mike> wordwrapping would really be
like icing on a cake
[01:00:25] <benjamin> hi
instead of this
[01:00:20] <mike> wordwrapping would really be
like icing on a cake
[01:00:25] <benjamin> hi
And if this isn't hard enough I'd like something like [XChat's selection behavior][1]
Some Ideas:
* Instead of one big StyledText I could divide it into three controls (one for each column) and sync the scrolling, but how to enable word wrap I don't know
* For each timestamp, nick and message a control is created and put in a gridlayout, but how to enable text selection across several messages I don't know
[1]: http://i.imgur.com/zRb6G.png
|
java
|
swt
|
eclipse-rcp
| null | null |
07/03/2012 13:50:24
|
not a real question
|
Creating a chat room layout in SWT
===
I want to build a chat room UI using eclipse rcp and wonder how to accomplish the heart of the UI, the message display:
Display a timestamp, followed by a right justified nick, followed by a message, e.g.
[01:00:20] <mike> sup
[01:00:25] <benjamin> hi
I currently use StyledText#setTabStops to get at least:
[01:00:20] <mike> sup
[01:00:25] <benjamin> hi
And wordwrap like this
[01:00:20] <mike> wordwrapping would really be
like icing on a cake
[01:00:25] <benjamin> hi
instead of this
[01:00:20] <mike> wordwrapping would really be
like icing on a cake
[01:00:25] <benjamin> hi
And if this isn't hard enough I'd like something like [XChat's selection behavior][1]
Some Ideas:
* Instead of one big StyledText I could divide it into three controls (one for each column) and sync the scrolling, but how to enable word wrap I don't know
* For each timestamp, nick and message a control is created and put in a gridlayout, but how to enable text selection across several messages I don't know
[1]: http://i.imgur.com/zRb6G.png
| 1 |
8,916,943 |
01/18/2012 20:28:57
| 13,791 |
09/16/2008 20:52:40
| 1,437 | 60 |
SSRS recursive count - how to get aggregates only for the children, not the parent?
|
**Disclaimer**: I'm an SSRS n00b, so not too many rotten tomatoes please :)
I have a hierarchy of employees and managers which I had Reporting Services build using the [Recursive Parent property](http://technet.microsoft.com/en-us/library/dd283103.aspx). Here's a crude representation:
-Jim Bob
Ray
-Steve
Ricky Bobby
Terry
For example, I need a count of the people under Steve, but when I call `Count(Fields!EmployeeID.Value, "Details", Recursive)` I get **3** instead of **2**. Of course, I can just subtract 1 in the case of a count, but this won't work when I need a sum. So the real question is **how do I get a recursive aggregate that excludes the parent?**
Additional info: I only have one group which is the default Details group. It's set up just like [this example](http://blog.infotoad.com/post/2009/08/10/Working-with-a-Recursive-Hierarchy-Group-in-SQL-Reporting-Services-2008.aspx), so I'm grouping by EmployeeID and I have the recursive parent set to ManagerID.
|
reporting-services
|
hierarchical-data
| null | null | null | null |
open
|
SSRS recursive count - how to get aggregates only for the children, not the parent?
===
**Disclaimer**: I'm an SSRS n00b, so not too many rotten tomatoes please :)
I have a hierarchy of employees and managers which I had Reporting Services build using the [Recursive Parent property](http://technet.microsoft.com/en-us/library/dd283103.aspx). Here's a crude representation:
-Jim Bob
Ray
-Steve
Ricky Bobby
Terry
For example, I need a count of the people under Steve, but when I call `Count(Fields!EmployeeID.Value, "Details", Recursive)` I get **3** instead of **2**. Of course, I can just subtract 1 in the case of a count, but this won't work when I need a sum. So the real question is **how do I get a recursive aggregate that excludes the parent?**
Additional info: I only have one group which is the default Details group. It's set up just like [this example](http://blog.infotoad.com/post/2009/08/10/Working-with-a-Recursive-Hierarchy-Group-in-SQL-Reporting-Services-2008.aspx), so I'm grouping by EmployeeID and I have the recursive parent set to ManagerID.
| 0 |
6,129,497 |
05/25/2011 19:05:06
| 423,079 |
08/17/2010 16:19:28
| 400 | 6 |
C# Dictionary ContainsKey
|
My problem is ContainsKey is always returning false even when they key has been added and .Equals evaluates to true.
I have the following class:
public class StatisticsFilter
{
private String someString1;
private String someString2;
.....
public override string ToString()
{
return string.Format("{0}-{1}-{2}-{3}-{4}", someString1, someString2, ...)
}
public override bool Equals(object obj)
{
return obj.ToString().Equals(ToString());
}
public override int GetHashCode()
{
return ToString().GetHashCode();
}
}
I then have a dictionary that looks like this:
private readonly IDictionary<StatisticsFilter, Statistics> _filteredStatisticsDict =
new Dictionary<StatisticsFilter, Statistics>();
....
{
// ALWAYS EVALUATES TO FALSE!
if (_filteredStatisticsDict.ContainsKey(statisticsFilter) == false)
{
_filteredStatisticsDict.Add(statisticsFilter, new Statistics());
}
}
|
c#
|
dictionary
|
equality
|
containskey
| null | null |
open
|
C# Dictionary ContainsKey
===
My problem is ContainsKey is always returning false even when they key has been added and .Equals evaluates to true.
I have the following class:
public class StatisticsFilter
{
private String someString1;
private String someString2;
.....
public override string ToString()
{
return string.Format("{0}-{1}-{2}-{3}-{4}", someString1, someString2, ...)
}
public override bool Equals(object obj)
{
return obj.ToString().Equals(ToString());
}
public override int GetHashCode()
{
return ToString().GetHashCode();
}
}
I then have a dictionary that looks like this:
private readonly IDictionary<StatisticsFilter, Statistics> _filteredStatisticsDict =
new Dictionary<StatisticsFilter, Statistics>();
....
{
// ALWAYS EVALUATES TO FALSE!
if (_filteredStatisticsDict.ContainsKey(statisticsFilter) == false)
{
_filteredStatisticsDict.Add(statisticsFilter, new Statistics());
}
}
| 0 |
10,876,988 |
06/04/2012 06:09:18
| 1,225,531 |
02/22/2012 10:23:37
| 16 | 0 |
Loading mask not appaear for full screen
|
In my application the loading mask is appear only for particular area not for complete screen. How to make it to appear for full screen.
|
extjs
| null | null | null | null |
06/04/2012 11:13:17
|
not a real question
|
Loading mask not appaear for full screen
===
In my application the loading mask is appear only for particular area not for complete screen. How to make it to appear for full screen.
| 1 |
7,803,915 |
10/18/2011 07:37:52
| 754,172 |
05/15/2011 03:03:14
| 11 | 1 |
Any online links/books on Database scaling?
|
Possible Duplicate: Knowing how a simple database engine works? Is there any books or tutorial which explains the various db engines,, their pros and cons? I would like to know any book which teaches how to scale the user requests and improve the performance in general.
|
database
|
performance
|
database-design
| null | null |
10/18/2011 09:16:20
|
not constructive
|
Any online links/books on Database scaling?
===
Possible Duplicate: Knowing how a simple database engine works? Is there any books or tutorial which explains the various db engines,, their pros and cons? I would like to know any book which teaches how to scale the user requests and improve the performance in general.
| 4 |
7,480,207 |
09/20/2011 04:37:56
| 215,148 |
11/20/2009 02:30:14
| 771 | 36 |
Any books on the history of computer architecture?
|
I'm very interested in the history of computer architecture. Various elders that I've talked to have shared anecdotes and bits of wisdom that I've never seen in a computer science textbook.
I'm hoping for something on the order of Steven Levy's Hackers. Something that chronologically covers architecture of the earliest computers all the way through modern-day, and isn't afraid to go in-depth about the technical *and* human aspects.
Are there any recommendable books out there covering this topic?
|
architecture
|
history
| null | null | null |
09/30/2011 12:16:55
|
not constructive
|
Any books on the history of computer architecture?
===
I'm very interested in the history of computer architecture. Various elders that I've talked to have shared anecdotes and bits of wisdom that I've never seen in a computer science textbook.
I'm hoping for something on the order of Steven Levy's Hackers. Something that chronologically covers architecture of the earliest computers all the way through modern-day, and isn't afraid to go in-depth about the technical *and* human aspects.
Are there any recommendable books out there covering this topic?
| 4 |
5,309,289 |
03/15/2011 08:43:36
| 624,209 |
02/19/2011 08:30:11
| 6 | 0 |
xml processing using php (simplexml?)
|
How to access certain child's values? Let's say we have an XML:
http://www.more2home.dk/pi/Hvilestol_Model_090_m_skammel_l%E6der_5854_70.aspx?xml=1
How to acces e.g. `ImageUrl (<ImageUrl></ImageUrl>)` and extract http://www.more2home.dk/SL/PI/290/9/a132edfb-16e7-47b3-b781-8c0a973cc46b.jpg?c=0_1
|
php
|
xml
| null | null | null |
03/15/2011 10:17:48
|
not a real question
|
xml processing using php (simplexml?)
===
How to access certain child's values? Let's say we have an XML:
http://www.more2home.dk/pi/Hvilestol_Model_090_m_skammel_l%E6der_5854_70.aspx?xml=1
How to acces e.g. `ImageUrl (<ImageUrl></ImageUrl>)` and extract http://www.more2home.dk/SL/PI/290/9/a132edfb-16e7-47b3-b781-8c0a973cc46b.jpg?c=0_1
| 1 |
10,237,932 |
04/19/2012 22:46:10
| 1,345,235 |
04/19/2012 22:29:22
| 1 | 0 |
is there any point in passing a pointer to a thread (java)?
|
assume we have 2 threads, thread A and thread B.
thread A is the main method and contain large data structures.
is it possible to create a second thread and pass the address(a pointer) of the data structure (local to thread A) to thread B so both thread can read from the data structure?
the point of this is to avoid the need to duplicate the entire data structure on thread B or spend a lot of time pulling relevant information from the data structure for thread B to use
keep in mind that neither thread is modifying the data
|
java
|
multithreading
|
pointers
| null | null | null |
open
|
is there any point in passing a pointer to a thread (java)?
===
assume we have 2 threads, thread A and thread B.
thread A is the main method and contain large data structures.
is it possible to create a second thread and pass the address(a pointer) of the data structure (local to thread A) to thread B so both thread can read from the data structure?
the point of this is to avoid the need to duplicate the entire data structure on thread B or spend a lot of time pulling relevant information from the data structure for thread B to use
keep in mind that neither thread is modifying the data
| 0 |
63,801 |
09/15/2008 15:13:02
| 5,056 |
09/07/2008 15:43:17
| 845 | 64 |
How do you document your methods?
|
As suggested, I have closed the question posed [here][1] and have broken it up into separate questions regarding code documentation to be posed throughout the day.
----------
The first question I have is, what are the guidelines you follow when you write documentation for a method/function/procedure? Do you always do doc-comments or do you try to let the method names speak for themselves?
What about within the code block? Do you find yourself writing a lot of line by line code? If you do, why do you feel the need for it?
What do you think should be the standard for documenting a small self-contained chunk of code (as opposed to the code as whole or tests)?
Do you find that your opinions differ depending on project size/type? On language you're using? On documentation tools available?
[1]: http://stackoverflow.com/questions/63297/how-do-you-do-documentation
|
documentation
|
guidance
| null | null | null |
03/15/2012 22:48:13
|
not constructive
|
How do you document your methods?
===
As suggested, I have closed the question posed [here][1] and have broken it up into separate questions regarding code documentation to be posed throughout the day.
----------
The first question I have is, what are the guidelines you follow when you write documentation for a method/function/procedure? Do you always do doc-comments or do you try to let the method names speak for themselves?
What about within the code block? Do you find yourself writing a lot of line by line code? If you do, why do you feel the need for it?
What do you think should be the standard for documenting a small self-contained chunk of code (as opposed to the code as whole or tests)?
Do you find that your opinions differ depending on project size/type? On language you're using? On documentation tools available?
[1]: http://stackoverflow.com/questions/63297/how-do-you-do-documentation
| 4 |
8,778,292 |
01/08/2012 14:21:48
| 984,527 |
10/07/2011 18:23:15
| 11 | 0 |
Centralized storage & backup solution
|
I'm looking for a centralized and a backup solution for my data , I'm looking for stability , safety and high throughput . now I'm choosing between **Western Digital My Book Essential** and **Western Digital My Book Life** , and I'm very confused about which fits my requirements .
Hope you can help me choosing between them or suggesting a better solution .
Thanks in advance .
|
backup
|
storage
|
data-storage
| null | null |
01/09/2012 07:04:24
|
off topic
|
Centralized storage & backup solution
===
I'm looking for a centralized and a backup solution for my data , I'm looking for stability , safety and high throughput . now I'm choosing between **Western Digital My Book Essential** and **Western Digital My Book Life** , and I'm very confused about which fits my requirements .
Hope you can help me choosing between them or suggesting a better solution .
Thanks in advance .
| 2 |
475,553 |
01/24/2009 05:16:54
| 49,739 |
12/29/2008 05:24:05
| 132 | 35 |
iPhone Develeopment - How can i test landscape view using simulator?
|
I wonder if i can test landscape view using simulator?
|
iphone
|
development
|
cocoa
|
landscape
|
simulation
| null |
open
|
iPhone Develeopment - How can i test landscape view using simulator?
===
I wonder if i can test landscape view using simulator?
| 0 |
11,187,365 |
06/25/2012 10:15:40
| 1,479,640 |
06/25/2012 10:11:32
| 1 | 0 |
SharePoint/ASP.NET life cycle and databinding
|
I'm having a issue with databinding to a grid and what event to do it in. I'm using the DevExpress ASPxGridView, but it also happens with a few other grids I've tried.
We rely on a web part property to determine what data to retrieve, so we have to do the grid databinding in the OnPreRender event. If we do any grouping, then the expand/collapse of the grid doesn't work. If the databinding is moved to the OnLoad event then everything works fine. Is there a proper way to do this or is it just not supported?
Thanks
|
asp.net
|
sharepoint
|
data-binding
| null | null | null |
open
|
SharePoint/ASP.NET life cycle and databinding
===
I'm having a issue with databinding to a grid and what event to do it in. I'm using the DevExpress ASPxGridView, but it also happens with a few other grids I've tried.
We rely on a web part property to determine what data to retrieve, so we have to do the grid databinding in the OnPreRender event. If we do any grouping, then the expand/collapse of the grid doesn't work. If the databinding is moved to the OnLoad event then everything works fine. Is there a proper way to do this or is it just not supported?
Thanks
| 0 |
6,265,691 |
06/07/2011 13:11:06
| 167,980 |
09/03/2009 15:40:47
| 449 | 26 |
How to properly save a many-to-many relationship in Entity Framework.
|
I am currently working with the following EF code first model that has a many to many relationship between a Person and a Tag.
public class person
{
public Person()
{
this.Tags = new List<Tag>();
}
public int Id { get; set; }
public string Name { get; set; }
public virtual ICollection<Tag> Tags { get; set; }
}
public class Tag
{
public Tag()
{
this.People = new List<Person>();
}
public int Id { get; set; }
public string Name { get; set; }
public virtual ICollection<Person> People { get; set; }
}
public MyContext : DbContext
{
public DbSet<Person> People { get; set; }
public DbSet<Tag> Tags { get; set; }
}
I am then passing in a Json model to an MVC Controller that contains an existing person and is updating the person name along with also either adding or removing tags from the person's tag list.
I was having some issues getting the tags associated to the person properly. After a lot trial and error, I have come up with the following method that works.
[HttpPost]
public JsonResult Save(Person person)
{
//get ids of all tags that are associated with this person.
var tagIds = new List<int>();
foreach (var tag in person.Tags)
{
tagsIds.Add(tag.Id);
}
//clone the person minus the tags
var personToSave = person;
personToSave.Tags = new List<Tag>();
var context = new MyContext();
var existingTags = (from t in context.Tags
where t.People.Count > 0 && t.People.All(p => p.Id == person.Id)
select t).ToList();
//attach the person, so updates to the person object will save.
context.Entry(personToSave).State = EntityState.Modified;
if (tagIds.Count > 0)
{
//add new tags
var tags = context.Tags.Where(t => tagIds.Contains(t.Id));
foreach (var tag in tags)
{
//check if tags has no people and not already associated to this person.
if (tag.People.Count == 0 || tag.People.First(p => p.Id == person.Id) == null)
{
personToSave.Tags.Add(tag);
}
}
//remove tags that exist for this person, but were not specified in the list of
//tags on the person object that was passed into the method.
foreach(var existingTag in existingTags)
{
if (!tagIds.Contains(existingTag.Id)
{
context.Tags.Find(existingTag.Id).People.Remove(person);
}
}
}
//Finally if no tags were passed in the model and the person has tags, remove them.
if (tagsIds.Count == 0 && existingTags.Count > 0)
{
foreach (var oldTag in existingTags)
{
context.Tags.Find(oldTag.Id).People.Remove(person);
}
}
context.SaveChanges();
var message = string.Format("Saved {0} with {1} tags", person.Name, person.Tags.Count);
return Json(new {message});
}
All of this code just seems like a lot of work to add/remove tags from a person. I am still fairly new to Entity Framework, so I feel like I am probably missing something. I would like to know if I there is a better way to do this. Also, please note that this was the first thing that I was able to get working, so there are probably additional refactorings that could be applied.
|
c#
|
entity-framework
|
many-to-many
|
entity-framework-4.1
| null | null |
open
|
How to properly save a many-to-many relationship in Entity Framework.
===
I am currently working with the following EF code first model that has a many to many relationship between a Person and a Tag.
public class person
{
public Person()
{
this.Tags = new List<Tag>();
}
public int Id { get; set; }
public string Name { get; set; }
public virtual ICollection<Tag> Tags { get; set; }
}
public class Tag
{
public Tag()
{
this.People = new List<Person>();
}
public int Id { get; set; }
public string Name { get; set; }
public virtual ICollection<Person> People { get; set; }
}
public MyContext : DbContext
{
public DbSet<Person> People { get; set; }
public DbSet<Tag> Tags { get; set; }
}
I am then passing in a Json model to an MVC Controller that contains an existing person and is updating the person name along with also either adding or removing tags from the person's tag list.
I was having some issues getting the tags associated to the person properly. After a lot trial and error, I have come up with the following method that works.
[HttpPost]
public JsonResult Save(Person person)
{
//get ids of all tags that are associated with this person.
var tagIds = new List<int>();
foreach (var tag in person.Tags)
{
tagsIds.Add(tag.Id);
}
//clone the person minus the tags
var personToSave = person;
personToSave.Tags = new List<Tag>();
var context = new MyContext();
var existingTags = (from t in context.Tags
where t.People.Count > 0 && t.People.All(p => p.Id == person.Id)
select t).ToList();
//attach the person, so updates to the person object will save.
context.Entry(personToSave).State = EntityState.Modified;
if (tagIds.Count > 0)
{
//add new tags
var tags = context.Tags.Where(t => tagIds.Contains(t.Id));
foreach (var tag in tags)
{
//check if tags has no people and not already associated to this person.
if (tag.People.Count == 0 || tag.People.First(p => p.Id == person.Id) == null)
{
personToSave.Tags.Add(tag);
}
}
//remove tags that exist for this person, but were not specified in the list of
//tags on the person object that was passed into the method.
foreach(var existingTag in existingTags)
{
if (!tagIds.Contains(existingTag.Id)
{
context.Tags.Find(existingTag.Id).People.Remove(person);
}
}
}
//Finally if no tags were passed in the model and the person has tags, remove them.
if (tagsIds.Count == 0 && existingTags.Count > 0)
{
foreach (var oldTag in existingTags)
{
context.Tags.Find(oldTag.Id).People.Remove(person);
}
}
context.SaveChanges();
var message = string.Format("Saved {0} with {1} tags", person.Name, person.Tags.Count);
return Json(new {message});
}
All of this code just seems like a lot of work to add/remove tags from a person. I am still fairly new to Entity Framework, so I feel like I am probably missing something. I would like to know if I there is a better way to do this. Also, please note that this was the first thing that I was able to get working, so there are probably additional refactorings that could be applied.
| 0 |
5,174,844 |
03/02/2011 23:29:36
| 642,121 |
03/02/2011 23:24:11
| 1 | 0 |
Has anyone done any interesting development leveraging the Pega PRPC platform.
|
Most Pega implementations typically fall into say 1 of 5 non-interesting project kits. Think insurance policy underwriting, loan application underwriting, new account opening, case management workflows etc. Given the power of their BRMS I assuming there are folks that have done something besides one of these canned project kits. I'm curious to find implementations that have followed their own blueprint.
|
pega
| null | null | null | null |
03/03/2011 04:03:20
|
not a real question
|
Has anyone done any interesting development leveraging the Pega PRPC platform.
===
Most Pega implementations typically fall into say 1 of 5 non-interesting project kits. Think insurance policy underwriting, loan application underwriting, new account opening, case management workflows etc. Given the power of their BRMS I assuming there are folks that have done something besides one of these canned project kits. I'm curious to find implementations that have followed their own blueprint.
| 1 |
4,255,128 |
11/23/2010 10:34:57
| 17,279 |
09/18/2008 05:53:12
| 12,193 | 434 |
Only perform selector if target supports it?
|
How do call optional protocol methods?
@protocol Foo
@optional
- (void) doA;
- (void) doB;
@end
Now we have to check each time we want to call `doA` or `doB`:
if ([delegate respondsToSelector:@selector(doA)])
[delegate performSelector:@selector(doA)];
That’s just silly. I’ve come up with a category on `NSObject` that adds:
- (void) performSelectorIfSupported: (SEL) selector
{
if ([self respondsToSelector:selector])
[self performSelector:selector];
}
…which is not that much better. Do you have a smarter solution, or do you just put up with the conditionals before each call?
|
objective-c
|
protocols
| null | null | null | null |
open
|
Only perform selector if target supports it?
===
How do call optional protocol methods?
@protocol Foo
@optional
- (void) doA;
- (void) doB;
@end
Now we have to check each time we want to call `doA` or `doB`:
if ([delegate respondsToSelector:@selector(doA)])
[delegate performSelector:@selector(doA)];
That’s just silly. I’ve come up with a category on `NSObject` that adds:
- (void) performSelectorIfSupported: (SEL) selector
{
if ([self respondsToSelector:selector])
[self performSelector:selector];
}
…which is not that much better. Do you have a smarter solution, or do you just put up with the conditionals before each call?
| 0 |
9,495,052 |
02/29/2012 07:20:47
| 973,530 |
09/30/2011 17:13:45
| 133 | 15 |
How to get float value from modulus in PHP?
|
We know `10 % 3` is `3.3333333333333333333333333`.
if i use `echo 10 % 3`, it return `1` not `3.3333333333333333333333333`.
Now how to get float value from modulus in PHP? is possible to get `3.3333333333333333333333333`?
Thanks.
|
php5
|
math
|
float
| null | null |
02/29/2012 19:07:26
|
too localized
|
How to get float value from modulus in PHP?
===
We know `10 % 3` is `3.3333333333333333333333333`.
if i use `echo 10 % 3`, it return `1` not `3.3333333333333333333333333`.
Now how to get float value from modulus in PHP? is possible to get `3.3333333333333333333333333`?
Thanks.
| 3 |
746,435 |
04/14/2009 05:22:08
| 111,869 |
04/14/2009 04:24:19
| 1 | 1 |
Ruby Deleting subdirectories that contain only a specific directory
|
I need to delete a bunch of subdirectories that only contain other directories, and ".svn" directories.
If you look at it like a tree, the "leaves" contain only ".svn" directories, so it should be possible to delete the leaves, then step back up a level, delete the new leaves, etc.
I think this code should do it, but I'm stuck on what to put in "something".
Find.find('./com/') do |path|
if File.basename(path) == 'something'
FileUtils.remove_dir(path, true)
Find.prune
end
end
Any suggestions?
|
ruby
|
file-io
|
directory
| null | null | null |
open
|
Ruby Deleting subdirectories that contain only a specific directory
===
I need to delete a bunch of subdirectories that only contain other directories, and ".svn" directories.
If you look at it like a tree, the "leaves" contain only ".svn" directories, so it should be possible to delete the leaves, then step back up a level, delete the new leaves, etc.
I think this code should do it, but I'm stuck on what to put in "something".
Find.find('./com/') do |path|
if File.basename(path) == 'something'
FileUtils.remove_dir(path, true)
Find.prune
end
end
Any suggestions?
| 0 |
3,629,114 |
09/02/2010 16:26:16
| 438,171 |
09/02/2010 16:20:11
| 1 | 0 |
Can't run php code from inside html file
|
I am having a problem running my php code from inside an html file. I have tried the .htaccess method and the handler method. I'm using a webserver with cpanel(version 11), apache(2.2.15) and php(5.2.13).I have also tried the files on xampp and they work perfect, but when I upload them to the webserver the php code from inside the html will not run.
Any suggestions, please?
|
php
|
html
| null | null | null | null |
open
|
Can't run php code from inside html file
===
I am having a problem running my php code from inside an html file. I have tried the .htaccess method and the handler method. I'm using a webserver with cpanel(version 11), apache(2.2.15) and php(5.2.13).I have also tried the files on xampp and they work perfect, but when I upload them to the webserver the php code from inside the html will not run.
Any suggestions, please?
| 0 |
1,995,189 |
01/03/2010 14:55:50
| 231,582 |
12/14/2009 20:02:39
| 13 | 0 |
MySQL stored procedure, handling multiple cursors and query results
|
How can I use two cursors in the same rutine? If I remove the second cursor declaration and fetch loop everthing works fine. The rutine is used for adding a friend in my webapp. It takes the id of the current user and the email of the friend we want to add as a friend, then it checks if the email has a corresponding user id and if no friend relation exists it will create one. Any other rutine solution than this one would be great as well.
DROP PROCEDURE IF EXISTS addNewFriend;
DELIMITER //
CREATE PROCEDURE addNewFriend(IN inUserId INT UNSIGNED, IN inFriendEmail VARCHAR(80))
BEGIN
DECLARE tempFriendId INT UNSIGNED DEFAULT 0;
DECLARE tempId INT UNSIGNED DEFAULT 0;
DECLARE done INT DEFAULT 0;
DECLARE cur CURSOR FOR
SELECT id FROM users WHERE email = inFriendEmail;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = 1;
OPEN cur;
REPEAT
FETCH cur INTO tempFriendId;
UNTIL done = 1 END REPEAT;
CLOSE cur;
DECLARE cur CURSOR FOR
SELECT user_id FROM users_friends WHERE user_id = tempFriendId OR friend_id = tempFriendId;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = 1;
OPEN cur;
REPEAT
FETCH cur INTO tempId;
UNTIL done = 1 END REPEAT;
CLOSE cur;
IF tempFriendId != 0 AND tempId != 0 THEN
INSERT INTO users_friends (user_id, friend_id) VALUES(inUserId, tempFriendId);
END IF;
SELECT tempFriendId as friendId;
END //
DELIMITER ;
|
mysql
|
stored-procedures
|
sql
|
cursor
| null | null |
open
|
MySQL stored procedure, handling multiple cursors and query results
===
How can I use two cursors in the same rutine? If I remove the second cursor declaration and fetch loop everthing works fine. The rutine is used for adding a friend in my webapp. It takes the id of the current user and the email of the friend we want to add as a friend, then it checks if the email has a corresponding user id and if no friend relation exists it will create one. Any other rutine solution than this one would be great as well.
DROP PROCEDURE IF EXISTS addNewFriend;
DELIMITER //
CREATE PROCEDURE addNewFriend(IN inUserId INT UNSIGNED, IN inFriendEmail VARCHAR(80))
BEGIN
DECLARE tempFriendId INT UNSIGNED DEFAULT 0;
DECLARE tempId INT UNSIGNED DEFAULT 0;
DECLARE done INT DEFAULT 0;
DECLARE cur CURSOR FOR
SELECT id FROM users WHERE email = inFriendEmail;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = 1;
OPEN cur;
REPEAT
FETCH cur INTO tempFriendId;
UNTIL done = 1 END REPEAT;
CLOSE cur;
DECLARE cur CURSOR FOR
SELECT user_id FROM users_friends WHERE user_id = tempFriendId OR friend_id = tempFriendId;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = 1;
OPEN cur;
REPEAT
FETCH cur INTO tempId;
UNTIL done = 1 END REPEAT;
CLOSE cur;
IF tempFriendId != 0 AND tempId != 0 THEN
INSERT INTO users_friends (user_id, friend_id) VALUES(inUserId, tempFriendId);
END IF;
SELECT tempFriendId as friendId;
END //
DELIMITER ;
| 0 |
9,246,888 |
02/12/2012 06:16:38
| 1,155,412 |
01/18/2012 04:32:52
| 16 | 2 |
Webdrive errors from Firefox
|
A client ran a small test for me, her Firefox fails with errors...and yet it runs on mine.
> First is "Your Firefox profile cannot be loaded. It may be missing or
inaccessible.", which is then followed by "The update could not be
installed. Please make sure there are no other copies of Firefox
running on your computer, and then restart Firefox to try again." Then
a new Firefox window is opened with an empty tab in it (and no
navigation bar, unlike all the other Firefox windows I have opened
right now).
Is she going to have to add some addons to her browser?
|
firefox
|
webdriver
| null | null | null | null |
open
|
Webdrive errors from Firefox
===
A client ran a small test for me, her Firefox fails with errors...and yet it runs on mine.
> First is "Your Firefox profile cannot be loaded. It may be missing or
inaccessible.", which is then followed by "The update could not be
installed. Please make sure there are no other copies of Firefox
running on your computer, and then restart Firefox to try again." Then
a new Firefox window is opened with an empty tab in it (and no
navigation bar, unlike all the other Firefox windows I have opened
right now).
Is she going to have to add some addons to her browser?
| 0 |
7,834,013 |
10/20/2011 09:41:51
| 200,716 |
08/27/2009 17:47:03
| 369 | 30 |
Download the all things like audio,video and html pages
|
I am creating the one application in that use the audio,video and html pages when user tap in the download button then the all html page, video and audio download into locally.
when the download this stuffs that times shows the progress bar.
Any body have the idea about this things.
Thanks in advance.
|
iphone
|
xcode
|
ipad
| null | null |
10/21/2011 19:51:02
|
not a real question
|
Download the all things like audio,video and html pages
===
I am creating the one application in that use the audio,video and html pages when user tap in the download button then the all html page, video and audio download into locally.
when the download this stuffs that times shows the progress bar.
Any body have the idea about this things.
Thanks in advance.
| 1 |
6,008,898 |
05/15/2011 14:11:23
| 556,479 |
12/28/2010 21:51:51
| 739 | 28 |
Help with C printf function
|
I am trying to duplicate NSLog but without all of the unnecessary dates at the beginning. I have tried the following c function (I made myself), but it wont log any other values that are not NSStrings. Please could you tell me how I could do it so that it would log any value?
static void echo(NSString *fmt, ...) {
printf("<<<<<<<%s>>>>>>>", [fmt UTF8String]);
}
Thanks in advanced.
XcodeDev
|
objective-c
|
c
|
printf
|
nslog
| null | null |
open
|
Help with C printf function
===
I am trying to duplicate NSLog but without all of the unnecessary dates at the beginning. I have tried the following c function (I made myself), but it wont log any other values that are not NSStrings. Please could you tell me how I could do it so that it would log any value?
static void echo(NSString *fmt, ...) {
printf("<<<<<<<%s>>>>>>>", [fmt UTF8String]);
}
Thanks in advanced.
XcodeDev
| 0 |
6,187,164 |
05/31/2011 11:53:38
| 674,530 |
03/24/2011 08:22:11
| 80 | 33 |
android player need help
|
<pre>
Hello,<br>
is it possible to create all the function of the media player without create our methods like stop play etc?<br>
i mean to ask how to play song into media player using android without doing coding? if it is possible?<br>
<br>
<b>Problem 2]</b><br>
http://stackoverflow.com/questions/6186676/android-audio-player-getting-problem<br>
how to set my current position to seekbar?
i mean seekbar moves itself according to playing video into videoview?
<pre>
|
android
|
player
|
seek
| null | null |
05/31/2011 18:48:46
|
not a real question
|
android player need help
===
<pre>
Hello,<br>
is it possible to create all the function of the media player without create our methods like stop play etc?<br>
i mean to ask how to play song into media player using android without doing coding? if it is possible?<br>
<br>
<b>Problem 2]</b><br>
http://stackoverflow.com/questions/6186676/android-audio-player-getting-problem<br>
how to set my current position to seekbar?
i mean seekbar moves itself according to playing video into videoview?
<pre>
| 1 |
5,436,224 |
03/25/2011 17:52:30
| 496,700 |
11/04/2010 02:21:42
| 111 | 4 |
What is the necessary Math skills needed for a particular field?
|
Do you have an overview of what kind of Math is most useful for which field? For example, if a linux kernel developer, what type of math knowledge does one programmer need? For a driver developer, what type of Math is needed? It seems to me that except for computer science related fields and game programming, do other IT fields need hardcore Math?
|
math
| null | null | null | null |
03/25/2011 20:37:03
|
not a real question
|
What is the necessary Math skills needed for a particular field?
===
Do you have an overview of what kind of Math is most useful for which field? For example, if a linux kernel developer, what type of math knowledge does one programmer need? For a driver developer, what type of Math is needed? It seems to me that except for computer science related fields and game programming, do other IT fields need hardcore Math?
| 1 |
6,000,829 |
05/14/2011 09:04:27
| 705,414 |
04/13/2011 06:40:40
| 179 | 0 |
Is there any concurent queue library available in c++?
|
I am wondering if there is any concurrent queue implementation/library available in c++?
|
c++
|
boost
|
stl
| null | null | null |
open
|
Is there any concurent queue library available in c++?
===
I am wondering if there is any concurrent queue implementation/library available in c++?
| 0 |
4,725,056 |
01/18/2011 14:14:08
| 341,062 |
05/14/2010 08:37:59
| 492 | 13 |
How to convert data downloaded from a web site into the correct encoding?
|
I've been having issues with data downloaded using a .net WebClient control, in that I seem to have little control over the encoding of the data that I get back from a web server.
The specifics of the question are in the post linked below, but I want to ask the question in a more general sense as the answer is not really helping (not the answerer's fault!).
http://stackoverflow.com/questions/4716470/asp-net-c-webclient-downloadstring-returns-string-with-perculiar-characters
**The real problem is that supposedly there is no way to detect the encoding of a response from a web server, and the webserver may not respond using the encoding specified in the headers.**
*If* this is true, how do web browsers such as IE, Firefox and Chrome work out how to decode the stream when you use the view source functionality?
It must be possible, this seems like a really fundamental requirement!
|
c#
|
asp.net
|
character-encoding
|
webkit
|
webbrowser
| null |
open
|
How to convert data downloaded from a web site into the correct encoding?
===
I've been having issues with data downloaded using a .net WebClient control, in that I seem to have little control over the encoding of the data that I get back from a web server.
The specifics of the question are in the post linked below, but I want to ask the question in a more general sense as the answer is not really helping (not the answerer's fault!).
http://stackoverflow.com/questions/4716470/asp-net-c-webclient-downloadstring-returns-string-with-perculiar-characters
**The real problem is that supposedly there is no way to detect the encoding of a response from a web server, and the webserver may not respond using the encoding specified in the headers.**
*If* this is true, how do web browsers such as IE, Firefox and Chrome work out how to decode the stream when you use the view source functionality?
It must be possible, this seems like a really fundamental requirement!
| 0 |
5,033,929 |
02/17/2011 20:01:39
| 255,932 |
01/21/2010 15:36:34
| 65 | 4 |
Get template rendered from controller without render yet
|
I want to return my response as JSON with ajax containing more atributtes instead only the template:
Default:
render(template:"/templates/question",model:[question: question])
..and want something like:
def template = *get*(template:"/templates/question",model:[question: question])
render [template:template, isTemplate: true] as JSON
Is that possible?
Thanks
|
json
|
templates
|
grails
|
render
| null | null |
open
|
Get template rendered from controller without render yet
===
I want to return my response as JSON with ajax containing more atributtes instead only the template:
Default:
render(template:"/templates/question",model:[question: question])
..and want something like:
def template = *get*(template:"/templates/question",model:[question: question])
render [template:template, isTemplate: true] as JSON
Is that possible?
Thanks
| 0 |
4,028,569 |
10/26/2010 22:25:07
| 109,589 |
05/19/2009 19:58:04
| 20 | 4 |
What is the best way to render LESS.js stylesheets in node.js using express?
|
I have a small node.js app (my first) that I want to have compile it's less.js stylesheets when the server loads. The point I'm starting at is the express example app for jade where it appears it compiles it's SASS templates when the server is created:
var pub = __dirname + '/public';
var app = express.createServer(
express.compiler({ src: pub, enable: ['sass'] }),
express.staticProvider(pub)
);
I saw this and hoped it would be as simple as changing sass to less but that doesn't appear to work.
Is there a different approach I should take? Is there something I'm missing? I can't find the documentation on the .compile method anywhere.
Thanks!
|
node.js
|
less
|
express
| null | null | null |
open
|
What is the best way to render LESS.js stylesheets in node.js using express?
===
I have a small node.js app (my first) that I want to have compile it's less.js stylesheets when the server loads. The point I'm starting at is the express example app for jade where it appears it compiles it's SASS templates when the server is created:
var pub = __dirname + '/public';
var app = express.createServer(
express.compiler({ src: pub, enable: ['sass'] }),
express.staticProvider(pub)
);
I saw this and hoped it would be as simple as changing sass to less but that doesn't appear to work.
Is there a different approach I should take? Is there something I'm missing? I can't find the documentation on the .compile method anywhere.
Thanks!
| 0 |
6,635,697 |
07/09/2011 15:30:29
| 836,826 |
07/09/2011 15:30:29
| 1 | 0 |
how to make this program efficient in c?
|
here is the code for mars rover problem.
#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
int x,y,i=0,o,p;
char dir[25],a;
printf("enter the a value");
scanf("%c",&a);
printf("enter the command");
scanf("%s",dir);
printf("enter the upper bounds");
scanf("%d%d",&o,&p);
printf("enter the coordinates n dir");
scanf("%d%d",&x,&y);
clrscr();
if(((x>0)&&(x<o))&&((y>0)&&(y<p)))
{
while(dir[i]!='\0')
{
for(i=0;i<strlen(dir);i++)
{
if(dir[i]=='l')
{
if(a=='n')
a='w';
else if(a=='w')
a='s';
else if(a=='s')
a='e';
else
a='n';
}
else if(dir[i]=='r')
{
if(a=='n')
a='e';
else if(a=='e')
a='s';
else if(a=='s')
a='w';
else
a='n';
}
else
{
if(a=='n')
y=y+1;
else if(a=='w')
x=x-1;
else if(a=='s')
y=y-1;
else
x=x+1;
}}}
printf("%d %d %c",x,y,a);}
else
printf("out of boundaries");
getch();
}
how to make the above program efficient using some oops concept in c or by some way?
|
c
| null | null | null | null |
07/09/2011 20:41:03
|
not a real question
|
how to make this program efficient in c?
===
here is the code for mars rover problem.
#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
int x,y,i=0,o,p;
char dir[25],a;
printf("enter the a value");
scanf("%c",&a);
printf("enter the command");
scanf("%s",dir);
printf("enter the upper bounds");
scanf("%d%d",&o,&p);
printf("enter the coordinates n dir");
scanf("%d%d",&x,&y);
clrscr();
if(((x>0)&&(x<o))&&((y>0)&&(y<p)))
{
while(dir[i]!='\0')
{
for(i=0;i<strlen(dir);i++)
{
if(dir[i]=='l')
{
if(a=='n')
a='w';
else if(a=='w')
a='s';
else if(a=='s')
a='e';
else
a='n';
}
else if(dir[i]=='r')
{
if(a=='n')
a='e';
else if(a=='e')
a='s';
else if(a=='s')
a='w';
else
a='n';
}
else
{
if(a=='n')
y=y+1;
else if(a=='w')
x=x-1;
else if(a=='s')
y=y-1;
else
x=x+1;
}}}
printf("%d %d %c",x,y,a);}
else
printf("out of boundaries");
getch();
}
how to make the above program efficient using some oops concept in c or by some way?
| 1 |
909,449 |
05/26/2009 07:49:58
| 112,328 |
05/26/2009 01:43:51
| 13 | 0 |
Anagrams finder in javascript
|
I am supposed to write a program in JavaScript to find all the anagrams within a series of words provided. e.g.: "monk, konm, bbc, cbb, dell, ledl"
The output should be categorised into rows:
1. monk konm;
2. bbc cbb;
3. dell ledl;
I already sorted them into alphabetical order i.e.:
"kmno kmno bbc bbc dell dell"
and put them into an array.
However I am stuck in comparing and finding the matching anagram within the array.
Any help will be greatly appreciated.
|
javascript
|
string
|
anagram
| null | null | null |
open
|
Anagrams finder in javascript
===
I am supposed to write a program in JavaScript to find all the anagrams within a series of words provided. e.g.: "monk, konm, bbc, cbb, dell, ledl"
The output should be categorised into rows:
1. monk konm;
2. bbc cbb;
3. dell ledl;
I already sorted them into alphabetical order i.e.:
"kmno kmno bbc bbc dell dell"
and put them into an array.
However I am stuck in comparing and finding the matching anagram within the array.
Any help will be greatly appreciated.
| 0 |
3,733,968 |
09/17/2010 09:04:08
| 395,126 |
07/18/2010 11:47:23
| 798 | 51 |
Implementation of network protocols
|
I am going to be implementing a network protocol (specifically, SFTP) and I wondered if there are any general rules-of-thumb to follow?
At the moment it seems like a mammoth task and I'm at a loss as where to start.
I'm looking for:
- Tips
- Best practices
- Possible design patterns
- Experiences
Try to keep it applicable to network protocols in general.
Thanks!
|
c#
|
design-patterns
|
oop
|
implementation
|
network-protocols
| null |
open
|
Implementation of network protocols
===
I am going to be implementing a network protocol (specifically, SFTP) and I wondered if there are any general rules-of-thumb to follow?
At the moment it seems like a mammoth task and I'm at a loss as where to start.
I'm looking for:
- Tips
- Best practices
- Possible design patterns
- Experiences
Try to keep it applicable to network protocols in general.
Thanks!
| 0 |
8,127,158 |
11/14/2011 19:46:45
| 1,046,196 |
11/14/2011 19:08:16
| 1 | 0 |
PHP OOP website opesource
|
I'm searching for an opensource php oop website to learn how to structure my first web site. Somebody can help me find that?
|
php
|
oop
|
open-source
|
website
| null |
11/14/2011 21:20:10
|
not a real question
|
PHP OOP website opesource
===
I'm searching for an opensource php oop website to learn how to structure my first web site. Somebody can help me find that?
| 1 |
90,976 |
09/18/2008 08:38:21
| 3,820 |
08/31/2008 02:26:19
| 166 | 7 |
Can you register an existing instance of a type in the Windsor Container?
|
In the Windsor IOC container is it possible to register a type that I've already got an instance for, instead of having the container create it?
|
c#
|
.net
|
vb.net
|
castle-windsor
|
inversionofcontrol
| null |
open
|
Can you register an existing instance of a type in the Windsor Container?
===
In the Windsor IOC container is it possible to register a type that I've already got an instance for, instead of having the container create it?
| 0 |
4,789,060 |
01/25/2011 01:15:44
| 588,336 |
01/25/2011 00:43:23
| 1 | 5 |
What percentage of the developer’s time is spent in meetings versus uninterrupted coding time?
|
What percentage of the developer’s time is spent in meetings versus uninterrupted coding time?
|
programming-languages
| null | null | null | null |
01/25/2011 01:21:45
|
off topic
|
What percentage of the developer’s time is spent in meetings versus uninterrupted coding time?
===
What percentage of the developer’s time is spent in meetings versus uninterrupted coding time?
| 2 |
6,419,962 |
06/21/2011 03:15:30
| 376,947 |
06/26/2010 12:43:39
| 764 | 6 |
Why do IDs exist?
|
Anything that you can do with IDs you can do with classes.
So why is there a ID attribute then?
Yeah the ID is unique but a class can be unique too...
|
html
|
css
| null | null | null | null |
open
|
Why do IDs exist?
===
Anything that you can do with IDs you can do with classes.
So why is there a ID attribute then?
Yeah the ID is unique but a class can be unique too...
| 0 |
10,778,837 |
05/28/2012 02:44:59
| 754,830 |
05/15/2011 20:32:45
| 521 | 36 |
How to setup a multi-server network for a web application
|
I am experienced with development, but not with servers and networking. I am developing an application and stability is critical. What I am wondering is how my network should be structured and how it will all work?
To create a stable, fast and expandable network, I think I will need 2 web servers, 2 database servers and a load balancer. The reason I believe I need 2 web servers and 2 database servers is not for performance, but for failover.
Is this the best solution? Where would my application files & databases reside? Could there be a "central stand alone" storage point that is RAID10 and all servers read from it? I think this because it doesn't sound logical to duplicate the files across the servers.
The most amount of money I want to spend on getting the network setup would be about $10k. Will this be enough? The servers don't have to be huge at the beginning as there will not be enough transactions to overload even a small server. It is the critical stability that I am after.
If anyone can explain in laymen terms how my network should be setup it would be appreciated. If it is needed, this is a web based .net 4.0 application with sql server 2008 running multiple databases.
|
asp.net
|
sql-server
|
windows
|
networking
|
load-balancing
|
05/28/2012 12:05:16
|
off topic
|
How to setup a multi-server network for a web application
===
I am experienced with development, but not with servers and networking. I am developing an application and stability is critical. What I am wondering is how my network should be structured and how it will all work?
To create a stable, fast and expandable network, I think I will need 2 web servers, 2 database servers and a load balancer. The reason I believe I need 2 web servers and 2 database servers is not for performance, but for failover.
Is this the best solution? Where would my application files & databases reside? Could there be a "central stand alone" storage point that is RAID10 and all servers read from it? I think this because it doesn't sound logical to duplicate the files across the servers.
The most amount of money I want to spend on getting the network setup would be about $10k. Will this be enough? The servers don't have to be huge at the beginning as there will not be enough transactions to overload even a small server. It is the critical stability that I am after.
If anyone can explain in laymen terms how my network should be setup it would be appreciated. If it is needed, this is a web based .net 4.0 application with sql server 2008 running multiple databases.
| 2 |
11,477,100 |
07/13/2012 19:29:00
| 1,218,599 |
02/19/2012 00:02:54
| 112 | 0 |
Algorithm analysis: Am I analyzing these algorithms correctly? How to approach problems like these
|
1)
x = 25;
for (int i = 0; i < myArray.length; i++)
{
if (myArray[i] == x)
System.out.println("found!");
}
I think this one is O(n).
2)
for (int r = 0; r < 10000; r++)
for (int c = 0; c < 10000; c++)
if (c % r == 0)
System.out.println("blah!");
I think this one is O(1), because for any input n, it will run 10000 * 10000 times. Not sure if this is right.
3)
a = 0
for (int i = 0; i < k; i++)
{
for (int j = 0; j < i; j++)
a++;
}
I think this one is O(i * k). I don't really know how to approach problems like this where the inner loop is affected by variables being incremented in the outer loop. Some key insights here would be much appreciated. The outer loop runs k times, and the inner loop runs 1 + 2 + 3 + ... + k times. So that sum should be (k/2) * (k+1), which would be order of k^2. So would it actually be O(n * k^2)? That seems too large. Again, don't know how to approach this.
4)
int key = 0; //key may be any value
int first = 0;
int last = intArray.length-1;;
int mid = 0;
boolean found = false;
while( (!found) && (first <= last) )
{
mid = (first + last) / 2;
if(key == intArray[mid])
found = true;
if(key < intArray[mid])
last = mid - 1;
if(key > intArray[mid])
first = mid + 1;
}
This one, I think is O(log n). But, I came to this conclusion because I believe it is a binary search and I know from reading that the runtime is O(log n). I think it's because you divide the input size by 2 for each iteration of the loop. But, I don't know if this is the correct reasoning or how to approach similar algorithms that I haven't seen and be able to deduce that they run in logarithmic time in a more verifiable or formal way.
5)
int currentMinIndex = 0;
for (int front = 0; front < intArray.length; front++)
{
currentMinIndex = front;
for (int i = front; i < intArray.length; i++)
{
if (intArray[i] < intArray[currentMinIndex])
{
currentMinIndex = i;
}
}
int tmp = intArray[front];
intArray[front] = intArray[currentMinIndex];
intArray[currentMinIndex] = tmp;
}
I am confused about this one. The outer loop runs n times. And the inner for loop runs
n + (n-1) + (n-2) + ... (n - k) + 1 times? So is that O(n^3) ?? I don't know how to approach this one. Any
|
c++
|
algorithm
|
big-o
| null | null |
07/14/2012 20:18:24
|
too localized
|
Algorithm analysis: Am I analyzing these algorithms correctly? How to approach problems like these
===
1)
x = 25;
for (int i = 0; i < myArray.length; i++)
{
if (myArray[i] == x)
System.out.println("found!");
}
I think this one is O(n).
2)
for (int r = 0; r < 10000; r++)
for (int c = 0; c < 10000; c++)
if (c % r == 0)
System.out.println("blah!");
I think this one is O(1), because for any input n, it will run 10000 * 10000 times. Not sure if this is right.
3)
a = 0
for (int i = 0; i < k; i++)
{
for (int j = 0; j < i; j++)
a++;
}
I think this one is O(i * k). I don't really know how to approach problems like this where the inner loop is affected by variables being incremented in the outer loop. Some key insights here would be much appreciated. The outer loop runs k times, and the inner loop runs 1 + 2 + 3 + ... + k times. So that sum should be (k/2) * (k+1), which would be order of k^2. So would it actually be O(n * k^2)? That seems too large. Again, don't know how to approach this.
4)
int key = 0; //key may be any value
int first = 0;
int last = intArray.length-1;;
int mid = 0;
boolean found = false;
while( (!found) && (first <= last) )
{
mid = (first + last) / 2;
if(key == intArray[mid])
found = true;
if(key < intArray[mid])
last = mid - 1;
if(key > intArray[mid])
first = mid + 1;
}
This one, I think is O(log n). But, I came to this conclusion because I believe it is a binary search and I know from reading that the runtime is O(log n). I think it's because you divide the input size by 2 for each iteration of the loop. But, I don't know if this is the correct reasoning or how to approach similar algorithms that I haven't seen and be able to deduce that they run in logarithmic time in a more verifiable or formal way.
5)
int currentMinIndex = 0;
for (int front = 0; front < intArray.length; front++)
{
currentMinIndex = front;
for (int i = front; i < intArray.length; i++)
{
if (intArray[i] < intArray[currentMinIndex])
{
currentMinIndex = i;
}
}
int tmp = intArray[front];
intArray[front] = intArray[currentMinIndex];
intArray[currentMinIndex] = tmp;
}
I am confused about this one. The outer loop runs n times. And the inner for loop runs
n + (n-1) + (n-2) + ... (n - k) + 1 times? So is that O(n^3) ?? I don't know how to approach this one. Any
| 3 |
3,999,875 |
10/22/2010 18:36:49
| 377,031 |
06/26/2010 16:51:13
| 1,600 | 3 |
Which recommended Perl modules can serialize coderefs?
|
As far as I can tell `Storable` can't. I only found `YAML` (and `YAML::XS` which [I can't really get to work][1]).
Are there other alternatives?
What would you recommend?
[1]: http://stackoverflow.com/questions/3999841
|
perl
|
serialization
|
yaml
|
storable
|
coderef
| null |
open
|
Which recommended Perl modules can serialize coderefs?
===
As far as I can tell `Storable` can't. I only found `YAML` (and `YAML::XS` which [I can't really get to work][1]).
Are there other alternatives?
What would you recommend?
[1]: http://stackoverflow.com/questions/3999841
| 0 |
7,228,956 |
08/29/2011 10:34:20
| 346,645 |
05/20/2010 23:57:48
| 87 | 4 |
Unexplained warning creating vectors
|
Below is a printout of from my terminal when I create two vectors of ones. Does anyone know the reason why the second call to *ones()* issues a warning, while the first does not?
>> p1
p1 =
0.7000
>> p2
p2 =
0.3000
>> whos p1
Name Size Bytes Class Attributes
p1 1x1 8 double
>> whos p2
Name Size Bytes Class Attributes
p2 1x1 8 double
>> N
N =
100
>> T1 = ones(N*p1,1);
>> T2 = ones(N*p2,1);
Warning: Size vector should be a row vector with integer elements.
|
matlab
| null | null | null | null | null |
open
|
Unexplained warning creating vectors
===
Below is a printout of from my terminal when I create two vectors of ones. Does anyone know the reason why the second call to *ones()* issues a warning, while the first does not?
>> p1
p1 =
0.7000
>> p2
p2 =
0.3000
>> whos p1
Name Size Bytes Class Attributes
p1 1x1 8 double
>> whos p2
Name Size Bytes Class Attributes
p2 1x1 8 double
>> N
N =
100
>> T1 = ones(N*p1,1);
>> T2 = ones(N*p2,1);
Warning: Size vector should be a row vector with integer elements.
| 0 |
9,788,822 |
03/20/2012 14:34:09
| 1,242,947 |
03/01/2012 14:51:20
| 66 | 6 |
How to limit the list of ciphers available to openssl
|
Is there a way to force openssl to use a particular cipher by default (or to some how set a preference list). If I run openssl from the command line connecting to a particular server as follows:
openssl s_client -connect host:port -cert cert.pem
It fails with error message `tlsv1 alert internal error`. However if I force the cipher as in the following command line example then it works:
openssl s_client -cipher DHE-RSA-AES256-SHA -connect host:port -cert cert.pem
I am experiencing this problem with OpenSSL 1.0.1. The problem does not exist if I use openssl 0.98 (but this causes other issues). I read some where about a similiar problem which was solved by limiting the ciphers available to OpenSSL (version 1). Can any one shed some light on how to do this?
I am ultimately using php but would prefer to solve this problem at an openssl level if possible.
|
ssl
|
openssl
| null | null | null |
03/21/2012 10:13:57
|
too localized
|
How to limit the list of ciphers available to openssl
===
Is there a way to force openssl to use a particular cipher by default (or to some how set a preference list). If I run openssl from the command line connecting to a particular server as follows:
openssl s_client -connect host:port -cert cert.pem
It fails with error message `tlsv1 alert internal error`. However if I force the cipher as in the following command line example then it works:
openssl s_client -cipher DHE-RSA-AES256-SHA -connect host:port -cert cert.pem
I am experiencing this problem with OpenSSL 1.0.1. The problem does not exist if I use openssl 0.98 (but this causes other issues). I read some where about a similiar problem which was solved by limiting the ciphers available to OpenSSL (version 1). Can any one shed some light on how to do this?
I am ultimately using php but would prefer to solve this problem at an openssl level if possible.
| 3 |
771,048 |
04/21/2009 04:33:46
| 9,425 |
09/15/2008 18:46:39
| 818 | 59 |
Add "Select top 1000" command to toolbar in SSMS
|
I am using SQL server management studio (2008) quite a lot these days. If it had a "Select top 1000" command in the toolbar,(or a shortcut key) it would make my life a lot easier. Is there any way i can do it. I tried looking in the customize dialog, but cant find that command there.
|
sql-server
|
ssms
|
ssms2008
| null | null | null |
open
|
Add "Select top 1000" command to toolbar in SSMS
===
I am using SQL server management studio (2008) quite a lot these days. If it had a "Select top 1000" command in the toolbar,(or a shortcut key) it would make my life a lot easier. Is there any way i can do it. I tried looking in the customize dialog, but cant find that command there.
| 0 |
6,882,921 |
07/30/2011 11:50:26
| 870,617 |
07/30/2011 11:50:26
| 1 | 0 |
cakephp: How can i add dropdownlist in default.ctp ?
|
In default.ctp I want to add two dropdownlists.
One is list of year from 2010 to 2020 and the another one is a list of month from January to December.
How can i do this ?
Do i have to create form for this ? like
echo $this->Form->create...
echo $this->Form->end..
Or can i just add two dropdownlists and a search button ?
The if i click the "Search" button it will go for posts/archive action and display those posts with that "year-month"
Can anyone post sample code for this?
Thanks in advance.
|
php
|
mysql
|
database
|
php5
|
cakephp
| null |
open
|
cakephp: How can i add dropdownlist in default.ctp ?
===
In default.ctp I want to add two dropdownlists.
One is list of year from 2010 to 2020 and the another one is a list of month from January to December.
How can i do this ?
Do i have to create form for this ? like
echo $this->Form->create...
echo $this->Form->end..
Or can i just add two dropdownlists and a search button ?
The if i click the "Search" button it will go for posts/archive action and display those posts with that "year-month"
Can anyone post sample code for this?
Thanks in advance.
| 0 |
10,597,458 |
05/15/2012 09:05:24
| 1,272,383 |
03/15/2012 18:50:38
| 34 | 5 |
Interspire Email Marketer Configuration
|
Im trying to setup Interspire email marketer for a client. I have a working configuration of it on the VPS but this one is having issues! I have transferred it from their old server and setup the new database...
Im thinking it could be to do with the PHP settings / MY SQL memory or buffer.
when I send to a small list, it works fine, but when its faced with a larger list it wont do the business... it wont even start sending.
Ive been comparing the two configurations:
http://oldhabs.com/emailmarketer/check_iem.php (This one works)
http://servedby.intelligentmedia.co.uk/check_iem.php (This is the one that wont send to a large list)
Ive been getting these errors from Interspire itself:
> Error Resource is not really a resource Internal May 15
> 2012 07:20:05
> Location::
>
> /var/www/vhosts/intelligentmedia.co.uk/servedby/admin/functions/api/jobs.php
> (Line 1068)
> Error Table 'imsemailsender.email_user_permissions' doesn't exist Internal May 15 2012 07:20:05
> Query:
>
> SELECT l.listid, l.ownername, l.owneremail FROM email_lists l,
> email_user_permissions p WHERE l.listid IN(198) AND l.ownerid =
> p.userid AND p.area = 'lists' AND p.subarea = 'bouncesettings'
>
> Location::
>
> /var/www/vhosts/intelligentmedia.co.uk/servedby/admin/functions/api/jobs.php
> (Line 1065)
> Notice Undefined index: ownerid Internal May 15 2012 07:15:54 Undefined index: ownerid in
> /var/www/vhosts/intelligentmedia.co.uk/servedby/admin/functions/send.php
> at 213 File Line Function
> /var/www/vhosts/intelligentmedia.co.uk/servedby/admin/functions/send.php
> 213 HandlePHPErrors
> /var/www/vhosts/intelligentmedia.co.uk/servedby/admin/com/init.php
> 548 Send->Process
> /var/www/vhosts/intelligentmedia.co.uk/servedby/admin/index.php 76
> require_once
>
> Notice Undefined index: jobdetails Internal May 15 2012 07:15:54 Undefined index: jobdetails in
> /var/www/vhosts/intelligentmedia.co.uk/servedby/admin/functions/send.php
> at 212 File Line Function
> /var/www/vhosts/intelligentmedia.co.uk/servedby/admin/functions/send.php
> 212 HandlePHPErrors
> /var/www/vhosts/intelligentmedia.co.uk/servedby/admin/com/init.php
> 548 Send->Process
> /var/www/vhosts/intelligentmedia.co.uk/servedby/admin/index.php
I know the top error is to do with the wrong bounced address... I think. Would this stop the send to that list?
Ive checked the server logs, and Im not getting any errors.
Any help you can give is greatly appreciated.
Thanks
Dan
|
php
|
mysql
|
email
| null | null |
05/23/2012 09:08:41
|
off topic
|
Interspire Email Marketer Configuration
===
Im trying to setup Interspire email marketer for a client. I have a working configuration of it on the VPS but this one is having issues! I have transferred it from their old server and setup the new database...
Im thinking it could be to do with the PHP settings / MY SQL memory or buffer.
when I send to a small list, it works fine, but when its faced with a larger list it wont do the business... it wont even start sending.
Ive been comparing the two configurations:
http://oldhabs.com/emailmarketer/check_iem.php (This one works)
http://servedby.intelligentmedia.co.uk/check_iem.php (This is the one that wont send to a large list)
Ive been getting these errors from Interspire itself:
> Error Resource is not really a resource Internal May 15
> 2012 07:20:05
> Location::
>
> /var/www/vhosts/intelligentmedia.co.uk/servedby/admin/functions/api/jobs.php
> (Line 1068)
> Error Table 'imsemailsender.email_user_permissions' doesn't exist Internal May 15 2012 07:20:05
> Query:
>
> SELECT l.listid, l.ownername, l.owneremail FROM email_lists l,
> email_user_permissions p WHERE l.listid IN(198) AND l.ownerid =
> p.userid AND p.area = 'lists' AND p.subarea = 'bouncesettings'
>
> Location::
>
> /var/www/vhosts/intelligentmedia.co.uk/servedby/admin/functions/api/jobs.php
> (Line 1065)
> Notice Undefined index: ownerid Internal May 15 2012 07:15:54 Undefined index: ownerid in
> /var/www/vhosts/intelligentmedia.co.uk/servedby/admin/functions/send.php
> at 213 File Line Function
> /var/www/vhosts/intelligentmedia.co.uk/servedby/admin/functions/send.php
> 213 HandlePHPErrors
> /var/www/vhosts/intelligentmedia.co.uk/servedby/admin/com/init.php
> 548 Send->Process
> /var/www/vhosts/intelligentmedia.co.uk/servedby/admin/index.php 76
> require_once
>
> Notice Undefined index: jobdetails Internal May 15 2012 07:15:54 Undefined index: jobdetails in
> /var/www/vhosts/intelligentmedia.co.uk/servedby/admin/functions/send.php
> at 212 File Line Function
> /var/www/vhosts/intelligentmedia.co.uk/servedby/admin/functions/send.php
> 212 HandlePHPErrors
> /var/www/vhosts/intelligentmedia.co.uk/servedby/admin/com/init.php
> 548 Send->Process
> /var/www/vhosts/intelligentmedia.co.uk/servedby/admin/index.php
I know the top error is to do with the wrong bounced address... I think. Would this stop the send to that list?
Ive checked the server logs, and Im not getting any errors.
Any help you can give is greatly appreciated.
Thanks
Dan
| 2 |
8,151,445 |
11/16/2011 12:11:13
| 621,603 |
02/17/2011 15:02:45
| 1 | 0 |
"Like" timestamp
|
I'm creating an app that tracks activity on a user's wall: posts made on the wall, and likes and comments in those posts.
I would like to save that activity into a database, and for the script to look for new activity based on the most recent timestamp saved to the database.
This is fairly easy to accomplish for posts and comments which have their creation time returned, but I haven't been able to find anything similar for post likes. The closest I've come is returning a user's likes, but that only for pages.
Are post likes even timestamped, and if they are, is there any way to retrieve that information?
The only alternative is running through the user's posts every time we need to check activity in his wall, but it's kind of an intense process...
|
facebook
|
like
| null | null | null |
11/17/2011 03:39:32
|
not a real question
|
"Like" timestamp
===
I'm creating an app that tracks activity on a user's wall: posts made on the wall, and likes and comments in those posts.
I would like to save that activity into a database, and for the script to look for new activity based on the most recent timestamp saved to the database.
This is fairly easy to accomplish for posts and comments which have their creation time returned, but I haven't been able to find anything similar for post likes. The closest I've come is returning a user's likes, but that only for pages.
Are post likes even timestamped, and if they are, is there any way to retrieve that information?
The only alternative is running through the user's posts every time we need to check activity in his wall, but it's kind of an intense process...
| 1 |
8,107,093 |
11/12/2011 19:50:15
| 1,043,495 |
11/12/2011 19:41:20
| 1 | 0 |
Download album art for an mp3 on iOS
|
I'm creating a music player application for the iPhone.
I am not using the integrated iPod Player, but an AVAudioPlayer with my own controller.
Now i wanna display some album artwork.
I heard about the Amazon Search API but i don't know how to use it on iOS.
I wanna search for a Song name, and i wanna get a .png or .jpg image back.
Thanks in advance!
|
objective-c
|
ios
|
xcode
|
mp3
|
albumart
|
11/12/2011 21:47:53
|
not a real question
|
Download album art for an mp3 on iOS
===
I'm creating a music player application for the iPhone.
I am not using the integrated iPod Player, but an AVAudioPlayer with my own controller.
Now i wanna display some album artwork.
I heard about the Amazon Search API but i don't know how to use it on iOS.
I wanna search for a Song name, and i wanna get a .png or .jpg image back.
Thanks in advance!
| 1 |
9,864,206 |
03/25/2012 21:23:05
| 945,057 |
09/14/2011 16:16:49
| 89 | 0 |
having problems with count Inversion Algorithm
|
I wrote an implementation of a count Inversion. This is an assignment being carried out in an online course. But the input i get isn't correct and according to what I have the program has a correct syntax. I dont just know were I went wrong
The program below is my implementation
import java.io.*;
class CountInversions {
//Create an array of length 1 and keep expanding as data comes in
private int elements[];
private int checker = 0;
public CountInversions() {
elements = new int[1];
checker = 0;
}
private boolean isFull() {
return checker == elements.length;
}
public int[] getElements() {
return elements;
}
public void push(int value) {
if (isFull()) {
int newElements[] = new int[elements.length * 2];
System.arraycopy(elements, 0, newElements, 0, elements.length);
elements = newElements;
}
elements[checker++] = value;
}
public void readInputElements() throws IOException {
//Read input from file and until the very last input
try {
File f = new File("IntegerArray.txt");
FileReader fReader = new FileReader(f);
BufferedReader br = new BufferedReader(fReader);
String stringln;
while ((stringln = br.readLine()) != null) {
push(Integer.parseInt(stringln));
}
System.out.println(elements.length);
fReader.close();
} catch (Exception e) {//Catch exception if any
System.err.println("Error: " + e.getMessage());
} finally {
// in.close
}
}
//Perform the count inversion algorithm
public int countInversion(int array[],int length){
int x,y,z;
int mid = array.length/2 ;
int k;
if (length == 1){
return 0;
}else{
//count Leftinversion and count Rightinversion respectively
int left[] = new int[mid];
int right[] = new int[array.length - mid];
for(k = 0; k < left.length;k++){
left[k] = array[k];
}
for(k = 0 ;k < right.length;k++){
right[k] = array[mid + k];
}
x = countInversion(left, left.length);
y = countInversion(right, right.length);
int result[] = new int[array.length];
z = mergeAndCount(left,right,result);
//count splitInversion
return x + y + z;
}
}
private int mergeAndCount(int[] left, int[] right, int[] result) {
int count = 0;
int i = 0, j = 0, k = 0;
int m = left.length, n = right.length;
while(i < m && j < n){
if(left[i] < right[j]){
result[k++] = left[i++];
}else{
result[k++] = right[j++];
count += left.length - i;
}
}
if(i < m){
for (int p = i ;p < m ;p++){
result[k++] = left[p];
}
}
if(j < n){
for (int p = j ;p < n ;p++){
result[k++] = right[p];
}
}
return count;
}
}
class MainApp{
public static void main(String args[]){
int count = 0;
CountInversions cIn = new CountInversions();
try {
cIn.readInputElements();
count = cIn.countInversion(cIn.getElements(),cIn.getElements().length);
System.out.println("Number of Inversios: " + count);
} catch (IOException ex) {
ex.printStackTrace();
}
}
}
|
java
|
homework
| null | null | null | null |
open
|
having problems with count Inversion Algorithm
===
I wrote an implementation of a count Inversion. This is an assignment being carried out in an online course. But the input i get isn't correct and according to what I have the program has a correct syntax. I dont just know were I went wrong
The program below is my implementation
import java.io.*;
class CountInversions {
//Create an array of length 1 and keep expanding as data comes in
private int elements[];
private int checker = 0;
public CountInversions() {
elements = new int[1];
checker = 0;
}
private boolean isFull() {
return checker == elements.length;
}
public int[] getElements() {
return elements;
}
public void push(int value) {
if (isFull()) {
int newElements[] = new int[elements.length * 2];
System.arraycopy(elements, 0, newElements, 0, elements.length);
elements = newElements;
}
elements[checker++] = value;
}
public void readInputElements() throws IOException {
//Read input from file and until the very last input
try {
File f = new File("IntegerArray.txt");
FileReader fReader = new FileReader(f);
BufferedReader br = new BufferedReader(fReader);
String stringln;
while ((stringln = br.readLine()) != null) {
push(Integer.parseInt(stringln));
}
System.out.println(elements.length);
fReader.close();
} catch (Exception e) {//Catch exception if any
System.err.println("Error: " + e.getMessage());
} finally {
// in.close
}
}
//Perform the count inversion algorithm
public int countInversion(int array[],int length){
int x,y,z;
int mid = array.length/2 ;
int k;
if (length == 1){
return 0;
}else{
//count Leftinversion and count Rightinversion respectively
int left[] = new int[mid];
int right[] = new int[array.length - mid];
for(k = 0; k < left.length;k++){
left[k] = array[k];
}
for(k = 0 ;k < right.length;k++){
right[k] = array[mid + k];
}
x = countInversion(left, left.length);
y = countInversion(right, right.length);
int result[] = new int[array.length];
z = mergeAndCount(left,right,result);
//count splitInversion
return x + y + z;
}
}
private int mergeAndCount(int[] left, int[] right, int[] result) {
int count = 0;
int i = 0, j = 0, k = 0;
int m = left.length, n = right.length;
while(i < m && j < n){
if(left[i] < right[j]){
result[k++] = left[i++];
}else{
result[k++] = right[j++];
count += left.length - i;
}
}
if(i < m){
for (int p = i ;p < m ;p++){
result[k++] = left[p];
}
}
if(j < n){
for (int p = j ;p < n ;p++){
result[k++] = right[p];
}
}
return count;
}
}
class MainApp{
public static void main(String args[]){
int count = 0;
CountInversions cIn = new CountInversions();
try {
cIn.readInputElements();
count = cIn.countInversion(cIn.getElements(),cIn.getElements().length);
System.out.println("Number of Inversios: " + count);
} catch (IOException ex) {
ex.printStackTrace();
}
}
}
| 0 |
4,930,763 |
02/08/2011 07:57:00
| 599,575 |
02/02/2011 06:53:08
| 61 | 2 |
Accessing a logger in a Java application
|
I have a question regarding logging in a Java application. I want to log the main user actions and possible errors with user friendly messages. Therefore, I have two appenders for the logger: one shows errors (level = error) in dialogs and the other writes the logs of the current user session into an html-file so that the user could send this file back if something goes wrong.
To avoid having the logger creation in every class (private Logger logger = …) I have a static reference of the configured logger in a class App which has also the methods for accessing the logger:
public class App {
private static Logger logger = Logger.getLogger("logger name");
…
public static void logError(String message, Throwable cause) {
…
}
public static void logInfo(String message) {
…
}
}
The logging is mainly done in the UI classes:
class UIWidget extends UIFrameworkWidget {
void aMethod() {
try {
someBusinessLogic();
} catch (Exception e) {
App.logError(“log message”, e);
}
}
}
Is this a good practice? (Note that the widgets are created by the framework.)
Thanks in advance for answers, comments, or hints on this
|
java
|
logging
|
application
| null | null | null |
open
|
Accessing a logger in a Java application
===
I have a question regarding logging in a Java application. I want to log the main user actions and possible errors with user friendly messages. Therefore, I have two appenders for the logger: one shows errors (level = error) in dialogs and the other writes the logs of the current user session into an html-file so that the user could send this file back if something goes wrong.
To avoid having the logger creation in every class (private Logger logger = …) I have a static reference of the configured logger in a class App which has also the methods for accessing the logger:
public class App {
private static Logger logger = Logger.getLogger("logger name");
…
public static void logError(String message, Throwable cause) {
…
}
public static void logInfo(String message) {
…
}
}
The logging is mainly done in the UI classes:
class UIWidget extends UIFrameworkWidget {
void aMethod() {
try {
someBusinessLogic();
} catch (Exception e) {
App.logError(“log message”, e);
}
}
}
Is this a good practice? (Note that the widgets are created by the framework.)
Thanks in advance for answers, comments, or hints on this
| 0 |
10,862,703 |
06/02/2012 13:34:26
| 1,423,831 |
05/29/2012 13:45:11
| 1 | 0 |
Java - app works in Windows but not on Linux
|
I'm a beginner in Java and made my first project Quadratic Equations solver. It works fine on Windows (the platform I developed it on), but it is supposed to work on other platform too, (isn't it?). Well, this one doesn't work on Linux(BackBox, PuppyLinux), i tried but it shows up that its not an executable. What could be the possible causes of this failure?
P.S I'm REALLY a beginner in "cross-platform", especially Java.
|
java
|
cross-platform
| null | null | null |
06/04/2012 08:23:45
|
too localized
|
Java - app works in Windows but not on Linux
===
I'm a beginner in Java and made my first project Quadratic Equations solver. It works fine on Windows (the platform I developed it on), but it is supposed to work on other platform too, (isn't it?). Well, this one doesn't work on Linux(BackBox, PuppyLinux), i tried but it shows up that its not an executable. What could be the possible causes of this failure?
P.S I'm REALLY a beginner in "cross-platform", especially Java.
| 3 |
10,493,859 |
05/08/2012 06:41:29
| 835,268 |
07/08/2011 11:35:45
| 32 | 0 |
Facebook canvas app authorization
|
My app which is built-in to FB canvas needs to authorize users before processing any action. I see two options for doing it:
1. To authorize the user on FB upon every his action (redirecting to https://www.facebook.com/dialog/oauth?blahblah)
2. To create a persistent cookie so the app won't need to FB authorize for every action.
My questions are:
For the 1st case: is it OK for FB to be asked for user authorization so often?
For the 2nd case: how can i catch the FB user has changed at the same PC? My app's cookie will remain old.
Thank you!
|
facebook
| null | null | null | null | null |
open
|
Facebook canvas app authorization
===
My app which is built-in to FB canvas needs to authorize users before processing any action. I see two options for doing it:
1. To authorize the user on FB upon every his action (redirecting to https://www.facebook.com/dialog/oauth?blahblah)
2. To create a persistent cookie so the app won't need to FB authorize for every action.
My questions are:
For the 1st case: is it OK for FB to be asked for user authorization so often?
For the 2nd case: how can i catch the FB user has changed at the same PC? My app's cookie will remain old.
Thank you!
| 0 |
4,379,757 |
12/07/2010 17:38:52
| 172,828 |
09/13/2009 19:59:49
| 89 | 7 |
Best way to do PHP hooks
|
I'm wondering what the best way is of handling hooks in a PHP application - so I can insert custom or 'plug in' functionality without modifying the main body of code. I know Wordpress features something like this.
Is it really alright to do something as follows:
if (file_exists('file_before'){ include('file_before'); }
print 'hello';
if (file_exists('file_after'){ include('file_after'); }
|
php
|
hook
| null | null | null |
04/18/2012 16:07:50
|
not constructive
|
Best way to do PHP hooks
===
I'm wondering what the best way is of handling hooks in a PHP application - so I can insert custom or 'plug in' functionality without modifying the main body of code. I know Wordpress features something like this.
Is it really alright to do something as follows:
if (file_exists('file_before'){ include('file_before'); }
print 'hello';
if (file_exists('file_after'){ include('file_after'); }
| 4 |
7,157,447 |
08/23/2011 07:12:57
| 82,410 |
03/25/2009 06:43:42
| 449 | 26 |
Is there any event before source is updated in binding in WPF?
|
I am looking for something that fire before the source is update
So instead of <Pre>Binding.SourceUpdated</Pre> I want <Pre>Binding.PreviewSourceUpdated</Pre>
|
wpf
|
binding
| null | null | null | null |
open
|
Is there any event before source is updated in binding in WPF?
===
I am looking for something that fire before the source is update
So instead of <Pre>Binding.SourceUpdated</Pre> I want <Pre>Binding.PreviewSourceUpdated</Pre>
| 0 |
10,433,028 |
05/03/2012 14:02:48
| 427,425 |
08/22/2010 03:41:10
| 175 | 7 |
Asynchronous sockets vs synchronous
|
I have a question about asynchronous sockets. It's been bothering me for the last few months and thought I should wise up and get the facts from the pros here.
I have an incoming stream from a client which I want to take in the data. This incoming stream requires initial setup via strings before it will commence sending the data.
I have heard about the powerful scalability of asynchronous tcp servers like node.js. My question is whether can I use node.js or any other asynchronous tcp server to handshake with this client and receive the incoming stream.
You can think of the incoming data as an stream of stock data or electricity usage at a given point in time. In essence the data will be streaming in continuously.
Pls let me know what other information I need to share to help me understand asynchronous sockets and how to use it.
|
sockets
| null | null | null | null | null |
open
|
Asynchronous sockets vs synchronous
===
I have a question about asynchronous sockets. It's been bothering me for the last few months and thought I should wise up and get the facts from the pros here.
I have an incoming stream from a client which I want to take in the data. This incoming stream requires initial setup via strings before it will commence sending the data.
I have heard about the powerful scalability of asynchronous tcp servers like node.js. My question is whether can I use node.js or any other asynchronous tcp server to handshake with this client and receive the incoming stream.
You can think of the incoming data as an stream of stock data or electricity usage at a given point in time. In essence the data will be streaming in continuously.
Pls let me know what other information I need to share to help me understand asynchronous sockets and how to use it.
| 0 |
5,385,745 |
03/22/2011 01:28:13
| 422,674 |
06/06/2010 21:49:31
| 177 | 12 |
Random deleting of text file on java learner training
|
So I'm working on a project where we created a supervised learner in Java. It uses a weight .txt file with about 15 lines (one number per line) that gets opened and closed twice per run. Opening and closing happens directly before and directly after reading/writing.
Because of the way the code is structured (not our decision), I cannot run our training code in a loop. So I setup a batch script that simply iterates over a loop, during each iteration running our code (and thus updating our file), waiting for a few seconds, and then repeating.
The problem is that every few hundred runs or so randomly, all the contents of our file gets deleted. The file still exists, but all the content is clear. Sometimes it'll happen on the 100th run, sometimes it'll happen on the 200th, sometimes on the 3rd.
Assuming it's not our code that is the problem, what could possibly cause this? Or possible fix?
Specs:
Windows 7
Making 'java' calls to execute the .class file
modifies a .txt file in the same directory
Any help is greatly appreciated.
|
java
|
windows
|
jvm
| null | null | null |
open
|
Random deleting of text file on java learner training
===
So I'm working on a project where we created a supervised learner in Java. It uses a weight .txt file with about 15 lines (one number per line) that gets opened and closed twice per run. Opening and closing happens directly before and directly after reading/writing.
Because of the way the code is structured (not our decision), I cannot run our training code in a loop. So I setup a batch script that simply iterates over a loop, during each iteration running our code (and thus updating our file), waiting for a few seconds, and then repeating.
The problem is that every few hundred runs or so randomly, all the contents of our file gets deleted. The file still exists, but all the content is clear. Sometimes it'll happen on the 100th run, sometimes it'll happen on the 200th, sometimes on the 3rd.
Assuming it's not our code that is the problem, what could possibly cause this? Or possible fix?
Specs:
Windows 7
Making 'java' calls to execute the .class file
modifies a .txt file in the same directory
Any help is greatly appreciated.
| 0 |
2,003,623 |
01/05/2010 01:42:14
| 22,777 |
09/26/2008 17:14:26
| 1,094 | 56 |
jQuery Autocomplete with multiple inputs
|
I have an autocomplete field which I would like to augment by providing a drop down for categories as well, in the hopes that this makes it even easier to search on. This would take the category id from the drop down and then pass this in along with the search text to my server side Autocomplete Function.
I am using the jQuery autocomplete plugin found here:
http://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/
The demo page is here:
http://jquery.bassistance.de/autocomplete/demo/
Perhaps this is already explained in the demo somehow, but I'm just not seeing it. I am able to get the data out from JSON and split it into multiple fields.
It doesn't matter much, but I am using ASP.NET MVC as well.
|
jquery
|
autocomplete
|
asp.net-mvc
| null | null | null |
open
|
jQuery Autocomplete with multiple inputs
===
I have an autocomplete field which I would like to augment by providing a drop down for categories as well, in the hopes that this makes it even easier to search on. This would take the category id from the drop down and then pass this in along with the search text to my server side Autocomplete Function.
I am using the jQuery autocomplete plugin found here:
http://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/
The demo page is here:
http://jquery.bassistance.de/autocomplete/demo/
Perhaps this is already explained in the demo somehow, but I'm just not seeing it. I am able to get the data out from JSON and split it into multiple fields.
It doesn't matter much, but I am using ASP.NET MVC as well.
| 0 |
5,679,562 |
04/15/2011 16:13:01
| 258,355 |
01/25/2010 11:13:21
| 616 | 15 |
How to fuzzy match a short bit pattern in a long one?
|
I encounter a problem when try to match a short bit pattern in a long one: I have one long bit pattern, e.g. 6k bits, stored in a char array, also a short one, say 150 bits, stored in a char array, too. Now I want to check whether the short bit pattern is in the long bit pattern. While there is no need for short bit pattern to match some part of long bit pattern exactly, I will define a threshold, if the bit-error-rate under it, I will take the two pattern match.
Given the misalignment problem, I can't come up with an elegant solution. One way I can find out is convert the bit pattern into char pattern, i.e. convert bit 1 to '1', 0 to '0' and apply some string matching algorithm. But I'm afraid it may cost memory 7-8 times more burden my system. Someone around me recommend the [Rabin Fingerprint][1], however it seems not designed for this kind of problem.
Hope you can give me a hand.
Thanks and best Regards.
[1]: http://en.wikipedia.org/wiki/Rabin_fingerprint
|
c++
|
c
|
algorithm
|
string-matching
|
fingerprint
| null |
open
|
How to fuzzy match a short bit pattern in a long one?
===
I encounter a problem when try to match a short bit pattern in a long one: I have one long bit pattern, e.g. 6k bits, stored in a char array, also a short one, say 150 bits, stored in a char array, too. Now I want to check whether the short bit pattern is in the long bit pattern. While there is no need for short bit pattern to match some part of long bit pattern exactly, I will define a threshold, if the bit-error-rate under it, I will take the two pattern match.
Given the misalignment problem, I can't come up with an elegant solution. One way I can find out is convert the bit pattern into char pattern, i.e. convert bit 1 to '1', 0 to '0' and apply some string matching algorithm. But I'm afraid it may cost memory 7-8 times more burden my system. Someone around me recommend the [Rabin Fingerprint][1], however it seems not designed for this kind of problem.
Hope you can give me a hand.
Thanks and best Regards.
[1]: http://en.wikipedia.org/wiki/Rabin_fingerprint
| 0 |
3,318,334 |
07/23/2010 13:01:04
| 181,052 |
09/29/2009 10:52:46
| 155 | 10 |
How to install orbited on OS X 10.6
|
I am trying to get orbited working on OS X 10.6. Installing it in Linux was simple but I have seem to run into a roadblock. After installation when I try to run orbited server I get the following error
Traceback (most recent call last):
File "/opt/local/bin/orbited", line 9, in <module>
load_entry_point('orbited==0.7.10', 'console_scripts', 'orbited')()
File "/opt/local/lib/python2.5/site-packages/orbited/start.py", line 114, in main
install = _import('twisted.internet.%sreactor.install' % reactor_name)
File "/opt/local/lib/python2.5/site-packages/orbited/start.py", line 13, in _import
return reduce(getattr, name.split('.')[1:], __import__(module_import))
ImportError: No module named kqueuereactor
I have twisted setup, Its the one that comes with OS X 10.6. Any solutions for this?
Thanks in advance
|
installation
|
snow-leopard
|
orbited
| null | null | null |
open
|
How to install orbited on OS X 10.6
===
I am trying to get orbited working on OS X 10.6. Installing it in Linux was simple but I have seem to run into a roadblock. After installation when I try to run orbited server I get the following error
Traceback (most recent call last):
File "/opt/local/bin/orbited", line 9, in <module>
load_entry_point('orbited==0.7.10', 'console_scripts', 'orbited')()
File "/opt/local/lib/python2.5/site-packages/orbited/start.py", line 114, in main
install = _import('twisted.internet.%sreactor.install' % reactor_name)
File "/opt/local/lib/python2.5/site-packages/orbited/start.py", line 13, in _import
return reduce(getattr, name.split('.')[1:], __import__(module_import))
ImportError: No module named kqueuereactor
I have twisted setup, Its the one that comes with OS X 10.6. Any solutions for this?
Thanks in advance
| 0 |
3,839,593 |
10/01/2010 13:27:55
| 282,343 |
02/26/2010 20:13:25
| 30 | 6 |
jQuery Selector Question
|
I have a quick question about jQuery selectors.
Is doing this:
$('.class_el_1, .class_el_2').hide();
The same as just looping through each element using jQuery's .each function?
|
jquery
|
jquery-selectors
| null | null | null | null |
open
|
jQuery Selector Question
===
I have a quick question about jQuery selectors.
Is doing this:
$('.class_el_1, .class_el_2').hide();
The same as just looping through each element using jQuery's .each function?
| 0 |
8,180,616 |
11/18/2011 09:57:48
| 947,191 |
09/15/2011 15:49:58
| 27 | 1 |
Check Virtual Directory Path Exists on IIS or not Using WebDav
|
>i have a virtual Directory http://10.4.0.10/imageserver4
this Virtual Directory is mapped to physical drive d:\imageserver4
No i have a Application which needs to check the URL first i.e http://10.4.0.10/imageserver4
if it exits i want to store in database
>is there any way i can check the validity of a URL using WebDav
|
c#
|
asp.net
|
webdav
| null | null | null |
open
|
Check Virtual Directory Path Exists on IIS or not Using WebDav
===
>i have a virtual Directory http://10.4.0.10/imageserver4
this Virtual Directory is mapped to physical drive d:\imageserver4
No i have a Application which needs to check the URL first i.e http://10.4.0.10/imageserver4
if it exits i want to store in database
>is there any way i can check the validity of a URL using WebDav
| 0 |
8,402,595 |
12/06/2011 15:40:48
| 895,702 |
08/15/2011 22:13:14
| 27 | 1 |
Internet Explorer adding an extra line break
|
I have the following Javascript code:
parts[0] + "\n" + parts[1] + "\n" + parts[2] + "\n" + parts[3] + "\n" +parts[4]
Which should result in the following on screen
Some text
More Text
Text here too
Another Line
Final Line
But in Internet Explorer it adds an extra line break so I get:
Some text
Why the extra space?
Is it something
IE does
Just to annoy me?!
|
javascript
|
internet-explorer
|
line-breaks
| null | null | null |
open
|
Internet Explorer adding an extra line break
===
I have the following Javascript code:
parts[0] + "\n" + parts[1] + "\n" + parts[2] + "\n" + parts[3] + "\n" +parts[4]
Which should result in the following on screen
Some text
More Text
Text here too
Another Line
Final Line
But in Internet Explorer it adds an extra line break so I get:
Some text
Why the extra space?
Is it something
IE does
Just to annoy me?!
| 0 |
10,593,963 |
05/15/2012 03:56:09
| 1,395,109 |
05/15/2012 03:22:08
| 1 | 0 |
Scalabilty of Java middleware between Core banking and ATM Server
|
I have a requirement to build a Java module which will act as a router between ATM Server or any other Point of Sale which accept cards, and a core banking system.
This module should interpret requests from the end points and do some processing before it communicate with the core baking system. The communication will be through the java implementation of TCP IP Sockets. The end points like ATM will be the server & this middle ware will be the client. This application will keep on listening for the server messages & should be capable of interpreting simultaneous requests in range of 1k to 2k.
The idea is to have one client socket thread listening for server messages and handle each of the received messages in different threads. Is there any issue in my basic idea?
Is there is any open source application available to cater my requirements?
Thanks in advance for your advice.
|
java
|
multithreading
|
sockets
| null | null | null |
open
|
Scalabilty of Java middleware between Core banking and ATM Server
===
I have a requirement to build a Java module which will act as a router between ATM Server or any other Point of Sale which accept cards, and a core banking system.
This module should interpret requests from the end points and do some processing before it communicate with the core baking system. The communication will be through the java implementation of TCP IP Sockets. The end points like ATM will be the server & this middle ware will be the client. This application will keep on listening for the server messages & should be capable of interpreting simultaneous requests in range of 1k to 2k.
The idea is to have one client socket thread listening for server messages and handle each of the received messages in different threads. Is there any issue in my basic idea?
Is there is any open source application available to cater my requirements?
Thanks in advance for your advice.
| 0 |
7,824,733 |
10/19/2011 16:33:09
| 506,706 |
11/13/2010 12:49:14
| 8 | 1 |
Rails - Mongrel Time out on file upload from phone
|
I have a mobile app built using Rhomobile. When I launch an image upload from the phone to the rails server I end up with timeout issues on larger pictures (2+ MBs). I get an error in Mongrel on server side (Rails 2.3.8) and a CURL timeout error on the phone side. Is the timeout an issue from the phone or from the mongrel server?
Mongrel error:
Wed Oct 19 09:07:05 -0500 2011: Error reading HTTP body: #<RuntimeError: Socket read returned insufficient data: 13515>
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/http_request.rb:107:in `read_socket'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/http_request.rb:86:in `read_body'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/http_request.rb:55:in `initialize'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:149:in `new'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:149:in `process_client'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:285:in `run'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:285:in `initialize'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:285:in `new'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:285:in `run'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:268:in `initialize'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:268:in `new'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:268:in `run'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:282:in `run'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:281:in `each'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:281:in `run'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:128:in `run'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/command.rb:212:in `run'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:281
/usr/bin/mongrel_rails:19:in `load'
/usr/bin/mongrel_rails:19
Error in Rhomobile App:
Net| Operation finished with error 28: Timeout was reached
Net| CURLNetRequest: METHOD = [POST] URL = [http://www.mywebsite.com/updload/upload_image ] BODY = []
I use the AsyncHttp.upload_file command.
Thanks,
Nick
|
image
|
upload
|
timeout
|
mongrel
|
rhomobile
| null |
open
|
Rails - Mongrel Time out on file upload from phone
===
I have a mobile app built using Rhomobile. When I launch an image upload from the phone to the rails server I end up with timeout issues on larger pictures (2+ MBs). I get an error in Mongrel on server side (Rails 2.3.8) and a CURL timeout error on the phone side. Is the timeout an issue from the phone or from the mongrel server?
Mongrel error:
Wed Oct 19 09:07:05 -0500 2011: Error reading HTTP body: #<RuntimeError: Socket read returned insufficient data: 13515>
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/http_request.rb:107:in `read_socket'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/http_request.rb:86:in `read_body'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/http_request.rb:55:in `initialize'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:149:in `new'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:149:in `process_client'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:285:in `run'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:285:in `initialize'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:285:in `new'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:285:in `run'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:268:in `initialize'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:268:in `new'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:268:in `run'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:282:in `run'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:281:in `each'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:281:in `run'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:128:in `run'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/command.rb:212:in `run'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:281
/usr/bin/mongrel_rails:19:in `load'
/usr/bin/mongrel_rails:19
Error in Rhomobile App:
Net| Operation finished with error 28: Timeout was reached
Net| CURLNetRequest: METHOD = [POST] URL = [http://www.mywebsite.com/updload/upload_image ] BODY = []
I use the AsyncHttp.upload_file command.
Thanks,
Nick
| 0 |
9,778,425 |
03/19/2012 21:44:21
| 665,720 |
03/18/2011 08:37:42
| 352 | 3 |
what determines the memory model?
|
Specifically this question is about flat and segmented model in real mode. I am reading a book on assembly which mentions that on DOS the COM files use flat memory model and EXE files use segmented memory model. However I am not understanding what tells DOS which memory model to use. I am asking this question because I am reading about bootloaders.
|
operating-system
|
computer-architecture
| null | null | null | null |
open
|
what determines the memory model?
===
Specifically this question is about flat and segmented model in real mode. I am reading a book on assembly which mentions that on DOS the COM files use flat memory model and EXE files use segmented memory model. However I am not understanding what tells DOS which memory model to use. I am asking this question because I am reading about bootloaders.
| 0 |
1,745,230 |
11/16/2009 22:21:15
| 212,434 |
11/16/2009 22:21:15
| 1 | 0 |
MSSQL - How many users do I *really* need?
|
I'm setting up an application, and I'm looking into purchasing a license for MSSQL. My question is pretty simple (though may have a complicated answer...)
How many users accounts do I *really* need, for SQL Server?
The way I see it, I'd give one master administration account, maybe 2 or 3 user accounts, and then one application-based account.
My application will likely have about 30-40 users, with the rare possibility of having 4-5 people being simultaneous users. But as I see it, I'd set up a BLL with the 30-40 accounts - and the BLL would have the SQL account, that all 30 accounts would use to query the DB through...
I'm just wondering what people's take on this is. Is that the way to go, or do I have the wrong idea of architecture here?
Thanks in advance!
|
sql-server
|
user-accounts
|
useraccount
|
architecture
| null | null |
open
|
MSSQL - How many users do I *really* need?
===
I'm setting up an application, and I'm looking into purchasing a license for MSSQL. My question is pretty simple (though may have a complicated answer...)
How many users accounts do I *really* need, for SQL Server?
The way I see it, I'd give one master administration account, maybe 2 or 3 user accounts, and then one application-based account.
My application will likely have about 30-40 users, with the rare possibility of having 4-5 people being simultaneous users. But as I see it, I'd set up a BLL with the 30-40 accounts - and the BLL would have the SQL account, that all 30 accounts would use to query the DB through...
I'm just wondering what people's take on this is. Is that the way to go, or do I have the wrong idea of architecture here?
Thanks in advance!
| 0 |
7,096,258 |
08/17/2011 16:28:02
| 776,647 |
05/30/2011 18:32:35
| 88 | 0 |
changing text colour using system colours from a combo box
|
I am in the process of making a text editor, I am trying to set up some functionality so that the user can select a colour from a combo box and that will change the colour of the text. Right now my combo box is being loaded with the system colours in xml using a resource like so
<ToolBarTray.Resources>
<ObjectDataProvider MethodName="GetType" ObjectType="{x:Type sys:Type}" x:Key="colorsTypeOdp">
<ObjectDataProvider.MethodParameters>
<sys:String>System.Windows.Media.Colors, PresentationCore, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35</sys:String>
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
<ObjectDataProvider ObjectInstance="{StaticResource colorsTypeOdp}" MethodName="GetProperties" x:Key="colorPropertiesOdp">
</ObjectDataProvider>
</ToolBarTray.Resources>
<ComboBox Name="colors" ItemsSource="{Binding Source={StaticResource colorPropertiesOdp}}" DisplayMemberPath="Name" SelectedValuePath="Name" MinWidth="100" ToolTip="Color" />
I am trying to make a selectionChanged event code that will change the text to the system colour selected by the user, if you need to see more code or need more info let me know.
Thanks, Beef
|
wpf
|
xaml
|
.net-4.0
|
resources
|
text-editor
| null |
open
|
changing text colour using system colours from a combo box
===
I am in the process of making a text editor, I am trying to set up some functionality so that the user can select a colour from a combo box and that will change the colour of the text. Right now my combo box is being loaded with the system colours in xml using a resource like so
<ToolBarTray.Resources>
<ObjectDataProvider MethodName="GetType" ObjectType="{x:Type sys:Type}" x:Key="colorsTypeOdp">
<ObjectDataProvider.MethodParameters>
<sys:String>System.Windows.Media.Colors, PresentationCore, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35</sys:String>
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
<ObjectDataProvider ObjectInstance="{StaticResource colorsTypeOdp}" MethodName="GetProperties" x:Key="colorPropertiesOdp">
</ObjectDataProvider>
</ToolBarTray.Resources>
<ComboBox Name="colors" ItemsSource="{Binding Source={StaticResource colorPropertiesOdp}}" DisplayMemberPath="Name" SelectedValuePath="Name" MinWidth="100" ToolTip="Color" />
I am trying to make a selectionChanged event code that will change the text to the system colour selected by the user, if you need to see more code or need more info let me know.
Thanks, Beef
| 0 |
377,340 |
12/18/2008 09:33:59
| 3,834 |
08/31/2008 06:25:52
| 889 | 49 |
Are language specific tests good for interview?
|
I wonder whether are language specific tests good for selecting potential candidates? Questions such as
1. Javascript's Syntax
2. .Net API( What class to use if you want to send email via Microsoft Outlook)
3. Specific SQL queries ( What's the difference between **inner join** and **join**?)
4. ASP.NET ( What event/ method is executed before/after Page_Load?)
and so on. The candidates have to answer them in a given time frame.
|
interview-questions
| null | null | null | null |
12/03/2011 06:13:38
|
not constructive
|
Are language specific tests good for interview?
===
I wonder whether are language specific tests good for selecting potential candidates? Questions such as
1. Javascript's Syntax
2. .Net API( What class to use if you want to send email via Microsoft Outlook)
3. Specific SQL queries ( What's the difference between **inner join** and **join**?)
4. ASP.NET ( What event/ method is executed before/after Page_Load?)
and so on. The candidates have to answer them in a given time frame.
| 4 |
7,300,271 |
09/04/2011 15:35:29
| 845,911 |
07/15/2011 06:07:00
| 1 | 0 |
Live face detection in Android
|
I try to implement the face detection from the camera preview in Android. Does someone achieve this successfully? If yes, can you share your source codes?
Thanks.
|
android
| null | null | null | null | null |
open
|
Live face detection in Android
===
I try to implement the face detection from the camera preview in Android. Does someone achieve this successfully? If yes, can you share your source codes?
Thanks.
| 0 |
9,493,762 |
02/29/2012 04:56:01
| 1,155,237 |
01/18/2012 01:51:21
| 86 | 0 |
PS: Launch an app and open chm
|
Many applications have associated help that you invoke by pressing F1.
What PowerShell command would launch the application AND open the help?
Applications I have in mind are Powershell ISE, Visual Studio, Microsoft Office, etc.
Is there a standard mechanism for this?
Thanks.
|
powershell
|
chm
|
launching-application
| null | null | null |
open
|
PS: Launch an app and open chm
===
Many applications have associated help that you invoke by pressing F1.
What PowerShell command would launch the application AND open the help?
Applications I have in mind are Powershell ISE, Visual Studio, Microsoft Office, etc.
Is there a standard mechanism for this?
Thanks.
| 0 |
5,777,558 |
04/25/2011 10:41:39
| 722,671 |
04/24/2011 14:28:10
| 6 | 0 |
gridview in asp.net
|
- I have used a GRIDVIEW
- in its 1st column i used a radio button
- I want to copy the **Text of Selected
Row(via radio button) of GridView to the Label Text**
on clicking the button...
Label1.Text = Text of 1st cell of gridview
Label2.Text = Text of 2nd cell of gridview
Label3.Text = Text of 3rd cell of gridview
Label4.Text = Text of 4th cell of gridview
|
asp.net
| null | null | null | null | null |
open
|
gridview in asp.net
===
- I have used a GRIDVIEW
- in its 1st column i used a radio button
- I want to copy the **Text of Selected
Row(via radio button) of GridView to the Label Text**
on clicking the button...
Label1.Text = Text of 1st cell of gridview
Label2.Text = Text of 2nd cell of gridview
Label3.Text = Text of 3rd cell of gridview
Label4.Text = Text of 4th cell of gridview
| 0 |
7,373,975 |
09/10/2011 19:13:10
| 890,647 |
08/11/2011 20:00:56
| 17 | 0 |
Undefined symbols of the architechture x86_64
|
ok I am learning c++ and I got this error
Undefined symbols for architecture x86_64:
"Point::set(int, int)", referenced from:
Point::Point(int, int)in ccHkya9E.o
"Point::add(Point const&)", referenced from:
Point::operator+(Point const&)in ccHkya9E.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
here is my code
1 #include<iostream>
2 using namespace std;
3
4 class Point {
5 private:
6 int x, y;
7 public:
8 Point() {}
9 Point(int new_x, int new_y) {set(new_x, new_y);}
10 Point (const Point & src) {set(src.x, src.y);}
11
12 //Operations
13 Point add (const Point &pt);
14 Point sub (const Point &pt);
15 Point operator+(const Point &pt) {return add(pt);}
16 Point operator-(const Point &pt) {return sub(pt);}
17 //other member functions
18 void set(int new_x, int new_y);
19 int get_x() const {return x;}
20 int get_y() const {return y;}
21 };
22 int main() {
23 Point point1(20,20);
24 Point point2(0,5);
25 Point point3(-10, 25);
26 Point point4=point1+point2+point3;
27
28 cout<<"the point is"<<point4.get_x();
29 cout<<","<<point4.get_y()<<"."<<endl;
30 return 0;
31 }
any help is appreciated!
|
c++
| null | null | null | null |
10/03/2011 12:03:44
|
too localized
|
Undefined symbols of the architechture x86_64
===
ok I am learning c++ and I got this error
Undefined symbols for architecture x86_64:
"Point::set(int, int)", referenced from:
Point::Point(int, int)in ccHkya9E.o
"Point::add(Point const&)", referenced from:
Point::operator+(Point const&)in ccHkya9E.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
here is my code
1 #include<iostream>
2 using namespace std;
3
4 class Point {
5 private:
6 int x, y;
7 public:
8 Point() {}
9 Point(int new_x, int new_y) {set(new_x, new_y);}
10 Point (const Point & src) {set(src.x, src.y);}
11
12 //Operations
13 Point add (const Point &pt);
14 Point sub (const Point &pt);
15 Point operator+(const Point &pt) {return add(pt);}
16 Point operator-(const Point &pt) {return sub(pt);}
17 //other member functions
18 void set(int new_x, int new_y);
19 int get_x() const {return x;}
20 int get_y() const {return y;}
21 };
22 int main() {
23 Point point1(20,20);
24 Point point2(0,5);
25 Point point3(-10, 25);
26 Point point4=point1+point2+point3;
27
28 cout<<"the point is"<<point4.get_x();
29 cout<<","<<point4.get_y()<<"."<<endl;
30 return 0;
31 }
any help is appreciated!
| 3 |
9,946,729 |
03/30/2012 16:16:48
| 1,159,429 |
01/19/2012 20:51:33
| 193 | 1 |
ubuntu nic card issue
|
I am trying to install NIC r8168 and it shows everything installed ok. It is a brand new NIC and the lights wont come on when I plug in a ethernet. The NIC is that is not working is eth0. Why does it show the r8168 driver being used by 0? My NIC model number is ST1000SPEX if anyone is wondering.
lsmod
Module Size Used by
r8168 215669 0
ifconfig
eth0 Link encap:Ethernet HWaddr 00:0a:cd:1e:0a:4a
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Interrupt:43 Base address:0x2000
eth1 Link encap:Ethernet HWaddr 00:19:d1:1d:f6:7a
inet addr:192.168.1.83 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::219:d1ff:fe1d:f67a/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:551467 errors:0 dropped:0 overruns:0 frame:0
TX packets:145219 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:409744342 (409.7 MB) TX bytes:12233173 (12.2 MB)
Interrupt:21 Memory:dfde0000-dfe00000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:280 errors:0 dropped:0 overruns:0 frame:0
TX packets:280 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:22608 (22.6 KB) TX bytes:22608 (22.6 KB)
|
linux
|
networking
|
ubuntu
|
nic
| null |
03/30/2012 16:34:19
|
off topic
|
ubuntu nic card issue
===
I am trying to install NIC r8168 and it shows everything installed ok. It is a brand new NIC and the lights wont come on when I plug in a ethernet. The NIC is that is not working is eth0. Why does it show the r8168 driver being used by 0? My NIC model number is ST1000SPEX if anyone is wondering.
lsmod
Module Size Used by
r8168 215669 0
ifconfig
eth0 Link encap:Ethernet HWaddr 00:0a:cd:1e:0a:4a
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Interrupt:43 Base address:0x2000
eth1 Link encap:Ethernet HWaddr 00:19:d1:1d:f6:7a
inet addr:192.168.1.83 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::219:d1ff:fe1d:f67a/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:551467 errors:0 dropped:0 overruns:0 frame:0
TX packets:145219 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:409744342 (409.7 MB) TX bytes:12233173 (12.2 MB)
Interrupt:21 Memory:dfde0000-dfe00000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:280 errors:0 dropped:0 overruns:0 frame:0
TX packets:280 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:22608 (22.6 KB) TX bytes:22608 (22.6 KB)
| 2 |
8,171,227 |
11/17/2011 17:03:42
| 417,627 |
08/11/2010 14:03:20
| 74 | 2 |
Using $_POST information only once
|
I have some information which gets passed from a form and needs to be used once and only once. I can collect it nicely from $_POST but I'm not sure which is the "best" way to ensure that I can only use it once, i.e. I want to avoid the user pressing F5 repeatedly and accessing the function more than once.
My initial thought was to set a session variable and time the function out for a set period of time. The problem with that is thay could have access to the function again after the set period has elapsed.
Better ideas welcomed!
|
php
| null | null | null | null | null |
open
|
Using $_POST information only once
===
I have some information which gets passed from a form and needs to be used once and only once. I can collect it nicely from $_POST but I'm not sure which is the "best" way to ensure that I can only use it once, i.e. I want to avoid the user pressing F5 repeatedly and accessing the function more than once.
My initial thought was to set a session variable and time the function out for a set period of time. The problem with that is thay could have access to the function again after the set period has elapsed.
Better ideas welcomed!
| 0 |
1,720,585 |
11/12/2009 07:47:46
| 27,328 |
10/13/2008 06:22:10
| 638 | 16 |
Is there a standard governing the __utma, __utmz etc.. cookies ?
|
Whether I log into Facebook or Twitter, I'll be bombarded with cookies of the such names as:
__utma
__utmb
__utmc
__utmv
What are their functions ?
Is there a standard that governs how these are used on the serverside ?
|
cookies
|
http
|
javascript
| null | null | null |
open
|
Is there a standard governing the __utma, __utmz etc.. cookies ?
===
Whether I log into Facebook or Twitter, I'll be bombarded with cookies of the such names as:
__utma
__utmb
__utmc
__utmv
What are their functions ?
Is there a standard that governs how these are used on the serverside ?
| 0 |
4,774,545 |
01/23/2011 15:18:01
| 280,391 |
02/24/2010 14:25:29
| 794 | 38 |
Should Threads be avoided if at all possible inside software components?
|
I have recently been looking at code, specifically component oriented code that uses threads internally. Is this a bad practise. The code I looked at was from an F# example that showed the use of event based programming techniques. I can not post the code in case of copyright infringements, but it does spin up a thread of its own. Is this regarded as bad practise or is it feasible that code not written by yourself has full control of thread creation. I do point out that this code is not a visual component and is very much "built from scratch".
What are the best practises of component creation where threading would be helpful?
I am completely language agnostic on this, the f# example could have been in c# or python.
I am concerned about the lack of control over the components run time and hogging of resources, the example just implemented another thread, but as far as I can see there is nothing stopping this type of design from spawning as many threads as it wishes, well to the limit of what your program allows.
I did think of methods such as object injecting and so fourth, but threads are weird as they are from a component perspective pure "action" as opposed to "model, state, declarations"
any help would be great.
|
c#
|
design-patterns
|
f#
|
components
| null | null |
open
|
Should Threads be avoided if at all possible inside software components?
===
I have recently been looking at code, specifically component oriented code that uses threads internally. Is this a bad practise. The code I looked at was from an F# example that showed the use of event based programming techniques. I can not post the code in case of copyright infringements, but it does spin up a thread of its own. Is this regarded as bad practise or is it feasible that code not written by yourself has full control of thread creation. I do point out that this code is not a visual component and is very much "built from scratch".
What are the best practises of component creation where threading would be helpful?
I am completely language agnostic on this, the f# example could have been in c# or python.
I am concerned about the lack of control over the components run time and hogging of resources, the example just implemented another thread, but as far as I can see there is nothing stopping this type of design from spawning as many threads as it wishes, well to the limit of what your program allows.
I did think of methods such as object injecting and so fourth, but threads are weird as they are from a component perspective pure "action" as opposed to "model, state, declarations"
any help would be great.
| 0 |
7,546,451 |
09/25/2011 15:22:55
| 963,718 |
09/25/2011 14:46:16
| 6 | 0 |
Programmatically creating new user on MAC OS using objective-c or any Cocoa API?
|
I'm trying to create new user within my Application. I know that is possible using dscl and NSTask.But does anyone know how it is possbile to do with any Cocoa API , or programmaticaly using objective-c? within code , not using bash commands , like here
sudo niutil -create / /users/newuser
sudo niutil -createprop / /users/newuser uid 502
sudo niutil -createprop / /users/newuser gid 502
sudo niutil -createprop / /users/newuser realname "Longer Name"
sudo niutil -createprop / /users/newuser home "/Users/newuser "
sudo niutil -createprop / /users/newuser shell "/bin/tcsh"
sudo niutil -createprop / /users/sharedDir shell "Public"
sudo niutil -createprop / /users/newuser passwd "*"
sudo passwd newuser
sudo ditto /System/Library/User\ Template/English.lproj /Users/newuser
sudo chown -R newuser :group /Users/newuser
I was told that is possible to do using **Open Directory Framework**, but couldn't find usefull documentation. Thanks.
|
objective-c
|
osx
|
cocoa
| null | null |
09/28/2011 03:33:28
|
not constructive
|
Programmatically creating new user on MAC OS using objective-c or any Cocoa API?
===
I'm trying to create new user within my Application. I know that is possible using dscl and NSTask.But does anyone know how it is possbile to do with any Cocoa API , or programmaticaly using objective-c? within code , not using bash commands , like here
sudo niutil -create / /users/newuser
sudo niutil -createprop / /users/newuser uid 502
sudo niutil -createprop / /users/newuser gid 502
sudo niutil -createprop / /users/newuser realname "Longer Name"
sudo niutil -createprop / /users/newuser home "/Users/newuser "
sudo niutil -createprop / /users/newuser shell "/bin/tcsh"
sudo niutil -createprop / /users/sharedDir shell "Public"
sudo niutil -createprop / /users/newuser passwd "*"
sudo passwd newuser
sudo ditto /System/Library/User\ Template/English.lproj /Users/newuser
sudo chown -R newuser :group /Users/newuser
I was told that is possible to do using **Open Directory Framework**, but couldn't find usefull documentation. Thanks.
| 4 |
5,851,306 |
05/01/2011 20:49:21
| 438,719 |
09/03/2010 07:20:26
| 33 | 2 |
Get changes in content provider
|
I'm developing an application that syncs a remote calendar with an Android device.
Everything works fine, but now I want to make it a bit faster by letting the Android device only sync events that got edited by the user (with Android Calendar). So I need to know which events got edited.
I've been looking into `ContentObserver` but that doesn't seem like a good solution since I would have to register an observer for each event in the calendar. And I don't even know if the observer would still be there if I restarted the device.
Another solution I came up with is to store a copy of all events in a local database. That database would get updated on each sync. And before each sync we could compare that database with the Android Calendar provider...
Is there an easier way to do this?
Thanks,
Gillis
|
android
|
synchronization
|
calendar
|
android-contentprovider
|
contentobserver
| null |
open
|
Get changes in content provider
===
I'm developing an application that syncs a remote calendar with an Android device.
Everything works fine, but now I want to make it a bit faster by letting the Android device only sync events that got edited by the user (with Android Calendar). So I need to know which events got edited.
I've been looking into `ContentObserver` but that doesn't seem like a good solution since I would have to register an observer for each event in the calendar. And I don't even know if the observer would still be there if I restarted the device.
Another solution I came up with is to store a copy of all events in a local database. That database would get updated on each sync. And before each sync we could compare that database with the Android Calendar provider...
Is there an easier way to do this?
Thanks,
Gillis
| 0 |
6,942,499 |
08/04/2011 13:41:26
| 793,388 |
06/10/2011 21:01:36
| 5 | 1 |
If condition in a webgrid
|
I am using this webgrid in my view.
<div class="grid">
@{
var grid = new WebGrid(Model.SearchResults, canPage: true, rowsPerPage: 15);
grid.Pager(WebGridPagerModes.NextPrevious);
@grid.GetHtml(
htmlAttributes: new { @style = "width:100%", cellspacing = "0" },
columns: grid.Columns(
grid.Column(header: "Customer Name", format: (item) => Html.ActionLink((string)item.FullName, "ShowContracts", new { id = item.UserId }, new { @style = "color: 'black'", @onmouseover = "this.style.color='green'", @onmouseout = "this.style.color='black'" })),
grid.Column(header: "SSN", format: item => item.SSN)
))
}
</div>
I search with SSN and display the results in a webgrid. The displayed data is dummy data.
I have a bool AccountVerified in my viewmodel, now I should not give action link to the accounts which are not verified and display text next to them saying account verification pending. Can someone help me on this?
|
asp.net-mvc-3
|
webgrid
| null | null | null | null |
open
|
If condition in a webgrid
===
I am using this webgrid in my view.
<div class="grid">
@{
var grid = new WebGrid(Model.SearchResults, canPage: true, rowsPerPage: 15);
grid.Pager(WebGridPagerModes.NextPrevious);
@grid.GetHtml(
htmlAttributes: new { @style = "width:100%", cellspacing = "0" },
columns: grid.Columns(
grid.Column(header: "Customer Name", format: (item) => Html.ActionLink((string)item.FullName, "ShowContracts", new { id = item.UserId }, new { @style = "color: 'black'", @onmouseover = "this.style.color='green'", @onmouseout = "this.style.color='black'" })),
grid.Column(header: "SSN", format: item => item.SSN)
))
}
</div>
I search with SSN and display the results in a webgrid. The displayed data is dummy data.
I have a bool AccountVerified in my viewmodel, now I should not give action link to the accounts which are not verified and display text next to them saying account verification pending. Can someone help me on this?
| 0 |
7,001,385 |
08/09/2011 18:53:49
| 562,766 |
01/04/2011 15:38:36
| 842 | 47 |
How to change background color of DateTimePicker control under Windows Vista / 7
|
My question is the same as the one at http://stackoverflow.com/questions/198532/changing-the-background-color-of-a-datetimepicker-in-net. Unfortunately, the solution there doesn't work in Windows Vista/7 when visual styles are enabled. It does work fine if I disable visual styles, but that isn't an acceptable solution for my application.
How do I change the background color of a .NET WinForms DateTimePicker under Windows Vista / 7 when visual styles are enabled?
Any answers written from a C++ / Windows API perspective are welcome as well; I am experienced enough to translate a solution from one platform to another. I just ask it from a C# / WinForms perspective as there are a lot of developers who use it.
**Edit:** Also I should add that suggestions to owner-draw the entire control are at the very bottom of my possible list of solutions as it sounds like a ton of work. Existing efforts I've seen seem very incomplete.
|
c#
|
.net
|
c++
|
winforms
|
winapi
| null |
open
|
How to change background color of DateTimePicker control under Windows Vista / 7
===
My question is the same as the one at http://stackoverflow.com/questions/198532/changing-the-background-color-of-a-datetimepicker-in-net. Unfortunately, the solution there doesn't work in Windows Vista/7 when visual styles are enabled. It does work fine if I disable visual styles, but that isn't an acceptable solution for my application.
How do I change the background color of a .NET WinForms DateTimePicker under Windows Vista / 7 when visual styles are enabled?
Any answers written from a C++ / Windows API perspective are welcome as well; I am experienced enough to translate a solution from one platform to another. I just ask it from a C# / WinForms perspective as there are a lot of developers who use it.
**Edit:** Also I should add that suggestions to owner-draw the entire control are at the very bottom of my possible list of solutions as it sounds like a ton of work. Existing efforts I've seen seem very incomplete.
| 0 |
5,169,707 |
03/02/2011 15:31:38
| 365,251 |
06/12/2010 13:37:57
| 771 | 1 |
Faux Columns - IE vs Chrome - Different opacity?
|
I don't know how to explain to you the trouble by using faux columns. So I'll [show][1] it to us.
IN the first image you can see the faux columns rendered by Chrome. In the second by IE8. How you can see, on IE there is a different opacity, and i don't know why.
This is the HTML code :
<div class="commentsWide">
<div class="commentContent">
<div class="commentsWide1">
<a class="lblackbbu" href="index.php?explore=userview&userv=chevr">chevr</a>
</div>
<div class="commentsWide2">
side A sorry i forgot to mention :P
</div>
<div class="commentsWide3">
<div class="commentsWide3A"> </div>
<div class="commentsWide3B">11:06:20</div>
<div class="commentsWide3C">30-06-2010</div>
</div>
</div>
</div>
And this the CSS :
.commentsWide{width:690px; float:left; background-color:#999999; color:#000000; border-bottom:1px #000000 solid; padding-top:5px; padding-bottom:5px; padding-left:10px; padding-right:10px;}
.commentContent{width:690px; float:left; background-image:url(../img/comments_background.png);}
.commentsWide1{width:120px; float:left;}
.commentsWide2{width:450px; float:left; padding-left:10px; padding-right:10px;}
.commentsWide3{width:100px; float:left; text-align:right; font-weight:bold;}
.commentsWide3A{width:20px; height:35px; float:left; padding-left:10px; padding-top:5px;}
.commentsWide3B{width:70px; float:left; text-align:right; font-size:14px;}
.commentsWide3C{width:70px; float:left; text-align:right; font-size:12px;}
Why this happens? And how can I fix this trouble?
[1]: http://img607.imageshack.us/f/chromevsie.png/
|
css
| null | null | null | null | null |
open
|
Faux Columns - IE vs Chrome - Different opacity?
===
I don't know how to explain to you the trouble by using faux columns. So I'll [show][1] it to us.
IN the first image you can see the faux columns rendered by Chrome. In the second by IE8. How you can see, on IE there is a different opacity, and i don't know why.
This is the HTML code :
<div class="commentsWide">
<div class="commentContent">
<div class="commentsWide1">
<a class="lblackbbu" href="index.php?explore=userview&userv=chevr">chevr</a>
</div>
<div class="commentsWide2">
side A sorry i forgot to mention :P
</div>
<div class="commentsWide3">
<div class="commentsWide3A"> </div>
<div class="commentsWide3B">11:06:20</div>
<div class="commentsWide3C">30-06-2010</div>
</div>
</div>
</div>
And this the CSS :
.commentsWide{width:690px; float:left; background-color:#999999; color:#000000; border-bottom:1px #000000 solid; padding-top:5px; padding-bottom:5px; padding-left:10px; padding-right:10px;}
.commentContent{width:690px; float:left; background-image:url(../img/comments_background.png);}
.commentsWide1{width:120px; float:left;}
.commentsWide2{width:450px; float:left; padding-left:10px; padding-right:10px;}
.commentsWide3{width:100px; float:left; text-align:right; font-weight:bold;}
.commentsWide3A{width:20px; height:35px; float:left; padding-left:10px; padding-top:5px;}
.commentsWide3B{width:70px; float:left; text-align:right; font-size:14px;}
.commentsWide3C{width:70px; float:left; text-align:right; font-size:12px;}
Why this happens? And how can I fix this trouble?
[1]: http://img607.imageshack.us/f/chromevsie.png/
| 0 |
11,472,162 |
07/13/2012 14:09:47
| 901,336 |
08/18/2011 20:14:14
| 44 | 1 |
Is it bad to have 3 levels of divs on the z-axis
|
As a general rule of design is it looked down upon to have more than one div ontop of the page contents? I have a table with records and a div that sits ontop of the table which moves to the vertical position of that record which contains sub-records upon the click. These sub-records in the div also have a level of sub-records themselves and I wish to put another div ontop of the first displaying info about them. Would that be too ridiculous?
gracias de antemano,
|
html
|
design
|
webpage
| null | null |
07/15/2012 01:26:10
|
not constructive
|
Is it bad to have 3 levels of divs on the z-axis
===
As a general rule of design is it looked down upon to have more than one div ontop of the page contents? I have a table with records and a div that sits ontop of the table which moves to the vertical position of that record which contains sub-records upon the click. These sub-records in the div also have a level of sub-records themselves and I wish to put another div ontop of the first displaying info about them. Would that be too ridiculous?
gracias de antemano,
| 4 |
3,240,515 |
07/13/2010 19:06:20
| 378,874 |
06/29/2010 10:03:34
| 140 | 8 |
PHP creating a while loop that is dependent on multiple variables that are independent of one another?
|
I'm stumped on this and my searches aren't turning up anything relevant.. I need to do a while loop that will continue if either of 2 variables are true... as far as I can tell you can't do a "while ($var = '' and $var2 = ''); so I tried this, basically I figured I could just set 2 different if statements so that it would change the variable "continue" if it went past 4 iterations (if $i >= 4), however this just gives an infinite loop:
function whiletest ()
{
$i = 1;
do {
echo 'output' ;
if ($status != 'true') {
$continue = 1 ;
}
if ($i >= 4) {
$continue = 2 ;
}
$i++ ;
} while ($continue = 1 );
}
|
php
|
if-statement
|
infinite-loop
| null | null | null |
open
|
PHP creating a while loop that is dependent on multiple variables that are independent of one another?
===
I'm stumped on this and my searches aren't turning up anything relevant.. I need to do a while loop that will continue if either of 2 variables are true... as far as I can tell you can't do a "while ($var = '' and $var2 = ''); so I tried this, basically I figured I could just set 2 different if statements so that it would change the variable "continue" if it went past 4 iterations (if $i >= 4), however this just gives an infinite loop:
function whiletest ()
{
$i = 1;
do {
echo 'output' ;
if ($status != 'true') {
$continue = 1 ;
}
if ($i >= 4) {
$continue = 2 ;
}
$i++ ;
} while ($continue = 1 );
}
| 0 |
1,910,097 |
12/15/2009 20:17:20
| 68,183 |
02/19/2009 03:16:03
| 1,988 | 0 |
content type by extension
|
Is there any built in function that returns the content type based on the file extension?
|
c#
|
content-type
| null | null | null | null |
open
|
content type by extension
===
Is there any built in function that returns the content type based on the file extension?
| 0 |
10,484,380 |
05/07/2012 15:02:33
| 1,355,358 |
04/25/2012 05:55:25
| 1 | 1 |
how to use BRMS tool
|
I am new to BRMS. I don't know how to use it.
Whether it used with eclipse(plugins) or it is a separate tool.
And tell me what is basic requirement for BRMS like jdk version, application server etc....
|
java
|
java-ee
|
jboss
|
drools
| null |
05/08/2012 18:08:29
|
not constructive
|
how to use BRMS tool
===
I am new to BRMS. I don't know how to use it.
Whether it used with eclipse(plugins) or it is a separate tool.
And tell me what is basic requirement for BRMS like jdk version, application server etc....
| 4 |
7,661,662 |
10/05/2011 12:58:46
| 980,353 |
10/05/2011 12:39:55
| 1 | 0 |
Best way to implement user verifcation
|
we are launching a classified portal. We want to be able to add a verification sticker, badge...to ensure safe transactions. What would be the best way to implement such a structure.
If a user is banned (scamming, spamming...) how could we make it difficult/tedious for them to create a new account ?
Thanks for your help, we are not looking for a ready made solution, but more towards general aspects and guidelines.
|
security
| null | null | null | null |
10/05/2011 13:28:21
|
off topic
|
Best way to implement user verifcation
===
we are launching a classified portal. We want to be able to add a verification sticker, badge...to ensure safe transactions. What would be the best way to implement such a structure.
If a user is banned (scamming, spamming...) how could we make it difficult/tedious for them to create a new account ?
Thanks for your help, we are not looking for a ready made solution, but more towards general aspects and guidelines.
| 2 |
9,981,058 |
04/02/2012 17:39:11
| 470,772 |
10/09/2010 00:59:12
| 2,341 | 134 |
Controlling events on Apple Ipad's Safari
|
well, this will be a tough one. I think i have exhausted all my options, let's see if you can come up with something better.
I have a horizontal carousel and am using touchstart, touchmove, touchend to control it. For the sake of this example, the html structure is something like:
<div>
<ul id="strip">
<li><a>...</a></li>
<li><a>...</a></li>
...................
</ul>
</div>
I have separated my eventhandlers to behave a bit differently from mouse to touch events, so, thinking only of touch, i have:
var strip = document.getElementById('strip');
strip.addEventListener('touchstart', touchStartHandler);
document.addEventListener('touchmove', touchMoveHandler);
document.addEventListener('touchend', touchEndHandler);
I want the horizontal scrolling to work even if the user has his finger outside my strip, so i attached the touchmove and touchend event to the document.
At first, i thought it would be natural to, while the user was scrolling my carousel, for the browser to stay put, so my touchMoveHandler looked something like:
function touchMoveHandler(evt){
evt.preventDefault();
...................
}
... this way, the browser wouldn't pan vertically when the user's finger positioned varied in the Y axis. Our usability guy, thinks otherwise, and i actually agree with him now. He wants the browser to respond normally, unless the movement of the finger is totally or near perfectly horizontal.
Anyway, this is probably too much information, so i am going to detail my actual problem now. This is a snippet of the prototype i'm working on as a proof of concept:
var stopY, lastTime, newTime;
var touchStartHandler(evt){
...
stopY = true;
lastTime = new Date();
...
};
var touchMoveHandler(evt){
...
//this following code works like a setInterval, it turns stopY on and off every 1/2 sec
//for some reason, setInterval doesn't play well inside a touchmove event
newTime = new Date();
if(newTime - lastTime >= 500){
this._stopY = !this._stopY;
lastTime = newTime;
}
...
if(stopY){
evt.preventDefault();
}
...
}
I am absolutely sure this code is pristine, i debugged it with console logs and everything is doing what it's supposed to do except for the commuting of the browser panning throught the stopY variable.
If i run the code starting with stopY = true, there is no browser panning, if i start with stopY = false, the browser pans as expected. The problem is that i would expect this behaviour to change every half a second and it doesn't.
I hope i didn't complicate this too much for you, but this is really specific.
Thanks for your time and for your help
|
javascript
|
ipad
|
mobile
|
javascript-events
|
mobile-safari
| null |
open
|
Controlling events on Apple Ipad's Safari
===
well, this will be a tough one. I think i have exhausted all my options, let's see if you can come up with something better.
I have a horizontal carousel and am using touchstart, touchmove, touchend to control it. For the sake of this example, the html structure is something like:
<div>
<ul id="strip">
<li><a>...</a></li>
<li><a>...</a></li>
...................
</ul>
</div>
I have separated my eventhandlers to behave a bit differently from mouse to touch events, so, thinking only of touch, i have:
var strip = document.getElementById('strip');
strip.addEventListener('touchstart', touchStartHandler);
document.addEventListener('touchmove', touchMoveHandler);
document.addEventListener('touchend', touchEndHandler);
I want the horizontal scrolling to work even if the user has his finger outside my strip, so i attached the touchmove and touchend event to the document.
At first, i thought it would be natural to, while the user was scrolling my carousel, for the browser to stay put, so my touchMoveHandler looked something like:
function touchMoveHandler(evt){
evt.preventDefault();
...................
}
... this way, the browser wouldn't pan vertically when the user's finger positioned varied in the Y axis. Our usability guy, thinks otherwise, and i actually agree with him now. He wants the browser to respond normally, unless the movement of the finger is totally or near perfectly horizontal.
Anyway, this is probably too much information, so i am going to detail my actual problem now. This is a snippet of the prototype i'm working on as a proof of concept:
var stopY, lastTime, newTime;
var touchStartHandler(evt){
...
stopY = true;
lastTime = new Date();
...
};
var touchMoveHandler(evt){
...
//this following code works like a setInterval, it turns stopY on and off every 1/2 sec
//for some reason, setInterval doesn't play well inside a touchmove event
newTime = new Date();
if(newTime - lastTime >= 500){
this._stopY = !this._stopY;
lastTime = newTime;
}
...
if(stopY){
evt.preventDefault();
}
...
}
I am absolutely sure this code is pristine, i debugged it with console logs and everything is doing what it's supposed to do except for the commuting of the browser panning throught the stopY variable.
If i run the code starting with stopY = true, there is no browser panning, if i start with stopY = false, the browser pans as expected. The problem is that i would expect this behaviour to change every half a second and it doesn't.
I hope i didn't complicate this too much for you, but this is really specific.
Thanks for your time and for your help
| 0 |
5,988,659 |
05/13/2011 07:28:47
| 105,992 |
05/13/2009 05:49:27
| 108 | 13 |
Get total size of attached files on all list items in SharePoint 2007with PowerShell v2.0
|
Using Powershell I have to get the total size of all attached files on all list items for a generic list. I tryed to use the function below but this will display the total length of names for the attached files.
function GetListSize($List, $Web)
{
[long]$listSize = 0
foreach ($listItem in $List.Items)
{
$listItemAttachments = $listItem.Attachments
foreach($file in $listItemAttachments)
{
$listSize += $file.Length
}
}
$totalInMb = ($listSize/1024)/1024
$totalInMb = "{0:N2}" -f $totalInMb
return $totalInMb
}
I can do this using c# (http://mykiavash.wordpress.com/2011/05/02/how-to-get-size-of-sharepoint-2010-list-item-attachment/) code but no ideea using PowerShell script. Do you have any ideea ?
|
powershell
|
sharepoint2007
| null | null | null | null |
open
|
Get total size of attached files on all list items in SharePoint 2007with PowerShell v2.0
===
Using Powershell I have to get the total size of all attached files on all list items for a generic list. I tryed to use the function below but this will display the total length of names for the attached files.
function GetListSize($List, $Web)
{
[long]$listSize = 0
foreach ($listItem in $List.Items)
{
$listItemAttachments = $listItem.Attachments
foreach($file in $listItemAttachments)
{
$listSize += $file.Length
}
}
$totalInMb = ($listSize/1024)/1024
$totalInMb = "{0:N2}" -f $totalInMb
return $totalInMb
}
I can do this using c# (http://mykiavash.wordpress.com/2011/05/02/how-to-get-size-of-sharepoint-2010-list-item-attachment/) code but no ideea using PowerShell script. Do you have any ideea ?
| 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.