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
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6,462,408
|
06/24/2011 01:29:59
| 553,044
|
11/05/2010 07:53:21
| 125
| 0
|
While programing, how do I avoid stupid typos that result in wasted debugging time?
|
Is it an innate coder skill? Or something that is developed? Something that can be mitigated with certain tricks or techniques?
Sometimes I just stare at the wall of text and can't figure out what's wrong, only to find much, much later that it was a misspelled word or one-character typo.
|
debugging
|
typo
| null | null | null |
06/24/2011 01:45:52
|
not a real question
|
While programing, how do I avoid stupid typos that result in wasted debugging time?
===
Is it an innate coder skill? Or something that is developed? Something that can be mitigated with certain tricks or techniques?
Sometimes I just stare at the wall of text and can't figure out what's wrong, only to find much, much later that it was a misspelled word or one-character typo.
| 1
|
3,934,992
|
10/14/2010 15:43:14
| 14,065
|
09/16/2008 21:51:44
| 40,068
| 1,252
|
Fair comparison of fork() Vs Thread
|
I was having a discussion about the relative cost of fork() Vs thread() for parallelization of a task.
We understand the basic differences between processes Vs Thread
Thread:
* Easy to communicate between threads
* Fast context switching.
Processes:
* Fault talarance.
* Communicating with parent not a real problem (open a pipe)
* Communication with other child processes hard
But we disagreed on the start-up cost of processes Vs threads.
So to test the theories I wrote the following code. My question: Is this a valid test of measuring the start-up cost or I am missing something. Also I would be interested in how each test performs on different platforms.
##fork.cpp
#include <boost/lexical_cast.hpp>
#include <vector>
#include <unistd.h>
#include <iostream>
#include <stdlib.h>
#include <time.h>
extern "C" int threadStart(void* threadData)
{
return 0;
}
int main(int argc,char* argv[])
{
int threadCount = boost::lexical_cast<int>(argv[1]);
std::vector<pid_t> data(threadCount);
clock_t start = clock();
for(int loop=0;loop < threadCount;++loop)
{
data[loop] = fork();
if (data[loop] == 0)
{
exit(threadStart(NULL));
}
}
clock_t middle = clock();
for(int loop=0;loop < threadCount;++loop)
{
int result;
waitpid(data[loop], &result, 0);
}
clock_t end = clock();
std::cout << "Start: " << middle - start << "\n";
std::cout << "Wait: " << end - middle << "\n";
std::cout << "All: " << end - start << "\n";
}
### Thread.cpp
#include <boost/lexical_cast.hpp>
#include <vector>
#include <iostream>
#include <pthread.h>
#include <time.h>
extern "C" void* threadStart(void* threadData)
{
return NULL;
}
int main(int argc,char* argv[])
{
int threadCount = boost::lexical_cast<int>(argv[1]);
std::vector<pthread_t> data(threadCount);
clock_t start = clock();
for(int loop=0;loop < threadCount;++loop)
{
pthread_create(&data[loop], NULL, threadStart, NULL);
}
clock_t middle = clock();
for(int loop=0;loop < threadCount;++loop)
{
void* result;
pthread_join(data[loop], &result);
}
clock_t end = clock();
std::cout << "Start: " << middle - start << "\n";
std::cout << "Wait: " << end - middle << "\n";
std::cout << "All: " << end - start << "\n";
}
I expect Windows to do worse in processes creation.
But I would expect modern Unix like systems to have a fairly light fork cost and be at least comparable to thread. On older Unix style systems (before fork() was implemented as using copy on write pages) that it would be worse.
Anyway My timing results are:
> uname -a
Darwin Alpha.local 10.4.0 Darwin Kernel Version 10.4.0: Fri Apr 23 18:28:53 PDT 2010; root:xnu-1504.7.4~1/RELEASE_I386 i386
> gcc --version | grep GCC
i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5659)
> g++ thread.cpp -o thread -I~/include
> g++ fork.cpp -o fork -I~/include
> ./fork 1000
Start: 21512
Wait: 1541
All: 23053
> ./thread 1000
Start: 1553755
Wait: 10373
All: 1564128
|
c++
|
c
|
multithreading
|
unix
|
fork
|
10/14/2010 19:08:28
|
not a real question
|
Fair comparison of fork() Vs Thread
===
I was having a discussion about the relative cost of fork() Vs thread() for parallelization of a task.
We understand the basic differences between processes Vs Thread
Thread:
* Easy to communicate between threads
* Fast context switching.
Processes:
* Fault talarance.
* Communicating with parent not a real problem (open a pipe)
* Communication with other child processes hard
But we disagreed on the start-up cost of processes Vs threads.
So to test the theories I wrote the following code. My question: Is this a valid test of measuring the start-up cost or I am missing something. Also I would be interested in how each test performs on different platforms.
##fork.cpp
#include <boost/lexical_cast.hpp>
#include <vector>
#include <unistd.h>
#include <iostream>
#include <stdlib.h>
#include <time.h>
extern "C" int threadStart(void* threadData)
{
return 0;
}
int main(int argc,char* argv[])
{
int threadCount = boost::lexical_cast<int>(argv[1]);
std::vector<pid_t> data(threadCount);
clock_t start = clock();
for(int loop=0;loop < threadCount;++loop)
{
data[loop] = fork();
if (data[loop] == 0)
{
exit(threadStart(NULL));
}
}
clock_t middle = clock();
for(int loop=0;loop < threadCount;++loop)
{
int result;
waitpid(data[loop], &result, 0);
}
clock_t end = clock();
std::cout << "Start: " << middle - start << "\n";
std::cout << "Wait: " << end - middle << "\n";
std::cout << "All: " << end - start << "\n";
}
### Thread.cpp
#include <boost/lexical_cast.hpp>
#include <vector>
#include <iostream>
#include <pthread.h>
#include <time.h>
extern "C" void* threadStart(void* threadData)
{
return NULL;
}
int main(int argc,char* argv[])
{
int threadCount = boost::lexical_cast<int>(argv[1]);
std::vector<pthread_t> data(threadCount);
clock_t start = clock();
for(int loop=0;loop < threadCount;++loop)
{
pthread_create(&data[loop], NULL, threadStart, NULL);
}
clock_t middle = clock();
for(int loop=0;loop < threadCount;++loop)
{
void* result;
pthread_join(data[loop], &result);
}
clock_t end = clock();
std::cout << "Start: " << middle - start << "\n";
std::cout << "Wait: " << end - middle << "\n";
std::cout << "All: " << end - start << "\n";
}
I expect Windows to do worse in processes creation.
But I would expect modern Unix like systems to have a fairly light fork cost and be at least comparable to thread. On older Unix style systems (before fork() was implemented as using copy on write pages) that it would be worse.
Anyway My timing results are:
> uname -a
Darwin Alpha.local 10.4.0 Darwin Kernel Version 10.4.0: Fri Apr 23 18:28:53 PDT 2010; root:xnu-1504.7.4~1/RELEASE_I386 i386
> gcc --version | grep GCC
i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5659)
> g++ thread.cpp -o thread -I~/include
> g++ fork.cpp -o fork -I~/include
> ./fork 1000
Start: 21512
Wait: 1541
All: 23053
> ./thread 1000
Start: 1553755
Wait: 10373
All: 1564128
| 1
|
10,910,420
|
06/06/2012 08:08:28
| 1,438,010
|
06/05/2012 17:50:23
| 1
| 0
|
Android application stopped unexpextedly in emulator?
|
/* Unable to remove this bug....don't know how to make my application run....plzz help*/
package com.android.demo;
import com.android.demo.R;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
public class textfield extends Activity {
Button button1;
EditText txtbox1,txtbox2;
TextView tv = new TextView(this);
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(R.layout.main);
txtbox1= (EditText) findViewById(R.id.txtbox1);
button1 = (Button) findViewById(R.id.button1);
tv = (TextView) findViewById(R.id.lbl1);
txtbox2= (EditText) findViewById(R.id.txtbox2);
button1.setOnClickListener(new clicker());
}
class clicker implements Button.OnClickListener
{
public void onClick(View v)
{
String a,b;
Integer vis;
a = txtbox1.getText().toString();
b = txtbox2.getText().toString();
vis = Integer.parseInt(a)+Integer.parseInt(b);
tv.setText(vis.toString());
}
}
}
|
android-emulator
| null | null | null | null |
06/06/2012 10:06:06
|
not a real question
|
Android application stopped unexpextedly in emulator?
===
/* Unable to remove this bug....don't know how to make my application run....plzz help*/
package com.android.demo;
import com.android.demo.R;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
public class textfield extends Activity {
Button button1;
EditText txtbox1,txtbox2;
TextView tv = new TextView(this);
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(R.layout.main);
txtbox1= (EditText) findViewById(R.id.txtbox1);
button1 = (Button) findViewById(R.id.button1);
tv = (TextView) findViewById(R.id.lbl1);
txtbox2= (EditText) findViewById(R.id.txtbox2);
button1.setOnClickListener(new clicker());
}
class clicker implements Button.OnClickListener
{
public void onClick(View v)
{
String a,b;
Integer vis;
a = txtbox1.getText().toString();
b = txtbox2.getText().toString();
vis = Integer.parseInt(a)+Integer.parseInt(b);
tv.setText(vis.toString());
}
}
}
| 1
|
11,150,988
|
06/22/2012 06:13:53
| 946,170
|
09/15/2011 06:50:08
| 1,369
| 122
|
IMAP: Change email password through php
|
How can I change password of the mail account using php. I am using IMAP functions.
IMAP doc : http://php.net/manual/en/book.imap.php
Note: There is no acess to cpanel API
|
php
|
imap
|
change-password
| null | null | null |
open
|
IMAP: Change email password through php
===
How can I change password of the mail account using php. I am using IMAP functions.
IMAP doc : http://php.net/manual/en/book.imap.php
Note: There is no acess to cpanel API
| 0
|
4,548,764
|
12/28/2010 19:19:49
| 432,209
|
08/26/2010 18:30:32
| 650
| 62
|
Bug with Android spinner in 2.2 related to layout arrangement
|
Below is a link to the bug I am experiencing with my Android application. Rather than trying to explain it via a huge wall of text, I figured a simple video would be much more direct and easier to understand.
http://www.youtube.com/watch?v=9V3v854894g
I've been beating my head against a wall on this problem for a day and a half now. I only found that it could be solved by changing the XML layout just recently which makes absolutely no sense to me. I have no idea how to properly fix it, or a way to band-aid the problem since I need the nested layouts in my application.
Thank you everyone for all your help!
Here is the code:
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.SeekBar;
import android.widget.Spinner;
import android.widget.TextView;
import android.widget.AdapterView.OnItemSelectedListener;
public class Builder extends Activity {
private Spinner mCompSelect;
private Spinner mNameSelect;
private int[] mCompColorAsBuilt;
private int mComponent;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.builder);
mCompColorAsBuilt = new int[3];
mCompSelect = (Spinner) findViewById(R.id.component);
mNameSelect = (Spinner) findViewById(R.id.component_name);
ArrayAdapter<CharSequence> a = ArrayAdapter.createFromResource(this, R.array.cc_components, android.R.layout.simple_spinner_item);
a.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
mCompSelect.setAdapter(a);
mCompSelect.setOnItemSelectedListener(new OnItemSelectedListener() {
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
mComponent = position;
int resourceId = Builder.this.getResources().getIdentifier("component"+Integer.toString(mComponent)+"_color", "array", Builder.this.getPackageName());
ArrayAdapter<CharSequence> a = ArrayAdapter.createFromResource(Builder.this, resourceId, android.R.layout.simple_spinner_item);
a.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
mNameSelect.setAdapter(a);
mNameSelect.setSelection(mCompColorAsBuilt[mComponent]);
}
public void onNothingSelected(AdapterView<?> parent) {
}
});
int resourceId = this.getResources().getIdentifier("component"+Integer.toString(mComponent)+"_color", "array", this.getPackageName());
ArrayAdapter<CharSequence> b = ArrayAdapter.createFromResource(this, resourceId, android.R.layout.simple_spinner_item);
b.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
mNameSelect.setAdapter(b);
mNameSelect.setOnItemSelectedListener(new OnItemSelectedListener() {
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
mCompColorAsBuilt[mComponent] = position;
}
public void onNothingSelected(AdapterView<?> parent) {
}
});
}
}
XML
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<Spinner
android:id="@+id/component"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_toLeftOf="@+id/finish"
android:drawSelectorOnTop="true"
android:prompt="@string/component_spinner" />
<LinearLayout
android:orientation="horizontal"
android:layout_alignParentBottom="true"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<Spinner
android:id="@+id/component_name"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:drawSelectorOnTop="true"
android:prompt="@string/component_name_spinner" />
</LinearLayout>
</RelativeLayout>
|
java
|
android
|
layout
| null | null | null |
open
|
Bug with Android spinner in 2.2 related to layout arrangement
===
Below is a link to the bug I am experiencing with my Android application. Rather than trying to explain it via a huge wall of text, I figured a simple video would be much more direct and easier to understand.
http://www.youtube.com/watch?v=9V3v854894g
I've been beating my head against a wall on this problem for a day and a half now. I only found that it could be solved by changing the XML layout just recently which makes absolutely no sense to me. I have no idea how to properly fix it, or a way to band-aid the problem since I need the nested layouts in my application.
Thank you everyone for all your help!
Here is the code:
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.SeekBar;
import android.widget.Spinner;
import android.widget.TextView;
import android.widget.AdapterView.OnItemSelectedListener;
public class Builder extends Activity {
private Spinner mCompSelect;
private Spinner mNameSelect;
private int[] mCompColorAsBuilt;
private int mComponent;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.builder);
mCompColorAsBuilt = new int[3];
mCompSelect = (Spinner) findViewById(R.id.component);
mNameSelect = (Spinner) findViewById(R.id.component_name);
ArrayAdapter<CharSequence> a = ArrayAdapter.createFromResource(this, R.array.cc_components, android.R.layout.simple_spinner_item);
a.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
mCompSelect.setAdapter(a);
mCompSelect.setOnItemSelectedListener(new OnItemSelectedListener() {
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
mComponent = position;
int resourceId = Builder.this.getResources().getIdentifier("component"+Integer.toString(mComponent)+"_color", "array", Builder.this.getPackageName());
ArrayAdapter<CharSequence> a = ArrayAdapter.createFromResource(Builder.this, resourceId, android.R.layout.simple_spinner_item);
a.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
mNameSelect.setAdapter(a);
mNameSelect.setSelection(mCompColorAsBuilt[mComponent]);
}
public void onNothingSelected(AdapterView<?> parent) {
}
});
int resourceId = this.getResources().getIdentifier("component"+Integer.toString(mComponent)+"_color", "array", this.getPackageName());
ArrayAdapter<CharSequence> b = ArrayAdapter.createFromResource(this, resourceId, android.R.layout.simple_spinner_item);
b.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
mNameSelect.setAdapter(b);
mNameSelect.setOnItemSelectedListener(new OnItemSelectedListener() {
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
mCompColorAsBuilt[mComponent] = position;
}
public void onNothingSelected(AdapterView<?> parent) {
}
});
}
}
XML
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<Spinner
android:id="@+id/component"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_toLeftOf="@+id/finish"
android:drawSelectorOnTop="true"
android:prompt="@string/component_spinner" />
<LinearLayout
android:orientation="horizontal"
android:layout_alignParentBottom="true"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<Spinner
android:id="@+id/component_name"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:drawSelectorOnTop="true"
android:prompt="@string/component_name_spinner" />
</LinearLayout>
</RelativeLayout>
| 0
|
6,241,967
|
06/05/2011 09:10:55
| 767,912
|
05/24/2011 14:23:57
| 39
| 0
|
How secure can we be?
|
How 'secure' can code be? I mean, right in it's most basic form using PHP and mySQL in conjunction, assuming you take basic precautions against things like injection etc, what vulnerabilities are there other than details for the database itself?
And how is it that major corporations like Sony can get attacked repeatedly, when you'd think a company of their size would be pretty secure...
What else is there to consider beyond the basics of the code you write?
|
php
|
database
|
security
| null | null |
06/05/2011 09:17:55
|
not constructive
|
How secure can we be?
===
How 'secure' can code be? I mean, right in it's most basic form using PHP and mySQL in conjunction, assuming you take basic precautions against things like injection etc, what vulnerabilities are there other than details for the database itself?
And how is it that major corporations like Sony can get attacked repeatedly, when you'd think a company of their size would be pretty secure...
What else is there to consider beyond the basics of the code you write?
| 4
|
8,381,491
|
12/05/2011 05:52:09
| 1,046,314
|
11/14/2011 20:22:15
| 26
| 3
|
Is it possible to use XML from an external website?
|
I have researched this topic for months now with no success. Many posts say it is possible but I have yet been able to get it to work.
Here is the issue, we are using a resource that provides a data file in XML. It can be found at the following URL: http://www.idexonline.com/image_portal/Home/Graph/Base/IDEXOnlineDiamondIndex.xml
I want to insert this data into an existing webpage.
I've tried accessing this data using XSL, or XML include and a variety of other techniques with no luck.
I am currently using PHP on this site. But, I am open to the method, it can use JavaScript or other techniques! HELP!
Thanks
|
php
|
javascript
|
xml
|
xslt
| null |
07/08/2012 01:39:00
|
too localized
|
Is it possible to use XML from an external website?
===
I have researched this topic for months now with no success. Many posts say it is possible but I have yet been able to get it to work.
Here is the issue, we are using a resource that provides a data file in XML. It can be found at the following URL: http://www.idexonline.com/image_portal/Home/Graph/Base/IDEXOnlineDiamondIndex.xml
I want to insert this data into an existing webpage.
I've tried accessing this data using XSL, or XML include and a variety of other techniques with no luck.
I am currently using PHP on this site. But, I am open to the method, it can use JavaScript or other techniques! HELP!
Thanks
| 3
|
861,871
|
05/14/2009 06:41:08
| 57,428
|
01/21/2009 08:23:46
| 6,915
| 294
|
Why does COM+ ignore the apartment threading model?
|
I have an STA COM component which is put into a COM+ application. The client creates several instances of the class in that component and calls their methods in parallel. The class is registered properly - the "ThreadingModel" for the corresponding class id is "Apartment".
I see several calls of the same method of the same class being executed in parallel inside the component - in actual component code. They are executed in the same process but in different threads.
What's happening? Is COM+ ignoring the threading model? Shouldn't STA model only allow one call at a time to be executed?
|
com
|
windows
|
interop
|
com+
| null | null |
open
|
Why does COM+ ignore the apartment threading model?
===
I have an STA COM component which is put into a COM+ application. The client creates several instances of the class in that component and calls their methods in parallel. The class is registered properly - the "ThreadingModel" for the corresponding class id is "Apartment".
I see several calls of the same method of the same class being executed in parallel inside the component - in actual component code. They are executed in the same process but in different threads.
What's happening? Is COM+ ignoring the threading model? Shouldn't STA model only allow one call at a time to be executed?
| 0
|
4,774,316
|
01/23/2011 14:29:57
| 164,394
|
08/27/2009 17:43:29
| 1,971
| 171
|
Dashcode localhost server fails
|
I write a dashcode program and run it to test. this should connect to http://localhost:50853/index.html but fails to do so with a "could not connect to the server".
THis worked some months ago when i was last working on it but have done several update since then. Also i cannot see anywhere to tweek this address. looks as though it is fixed.
|
ios-simulator
|
dashcode
| null | null | null | null |
open
|
Dashcode localhost server fails
===
I write a dashcode program and run it to test. this should connect to http://localhost:50853/index.html but fails to do so with a "could not connect to the server".
THis worked some months ago when i was last working on it but have done several update since then. Also i cannot see anywhere to tweek this address. looks as though it is fixed.
| 0
|
1,660,352
|
11/02/2009 10:00:24
| 164,683
|
08/28/2009 06:36:27
| 104
| 16
|
C++ Array intitlaization
|
bellow code gives compilation error when I try to create test t[2];
because there is no default constructor for this.
But if I create Test t[2] = {test(1,2), test(2,3)}; Then it works fine.
1)But think of a situation, if we want to create more then 100 array element. We need to create 100 element in the curly braces like..
Test t[100] = {test(1,2), test(1,2)……/*100 times*/};
The above code is difficult to maintain.
One more solution is to create public member function which takes 2 integers and run in a loop. This solves the problem but i want to know any other good method.
2) If I create it using new
Test *t = new test[10];
I get compilation error(No default constructor). How to solve this.
class test
{
int _a;int _b;
public:
test(int a, int b);
void display();
};
int _tmain(int argc, _TCHAR* argv[])
{
test t[10];
for (int i = 0 ; i< 10; i++)
t[i].display ();
}
|
c++
|
visual-c++
|
winapi
| null | null | null |
open
|
C++ Array intitlaization
===
bellow code gives compilation error when I try to create test t[2];
because there is no default constructor for this.
But if I create Test t[2] = {test(1,2), test(2,3)}; Then it works fine.
1)But think of a situation, if we want to create more then 100 array element. We need to create 100 element in the curly braces like..
Test t[100] = {test(1,2), test(1,2)……/*100 times*/};
The above code is difficult to maintain.
One more solution is to create public member function which takes 2 integers and run in a loop. This solves the problem but i want to know any other good method.
2) If I create it using new
Test *t = new test[10];
I get compilation error(No default constructor). How to solve this.
class test
{
int _a;int _b;
public:
test(int a, int b);
void display();
};
int _tmain(int argc, _TCHAR* argv[])
{
test t[10];
for (int i = 0 ; i< 10; i++)
t[i].display ();
}
| 0
|
3,633,484
|
09/03/2010 06:28:53
| 388,388
|
07/10/2010 10:12:11
| 382
| 41
|
How to have a node as non selectable one
|
I will have a treeview with a root node initially and i will have context menu to be opened when i right click on the root node. AFter that i will save a file to save my data in to that. Alng with that i will load a child node for that . So that tree will looks as follows
Root
|-> some.txt
|-> A(child for some.txt)
And if i right click on the Node A i will have a form that user will fill some data and save it. If the save was successful i will have my treeview as follows
Root
|-> some.txt
|-> A(child for some.txt)
|->B(Child for A)
Now what i need if the use again right clicks on A node i would like to show some error message or i would like to have that node as non selectable field.
Any idea please
|
c#
|
winforms
|
treeview
| null | null | null |
open
|
How to have a node as non selectable one
===
I will have a treeview with a root node initially and i will have context menu to be opened when i right click on the root node. AFter that i will save a file to save my data in to that. Alng with that i will load a child node for that . So that tree will looks as follows
Root
|-> some.txt
|-> A(child for some.txt)
And if i right click on the Node A i will have a form that user will fill some data and save it. If the save was successful i will have my treeview as follows
Root
|-> some.txt
|-> A(child for some.txt)
|->B(Child for A)
Now what i need if the use again right clicks on A node i would like to show some error message or i would like to have that node as non selectable field.
Any idea please
| 0
|
4,921,840
|
02/07/2011 13:28:38
| 296,155
|
03/18/2010 01:11:33
| 284
| 7
|
Replace comma with tab in Textmate
|
Is there a simple way to replace commas with tabs in Textmate, hopefully using the Edit > Find (command F) function?
I've tried /t and '/t' and haven't been able to find documentation about the correct syntax. Also, trying to avoid writing a Ruby script to do it, if possible.
|
textmate
| null | null | null | null |
02/07/2011 15:42:43
|
off topic
|
Replace comma with tab in Textmate
===
Is there a simple way to replace commas with tabs in Textmate, hopefully using the Edit > Find (command F) function?
I've tried /t and '/t' and haven't been able to find documentation about the correct syntax. Also, trying to avoid writing a Ruby script to do it, if possible.
| 2
|
413,150
|
01/05/2009 13:53:34
| 50,477
|
12/31/2008 12:22:50
| 71
| 10
|
When i run the rake:db migrate command i get an error "Uninitialized constant CreateArticles"
|
I created a model ruby script/generate model Article (simple enuff)
Here is the migration file create_articles.rb:
def self.up
create_table :articles do |t|
t.column :user_id, :integer
t.column :title, :string
t.column :synopsis, :text, :limit => 1000
t.column :body, :text, :limit => 20000
t.column :published, :boolean, :default => false
t.column :created_at, :datetime
t.column :updated_at, :datetime
t.column :published_at, :datetime
t.column :category_id, :integer
end
def self.down
drop_table :articles
end
end
When i run the rake:db migrate command i receive an error rake aborted! "Uninitialized constant CreateArticles."
Does anyone know why this error keeps happening?
|
rake
|
ruby-on-rails
|
uninitialized
|
constant
| null | null |
open
|
When i run the rake:db migrate command i get an error "Uninitialized constant CreateArticles"
===
I created a model ruby script/generate model Article (simple enuff)
Here is the migration file create_articles.rb:
def self.up
create_table :articles do |t|
t.column :user_id, :integer
t.column :title, :string
t.column :synopsis, :text, :limit => 1000
t.column :body, :text, :limit => 20000
t.column :published, :boolean, :default => false
t.column :created_at, :datetime
t.column :updated_at, :datetime
t.column :published_at, :datetime
t.column :category_id, :integer
end
def self.down
drop_table :articles
end
end
When i run the rake:db migrate command i receive an error rake aborted! "Uninitialized constant CreateArticles."
Does anyone know why this error keeps happening?
| 0
|
9,267,302
|
02/13/2012 20:10:30
| 656,635
|
03/12/2011 14:03:07
| 15
| 0
|
naming convention for accessor method in php
|
Im preparing API methods for one of the system. Api will be available for few languages but first version will be released for the php. Im wondering what naming convention should use for accessor methods. I would like to have api interface very similar or even equal for each language. I was reading some libraries for php and noticed two naming convetion :
1) public accessor as set*() and get*() methods
class MyClass {
private $data;
public function getData() {
...
}
public function setData($value) {
...
}
}
2) drop out set/get prefix
class MyClass {
private $data;
public function data($value = null) {
if (!empty($value) && is_array($value)) {
$data = $value;
}
return $data;
}
}
Im not php programmer, I have experience in java and c/c++ so I would like to ask about suggestions which way to go for php ? Especially what is more readable, clear and understandable for php programmers.
I would like to read comments and sugestions.
all the best.
ps. if the topic is duplicated im sorry, would like to ask to point me to original topic.
|
php
|
naming-conventions
| null | null | null |
02/14/2012 02:34:52
|
not constructive
|
naming convention for accessor method in php
===
Im preparing API methods for one of the system. Api will be available for few languages but first version will be released for the php. Im wondering what naming convention should use for accessor methods. I would like to have api interface very similar or even equal for each language. I was reading some libraries for php and noticed two naming convetion :
1) public accessor as set*() and get*() methods
class MyClass {
private $data;
public function getData() {
...
}
public function setData($value) {
...
}
}
2) drop out set/get prefix
class MyClass {
private $data;
public function data($value = null) {
if (!empty($value) && is_array($value)) {
$data = $value;
}
return $data;
}
}
Im not php programmer, I have experience in java and c/c++ so I would like to ask about suggestions which way to go for php ? Especially what is more readable, clear and understandable for php programmers.
I would like to read comments and sugestions.
all the best.
ps. if the topic is duplicated im sorry, would like to ask to point me to original topic.
| 4
|
5,018,787
|
02/16/2011 16:04:19
| 8,741
|
09/15/2008 16:46:16
| 3,793
| 92
|
Aging algorithm for insurance policy.
|
This may sound very simple, but these parts of my brain are a bit rusty from disuse. I need to report on insurance policies, stating whether a policy is current, in advance/credit, or behind/in arrears. It is this simple right?
Tally all monthly payments on the policy, and compare to the policy age in months * monthly premium.
|
algorithm
| null | null | null | null |
02/17/2011 01:36:32
|
off topic
|
Aging algorithm for insurance policy.
===
This may sound very simple, but these parts of my brain are a bit rusty from disuse. I need to report on insurance policies, stating whether a policy is current, in advance/credit, or behind/in arrears. It is this simple right?
Tally all monthly payments on the policy, and compare to the policy age in months * monthly premium.
| 2
|
7,663,410
|
10/05/2011 15:01:35
| 454,010
|
09/21/2010 13:58:06
| 107
| 3
|
Adding LinkedIn button in website
|
We are planning to add the LinkedIn button in our website. But the restriction we are having is the website should not use the cookies which collect the personal information.
No impersonation.
But I read the LinkedIn website privacy policy, which says it uses both persistent and session cookie.
So i need some more inputs on this one??
Thanks in advance
|
linkedin
| null | null | null | null |
10/05/2011 16:39:41
|
off topic
|
Adding LinkedIn button in website
===
We are planning to add the LinkedIn button in our website. But the restriction we are having is the website should not use the cookies which collect the personal information.
No impersonation.
But I read the LinkedIn website privacy policy, which says it uses both persistent and session cookie.
So i need some more inputs on this one??
Thanks in advance
| 2
|
11,738,709
|
07/31/2012 11:05:32
| 1,020,476
|
10/30/2011 07:55:30
| 1,244
| 17
|
T4 Template Save by Unicone
|
I use Template - Generator architect as Oleg Sych said to generate some code by T4, but there is some problems in using Unicode, I have some Persian characters after generate all of the Persian characters displayed as question mark.
This is my files: Template:
<#@ assembly name="Microsoft.SqlServer.ConnectionInfo" #>
<#@ assembly name="Microsoft.SqlServer.Smo" #>
<#@ assembly name="Microsoft.SqlServer.Management.Sdk.Sfc" #>
<#@ import namespace="Microsoft.SqlServer.Management.Smo" #>
<#@ import namespace="System.Collections.Generic" #>
<#+
public class DALTable : Template
{
public override string TransformText()
{
//My Template
}
Generator:
<#@ assembly name="Microsoft.SqlServer.ConnectionInfo" #>
<#@ assembly name="Microsoft.SqlServer.Smo" #>
<#@ assembly name="Microsoft.SqlServer.Management.Sdk.Sfc" #>
<#@ include file="DALTable.tt" #>
<#+
public class TableDALGenerator : Generator
{
public DALTable DALTableTemplate = new DALTable();
protected override void RunCore()
{
this.DALTableTemplate.Table = table;
this.DALTableTemplate.RenderToFile("DAL.cs");
}
}
And Script:
<#@ template language="C#v4" hostspecific="True" debug="True" #>
<#@ assembly name="System.Core" #>
<#@ output extension=".cs" encoding="UTF8" #>
<#@ include file="T4Toolbox.tt" #>
<#@ include file="TableDALGenerator.tt" #>
<#
TableDALGenerator TableDALGen = new TableDALGenerator();
//Pass Parameters
TableORMGen.Run();
#>
As Oleg Sych said I set Unicode in output as you see in this line: ` <#@ output extension=".cs" encoding="UTF8" #>` also I save as all of this 3 files with Unicode `utf8`
but the problem still remain, where is the problem? what another thing remain that I must do that?
|
c#
|
visual-studio-2010
|
templates
|
unicode
|
t4
| null |
open
|
T4 Template Save by Unicone
===
I use Template - Generator architect as Oleg Sych said to generate some code by T4, but there is some problems in using Unicode, I have some Persian characters after generate all of the Persian characters displayed as question mark.
This is my files: Template:
<#@ assembly name="Microsoft.SqlServer.ConnectionInfo" #>
<#@ assembly name="Microsoft.SqlServer.Smo" #>
<#@ assembly name="Microsoft.SqlServer.Management.Sdk.Sfc" #>
<#@ import namespace="Microsoft.SqlServer.Management.Smo" #>
<#@ import namespace="System.Collections.Generic" #>
<#+
public class DALTable : Template
{
public override string TransformText()
{
//My Template
}
Generator:
<#@ assembly name="Microsoft.SqlServer.ConnectionInfo" #>
<#@ assembly name="Microsoft.SqlServer.Smo" #>
<#@ assembly name="Microsoft.SqlServer.Management.Sdk.Sfc" #>
<#@ include file="DALTable.tt" #>
<#+
public class TableDALGenerator : Generator
{
public DALTable DALTableTemplate = new DALTable();
protected override void RunCore()
{
this.DALTableTemplate.Table = table;
this.DALTableTemplate.RenderToFile("DAL.cs");
}
}
And Script:
<#@ template language="C#v4" hostspecific="True" debug="True" #>
<#@ assembly name="System.Core" #>
<#@ output extension=".cs" encoding="UTF8" #>
<#@ include file="T4Toolbox.tt" #>
<#@ include file="TableDALGenerator.tt" #>
<#
TableDALGenerator TableDALGen = new TableDALGenerator();
//Pass Parameters
TableORMGen.Run();
#>
As Oleg Sych said I set Unicode in output as you see in this line: ` <#@ output extension=".cs" encoding="UTF8" #>` also I save as all of this 3 files with Unicode `utf8`
but the problem still remain, where is the problem? what another thing remain that I must do that?
| 0
|
4,579,754
|
01/02/2011 18:19:02
| 100,957
|
05/04/2009 15:44:36
| 241
| 13
|
ListView no longer reacts to onclick after a call to setSelection()
|
In [Zwitscher](https://github.com/pilhuhn/ZwitscherA) I have a ListView that displays a number of tweets. The user can then reload the timeline and if there are new tweets, the new list is loaded into the list adapter (plus some old ones) and I scroll to the end of the list via
listView.setSelection(x);
where x is the number of the oldest tweets of the freshly loaded ones. This works very well.
But unfortunately this "disables" the onItemClick() and onItemLongClick() handlers on the view. If I then (e.g. from a button) call
listView.setSelection(0);
The handlers for onItemClick() and onItemLongClick() are "enabled" again.
I've verified that the handlers are still set on the listView after the call to setSelection(x). And disabling that call to setSelection(x) also does not "disable" the handlers.
Any idea what I am doing wrong?
The full source is here: https://github.com/pilhuhn/ZwitscherA/blob/master/src/de/bsd/zwitscher/TweetListActivity.java and the lines in question are in onPostExecute() on line 417
|
android
|
listview
|
android-listview
| null | null | null |
open
|
ListView no longer reacts to onclick after a call to setSelection()
===
In [Zwitscher](https://github.com/pilhuhn/ZwitscherA) I have a ListView that displays a number of tweets. The user can then reload the timeline and if there are new tweets, the new list is loaded into the list adapter (plus some old ones) and I scroll to the end of the list via
listView.setSelection(x);
where x is the number of the oldest tweets of the freshly loaded ones. This works very well.
But unfortunately this "disables" the onItemClick() and onItemLongClick() handlers on the view. If I then (e.g. from a button) call
listView.setSelection(0);
The handlers for onItemClick() and onItemLongClick() are "enabled" again.
I've verified that the handlers are still set on the listView after the call to setSelection(x). And disabling that call to setSelection(x) also does not "disable" the handlers.
Any idea what I am doing wrong?
The full source is here: https://github.com/pilhuhn/ZwitscherA/blob/master/src/de/bsd/zwitscher/TweetListActivity.java and the lines in question are in onPostExecute() on line 417
| 0
|
8,680,377
|
12/30/2011 14:17:09
| 42,847
|
12/03/2008 14:48:23
| 2,021
| 68
|
Generate a URL From Route Data ONLY
|
I'm trying to do something simple in ASP.NET MVC:
RouteValuesDictionary routeValues = GetMyRouteData();
var url = new UrlHelper(Html.ViewContext.RequestContext);
return url.RouteUrl(routeValues);
The problem is that no matter what I do, the url includes route data from the current request context. I want to generate a URL based on ONLY the route values from `GetMyRouteData()`.
Thanks
|
asp.net-mvc
|
asp.net-mvc-3
|
route
| null | null | null |
open
|
Generate a URL From Route Data ONLY
===
I'm trying to do something simple in ASP.NET MVC:
RouteValuesDictionary routeValues = GetMyRouteData();
var url = new UrlHelper(Html.ViewContext.RequestContext);
return url.RouteUrl(routeValues);
The problem is that no matter what I do, the url includes route data from the current request context. I want to generate a URL based on ONLY the route values from `GetMyRouteData()`.
Thanks
| 0
|
1,012,696
|
06/18/2009 13:43:35
| 87,582
|
04/06/2009 12:06:44
| 44
| 2
|
Best ruby framework for web development
|
I am working on a web project. I want to implement same in ruby. I am aware of the ruby frameworks like merb, sinatra. Just I want to know which is most suitable framework for developing web based application using ruby ?
|
ruby
|
frameworks
| null | null | null |
06/19/2009 10:23:07
|
not constructive
|
Best ruby framework for web development
===
I am working on a web project. I want to implement same in ruby. I am aware of the ruby frameworks like merb, sinatra. Just I want to know which is most suitable framework for developing web based application using ruby ?
| 4
|
11,485,819
|
07/14/2012 17:21:13
| 1,208,005
|
02/14/2012 00:11:12
| 21
| 1
|
Server responds after 120s - how to find the hold up?
|
I have a WordPress site that works fine on the front-end but the backend admin pages take just over 120s to load. The page doesn't timeout - the server responds - it just takes a long time. I see no errors in the PHP or apache logs.
Obviously the 120s is a clue - I'm thinking a CURL request or something similar.
I have used mod_status to look at the server-status - I can see one process that is held in the "W" state (sending reply) for the duration of the long page load.
Obviously the WordPress page process winds it's way through many PHP scripts - how do I find out where the hold up is happening?
I have tried brute force methods of disabling plugins one by one but with everything pared back I still see the issue.
Thanks.
|
php
|
apache
| null | null | null |
07/15/2012 16:14:07
|
off topic
|
Server responds after 120s - how to find the hold up?
===
I have a WordPress site that works fine on the front-end but the backend admin pages take just over 120s to load. The page doesn't timeout - the server responds - it just takes a long time. I see no errors in the PHP or apache logs.
Obviously the 120s is a clue - I'm thinking a CURL request or something similar.
I have used mod_status to look at the server-status - I can see one process that is held in the "W" state (sending reply) for the duration of the long page load.
Obviously the WordPress page process winds it's way through many PHP scripts - how do I find out where the hold up is happening?
I have tried brute force methods of disabling plugins one by one but with everything pared back I still see the issue.
Thanks.
| 2
|
6,712,793
|
07/15/2011 20:27:46
| 821,484
|
06/29/2011 15:58:55
| 34
| 0
|
Prevent CSS changes on "Edit" UserControl?
|
I am using User Controls in ASP.NET and C# to develop pages for my project. With these pages, I have formatted a bunch of CSS into a DetailsView. However, when I run an "Edit" CommandField, the CSS on the page changes a bunch and I don't know how to stop it (ie. Text all becomes bold, column height changes dramatically, etc.). I don't want to have to reset these properties every time this button is hit.
Is there anyway to prevent the CSS changes from occurring?
|
c#
|
asp.net
|
css
|
usercontrols
|
detailsview
| null |
open
|
Prevent CSS changes on "Edit" UserControl?
===
I am using User Controls in ASP.NET and C# to develop pages for my project. With these pages, I have formatted a bunch of CSS into a DetailsView. However, when I run an "Edit" CommandField, the CSS on the page changes a bunch and I don't know how to stop it (ie. Text all becomes bold, column height changes dramatically, etc.). I don't want to have to reset these properties every time this button is hit.
Is there anyway to prevent the CSS changes from occurring?
| 0
|
401,743
|
12/30/2008 22:42:17
| 16,732
|
09/17/2008 20:15:51
| 82
| 4
|
Generating PDF with Quick Reports behind a Delphi Web Server
|
I have a Delphi web server providing some web services*. One of them is supposed to generate and return a PDF report.
The PDF creation is done with a QReport that is then exported into a PDF file with the ExportToFilter procedure.
The routine works fine when called from within an application, but when called behind a TIdTCPServer, it hangs and never finishes. Debugging it, I got tho the hanging point:
*(note: I'm home right now and I don't have the source code. I'll try to reproduce quickrpt.pas' source as accurrate as I can remember).*
procedure TCustomReport.ExportToFilter(TQRDocumentFilter filter);
...
AProgress := TQRFormProgress.Create(Application); // Hangs on this line
AProgress.Owner := QReport;
if ShowProgress then AProgress.Show;
QReport.Client := AProgress;
...
Searching the web, I found [this page](http://delphi.newswhat.com/geoxml/forumhistorythread?groupname=borland.public.delphi.thirdpartytools.general&messageid=44f6db6a$1@newsgroups.borland.com) the suggestion to set ShowProgress to False, and edit the code so that it does not create the progress form when ShowProgress is set to false (apparently, this is due to QReport not being threadsafe).
So, I edited the code, and now I have this:
procedure TCustomReport.ExportToFilter(TQRDocumentFilter filter);
...
if ShowProgress then
begin
AProgress := TQRFormProgress.Create(Application);
AProgress.Owner := QReport;
AProgress.Show;
QReport.Client := AProgress
end;
...
Now, the report comes out. But then the service gets to an Invalid Pointer Exception (which I can't trace). Following calls to the service complete successfully, but when I shut down the service** it starts whining again with Invalid Pointer Exceptions, then the "MyServer has commited an invalid action and must be closed" windows message, then again a couple of times more, then just the pointer exception, then comes to error 216 (which as far as I could find out, is related to Windows access permissions).
Thanks!
\* Running Delphi 7 on a Windows XP SP2. The server is based on Indy.
** I have two versions of the server: a Windows application and a Windows Service. Both call the same inner logic, and the problem occurs with both versions.
|
delphi
|
quickreports
|
web-services
|
pdf-generation
| null | null |
open
|
Generating PDF with Quick Reports behind a Delphi Web Server
===
I have a Delphi web server providing some web services*. One of them is supposed to generate and return a PDF report.
The PDF creation is done with a QReport that is then exported into a PDF file with the ExportToFilter procedure.
The routine works fine when called from within an application, but when called behind a TIdTCPServer, it hangs and never finishes. Debugging it, I got tho the hanging point:
*(note: I'm home right now and I don't have the source code. I'll try to reproduce quickrpt.pas' source as accurrate as I can remember).*
procedure TCustomReport.ExportToFilter(TQRDocumentFilter filter);
...
AProgress := TQRFormProgress.Create(Application); // Hangs on this line
AProgress.Owner := QReport;
if ShowProgress then AProgress.Show;
QReport.Client := AProgress;
...
Searching the web, I found [this page](http://delphi.newswhat.com/geoxml/forumhistorythread?groupname=borland.public.delphi.thirdpartytools.general&messageid=44f6db6a$1@newsgroups.borland.com) the suggestion to set ShowProgress to False, and edit the code so that it does not create the progress form when ShowProgress is set to false (apparently, this is due to QReport not being threadsafe).
So, I edited the code, and now I have this:
procedure TCustomReport.ExportToFilter(TQRDocumentFilter filter);
...
if ShowProgress then
begin
AProgress := TQRFormProgress.Create(Application);
AProgress.Owner := QReport;
AProgress.Show;
QReport.Client := AProgress
end;
...
Now, the report comes out. But then the service gets to an Invalid Pointer Exception (which I can't trace). Following calls to the service complete successfully, but when I shut down the service** it starts whining again with Invalid Pointer Exceptions, then the "MyServer has commited an invalid action and must be closed" windows message, then again a couple of times more, then just the pointer exception, then comes to error 216 (which as far as I could find out, is related to Windows access permissions).
Thanks!
\* Running Delphi 7 on a Windows XP SP2. The server is based on Indy.
** I have two versions of the server: a Windows application and a Windows Service. Both call the same inner logic, and the problem occurs with both versions.
| 0
|
8,912,434
|
01/18/2012 15:10:35
| 1,080,055
|
12/04/2011 12:53:29
| 3
| 0
|
Select from duplicated rows the biggest one
|
I have a table with data like this
ID | second_col
1 | 1
1 | 2
1 | 3
2 | 1
2 | 4
3 | 1
3 | 5
4 | 1
and i want select records from duplicated rows with the biggest number in second_col
the result should look as follows...
ID | second_col
1 | 3
2 | 4
3 | 5
4 | 1
|
sql
| null | null | null | null | null |
open
|
Select from duplicated rows the biggest one
===
I have a table with data like this
ID | second_col
1 | 1
1 | 2
1 | 3
2 | 1
2 | 4
3 | 1
3 | 5
4 | 1
and i want select records from duplicated rows with the biggest number in second_col
the result should look as follows...
ID | second_col
1 | 3
2 | 4
3 | 5
4 | 1
| 0
|
4,582,236
|
01/03/2011 05:26:27
| 769,667
|
01/03/2011 05:21:34
| 1
| 0
|
nsarray in uilabel
|
I want to add uilabels according to mutable array at run time.
actually i have some labels texts in nsmutablearray.and i want to create label at run time and fill the text in label.plz suggest any example or provide guidance
|
iphone
|
nsarray
| null | null | null | null |
open
|
nsarray in uilabel
===
I want to add uilabels according to mutable array at run time.
actually i have some labels texts in nsmutablearray.and i want to create label at run time and fill the text in label.plz suggest any example or provide guidance
| 0
|
9,385,275
|
02/21/2012 21:14:09
| 1,022,399
|
10/31/2011 17:17:54
| 11
| 0
|
Java ResultSet hasNext() empty rows
|
I have to query a table for a column but it may or may not have data corresponding to the query. How do I use ResultSet hasNext() in such a scenario. I see that as soon as the query returns no results, the loop gets broken. This is the code I have written, I have to loop for all the projects and releases to find resources- for few there are results and others 0 rows get returned. I have tried try and catch(SQLException) but it does not work. Please advice
ResultSet resultTeam = null;
resultTeam = statement.executeQuery("select resource_id from release_teammember where project_id='"+projectId+"' and release_id='"+releaseId+"'");
while (resultTeam.next()) {
// do your standard per row stuff
System.out.println(result.getString(1));
}
|
java
|
sql
|
oracle
|
jdbc
| null |
02/22/2012 02:04:31
|
not a real question
|
Java ResultSet hasNext() empty rows
===
I have to query a table for a column but it may or may not have data corresponding to the query. How do I use ResultSet hasNext() in such a scenario. I see that as soon as the query returns no results, the loop gets broken. This is the code I have written, I have to loop for all the projects and releases to find resources- for few there are results and others 0 rows get returned. I have tried try and catch(SQLException) but it does not work. Please advice
ResultSet resultTeam = null;
resultTeam = statement.executeQuery("select resource_id from release_teammember where project_id='"+projectId+"' and release_id='"+releaseId+"'");
while (resultTeam.next()) {
// do your standard per row stuff
System.out.println(result.getString(1));
}
| 1
|
8,053,394
|
11/08/2011 16:04:42
| 302,707
|
03/26/2010 16:39:27
| 400
| 9
|
How to do something before on submit?
|
i have a form and it have a button that submit the form. what i need is to do something before submit happen. i try to do onClick on that button but it happen after the submit. i cant share the code but in general what should i do in jQuery or JS to handel this.
|
javascript
|
jquery
|
html
| null | null |
11/08/2011 17:13:35
|
not a real question
|
How to do something before on submit?
===
i have a form and it have a button that submit the form. what i need is to do something before submit happen. i try to do onClick on that button but it happen after the submit. i cant share the code but in general what should i do in jQuery or JS to handel this.
| 1
|
3,298,795
|
07/21/2010 11:42:04
| 397,878
|
07/21/2010 11:42:04
| 1
| 0
|
Exe version in MSI installer file name (VS 2010)
|
is it possible to make Visual Studio 2010 installer output file name, containing exe version,
something like "setup[MajorExeVersion][MinorExeVersion].msi"?
Thanks!
|
.net
|
visual-studio-2010
|
installer
|
msi
| null | null |
open
|
Exe version in MSI installer file name (VS 2010)
===
is it possible to make Visual Studio 2010 installer output file name, containing exe version,
something like "setup[MajorExeVersion][MinorExeVersion].msi"?
Thanks!
| 0
|
3,809,955
|
09/28/2010 05:33:56
| 129,786
|
06/27/2009 09:39:59
| 66
| 4
|
What is 200 in xxx.csd200a.com svn?
|
What is 200 in xxx.csd200a.com svn?
|
svn
| null | null | null | null |
09/28/2010 05:45:32
|
not a real question
|
What is 200 in xxx.csd200a.com svn?
===
What is 200 in xxx.csd200a.com svn?
| 1
|
9,148,302
|
02/05/2012 09:50:29
| 1,053,190
|
11/18/2011 05:42:53
| 137
| 12
|
List Grid layout issue with Wordpress
|
I check may post related this issue but my one is completely different than others.
I am following this tutorial http://www.ssdtutorials.com/tutorials/series/list-grid-view-jquery-cookies.html
Everything is fine with normal page but when I am trying to integrate with wordpress its giving me problem. Somehow its not at all switching layout. I have checked in firebug and realize js not even loading class as its loading in normal page created as per tutorial.
I have created same structure as tutorial but with my own class and id I don't know what is going wrong.
I am using google jquery is that causing problem? but I have try to load jquery with no luck too.
Here is my entire code
index.php (theme root)
<?php get_header(); ?>
<?php // to disable this sidebar on a page by page basis just add a custom field to your page or post of disableSidebarLeft = true
/*$disableSidebarLeft = get_post_meta($post->ID, 'disableSidebarLeft', $single = true);
if ($disableSidebarLeft !== 'true') { get_sidebar('SidebarLeft'); }*/
?>
<div id="content" class="clear-fix" role="main">
<nav id="list-grid-nav" class="clearfix">
<a href="#" id="grid"></a>
<a href="#" id="list"></a>
</nav>
<div id="listgrid">
<div class="entry-wrapper">
<?php if (have_posts()) : while (have_posts()) : the_post(); //BEGIN: The Loop ?>
<!--BEGIN: Post-->
<article <?php post_class('list-post') ?> id="post-<?php the_ID(); ?>">
<?php comments_popup_link('0', '1', '%', 'list-comment', 'Off'); ?>
<!-- thumbnail start -->
<div class="post-thumbnail">
<a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>" width="250" height="140">
<?php the_post_thumbnail(); ?>
</a>
</div>
<!-- end of thumbnail start -->
<div class="list-content clearfix">
<div class="excerpt-wrapper">
<header class="post-title">
<h4><a href="<?php the_permalink() ?>" rel="bookmark" title='Click to read: "<?php strip_tags(the_title()); ?>"'><?php the_title(); ?></a></h4>
</header>
<div class="list-entry">
<?php the_excerpt(); ?>
</div>
</div>
<div class="post-author-meta">
<p>by <?php the_author_posts_link(); ?> </p>
<time datetime="<?php the_time('c'); ?>" pubdate="pubdate"><?php the_time('F jS, Y'); ?></time>
<div class="rates-views">
<!-- all my review related code will go here -->
</div>
</div>
<footer class="list-post-meta-data clearfix">
<ul class="no-bullet">
<li>in <?php the_category(', ') ?></li><li><?php the_tags('tags: ', ', ', '<br />'); ?></li>
<li class="edit"><?php edit_post_link('Edit»', '<small>', '</small>'); ?></li>
</ul>
</footer>
</div>
<div class="clearfix"></div>
</article>
<!--END: Post-->
<?php endwhile; ?>
<?php wp_link_pages(); //this allows for multi-page posts -- not 100% sure this is the best spot for it ?>
<?php else : ?>
<h2>No posts were found :(</h2>
<?php endif; ?>
<?php if ( $wp_query->max_num_pages > 1 ) : // if there's more pages show next and previous links ?>
<!-- Pagination code starts -->
<?php if (function_exists("pagination")) {
pagination($additional_loop->max_num_pages);
} ?>
<!-- Pagination code end -->
<?php endif; ?>
</div>
</div>
</div>
<!--END: Content div-->
<?php get_footer(); ?>
stylesheet (theme root style.css)
/* list + archive + search */
#listgrid{
width:100%;
}
.list-post{
width:620px;
}
.list-post{
border-bottom:1px solid #d5d5d5;
padding:20px;
position:relative;
}
.list-content{
width:470px;
margin:0 0 0 10px;
float:left;
position:relative;
height:140px;
}
.excerpt-wrapper{
float:left;
width:320px;
margin:0;
padding:0 5px 0 0;
height:114px;
}
.list-entry p{
margin:0 !important;
}
.post-thumbnail{
float:left;
display:inline-block;
}
.post-title{
}
.post-title h4{
font-weight:600;
margin:0;
display:inline-block;
}
.post-title a{
color:#171717;
}
.post-author-meta{
float:left;
width:139px;
height:114px;
padding:0 0 0 5px;
border-left:1px solid #e7e7e7;
position:relative;
}
.post-author-meta p{
margin:0 !important;
}
.post-author-meta .rates-views{
position:absolute;
left:5px;
bottom:5px;
}
.list-comment{
position:absolute;
top:5px;
right:5px;
width:24px;
height:22px;
display:block;
background:url(images/comment-icon.png)no-repeat center top;
text-align:center;
line-height:14px;
font-size:10px;
color:#aaa !important;
}
.list-comment:hover{
background:url(images/comment-icon.png)no-repeat center bottom;
text-decoration:none;
color:#ddd !important;
}
.list-post-meta-data{
width:100%;
position:absolute;
bottom:0;
border-top:1px solid #e7e7e7;
}
.list-post-meta-data ul{
list-style:none;
margin-bottom:0;
font-size:10px;
}
.list-post-meta-data ul li{
float:left;
margin:0 10px 0 0;
}
.list-post-meta-data .edit{
float:right;
margin:0 0 0 10px;
}
/* grid */
.grid .entry-wrapper{
width:100%;
}
.grid .list-post, .post-thumbnail,.grid .list-content{
width:140px;
}
.grid .post-thumbnail{
margin-bottom:7px;
}
.grid .list-post{
border:1px solid #aaa;
float:left;
clear:none;
padding:10px 0 0 0;
margin:20px 0 0 18px;
}
.grid .list-content .list-entry{
display:none;
}
/* end list/grid layout */
javascript (theme/js/list-grid/listgrid.js)
$(function() {
var cc = $.cookie('list_grid');
if (cc == 'g') {
$('#listgrid').addClass('grid');
$('#grid').addClass('current');
} else {
$('#listgrid').removeClass('grid');
$('#list').addClass('current');
}
});
$(document).ready(function() {
$('#grid').click(function() {
$(".current").removeClass("current");
$(this).addClass("current");
$('#listgrid').fadeOut(500, function() {
$(this).addClass('grid').fadeIn(500);
$.cookie('list_grid', 'g');
});
return false;
});
$('#list').click(function() {
$(".current").removeClass("current");
$(this).addClass("current");
$('#listgrid').fadeOut(500, function() {
$(this).removeClass('grid').fadeIn(500);
$.cookie('list_grid', null);
});
return false;
});
});
Also using cookie javascript to remember selection.
Please help me to short this out. Thanks a lot. :)
|
jquery
|
wordpress
|
listview
|
layout
|
gridview
| null |
open
|
List Grid layout issue with Wordpress
===
I check may post related this issue but my one is completely different than others.
I am following this tutorial http://www.ssdtutorials.com/tutorials/series/list-grid-view-jquery-cookies.html
Everything is fine with normal page but when I am trying to integrate with wordpress its giving me problem. Somehow its not at all switching layout. I have checked in firebug and realize js not even loading class as its loading in normal page created as per tutorial.
I have created same structure as tutorial but with my own class and id I don't know what is going wrong.
I am using google jquery is that causing problem? but I have try to load jquery with no luck too.
Here is my entire code
index.php (theme root)
<?php get_header(); ?>
<?php // to disable this sidebar on a page by page basis just add a custom field to your page or post of disableSidebarLeft = true
/*$disableSidebarLeft = get_post_meta($post->ID, 'disableSidebarLeft', $single = true);
if ($disableSidebarLeft !== 'true') { get_sidebar('SidebarLeft'); }*/
?>
<div id="content" class="clear-fix" role="main">
<nav id="list-grid-nav" class="clearfix">
<a href="#" id="grid"></a>
<a href="#" id="list"></a>
</nav>
<div id="listgrid">
<div class="entry-wrapper">
<?php if (have_posts()) : while (have_posts()) : the_post(); //BEGIN: The Loop ?>
<!--BEGIN: Post-->
<article <?php post_class('list-post') ?> id="post-<?php the_ID(); ?>">
<?php comments_popup_link('0', '1', '%', 'list-comment', 'Off'); ?>
<!-- thumbnail start -->
<div class="post-thumbnail">
<a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>" width="250" height="140">
<?php the_post_thumbnail(); ?>
</a>
</div>
<!-- end of thumbnail start -->
<div class="list-content clearfix">
<div class="excerpt-wrapper">
<header class="post-title">
<h4><a href="<?php the_permalink() ?>" rel="bookmark" title='Click to read: "<?php strip_tags(the_title()); ?>"'><?php the_title(); ?></a></h4>
</header>
<div class="list-entry">
<?php the_excerpt(); ?>
</div>
</div>
<div class="post-author-meta">
<p>by <?php the_author_posts_link(); ?> </p>
<time datetime="<?php the_time('c'); ?>" pubdate="pubdate"><?php the_time('F jS, Y'); ?></time>
<div class="rates-views">
<!-- all my review related code will go here -->
</div>
</div>
<footer class="list-post-meta-data clearfix">
<ul class="no-bullet">
<li>in <?php the_category(', ') ?></li><li><?php the_tags('tags: ', ', ', '<br />'); ?></li>
<li class="edit"><?php edit_post_link('Edit»', '<small>', '</small>'); ?></li>
</ul>
</footer>
</div>
<div class="clearfix"></div>
</article>
<!--END: Post-->
<?php endwhile; ?>
<?php wp_link_pages(); //this allows for multi-page posts -- not 100% sure this is the best spot for it ?>
<?php else : ?>
<h2>No posts were found :(</h2>
<?php endif; ?>
<?php if ( $wp_query->max_num_pages > 1 ) : // if there's more pages show next and previous links ?>
<!-- Pagination code starts -->
<?php if (function_exists("pagination")) {
pagination($additional_loop->max_num_pages);
} ?>
<!-- Pagination code end -->
<?php endif; ?>
</div>
</div>
</div>
<!--END: Content div-->
<?php get_footer(); ?>
stylesheet (theme root style.css)
/* list + archive + search */
#listgrid{
width:100%;
}
.list-post{
width:620px;
}
.list-post{
border-bottom:1px solid #d5d5d5;
padding:20px;
position:relative;
}
.list-content{
width:470px;
margin:0 0 0 10px;
float:left;
position:relative;
height:140px;
}
.excerpt-wrapper{
float:left;
width:320px;
margin:0;
padding:0 5px 0 0;
height:114px;
}
.list-entry p{
margin:0 !important;
}
.post-thumbnail{
float:left;
display:inline-block;
}
.post-title{
}
.post-title h4{
font-weight:600;
margin:0;
display:inline-block;
}
.post-title a{
color:#171717;
}
.post-author-meta{
float:left;
width:139px;
height:114px;
padding:0 0 0 5px;
border-left:1px solid #e7e7e7;
position:relative;
}
.post-author-meta p{
margin:0 !important;
}
.post-author-meta .rates-views{
position:absolute;
left:5px;
bottom:5px;
}
.list-comment{
position:absolute;
top:5px;
right:5px;
width:24px;
height:22px;
display:block;
background:url(images/comment-icon.png)no-repeat center top;
text-align:center;
line-height:14px;
font-size:10px;
color:#aaa !important;
}
.list-comment:hover{
background:url(images/comment-icon.png)no-repeat center bottom;
text-decoration:none;
color:#ddd !important;
}
.list-post-meta-data{
width:100%;
position:absolute;
bottom:0;
border-top:1px solid #e7e7e7;
}
.list-post-meta-data ul{
list-style:none;
margin-bottom:0;
font-size:10px;
}
.list-post-meta-data ul li{
float:left;
margin:0 10px 0 0;
}
.list-post-meta-data .edit{
float:right;
margin:0 0 0 10px;
}
/* grid */
.grid .entry-wrapper{
width:100%;
}
.grid .list-post, .post-thumbnail,.grid .list-content{
width:140px;
}
.grid .post-thumbnail{
margin-bottom:7px;
}
.grid .list-post{
border:1px solid #aaa;
float:left;
clear:none;
padding:10px 0 0 0;
margin:20px 0 0 18px;
}
.grid .list-content .list-entry{
display:none;
}
/* end list/grid layout */
javascript (theme/js/list-grid/listgrid.js)
$(function() {
var cc = $.cookie('list_grid');
if (cc == 'g') {
$('#listgrid').addClass('grid');
$('#grid').addClass('current');
} else {
$('#listgrid').removeClass('grid');
$('#list').addClass('current');
}
});
$(document).ready(function() {
$('#grid').click(function() {
$(".current").removeClass("current");
$(this).addClass("current");
$('#listgrid').fadeOut(500, function() {
$(this).addClass('grid').fadeIn(500);
$.cookie('list_grid', 'g');
});
return false;
});
$('#list').click(function() {
$(".current").removeClass("current");
$(this).addClass("current");
$('#listgrid').fadeOut(500, function() {
$(this).removeClass('grid').fadeIn(500);
$.cookie('list_grid', null);
});
return false;
});
});
Also using cookie javascript to remember selection.
Please help me to short this out. Thanks a lot. :)
| 0
|
5,773,309
|
04/24/2011 21:16:49
| 722,937
|
04/24/2011 20:32:40
| 1
| 0
|
Ie6*lat !! isnt it the same as 1000000*lat ?!!!
|
enter code here
package ntryn.n;
import java.util.List;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.os.Bundle;
import android.util.Log;
import android.widget.Toast;
import com.google.android.maps.GeoPoint;
import com.google.android.maps.MapActivity;
import com.google.android.maps.MapController;
import com.google.android.maps.MapView;
import com.google.android.maps.Overlay;
import com.google.android.maps.OverlayItem;
public class ntryn extends MapActivity
{
private MapView mapView;
private MapController mc;
GeoPoint p, p2, p3, p4;
List<Overlay> mapOverlays;
Drawable drawable, drawable2 , drawable3, drawable4;
HelloItemizedOverlay itemizedOverlay, itemizedOverlay2 , itemizedOverlay3, itemizedOverlay4;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{
try{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
/* Use the LocationManager class to obtain GPS locations */
LocationManager mlocManager = (LocationManager)getSystemService(Context.LOCATION_SERVICE);
LocationListener mlocListener = new MyLocationListener();
mlocManager.requestLocationUpdates( LocationManager.GPS_PROVIDER, 0, 0, mlocListener);
mapView = (MapView) findViewById(R.id.mapView);
// enable Street view by default
mapView.setStreetView(true);
// enable to show Satellite view
// mapView.setSatellite(true);
// enable to show Traffic on map
// mapView.setTraffic(true);
mapView.setBuiltInZoomControls(true);
mc = mapView.getController();
mapView.setStreetView(true);
//mapView.setSatellite(true);
mc.setZoom(12);
addOverLays();
}
catch(Exception e){
Log.d("eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",e.getMessage());
}
}
public void addOverLays(){
String [] coordinates = {"30.084262490272522","31.33625864982605" ,"30.084123015403748", "51.5002" , "-0.1262","31.337149143218994"};
double lat = 30.084262490272522, lat2 = 51.5002,lat3=30.084123015403748;
double log = 31.33625864982605, log2 = -0.1262,log3=31.337149143218994;
p = new GeoPoint((int) (lat * 1E6), (int) (log * 1E6));
p2 = new GeoPoint( (int) (lat2 * 1e6), (int) (log2 * 1e6));
p3=new GeoPoint( (int) (lat3 * 1000000), (int) (log3 * 1000000));
mapOverlays = mapView.getOverlays();
drawable = this.getResources().getDrawable(R.drawable.ballon);
drawable2 = this.getResources().getDrawable(R.drawable.dotred);
drawable3 = this.getResources().getDrawable(R.drawable.icon);
itemizedOverlay = new HelloItemizedOverlay(drawable,this);
itemizedOverlay2 = new HelloItemizedOverlay(drawable2,this);
itemizedOverlay3 = new HelloItemizedOverlay(drawable3,this);
OverlayItem overlayitem = new OverlayItem(p, "Cairo", " over1");
OverlayItem over2 = new OverlayItem(p2, "ulm", "over2");
OverlayItem over3 = new OverlayItem(p3, "offff", "over3");
itemizedOverlay.addOverlay(overlayitem);
mapOverlays.add(itemizedOverlay);
itemizedOverlay2.addOverlay(over2);
mapOverlays.add(itemizedOverlay2);
itemizedOverlay2.addOverlay(over3);
mapOverlays.add(itemizedOverlay3);
mc.setZoom(17);
//mc.animateTo(p);
}
/* Class My Location Listener */
public class MyLocationListener implements LocationListener
{
@Override
public void onLocationChanged(Location loc)
{
GeoPoint point = new GeoPoint( (int) (loc.getLatitude() * 1E6),
(int) (loc.getLongitude() * 1E6));
//DoubletoString(loc.getLatitude());
//DoubletoString(loc.getLongitude());
String Text = "My current location is: " +
"Latitud ="+ loc.getLatitude() +
"Longitud =" + loc.getLongitude();
Toast.makeText( getApplicationContext(),
Text,
Toast.LENGTH_SHORT).show();
mc.animateTo(point);
}
private void DoubletoString(double latitude) {
// TODO Auto-generated method stub
}
public void onProviderDisabled(String provider)
{
Toast.makeText( getApplicationContext(),
"Gps Disabled",
Toast.LENGTH_SHORT ).show();
}
public void onProviderEnabled(String provider)
{
Toast.makeText( getApplicationContext(),
"Gps Enabled",
Toast.LENGTH_SHORT).show();
}
public void onStatusChanged(String provider, int status, Bundle extras)
{
}
protected boolean isRouteDisplayed() {
return false;
}
}/* End of Class MyLocationListener */
@Override
protected boolean isRouteDisplayed() {
// TODO Auto-generated method stub
return false;
}
}
/* End of UseGps Activity*/
>
it forse close !! this due to the 3 overlaying items when i add onlyyy 2 in other words remove the p3 which is * 1000000 !! itss work !! but with it it doesnt zoom and when i want to zoom it show force close
|
android
| null | null | null | null |
04/24/2011 21:31:54
|
not a real question
|
Ie6*lat !! isnt it the same as 1000000*lat ?!!!
===
enter code here
package ntryn.n;
import java.util.List;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.os.Bundle;
import android.util.Log;
import android.widget.Toast;
import com.google.android.maps.GeoPoint;
import com.google.android.maps.MapActivity;
import com.google.android.maps.MapController;
import com.google.android.maps.MapView;
import com.google.android.maps.Overlay;
import com.google.android.maps.OverlayItem;
public class ntryn extends MapActivity
{
private MapView mapView;
private MapController mc;
GeoPoint p, p2, p3, p4;
List<Overlay> mapOverlays;
Drawable drawable, drawable2 , drawable3, drawable4;
HelloItemizedOverlay itemizedOverlay, itemizedOverlay2 , itemizedOverlay3, itemizedOverlay4;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{
try{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
/* Use the LocationManager class to obtain GPS locations */
LocationManager mlocManager = (LocationManager)getSystemService(Context.LOCATION_SERVICE);
LocationListener mlocListener = new MyLocationListener();
mlocManager.requestLocationUpdates( LocationManager.GPS_PROVIDER, 0, 0, mlocListener);
mapView = (MapView) findViewById(R.id.mapView);
// enable Street view by default
mapView.setStreetView(true);
// enable to show Satellite view
// mapView.setSatellite(true);
// enable to show Traffic on map
// mapView.setTraffic(true);
mapView.setBuiltInZoomControls(true);
mc = mapView.getController();
mapView.setStreetView(true);
//mapView.setSatellite(true);
mc.setZoom(12);
addOverLays();
}
catch(Exception e){
Log.d("eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",e.getMessage());
}
}
public void addOverLays(){
String [] coordinates = {"30.084262490272522","31.33625864982605" ,"30.084123015403748", "51.5002" , "-0.1262","31.337149143218994"};
double lat = 30.084262490272522, lat2 = 51.5002,lat3=30.084123015403748;
double log = 31.33625864982605, log2 = -0.1262,log3=31.337149143218994;
p = new GeoPoint((int) (lat * 1E6), (int) (log * 1E6));
p2 = new GeoPoint( (int) (lat2 * 1e6), (int) (log2 * 1e6));
p3=new GeoPoint( (int) (lat3 * 1000000), (int) (log3 * 1000000));
mapOverlays = mapView.getOverlays();
drawable = this.getResources().getDrawable(R.drawable.ballon);
drawable2 = this.getResources().getDrawable(R.drawable.dotred);
drawable3 = this.getResources().getDrawable(R.drawable.icon);
itemizedOverlay = new HelloItemizedOverlay(drawable,this);
itemizedOverlay2 = new HelloItemizedOverlay(drawable2,this);
itemizedOverlay3 = new HelloItemizedOverlay(drawable3,this);
OverlayItem overlayitem = new OverlayItem(p, "Cairo", " over1");
OverlayItem over2 = new OverlayItem(p2, "ulm", "over2");
OverlayItem over3 = new OverlayItem(p3, "offff", "over3");
itemizedOverlay.addOverlay(overlayitem);
mapOverlays.add(itemizedOverlay);
itemizedOverlay2.addOverlay(over2);
mapOverlays.add(itemizedOverlay2);
itemizedOverlay2.addOverlay(over3);
mapOverlays.add(itemizedOverlay3);
mc.setZoom(17);
//mc.animateTo(p);
}
/* Class My Location Listener */
public class MyLocationListener implements LocationListener
{
@Override
public void onLocationChanged(Location loc)
{
GeoPoint point = new GeoPoint( (int) (loc.getLatitude() * 1E6),
(int) (loc.getLongitude() * 1E6));
//DoubletoString(loc.getLatitude());
//DoubletoString(loc.getLongitude());
String Text = "My current location is: " +
"Latitud ="+ loc.getLatitude() +
"Longitud =" + loc.getLongitude();
Toast.makeText( getApplicationContext(),
Text,
Toast.LENGTH_SHORT).show();
mc.animateTo(point);
}
private void DoubletoString(double latitude) {
// TODO Auto-generated method stub
}
public void onProviderDisabled(String provider)
{
Toast.makeText( getApplicationContext(),
"Gps Disabled",
Toast.LENGTH_SHORT ).show();
}
public void onProviderEnabled(String provider)
{
Toast.makeText( getApplicationContext(),
"Gps Enabled",
Toast.LENGTH_SHORT).show();
}
public void onStatusChanged(String provider, int status, Bundle extras)
{
}
protected boolean isRouteDisplayed() {
return false;
}
}/* End of Class MyLocationListener */
@Override
protected boolean isRouteDisplayed() {
// TODO Auto-generated method stub
return false;
}
}
/* End of UseGps Activity*/
>
it forse close !! this due to the 3 overlaying items when i add onlyyy 2 in other words remove the p3 which is * 1000000 !! itss work !! but with it it doesnt zoom and when i want to zoom it show force close
| 1
|
5,656,457
|
04/13/2011 22:32:12
| 593,010
|
01/27/2011 22:47:36
| 130
| 13
|
Parsing a Auto-Generated .Net Date Object with Javascript/JQuery
|
There are some posts on this, but not an answer to this specific question.
The server is returning this: `"/Date(1304146800000)/"`
I would like to not change the server-side code at all and instead parse the date that is included in the .Net generated JSON object. This doesn't seem that hard because it looks like it is almost there. Yet there doesn't seem to be a quick fix, at least in these forums.
From previous posts it sounds like this can be done using REGEX but REGEX and I are old enemies that coldly stare at each other across the bar.
Is this the only way? If so, can someone point me to a REGEX reference that is appropriate to this task?
Regards,
Guido
|
c#
|
javascript
|
jquery
|
.net
|
date
| null |
open
|
Parsing a Auto-Generated .Net Date Object with Javascript/JQuery
===
There are some posts on this, but not an answer to this specific question.
The server is returning this: `"/Date(1304146800000)/"`
I would like to not change the server-side code at all and instead parse the date that is included in the .Net generated JSON object. This doesn't seem that hard because it looks like it is almost there. Yet there doesn't seem to be a quick fix, at least in these forums.
From previous posts it sounds like this can be done using REGEX but REGEX and I are old enemies that coldly stare at each other across the bar.
Is this the only way? If so, can someone point me to a REGEX reference that is appropriate to this task?
Regards,
Guido
| 0
|
11,597,409
|
07/22/2012 02:35:39
| 1,543,450
|
07/22/2012 02:30:08
| 1
| 0
|
Can Any one give me step-by-step example for creating JMS messaging with weblogic . Or any Link
|
Can any one please suggest me step-by-step example for creating JMS messaging , I am using Weblogic and eclipse. I am new to JMS. I am able to create weblogic Queue.But How we configure in eclipse and deploye application on weblogic. There are sender and reciver classes in eclips.
But can someone explain me all seteps .
what Jars required.
How to deploye on weblogic. Application flow.
|
jms
|
weblogic
| null | null | null |
07/23/2012 12:40:25
|
not a real question
|
Can Any one give me step-by-step example for creating JMS messaging with weblogic . Or any Link
===
Can any one please suggest me step-by-step example for creating JMS messaging , I am using Weblogic and eclipse. I am new to JMS. I am able to create weblogic Queue.But How we configure in eclipse and deploye application on weblogic. There are sender and reciver classes in eclips.
But can someone explain me all seteps .
what Jars required.
How to deploye on weblogic. Application flow.
| 1
|
8,809,925
|
01/10/2012 20:17:19
| 461,539
|
09/29/2010 09:09:43
| 1
| 0
|
FB comments admin
|
I'm developing a website and I'm using FB comments plugin to enable users to post comments in different pages. I want to admin these comments (delete comments if necessary). I added these tags to my website:
<meta property="fb:admins" content="admin1_id,admin2_id />
<meta property="fb:app_id" content="app+id" />
but I cannot delete comments. Please advice, thanks.
|
asp.net
|
facebook
| null | null | null |
01/11/2012 20:56:35
|
not a real question
|
FB comments admin
===
I'm developing a website and I'm using FB comments plugin to enable users to post comments in different pages. I want to admin these comments (delete comments if necessary). I added these tags to my website:
<meta property="fb:admins" content="admin1_id,admin2_id />
<meta property="fb:app_id" content="app+id" />
but I cannot delete comments. Please advice, thanks.
| 1
|
1,690,036
|
11/06/2009 20:06:35
| 75,889
|
03/09/2009 23:11:40
| 1,548
| 84
|
Amazon Computing Cloud: what does it cost for personal use?
|
Basically what I want to do is this:
- get a cheap linux server
- make a little Ruby on Rails project, I plan to toy a bit with Sinatra as well
- store my AMI on S3
So I input the following data into the calculator:
**S3:**
- Storage: 5 GB
- Data transfer in: 1 GB
- Data transfer out: 1 GB
- PUT/LIST Requests: 10000
- Other Requests: 10000
**EC2:**
- Small Linux/UNIX On-Demand Instance Compute Usage: 168 hours
**Total:** $17.930
Do you think the above estimation is realistic? Are there any other costs that I am overlooking?
Please resist the temptation to respond with "it depends" :)
|
amazon-ec2
|
amazon-s3
|
amazon-web-services
| null | null | null |
open
|
Amazon Computing Cloud: what does it cost for personal use?
===
Basically what I want to do is this:
- get a cheap linux server
- make a little Ruby on Rails project, I plan to toy a bit with Sinatra as well
- store my AMI on S3
So I input the following data into the calculator:
**S3:**
- Storage: 5 GB
- Data transfer in: 1 GB
- Data transfer out: 1 GB
- PUT/LIST Requests: 10000
- Other Requests: 10000
**EC2:**
- Small Linux/UNIX On-Demand Instance Compute Usage: 168 hours
**Total:** $17.930
Do you think the above estimation is realistic? Are there any other costs that I am overlooking?
Please resist the temptation to respond with "it depends" :)
| 0
|
6,980,980
|
08/08/2011 10:45:03
| 863,341
|
07/26/2011 11:30:43
| 13
| 0
|
How to add Share button to facebook welcome page (Static HTML - iFrame tabs)?
|
I have installed Static HTML - iFrame tabs application in my facebook page, and in welcome tab (welcome page) i want to put Share button. How to do that?
Thanks
|
html
|
facebook
|
button
|
share
| null |
08/08/2011 12:23:36
|
not a real question
|
How to add Share button to facebook welcome page (Static HTML - iFrame tabs)?
===
I have installed Static HTML - iFrame tabs application in my facebook page, and in welcome tab (welcome page) i want to put Share button. How to do that?
Thanks
| 1
|
5,901,196
|
05/05/2011 16:34:57
| 727,235
|
04/27/2011 12:21:30
| 30
| 0
|
Is there a way to use a image map coordinates in jquery?
|
I want to use the coordinates of an image map but not the map itself. So my question is can I use the coordinates of an image map and detect if a user has scrolled over those coordinates using jquery?
|
javascript
|
jquery
|
coordinates
|
imagemap
| null | null |
open
|
Is there a way to use a image map coordinates in jquery?
===
I want to use the coordinates of an image map but not the map itself. So my question is can I use the coordinates of an image map and detect if a user has scrolled over those coordinates using jquery?
| 0
|
8,463,102
|
12/11/2011 09:50:09
| 1,055,374
|
11/19/2011 14:20:59
| 24
| 1
|
How can i burn an iso using csharp
|
I have no experience in burning cd/dvd through code. could someone point me out where to start or give an example?
thank you.
|
c#
|
image
|
iso
|
burn
| null |
12/11/2011 13:22:57
|
not a real question
|
How can i burn an iso using csharp
===
I have no experience in burning cd/dvd through code. could someone point me out where to start or give an example?
thank you.
| 1
|
2,562,514
|
04/01/2010 18:01:58
| 265,693
|
02/03/2010 21:47:57
| 38
| 1
|
have an array of struct in wsdl + php without using NSoap
|
I want to have an array of struct (an array of books with their specifications like publication, ISBN number, ...). in wsdl and php. I have searched a little and I have found files that uses Nusoap, However, I dont want to use NuSoap. Is there any solution? I would appreciate if you help me in writing the related wsdl, client and server (php) files.
Thank you so much.
Best, shadi.
|
php
|
wsdl
| null | null | null | null |
open
|
have an array of struct in wsdl + php without using NSoap
===
I want to have an array of struct (an array of books with their specifications like publication, ISBN number, ...). in wsdl and php. I have searched a little and I have found files that uses Nusoap, However, I dont want to use NuSoap. Is there any solution? I would appreciate if you help me in writing the related wsdl, client and server (php) files.
Thank you so much.
Best, shadi.
| 0
|
2,080,140
|
01/17/2010 06:05:36
| 251,250
|
01/15/2010 03:10:13
| 11
| 0
|
Is there someway to change the content of a page with the htaccess file?
|
I just wanted to know if there is someway to use the htaccess file to chnage the content of a page(s). Maybe something sort of like the redirect, but instead of sending the user to another page, it would just change the content of the whole page.
Thank you for any and all help!
|
change
|
url
|
.htaccess
|
content
|
html
| null |
open
|
Is there someway to change the content of a page with the htaccess file?
===
I just wanted to know if there is someway to use the htaccess file to chnage the content of a page(s). Maybe something sort of like the redirect, but instead of sending the user to another page, it would just change the content of the whole page.
Thank you for any and all help!
| 0
|
8,191,150
|
11/19/2011 01:25:37
| 1,054,761
|
11/18/2011 23:33:55
| 1
| 0
|
Copy constructor and assignment operator both get called
|
I have the following program snippet:
Polynomial Polynomial:: add(const Polynomial b)
{
Polynomial c;
c.setRoot(internalAdd(root, c.root));
c.setRoot(internalAdd(b.root, c.root));
return c;
}
c = (a.add(b));
to my understanding, this code is suppose to add a and b together, then assign the resulting polynomial to c by calling the copy constructor.
however, when I actually test it,
c calls the copy constructor right away and tries to copy b,
then a and b add
then c tries to get the resulting polynomial via assignment operator
then the program crashes
what can i do to fix this?
|
constructor
|
copy
|
variable-assignment
|
operator-keyword
| null | null |
open
|
Copy constructor and assignment operator both get called
===
I have the following program snippet:
Polynomial Polynomial:: add(const Polynomial b)
{
Polynomial c;
c.setRoot(internalAdd(root, c.root));
c.setRoot(internalAdd(b.root, c.root));
return c;
}
c = (a.add(b));
to my understanding, this code is suppose to add a and b together, then assign the resulting polynomial to c by calling the copy constructor.
however, when I actually test it,
c calls the copy constructor right away and tries to copy b,
then a and b add
then c tries to get the resulting polynomial via assignment operator
then the program crashes
what can i do to fix this?
| 0
|
4,218,736
|
11/18/2010 19:29:58
| 510,942
|
11/17/2010 15:08:31
| 116
| 14
|
What 'cyberlaws' should I take into consideration in the design phase of a public multilingual website ? Or is this non- existing concern?
|
I can't seem to find any good resources I can understand regarding 'cyberlaws' with at least general guidelines except maybe this [one][1] maybe ?? (I think I can't event structure the right question to search on google)
I'm planning to promote the site to mainly Spanish, French and UK residents but maybe users from other countries as well may have interest as well.
This all actually starts too look too much for me so can I just drop any guidelines and just proceed further ?:) Maybe just use common sense when dealing with private data - do not disclose passwords,email etc. Could you provide my with any 'common sense' from your experience and/or knowledge about dealing with online privacy issues? Thanks.
[1]: http://ezinearticles.com/?Ten-Important-Things-in-Cyber-Law&id=2785358
|
website
|
internationalization
|
sdlc
| null | null |
11/22/2010 08:25:09
|
off topic
|
What 'cyberlaws' should I take into consideration in the design phase of a public multilingual website ? Or is this non- existing concern?
===
I can't seem to find any good resources I can understand regarding 'cyberlaws' with at least general guidelines except maybe this [one][1] maybe ?? (I think I can't event structure the right question to search on google)
I'm planning to promote the site to mainly Spanish, French and UK residents but maybe users from other countries as well may have interest as well.
This all actually starts too look too much for me so can I just drop any guidelines and just proceed further ?:) Maybe just use common sense when dealing with private data - do not disclose passwords,email etc. Could you provide my with any 'common sense' from your experience and/or knowledge about dealing with online privacy issues? Thanks.
[1]: http://ezinearticles.com/?Ten-Important-Things-in-Cyber-Law&id=2785358
| 2
|
6,776,213
|
07/21/2011 12:42:44
| 695,156
|
04/06/2011 15:38:32
| 9
| 0
|
Reading in HEX number from file
|
This has me pretty bothered as I should be able to do it but when I read in the hex number and assign it to an unsigned int when I print it out I get a different number. Any advice would be great. Thanks
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main()
{
fstream myfile;
myfile.open("test.text");
unsigned int tester;
string test;
myfile >> hex >> tester;
cout << tester;
system("pause");
return 0;
}
|
c++
| null | null | null | null | null |
open
|
Reading in HEX number from file
===
This has me pretty bothered as I should be able to do it but when I read in the hex number and assign it to an unsigned int when I print it out I get a different number. Any advice would be great. Thanks
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main()
{
fstream myfile;
myfile.open("test.text");
unsigned int tester;
string test;
myfile >> hex >> tester;
cout << tester;
system("pause");
return 0;
}
| 0
|
7,614,858
|
09/30/2011 18:59:47
| 963,313
|
09/25/2011 05:24:10
| 17
| 0
|
Using Google Calendar API in Java
|
I try to use Google Calendar API, and I have to ask a question: I use this tutorial - [http://code.google.com/apis/calendar/data/2.0/developers_guide_java.html][1], but I need to get event from calendar of russian holidays by today, and I don't know mean for my task. Help me please, I try to create application in Java
[1]: http://code.google.com/apis/calendar/data/2.0/developers_guide_java.html
|
java
| null | null | null | null |
10/12/2011 02:12:39
|
not a real question
|
Using Google Calendar API in Java
===
I try to use Google Calendar API, and I have to ask a question: I use this tutorial - [http://code.google.com/apis/calendar/data/2.0/developers_guide_java.html][1], but I need to get event from calendar of russian holidays by today, and I don't know mean for my task. Help me please, I try to create application in Java
[1]: http://code.google.com/apis/calendar/data/2.0/developers_guide_java.html
| 1
|
11,621,351
|
07/23/2012 22:14:51
| 1,536,086
|
07/18/2012 20:41:16
| 1
| 1
|
3 views in one... help me please
|
0
down vote
I need to combine 3 views in one. I have 3 create views that works but I will like to combine all three in one since they are connected by an id. Ok I have a Employee view that display the main information and two links per employee that connect to a department create view and area create view where after the user created the employee it need to add a department and an area to that employee. The point is that my department and my area tables are a history of the employee departments and area. but I will like to make it more user friendly and make only one click to add the department and the area without do it process twice. My employee tables is like this Employee Table: Emp_id, Emp_name, Emp_num, Type, Status, User, date. - this has a create view works Employee Department Table: EmpDepId, Emp_id, User, Date - this has a create view works Department tables: Depid, department Employee Area table: EmpAid, Emp_id, User, Date - this has a create view works Area table: AreaId, Area.
Can someone give me and Idea how to do this?
|
asp.net-mvc
| null | null | null | null |
07/24/2012 23:40:36
|
not a real question
|
3 views in one... help me please
===
0
down vote
I need to combine 3 views in one. I have 3 create views that works but I will like to combine all three in one since they are connected by an id. Ok I have a Employee view that display the main information and two links per employee that connect to a department create view and area create view where after the user created the employee it need to add a department and an area to that employee. The point is that my department and my area tables are a history of the employee departments and area. but I will like to make it more user friendly and make only one click to add the department and the area without do it process twice. My employee tables is like this Employee Table: Emp_id, Emp_name, Emp_num, Type, Status, User, date. - this has a create view works Employee Department Table: EmpDepId, Emp_id, User, Date - this has a create view works Department tables: Depid, department Employee Area table: EmpAid, Emp_id, User, Date - this has a create view works Area table: AreaId, Area.
Can someone give me and Idea how to do this?
| 1
|
10,623,578
|
05/16/2012 17:26:15
| 1,399,209
|
05/16/2012 17:00:39
| 1
| 0
|
how to add click for next image in jquery slideshow
|
I'm using the Simple jQuery Slideshow Script by Jon Raasch (http://jonraasch.com/blog/a-simple-jquery-slideshow) and was wondering how I could enable the user to click on the image to go to the next image while also keeping the autoplay mode of the slideshow on. First time in trying to built a website, so I have very basic knowledge in source coding/ css/jquery.
Would I have to modify both the js file and the source coding too? And how would I modify it?
If anyone can help it'll be much appreciated.
Thanks!
|
jquery
|
slideshow
| null | null | null |
05/17/2012 18:18:37
|
too localized
|
how to add click for next image in jquery slideshow
===
I'm using the Simple jQuery Slideshow Script by Jon Raasch (http://jonraasch.com/blog/a-simple-jquery-slideshow) and was wondering how I could enable the user to click on the image to go to the next image while also keeping the autoplay mode of the slideshow on. First time in trying to built a website, so I have very basic knowledge in source coding/ css/jquery.
Would I have to modify both the js file and the source coding too? And how would I modify it?
If anyone can help it'll be much appreciated.
Thanks!
| 3
|
4,767,361
|
01/22/2011 10:46:12
| 441,349
|
09/07/2010 10:43:26
| 16
| 0
|
Obtaining METER corpus
|
can somebody provide me link for downloading METER corpus.I visited the site http://nlp.shef.ac.uk/meter/index.jsp. But it seems to be broken.pls help me out. i need it for Text reuse method evaluation.Thanks in advance.
|
nlp
|
text-processing
| null | null | null |
01/22/2011 11:21:10
|
off topic
|
Obtaining METER corpus
===
can somebody provide me link for downloading METER corpus.I visited the site http://nlp.shef.ac.uk/meter/index.jsp. But it seems to be broken.pls help me out. i need it for Text reuse method evaluation.Thanks in advance.
| 2
|
200,229
|
10/14/2008 07:13:24
| 706
|
08/08/2008 06:06:11
| 117
| 7
|
Eclipse - generated method parapeters final
|
Can Eclipse make parameters for generated methods (overwriting, implementing interface, etc.) final. If yes - how?
If I'm not mistaken, then IntelliJ had an option for it. I could not something similar in Eclipse.
This has become a part of my coding style and I am making parameters final manually, but there has to be a faster way :P
/JaanusSiim
|
eclipse
|
coding-style
|
java
| null | null | null |
open
|
Eclipse - generated method parapeters final
===
Can Eclipse make parameters for generated methods (overwriting, implementing interface, etc.) final. If yes - how?
If I'm not mistaken, then IntelliJ had an option for it. I could not something similar in Eclipse.
This has become a part of my coding style and I am making parameters final manually, but there has to be a faster way :P
/JaanusSiim
| 0
|
8,051,699
|
11/08/2011 14:11:54
| 140,503
|
07/18/2009 01:31:53
| 731
| 29
|
MVC UI Pruning based on controller/action Authorize attribute
|
I have an secure application with an `Authorize` attribute on each action.
[Authorize(Roles = "Role1,Role2")]
public ActionResult MyAction(int id)
{
return View();
}
In my UI, I have links to these controller/actions. I would like to create a custom HtmlHelper for the links that accepts controller and action names:
@Html.SecuredLink("Click Me", "MyAction", "MyController");
And this would determine weather to render itself or not based on if the user has permission to the given action:
public static MvcHtmlString SecuredLink(this HtmlHelper helper, string text, string action, string controller)
{
var userHasRightsToThisAction = ??? // How to get this?
if (userHasRightsToThisAction )
{
// Render Link
// ...
}
}
I have been unable to find a way to easily test the action from code for authorization status.
|
mvc
|
user-interface
|
authorization
| null | null | null |
open
|
MVC UI Pruning based on controller/action Authorize attribute
===
I have an secure application with an `Authorize` attribute on each action.
[Authorize(Roles = "Role1,Role2")]
public ActionResult MyAction(int id)
{
return View();
}
In my UI, I have links to these controller/actions. I would like to create a custom HtmlHelper for the links that accepts controller and action names:
@Html.SecuredLink("Click Me", "MyAction", "MyController");
And this would determine weather to render itself or not based on if the user has permission to the given action:
public static MvcHtmlString SecuredLink(this HtmlHelper helper, string text, string action, string controller)
{
var userHasRightsToThisAction = ??? // How to get this?
if (userHasRightsToThisAction )
{
// Render Link
// ...
}
}
I have been unable to find a way to easily test the action from code for authorization status.
| 0
|
10,259,129
|
04/21/2012 12:59:37
| 1,134,935
|
01/06/2012 18:30:58
| 196
| 12
|
CSS issue: Javascript password validation message position error
|
I am using [this link for password match validation][1].
All is working very fine. But the problem is that I am getting message on top of the fields, not beside the confirm password field. Here what I tried;
**JavaScript Function**
function checkPass(){
var password = document.getElementById('password');
var password2 = document.getElementById('password2');
var message = document.getElementById('confirmMessage');
var goodColor = "#66cc66";
var badColor = "#ff6666";
if(password.value == password2.value){
password2.style.backgroundColor = goodColor;
message.style.color = goodColor;
message.innerHTML = 'Passwords Match!'
}else{
//The passwords do not match.
//Set the color to the bad color and
//notify the user.
password2.style.backgroundColor = badColor;
message.style.color = badColor;
message.innerHTML = 'Passwords Do Not Match!'
}
}
**HTML**
<div id="wrapper">
<form name="form" id="form" class="form" onsubmit="someFunction(this);return false">
<label for="password">Password:</label><input type="password" style="color: #B8B894;" value="Password" onblur="if(this.value == '') { this.value='Password'}" onfocus="if (this.value == 'Password') {this.value=''}" name="password" id="password" />
<label for="password2">Confirm Pass:</label><input type="password" name="password2" id="password2" onkeyup="checkPass(); return false;" />
<span id="confirmMessage" class="confirmMessage"></span><br/>
<input type="submit" value="Submit" class="submit" />
<input type="button" name="reset_form" value="Reset All Fields " onclick="this.form.reset();">
</form>
</div>
**CSS**
.form confirmMessage {font-size: 0.8em; margin:5px; padding:10px;}
The result is renders like below image;
![Image][2]
How this can be solved? Can any one help. Thank you
[1]: http://www.keithscode.com/tutorials/javascript-tutorials/a-simple-javascript-password-validator.html
[2]: http://i.stack.imgur.com/ftB7g.png
|
javascript
|
html
|
css
| null | null | null |
open
|
CSS issue: Javascript password validation message position error
===
I am using [this link for password match validation][1].
All is working very fine. But the problem is that I am getting message on top of the fields, not beside the confirm password field. Here what I tried;
**JavaScript Function**
function checkPass(){
var password = document.getElementById('password');
var password2 = document.getElementById('password2');
var message = document.getElementById('confirmMessage');
var goodColor = "#66cc66";
var badColor = "#ff6666";
if(password.value == password2.value){
password2.style.backgroundColor = goodColor;
message.style.color = goodColor;
message.innerHTML = 'Passwords Match!'
}else{
//The passwords do not match.
//Set the color to the bad color and
//notify the user.
password2.style.backgroundColor = badColor;
message.style.color = badColor;
message.innerHTML = 'Passwords Do Not Match!'
}
}
**HTML**
<div id="wrapper">
<form name="form" id="form" class="form" onsubmit="someFunction(this);return false">
<label for="password">Password:</label><input type="password" style="color: #B8B894;" value="Password" onblur="if(this.value == '') { this.value='Password'}" onfocus="if (this.value == 'Password') {this.value=''}" name="password" id="password" />
<label for="password2">Confirm Pass:</label><input type="password" name="password2" id="password2" onkeyup="checkPass(); return false;" />
<span id="confirmMessage" class="confirmMessage"></span><br/>
<input type="submit" value="Submit" class="submit" />
<input type="button" name="reset_form" value="Reset All Fields " onclick="this.form.reset();">
</form>
</div>
**CSS**
.form confirmMessage {font-size: 0.8em; margin:5px; padding:10px;}
The result is renders like below image;
![Image][2]
How this can be solved? Can any one help. Thank you
[1]: http://www.keithscode.com/tutorials/javascript-tutorials/a-simple-javascript-password-validator.html
[2]: http://i.stack.imgur.com/ftB7g.png
| 0
|
4,790,451
|
01/25/2011 05:55:09
| 564,847
|
01/06/2011 02:00:15
| 1
| 0
|
怎么样把nginx0.6升级到nginx0.9?
|
怎么样在debian5里把nginx0.6升级到nginx0.9?请提供一下相关的文摘参考!
|
nginx
|
debian
| null | null | null |
01/25/2011 05:59:44
|
too localized
|
怎么样把nginx0.6升级到nginx0.9?
===
怎么样在debian5里把nginx0.6升级到nginx0.9?请提供一下相关的文摘参考!
| 3
|
5,540,165
|
04/04/2011 14:44:33
| 251,969
|
01/16/2010 00:57:04
| 150
| 3
|
Any technique for hiding ssrs reports without denying access?
|
I have SSRS 2005 instance deployed in Sharepoint Integrated mode. There are a number of sub reports that are not intended to be used directly. They are only included as components in parent reports. Is there any way to hide them and present only the top level reports to simplify end user navigation?
|
sharepoint
|
reporting-services
| null | null | null | null |
open
|
Any technique for hiding ssrs reports without denying access?
===
I have SSRS 2005 instance deployed in Sharepoint Integrated mode. There are a number of sub reports that are not intended to be used directly. They are only included as components in parent reports. Is there any way to hide them and present only the top level reports to simplify end user navigation?
| 0
|
2,846,732
|
05/17/2010 04:50:31
| 102,635
|
05/07/2009 04:21:08
| 172
| 4
|
Anchor Window to Screen Edges in C#/WPF
|
I've decided to teach myself C# by writing a music player in Visual Studio 2010. I went with WPF because from what I hear it sounds like it will be a good base to skin from.
I want to program my window with the behavior where if the window comes to the edge of a screen (within 10px or so) it will snap to the screen edge. What's the best way to go about this?
|
c#
|
wpf
|
visual-studio-2010
| null | null | null |
open
|
Anchor Window to Screen Edges in C#/WPF
===
I've decided to teach myself C# by writing a music player in Visual Studio 2010. I went with WPF because from what I hear it sounds like it will be a good base to skin from.
I want to program my window with the behavior where if the window comes to the edge of a screen (within 10px or so) it will snap to the screen edge. What's the best way to go about this?
| 0
|
11,403,062
|
07/09/2012 20:59:35
| 1,513,091
|
07/09/2012 20:40:20
| 1
| 0
|
python vs php (specific task)
|
<p>I know that the title makes you say that this subject was debated too much, but i do not want to tell me again what are the differences between those two languages.
<p>I have in mind a project and the main idea is communicating somehow with google maps and including a window with maps there and with what I add. I have not worked at any project before, so i have to learn a new language. So, which language is best for what I want?
<p>Thanks in advance, and I'm sorry if the question is not right, is my first!
|
php
|
python
|
google
|
maps
| null |
07/09/2012 21:05:38
|
not constructive
|
python vs php (specific task)
===
<p>I know that the title makes you say that this subject was debated too much, but i do not want to tell me again what are the differences between those two languages.
<p>I have in mind a project and the main idea is communicating somehow with google maps and including a window with maps there and with what I add. I have not worked at any project before, so i have to learn a new language. So, which language is best for what I want?
<p>Thanks in advance, and I'm sorry if the question is not right, is my first!
| 4
|
8,987,018
|
01/24/2012 12:44:36
| 224,667
|
12/04/2009 10:52:47
| 470
| 30
|
Fail to convert svn to git. It justs stops
|
I am following [this guide][1]
On step 2 the clone/checkout just stops with no error. If I rerun the command it stops again. Any idea what is the problem? I have trunk, tags, branches, everything standard for SVN.
[1]: http://www.albin.net/git/convert-subversion-to-git
|
git-svn
| null | null | null | null | null |
open
|
Fail to convert svn to git. It justs stops
===
I am following [this guide][1]
On step 2 the clone/checkout just stops with no error. If I rerun the command it stops again. Any idea what is the problem? I have trunk, tags, branches, everything standard for SVN.
[1]: http://www.albin.net/git/convert-subversion-to-git
| 0
|
6,609,827
|
07/07/2011 11:24:15
| 824,751
|
07/01/2011 11:16:06
| 11
| 0
|
SQLite DatabaseHelper class
|
when we create SQLite database from an android application can use a DatabaseHelper class which extend SQLiteOpenHelper.
My constructor is as follows
public DatabaseHelper(Context context)
{
super(context, dbName, null, DATABASE_VERSION);
}
Then the onCreate() method
public void onCreate(SQLiteDatabase db)
{
String qry = "CREATE TABLE DEPT(dept_id INTEGER PRIMARY KEY, deptName TEXT)";
db.execSQL(qry);
InsertDepts(db);
}
But when i create an instance of the DatabaseHelper class, my database havent created yet.
I believe when I create an Object from this class, the constructor executes and since no database created yet it will create database and execute onCreate() method. So definitely an database must be created.
Or untill we execute the following code doesn't it execute the onCreate() method, even if we create an object from the class.
databaseHelper.getWritableDatabase()
Can anyone please explain the execution order of the databasehelper class.
|
android
|
sqlite
| null | null | null | null |
open
|
SQLite DatabaseHelper class
===
when we create SQLite database from an android application can use a DatabaseHelper class which extend SQLiteOpenHelper.
My constructor is as follows
public DatabaseHelper(Context context)
{
super(context, dbName, null, DATABASE_VERSION);
}
Then the onCreate() method
public void onCreate(SQLiteDatabase db)
{
String qry = "CREATE TABLE DEPT(dept_id INTEGER PRIMARY KEY, deptName TEXT)";
db.execSQL(qry);
InsertDepts(db);
}
But when i create an instance of the DatabaseHelper class, my database havent created yet.
I believe when I create an Object from this class, the constructor executes and since no database created yet it will create database and execute onCreate() method. So definitely an database must be created.
Or untill we execute the following code doesn't it execute the onCreate() method, even if we create an object from the class.
databaseHelper.getWritableDatabase()
Can anyone please explain the execution order of the databasehelper class.
| 0
|
9,912,669
|
03/28/2012 17:28:13
| 1,128,618
|
01/03/2012 20:12:57
| 350
| 17
|
Effect of duck-typing in polymorphism in python
|
Is polymorphism useful in any way in python? As far as I know, duck typing in python makes it trivial due to the nature that object can be used without forcing it to any sub-classes if it provides the required behavior. Has somebody encountered a situation where they have found this useful in python?
|
python
|
polymorphism
| null | null | null |
03/28/2012 17:46:25
|
not constructive
|
Effect of duck-typing in polymorphism in python
===
Is polymorphism useful in any way in python? As far as I know, duck typing in python makes it trivial due to the nature that object can be used without forcing it to any sub-classes if it provides the required behavior. Has somebody encountered a situation where they have found this useful in python?
| 4
|
11,292,641
|
07/02/2012 11:21:16
| 554,217
|
12/26/2010 09:29:16
| 1,226
| 6
|
Is there a wordpress plugin to present all photos in a post
|
... in a gallery type of way. I want all the pics in my post to be presented in a gallery. I already have posts submitted, but what I am looking for is a plugin that would take all the images in the post and present them as a gallary. Is there such a plugin?
|
php
|
wordpress
| null | null | null |
07/02/2012 13:52:55
|
not constructive
|
Is there a wordpress plugin to present all photos in a post
===
... in a gallery type of way. I want all the pics in my post to be presented in a gallery. I already have posts submitted, but what I am looking for is a plugin that would take all the images in the post and present them as a gallary. Is there such a plugin?
| 4
|
8,786,407
|
01/09/2012 09:42:12
| 1,028,872
|
11/04/2011 01:05:40
| 10
| 0
|
Triple DES Decryption of plain text
|
I have some plain text encrypted with Triple XOR and then Triple DES. I also have the key. How do I manage to uncover the plain text?
|
encryption
|
xor
|
decrypt
|
des
| null | null |
open
|
Triple DES Decryption of plain text
===
I have some plain text encrypted with Triple XOR and then Triple DES. I also have the key. How do I manage to uncover the plain text?
| 0
|
7,144,499
|
08/22/2011 07:50:35
| 602,714
|
02/04/2011 06:16:37
| 128
| 1
|
Is it possible to execute Server side code before executing client side code in ASP.Net
|
I have a Link button in `DataGrid` for to edit the grid data, I'm using `OnClientClick` event for loading a modal form and also i'm using `onSelectedIndexChanged` event function of the GRID for loading editing data to to controls. see the server side code below
protected void GetSelectedData(Object src, EventArgs e)
{
String Team_Id = GridView1.DataKeys[GridView1.SelectedIndex].ToString();
using (MySqlConnection DbConnection = new MySqlConnection(ConfigurationManager.AppSettings["ConnectionStr"]))
{
DbConnection.Close();
string cmdText = "SELECT Team_Id,Team_code,Team_Name FROM Team_Details WHERE Team_Id=?Id";
MySqlCommand cmd = new MySqlCommand(cmdText, DbConnection);
cmd.Parameters.Add("?Id", MySqlDbType.Int32).Value = Convert.ToInt32(Team_Id);
DbConnection.Open();
MySqlDataReader DR = cmd.ExecuteReader();
while (DR.Read())
{
this.txtTeamCode.Text = DR.GetValue(1).ToString();
this.txtTeamName.Text = DR.GetValue(2).ToString();
}
}
}
see the Client side code for invoking the modal window,
function EditDialog(){
$('#newTeam').dialog("open");
alert(document.Team.txtTeamCode.value);
document.getElementById("cvCode").innerHTML = '';
document.Team.txtTeamCode.focus();
}
The problem is, while poping up the modal form, the fields (team code & team name) are getting blank. Please provide a solution to solve this issue.
|
javascript
|
asp.net
|
jquery-ui
| null | null | null |
open
|
Is it possible to execute Server side code before executing client side code in ASP.Net
===
I have a Link button in `DataGrid` for to edit the grid data, I'm using `OnClientClick` event for loading a modal form and also i'm using `onSelectedIndexChanged` event function of the GRID for loading editing data to to controls. see the server side code below
protected void GetSelectedData(Object src, EventArgs e)
{
String Team_Id = GridView1.DataKeys[GridView1.SelectedIndex].ToString();
using (MySqlConnection DbConnection = new MySqlConnection(ConfigurationManager.AppSettings["ConnectionStr"]))
{
DbConnection.Close();
string cmdText = "SELECT Team_Id,Team_code,Team_Name FROM Team_Details WHERE Team_Id=?Id";
MySqlCommand cmd = new MySqlCommand(cmdText, DbConnection);
cmd.Parameters.Add("?Id", MySqlDbType.Int32).Value = Convert.ToInt32(Team_Id);
DbConnection.Open();
MySqlDataReader DR = cmd.ExecuteReader();
while (DR.Read())
{
this.txtTeamCode.Text = DR.GetValue(1).ToString();
this.txtTeamName.Text = DR.GetValue(2).ToString();
}
}
}
see the Client side code for invoking the modal window,
function EditDialog(){
$('#newTeam').dialog("open");
alert(document.Team.txtTeamCode.value);
document.getElementById("cvCode").innerHTML = '';
document.Team.txtTeamCode.focus();
}
The problem is, while poping up the modal form, the fields (team code & team name) are getting blank. Please provide a solution to solve this issue.
| 0
|
7,813,267
|
10/18/2011 20:27:19
| 791,345
|
06/09/2011 16:28:53
| 6
| 0
|
website layout changing on browser window resizing
|
For a website I'm making, I'm using percentages for the divs and so when I resize the browser window, the website layout gets messed up. How should I keep using percentages and make the layout stay the way it is upon browser resizing?
|
html
|
css
|
layout
|
website
| null | null |
open
|
website layout changing on browser window resizing
===
For a website I'm making, I'm using percentages for the divs and so when I resize the browser window, the website layout gets messed up. How should I keep using percentages and make the layout stay the way it is upon browser resizing?
| 0
|
7,545,323
|
09/25/2011 11:53:16
| 963,555
|
09/25/2011 11:46:30
| 1
| 0
|
How to find Index of an array in php while loop
|
I am fetching data from MySQL database... I want to check index of each row...
e.g
while($row=mysql_fetch_array($result)
{
i want index of $row in each row... (current Index).
}
Please Help me.
Thanks
|
php
| null | null | null | null |
09/25/2011 18:08:55
|
not a real question
|
How to find Index of an array in php while loop
===
I am fetching data from MySQL database... I want to check index of each row...
e.g
while($row=mysql_fetch_array($result)
{
i want index of $row in each row... (current Index).
}
Please Help me.
Thanks
| 1
|
3,738,559
|
09/17/2010 19:57:33
| 427,141
|
08/21/2010 14:41:52
| 1
| 0
|
IIS Manager can't configure .NET Compilation on .NET 4 Applications
|
i tried to configure the .NET Compilation Settings in the IIS Manager but all i see is an Error Message that tells me that there is an unrecognized element in the `web.config` file in `C:\windows\Microsoft.NET\Framework64\v.4.0.30319\config\`.
A little bit strange for me is, that i get this error message on my Windows 7 System and also on a Windows Server 2008 R2.
While googling around a little bit all i found is this blog entry <http://olegtarasov.me/2010/09/nastrojka-iis-7-5-i-asp-net-4/>.
I tried the `aspnet_regiis -i -enable` command but that was not the solution for me.
|
web-config
|
iis-7.5
| null | null | null | null |
open
|
IIS Manager can't configure .NET Compilation on .NET 4 Applications
===
i tried to configure the .NET Compilation Settings in the IIS Manager but all i see is an Error Message that tells me that there is an unrecognized element in the `web.config` file in `C:\windows\Microsoft.NET\Framework64\v.4.0.30319\config\`.
A little bit strange for me is, that i get this error message on my Windows 7 System and also on a Windows Server 2008 R2.
While googling around a little bit all i found is this blog entry <http://olegtarasov.me/2010/09/nastrojka-iis-7-5-i-asp-net-4/>.
I tried the `aspnet_regiis -i -enable` command but that was not the solution for me.
| 0
|
4,354,183
|
12/04/2010 15:18:21
| 491,753
|
10/29/2010 20:44:18
| 32
| 0
|
Branch and bound algorithm for the Set Cover problem?
|
Can someone pleas share with me a java program what uses the Branch and bound method to solve the Set Cover problem?
|
java
|
algorithm
| null | null | null |
12/06/2010 01:45:24
|
not a real question
|
Branch and bound algorithm for the Set Cover problem?
===
Can someone pleas share with me a java program what uses the Branch and bound method to solve the Set Cover problem?
| 1
|
11,515,762
|
07/17/2012 03:46:39
| 1,528,106
|
07/16/2012 06:49:45
| 1
| 0
|
ROWLEX RDF .NET API
|
I hope someone will be able to help me. I am looking for Rowlex .NET RDF API, the website seems to down for technical reasons.
Can someone share the API?
I would be really thankful.
Thanks,
Rushi
|
rdf
|
rowlex
| null | null | null |
07/18/2012 10:30:15
|
not constructive
|
ROWLEX RDF .NET API
===
I hope someone will be able to help me. I am looking for Rowlex .NET RDF API, the website seems to down for technical reasons.
Can someone share the API?
I would be really thankful.
Thanks,
Rushi
| 4
|
8,556,112
|
12/19/2011 00:55:05
| 1,105,080
|
12/19/2011 00:44:34
| 1
| 0
|
Evaluating ASPX Pages from custom httpHandlers
|
I have search everywhere for help and its starting to piss me off.
I am creating an Internal Tooling Website which stores Tools and their related information.
My vision is to have a web address (Http://website.local/Tool/ID)
Where ID is the ID of the Tool we want displayed.
My reasoning is then I can extend the functionality of the URL to allow for various other functions.
Currently I use a custom httpHandler which intercepts any URL which is in the 'Tool' Folder.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace Tooling_Website.Tool
{
public class ToolHandler : IHttpHandler
{
public bool IsReusable
{
get { return false; }
}
public void ProcessRequest(HttpContext context)
{
//The URL that would hit this handler is: http://{website}/Tool/{AN ID eg: http://{website}/Tool/PDINJ000500}
//The idea is that what would be the page name is now the ID of the tool.
//tool is an ASPX Page.
tool tl = new tool();
System.Web.UI.HtmlTextWriter htr = new System.Web.UI.HtmlTextWriter(context.Response.Output);
tl.RenderControl(htr);
htr.Close();
}
}
}
Basically I have a page inside the 'Tool' folder (Tool\tool.aspx) which I want my customer httpHandler to Render into the Response.
But this method doesn't work (It doesn't fail, just doesn't show anything) I can write the raw file to the response but obviously thats not my goal.
Thanks,
Oliver
|
c#
|
asp.net
|
.net
|
httphandler
| null | null |
open
|
Evaluating ASPX Pages from custom httpHandlers
===
I have search everywhere for help and its starting to piss me off.
I am creating an Internal Tooling Website which stores Tools and their related information.
My vision is to have a web address (Http://website.local/Tool/ID)
Where ID is the ID of the Tool we want displayed.
My reasoning is then I can extend the functionality of the URL to allow for various other functions.
Currently I use a custom httpHandler which intercepts any URL which is in the 'Tool' Folder.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace Tooling_Website.Tool
{
public class ToolHandler : IHttpHandler
{
public bool IsReusable
{
get { return false; }
}
public void ProcessRequest(HttpContext context)
{
//The URL that would hit this handler is: http://{website}/Tool/{AN ID eg: http://{website}/Tool/PDINJ000500}
//The idea is that what would be the page name is now the ID of the tool.
//tool is an ASPX Page.
tool tl = new tool();
System.Web.UI.HtmlTextWriter htr = new System.Web.UI.HtmlTextWriter(context.Response.Output);
tl.RenderControl(htr);
htr.Close();
}
}
}
Basically I have a page inside the 'Tool' folder (Tool\tool.aspx) which I want my customer httpHandler to Render into the Response.
But this method doesn't work (It doesn't fail, just doesn't show anything) I can write the raw file to the response but obviously thats not my goal.
Thanks,
Oliver
| 0
|
10,647,851
|
05/18/2012 06:37:22
| 674,202
|
03/24/2011 02:44:04
| 80
| 0
|
Security Aspects Of PeerGuardian
|
I have/am selected/considering `PeerGuardian` as my open-source system management application and I am trying to look into SECURITY MANAGEMENT ASPECTS of `PeerGuardian`. I'm looking into the research areas of reliability & relevant sources of information. Could someone help me out here as this will help in the decision making of securing my hosting services.
|
security
|
open-source
| null | null | null |
05/18/2012 22:56:05
|
not constructive
|
Security Aspects Of PeerGuardian
===
I have/am selected/considering `PeerGuardian` as my open-source system management application and I am trying to look into SECURITY MANAGEMENT ASPECTS of `PeerGuardian`. I'm looking into the research areas of reliability & relevant sources of information. Could someone help me out here as this will help in the decision making of securing my hosting services.
| 4
|
3,633,696
|
09/03/2010 07:10:51
| 413,011
|
08/06/2010 12:11:09
| 11
| 0
|
which one faster to access one large field or multiple small fields with equal data length?
|
i am in litle confusion....
Let we have a large field in the database,and same field is splitted in the other table.
eg address(containing all city state ,country) in table1...
and add, city,state,country in table2... all are separte column.
i need complete address which on is faster..
Select address from table1 (larger data in one field)
or
Select city,state,country from table 2.. (same data is splitted in these fields)(data length equal in both cases)
plz reply
regards
|
database
| null | null | null | null | null |
open
|
which one faster to access one large field or multiple small fields with equal data length?
===
i am in litle confusion....
Let we have a large field in the database,and same field is splitted in the other table.
eg address(containing all city state ,country) in table1...
and add, city,state,country in table2... all are separte column.
i need complete address which on is faster..
Select address from table1 (larger data in one field)
or
Select city,state,country from table 2.. (same data is splitted in these fields)(data length equal in both cases)
plz reply
regards
| 0
|
2,359,934
|
03/01/2010 23:39:26
| 71,683
|
02/27/2009 02:10:07
| 796
| 29
|
AI Programming Resources with a focus on Web Applications
|
I'm interested in learning some AI algorithms that have a practical use in web applications eg. search, product recommendations etc. Obviously since I'm asking this question I am look for some more entry level material.
Any sort of useful stuff on the subject is good - books, blogs, tutorials, anything. My language of choice is c# so anything in that would be awesome but I'm happy to look at examples in other languages.
|
artificial-intelligence
|
c#
| null | null | null | null |
open
|
AI Programming Resources with a focus on Web Applications
===
I'm interested in learning some AI algorithms that have a practical use in web applications eg. search, product recommendations etc. Obviously since I'm asking this question I am look for some more entry level material.
Any sort of useful stuff on the subject is good - books, blogs, tutorials, anything. My language of choice is c# so anything in that would be awesome but I'm happy to look at examples in other languages.
| 0
|
6,394,566
|
06/18/2011 07:33:14
| 395,701
|
07/19/2010 10:04:59
| 57
| 0
|
How can I fake my IP address
|
I have a sprider collect data from some web site.but it offen be denied.
I think it basis of my IP address.
how can I fake my IP address. or have a another way to avoid be denied.
thx.
|
ruby
|
ip
|
open-uri
|
fake
| null |
06/18/2011 08:18:34
|
not constructive
|
How can I fake my IP address
===
I have a sprider collect data from some web site.but it offen be denied.
I think it basis of my IP address.
how can I fake my IP address. or have a another way to avoid be denied.
thx.
| 4
|
5,527,320
|
04/03/2011 03:11:47
| 515,136
|
11/21/2010 14:12:52
| 37
| 0
|
Shader side of Vertex composition HLSL
|
Say you ask directX to send in vertex data from multiple vertex buffers like so:
immediateContext->IASetVertexBuffers( 0, 3, bufferArray, &vertexStride, 0 );
immediateContext->IASetIndexBuffer( indexBuffer, DXGI_FORMAT_R32_UINT, 0 );
immediateContext->DrawIndexed( numIndices, 0 , 0 );
Now HLSL side should I be doing something like this:
struct FatVertex
{
float4 dataFromVertexBuffer1: SemanticName1
float4 dataFromVertexBuffer2: SemanticName2
float4 dataFromVertexBuffer3: SemanticName3
};
PixelShaderInput VertexShader( FatVertex input )
{
// Transform things, fill PixelShaderInput struct etc.
}
Or something like this:
struct BufferData1
{
float4 dataFromVertexBuffer1: SemanticName1
};
struct BufferData2
{
float4 dataFromVertexBuffer2: SemanticName2
};
struct BufferData3
{
float4 dataFromVertexBuffer3: SemanticName3
};
PixelShaderInput VertexShader( BufferData1 input1, BufferData2 input2, BufferData3 input3 )
{
// Transform things, fill PixelShaderInput struct etc.
}
Or are both perfectly valid (as I am assuming that the semantic name tells Direct3D where to put things).
This is all Direct3D11.
|
directx
|
semantic
|
shader
|
hlsl
| null | null |
open
|
Shader side of Vertex composition HLSL
===
Say you ask directX to send in vertex data from multiple vertex buffers like so:
immediateContext->IASetVertexBuffers( 0, 3, bufferArray, &vertexStride, 0 );
immediateContext->IASetIndexBuffer( indexBuffer, DXGI_FORMAT_R32_UINT, 0 );
immediateContext->DrawIndexed( numIndices, 0 , 0 );
Now HLSL side should I be doing something like this:
struct FatVertex
{
float4 dataFromVertexBuffer1: SemanticName1
float4 dataFromVertexBuffer2: SemanticName2
float4 dataFromVertexBuffer3: SemanticName3
};
PixelShaderInput VertexShader( FatVertex input )
{
// Transform things, fill PixelShaderInput struct etc.
}
Or something like this:
struct BufferData1
{
float4 dataFromVertexBuffer1: SemanticName1
};
struct BufferData2
{
float4 dataFromVertexBuffer2: SemanticName2
};
struct BufferData3
{
float4 dataFromVertexBuffer3: SemanticName3
};
PixelShaderInput VertexShader( BufferData1 input1, BufferData2 input2, BufferData3 input3 )
{
// Transform things, fill PixelShaderInput struct etc.
}
Or are both perfectly valid (as I am assuming that the semantic name tells Direct3D where to put things).
This is all Direct3D11.
| 0
|
513,386
|
02/04/2009 21:15:52
| 62,617
|
02/04/2009 21:09:08
| 1
| 0
|
a few java question from someone new to the language?
|
i am a 25 year old male new to programming. my question are as follow:
my goals is to get into mobile programming in the near future.
1.about how long would it take a newbie such as myself to get up to
speed with the java language?
2. is it a hard language for someone new to programming?if so any alternatives?
|
java
| null | null | null | null |
01/29/2012 21:00:11
|
not constructive
|
a few java question from someone new to the language?
===
i am a 25 year old male new to programming. my question are as follow:
my goals is to get into mobile programming in the near future.
1.about how long would it take a newbie such as myself to get up to
speed with the java language?
2. is it a hard language for someone new to programming?if so any alternatives?
| 4
|
5,416,031
|
03/24/2011 07:30:20
| 480,059
|
10/19/2010 05:17:18
| 99
| 0
|
some basic seo knowledge?
|
i will have a job interview on SEO tomorrow. but i am a newbie of it.i want to make a good impression to the interviewer. expect someone can give some basic seo knowledge sumary here. thank you.
|
seo
| null | null | null | null |
03/24/2011 07:34:18
|
off topic
|
some basic seo knowledge?
===
i will have a job interview on SEO tomorrow. but i am a newbie of it.i want to make a good impression to the interviewer. expect someone can give some basic seo knowledge sumary here. thank you.
| 2
|
3,493,060
|
08/16/2010 12:26:29
| 767,920
|
08/30/2009 07:49:27
| 498
| 15
|
formatting data inside an a datatable
|
HI,
i have an datatable like this. i need to format the data like this.
ID name mailID
12 kumar kumar@gmail.com
14 kumar kumar@gmail.com
17 kumar kumar@gmail.com
20 kiran kiran@gmail.com
21 kiran kiran@gmail.com
26 kiran kiran@gmail.com
100 Ram Ram@gmail.com
101 Ram Ram@gmail.com
102 Ram Ram@gmail.com
now in need to format the data like this in a datatable . can any one help me out how to sort this issue.
ID name mailID
12,14,17 kumar kumar@gmail.com
20,21,26 kiran kiran@gmail.com
100,101,102 Ram Ram@gmail.com
any help would be great
thanks
prince
|
c#
| null | null | null | null | null |
open
|
formatting data inside an a datatable
===
HI,
i have an datatable like this. i need to format the data like this.
ID name mailID
12 kumar kumar@gmail.com
14 kumar kumar@gmail.com
17 kumar kumar@gmail.com
20 kiran kiran@gmail.com
21 kiran kiran@gmail.com
26 kiran kiran@gmail.com
100 Ram Ram@gmail.com
101 Ram Ram@gmail.com
102 Ram Ram@gmail.com
now in need to format the data like this in a datatable . can any one help me out how to sort this issue.
ID name mailID
12,14,17 kumar kumar@gmail.com
20,21,26 kiran kiran@gmail.com
100,101,102 Ram Ram@gmail.com
any help would be great
thanks
prince
| 0
|
5,960,198
|
05/11/2011 06:36:04
| 674,339
|
03/24/2011 05:20:15
| 1
| 0
|
Audio signal Processing-Retrieving information from audio
|
Is it possible to retrieve some information like some id from the audio signal ?
|
java
|
android
|
signal-processing
| null | null |
05/11/2011 15:47:47
|
not a real question
|
Audio signal Processing-Retrieving information from audio
===
Is it possible to retrieve some information like some id from the audio signal ?
| 1
|
5,914,078
|
05/06/2011 16:09:21
| 15,948
|
09/17/2008 13:41:28
| 418
| 13
|
ffmpeg vs mencoder
|
I'm doing a bunch of video encoding for a variety of devices and platforms. I've bounced back and forth a few times between [mencoder][1] and [ffmpeg][2]. Which do you recommend and why?
Side question: From googling it seems that mencoder uses ffmpeg. Does it do this all the time or only when it deems necessary?
[1]: http://www.mplayerhq.hu/
[2]: http://www.ffmpeg.org/
|
ffmpeg
|
mencoder
| null | null | null | null |
open
|
ffmpeg vs mencoder
===
I'm doing a bunch of video encoding for a variety of devices and platforms. I've bounced back and forth a few times between [mencoder][1] and [ffmpeg][2]. Which do you recommend and why?
Side question: From googling it seems that mencoder uses ffmpeg. Does it do this all the time or only when it deems necessary?
[1]: http://www.mplayerhq.hu/
[2]: http://www.ffmpeg.org/
| 0
|
11,170,762
|
06/23/2012 15:37:07
| 458,960
|
09/26/2010 21:45:36
| 1,986
| 30
|
Dynamic UITableView height with Core Data objects
|
I've been trying to solve a mystery the past few days as to why my NSFetchedResultsController with a batch size of 20 would always fault in (that is, load into memory) all my objects immediately when the fetch was finished, causing the request to take ~ 20 seconds.
It turns out that it was because in my heightForRowAtIndexPath, the height was based on the length of an NSString property of each fetched object, and so upon reloading the table, if the table has 2000 rows, then the height is calculated for every row in the beginning, and since I access a text property of the object, it would fault in 2000 objects (in 20 size batches) right in the very beginning, causing it to take forever. (I didn't know row heights were calculated all in the beginning).
So the question is, if I have a fetch results controller with a batch size of 20, but my row heights are based on a text property of the object, which if I try to access would cause the object to not be a fault anymore but actually loaded into memory, what would be a workaround to calculating the height?
What are my options?
|
iphone
|
objective-c
|
ios
|
core-data
| null | null |
open
|
Dynamic UITableView height with Core Data objects
===
I've been trying to solve a mystery the past few days as to why my NSFetchedResultsController with a batch size of 20 would always fault in (that is, load into memory) all my objects immediately when the fetch was finished, causing the request to take ~ 20 seconds.
It turns out that it was because in my heightForRowAtIndexPath, the height was based on the length of an NSString property of each fetched object, and so upon reloading the table, if the table has 2000 rows, then the height is calculated for every row in the beginning, and since I access a text property of the object, it would fault in 2000 objects (in 20 size batches) right in the very beginning, causing it to take forever. (I didn't know row heights were calculated all in the beginning).
So the question is, if I have a fetch results controller with a batch size of 20, but my row heights are based on a text property of the object, which if I try to access would cause the object to not be a fault anymore but actually loaded into memory, what would be a workaround to calculating the height?
What are my options?
| 0
|
8,395,084
|
12/06/2011 03:43:56
| 1,082,752
|
12/06/2011 03:23:34
| 1
| 0
|
iOS Data Storage Guidelines. in this situation what should i do?
|
i got rejection leter from apple stating that my app does not follow "iOS Data Storage Guidelines"
so here what i have it is a dictionary app which has 3 sqlite databases 2 bookmarks and dictionary database it self. i will be pushing updates every month which overwrites dictionary.sqlite if update is avaliable right now all of these are in /document folder what you guys suggest i do i'm pretty confuesd. thanks for your help.
|
iphone
|
objective-c
|
cocoa-touch
|
ipad
|
ios5
|
12/06/2011 12:34:00
|
off topic
|
iOS Data Storage Guidelines. in this situation what should i do?
===
i got rejection leter from apple stating that my app does not follow "iOS Data Storage Guidelines"
so here what i have it is a dictionary app which has 3 sqlite databases 2 bookmarks and dictionary database it self. i will be pushing updates every month which overwrites dictionary.sqlite if update is avaliable right now all of these are in /document folder what you guys suggest i do i'm pretty confuesd. thanks for your help.
| 2
|
11,335,112
|
07/04/2012 20:28:15
| 1,411,019
|
05/22/2012 19:02:15
| 113
| 3
|
Sharing an iCloud account across multiple users
|
If I have hundreds of iPads belonging to a single commercial organisation can I create a single iCloud account that all the iPads can share? If I place some PDF documents into the iCloud account then presumably all the iPads will be able to see the documents? And I'll then be able to read these documents from my iPad app (assuming correct permissions)?
If individual people using the iPads also have their own iCloud accounts is there any way to have the iPad operate against two (or more) iCloud accounts at the same time, thus allowing the client account and the individual account to operate at the same time.
Thanks.
|
ios
|
icloud
| null | null | null |
07/05/2012 15:46:05
|
off topic
|
Sharing an iCloud account across multiple users
===
If I have hundreds of iPads belonging to a single commercial organisation can I create a single iCloud account that all the iPads can share? If I place some PDF documents into the iCloud account then presumably all the iPads will be able to see the documents? And I'll then be able to read these documents from my iPad app (assuming correct permissions)?
If individual people using the iPads also have their own iCloud accounts is there any way to have the iPad operate against two (or more) iCloud accounts at the same time, thus allowing the client account and the individual account to operate at the same time.
Thanks.
| 2
|
1,955,037
|
12/23/2009 20:10:41
| 193,251
|
10/20/2009 16:38:35
| 387
| 5
|
Why does C++ prohit non-integral data member initialization at the point of definition?
|
class Interface {
public:
static const int i = 1;
static const double d = 1.0;
//! static const string name = new string("Interface name");
virtual string getName() = 0;
}
Since C++ is a traditional truely compiled programming language,it could be easily convinced that it does allow object initialization(?).But why do C++ prohit double initialization at the point of defintion?I see that g++ now support double initialization at the point of definition,but not msvc.
My question is,since it's easy to support primitive types - float/double initialization at the point of definition and it could make C++ programmer's life easier and happier with this convenient,why do C++ prohibit it?
P.S:
Reference - 9.2.4 section of C++ standard 2003.
> A member-declarator can contain a
> constant-initializer only if it
> declares a static member (9.4) of
> const integral or const enumeration
> type, see 9.4.2.
|
initialization
|
c++
|
static
| null | null | null |
open
|
Why does C++ prohit non-integral data member initialization at the point of definition?
===
class Interface {
public:
static const int i = 1;
static const double d = 1.0;
//! static const string name = new string("Interface name");
virtual string getName() = 0;
}
Since C++ is a traditional truely compiled programming language,it could be easily convinced that it does allow object initialization(?).But why do C++ prohit double initialization at the point of defintion?I see that g++ now support double initialization at the point of definition,but not msvc.
My question is,since it's easy to support primitive types - float/double initialization at the point of definition and it could make C++ programmer's life easier and happier with this convenient,why do C++ prohibit it?
P.S:
Reference - 9.2.4 section of C++ standard 2003.
> A member-declarator can contain a
> constant-initializer only if it
> declares a static member (9.4) of
> const integral or const enumeration
> type, see 9.4.2.
| 0
|
1,644,212
|
10/29/2009 14:41:08
| 57,185
|
11/11/2008 14:42:09
| 37
| 3
|
Connecting multiple devices through RAPI2
|
The Microsoft [RAPI2 interface][1] is designed with the ability to talk to multiple devices. But, ActiveSync 4.5.0 allows only allows one device at a time to connect and only allows it over a USB connection.
Is there a way to write a client-server piece for the desktop and mobile device that will allow more than one device to connect to the desktop through a RAPI2 connection? Preferably some way to put RAPI2 over TCP/IP.
Thanks,
PaulH
[1]: http://msdn.microsoft.com/en-us/library/aa920150.aspx
|
c++
|
windows-mobile
|
rapi
| null | null | null |
open
|
Connecting multiple devices through RAPI2
===
The Microsoft [RAPI2 interface][1] is designed with the ability to talk to multiple devices. But, ActiveSync 4.5.0 allows only allows one device at a time to connect and only allows it over a USB connection.
Is there a way to write a client-server piece for the desktop and mobile device that will allow more than one device to connect to the desktop through a RAPI2 connection? Preferably some way to put RAPI2 over TCP/IP.
Thanks,
PaulH
[1]: http://msdn.microsoft.com/en-us/library/aa920150.aspx
| 0
|
10,063,459
|
04/08/2012 14:16:06
| 235,715
|
12/21/2009 00:56:44
| 1,644
| 65
|
How to deal with code modification in events handlers with Event Sourcing pattern
|
I'm making my way into using Event Sourcing pattern, and there is one thing that bother me.
What will happen if I change source code for some event handlers, the next time I will be rebuilding object state (replaying events) I might get completly different object, or worse I can get nothing cause of some exceptional condition in one of handlers doing some rule checking.
Does it mean that event handling code should be immutable? (Once you wrote it you never touch it again). I really don't like this idea.
|
c#
|
event-sourcing
| null | null | null |
04/09/2012 20:42:08
|
not a real question
|
How to deal with code modification in events handlers with Event Sourcing pattern
===
I'm making my way into using Event Sourcing pattern, and there is one thing that bother me.
What will happen if I change source code for some event handlers, the next time I will be rebuilding object state (replaying events) I might get completly different object, or worse I can get nothing cause of some exceptional condition in one of handlers doing some rule checking.
Does it mean that event handling code should be immutable? (Once you wrote it you never touch it again). I really don't like this idea.
| 1
|
4,299,497
|
11/28/2010 22:28:12
| 50,394
|
12/31/2008 04:52:41
| 10,391
| 467
|
Test-driven development not working for my class
|
I have this class that I wanted to build using TDD, but I failed. It's a pretty basic class called `SubMissions`, and all it does is it fetches some data from an SQL database.
So it has methods like `getSubMissionForPage()`, `getSubMissionFromId()` etc..
I tried building it using TDD. My first test contained a call to `getSubMissionPage()`, which only purpose is to return data. So making this test fail is pretty darn hard, since it can return any data, I couldn't come up with a way to make it fail.
I know making your test fail is the first step into knowing what to implement, but what do you do when there's actually no way of failing a test?
|
java
|
tdd
| null | null | null | null |
open
|
Test-driven development not working for my class
===
I have this class that I wanted to build using TDD, but I failed. It's a pretty basic class called `SubMissions`, and all it does is it fetches some data from an SQL database.
So it has methods like `getSubMissionForPage()`, `getSubMissionFromId()` etc..
I tried building it using TDD. My first test contained a call to `getSubMissionPage()`, which only purpose is to return data. So making this test fail is pretty darn hard, since it can return any data, I couldn't come up with a way to make it fail.
I know making your test fail is the first step into knowing what to implement, but what do you do when there's actually no way of failing a test?
| 0
|
8,263,938
|
11/25/2011 01:06:02
| 1,064,827
|
11/25/2011 00:43:43
| 1
| 0
|
how to avoid delay playing wav file in JS
|
I have programmed my site so that a sound palys when the user clicks on an image. I did this with JS. But there is a problem. There is a ling delau of about 5 sec before the sound plays that is after you click on the image. What can I do to make the sound paly without delay? The sound is a wav file.
|
javascript
| null | null | null | null |
11/26/2011 03:03:53
|
not a real question
|
how to avoid delay playing wav file in JS
===
I have programmed my site so that a sound palys when the user clicks on an image. I did this with JS. But there is a problem. There is a ling delau of about 5 sec before the sound plays that is after you click on the image. What can I do to make the sound paly without delay? The sound is a wav file.
| 1
|
9,004,848
|
01/25/2012 15:03:14
| 98,422
|
04/30/2009 09:51:51
| 4,260
| 151
|
Working with Office "open" XML - just how hard is it?
|
I'm considering replacing a (very) large body of Office-automation code with something that works with the Office XML format directly. I'm just starting out, but already I'm worried that it's too big a task.
I'll be dealing with Word, Excel and PowerPoint. So far I've only looked at Word and Excel. It looks like Word documents should be reasonably easy to manipulate, but Excel workbooks look like a nightmare. For example...
In Word, it looks like you could delete a paragraph simply by deleting the corresponding "w:p" tag. However, the supplied code snippet for deleting a row in Excel takes about 150 lines of code(!).
The reason the Excel code is so big is that deleting a row means updating the row indexes of all the subsequent rows, fixing up the "share strings" table, etc. According to a comment at the top, the code snippet is not even complete, in that it won't deal with a workbook that has tables in it (I can live with that).
What I'm not clear on is whether that's the only restriction that the sample code has. For example, would there also be a problem if the workbook contained a Pivot Table? Or a chart that references data from the same sheet? Or some named ranges? Wouldn't you also have to update the formulae for any cells (etc.) that referenced a row whose row index had changed?
[That's not to mention the "calc chain", which (thankfully) I think you can simply delete since it's only a chache that can be re-built.]
And that's my question, woolly though it is. Just how hard do you have to work do something as simple as deleting a row properly? Is it an insurmountable task?
Also, if there are other, similar issues either with Excel or with Word or PowerPoint, I'd love to hear about them now, before I waste too much time going down a blind alley. Thanks.
|
ms-office
|
openxml
|
openxml-sdk
|
office-2007
|
office-2010
| null |
open
|
Working with Office "open" XML - just how hard is it?
===
I'm considering replacing a (very) large body of Office-automation code with something that works with the Office XML format directly. I'm just starting out, but already I'm worried that it's too big a task.
I'll be dealing with Word, Excel and PowerPoint. So far I've only looked at Word and Excel. It looks like Word documents should be reasonably easy to manipulate, but Excel workbooks look like a nightmare. For example...
In Word, it looks like you could delete a paragraph simply by deleting the corresponding "w:p" tag. However, the supplied code snippet for deleting a row in Excel takes about 150 lines of code(!).
The reason the Excel code is so big is that deleting a row means updating the row indexes of all the subsequent rows, fixing up the "share strings" table, etc. According to a comment at the top, the code snippet is not even complete, in that it won't deal with a workbook that has tables in it (I can live with that).
What I'm not clear on is whether that's the only restriction that the sample code has. For example, would there also be a problem if the workbook contained a Pivot Table? Or a chart that references data from the same sheet? Or some named ranges? Wouldn't you also have to update the formulae for any cells (etc.) that referenced a row whose row index had changed?
[That's not to mention the "calc chain", which (thankfully) I think you can simply delete since it's only a chache that can be re-built.]
And that's my question, woolly though it is. Just how hard do you have to work do something as simple as deleting a row properly? Is it an insurmountable task?
Also, if there are other, similar issues either with Excel or with Word or PowerPoint, I'd love to hear about them now, before I waste too much time going down a blind alley. Thanks.
| 0
|
1,857,822
|
12/07/2009 04:31:16
| 46,928
|
12/17/2008 04:44:27
| 170
| 14
|
Unique model field in Django and case sensitivity (postgres)
|
Consider the following situation: -
Suppose my app allows users to create the states / provinces in their
country. Just for clarity, we are considering only ASCII characters
here.
In the US, a user could create the state called "Texas". If this app
is being used internally, let's say the user doesn't care if it is
spelled "texas" or "Texas" or "teXas"
But importantly, the system should prevent creation of "texas" if
"Texas" is already in the database.
If the model is like the following:
class State(models.Model):
name = models.CharField(max_length=50, unique=True)
The uniqueness would be case-sensitive in postgres; that is, postgres
would allow the user to create both "texas" and "Texas" as they are
considered unique.
What can be done in this situation to prevent such behavior. How does
one go about providing case-**insenstitive** uniqueness with Django and
Postgres
Right now I'm doing the following to prevent creation of case-
insensitive duplicates.
class CreateStateForm(forms.ModelForm):
def clean_name(self):
name = self.cleaned_data['name']
try:
State.objects.get(name__iexact=name)
except ObjectDoesNotExist:
return name
raise forms.ValidationError('State already exists.')
class Meta:
model = State
There are a number of cases where I will have to do this check and I'm not keen on having to write similar iexact checks everywhere.
Just wondering if there is a built-in or
better way? Perhaps db_type would help? Maybe some other solution exists?
|
django
|
django-models
|
postgresql
|
unique
| null | null |
open
|
Unique model field in Django and case sensitivity (postgres)
===
Consider the following situation: -
Suppose my app allows users to create the states / provinces in their
country. Just for clarity, we are considering only ASCII characters
here.
In the US, a user could create the state called "Texas". If this app
is being used internally, let's say the user doesn't care if it is
spelled "texas" or "Texas" or "teXas"
But importantly, the system should prevent creation of "texas" if
"Texas" is already in the database.
If the model is like the following:
class State(models.Model):
name = models.CharField(max_length=50, unique=True)
The uniqueness would be case-sensitive in postgres; that is, postgres
would allow the user to create both "texas" and "Texas" as they are
considered unique.
What can be done in this situation to prevent such behavior. How does
one go about providing case-**insenstitive** uniqueness with Django and
Postgres
Right now I'm doing the following to prevent creation of case-
insensitive duplicates.
class CreateStateForm(forms.ModelForm):
def clean_name(self):
name = self.cleaned_data['name']
try:
State.objects.get(name__iexact=name)
except ObjectDoesNotExist:
return name
raise forms.ValidationError('State already exists.')
class Meta:
model = State
There are a number of cases where I will have to do this check and I'm not keen on having to write similar iexact checks everywhere.
Just wondering if there is a built-in or
better way? Perhaps db_type would help? Maybe some other solution exists?
| 0
|
9,481,482
|
02/28/2012 11:58:34
| 838,650
|
07/11/2011 10:06:57
| 4
| 0
|
Drag And Drop a Button to a specific position in Android
|
Hi everybody,
I am developing an app, which needs a button to be dragged and dropped to a particular place ie., I have a button named "btn" at a specific position (Eg.default position (0,0) ), i need to drag that button and drop it at a particular coordinate (Eg. button should be dragged and dropped at (250,250) ). If the button is dragged and dropped somewhere else other than that coordinate, it should return back to its origin.
|
android
|
android-layout
|
button
|
drag-and-drop
|
imageview
|
02/29/2012 18:36:50
|
not a real question
|
Drag And Drop a Button to a specific position in Android
===
Hi everybody,
I am developing an app, which needs a button to be dragged and dropped to a particular place ie., I have a button named "btn" at a specific position (Eg.default position (0,0) ), i need to drag that button and drop it at a particular coordinate (Eg. button should be dragged and dropped at (250,250) ). If the button is dragged and dropped somewhere else other than that coordinate, it should return back to its origin.
| 1
|
761,340
|
04/17/2009 17:18:06
| 47,637
|
12/19/2008 03:31:07
| 20
| 3
|
Is Redhat Linux server free?
|
I will maintain a C program which I was told it should only work on Redhat Linux. I want to setup a development environment for it but I'm wondering if Redhat Linux server is free? If it's not free, is there any other free Linux distros can relpace Redhat for me?
|
redhat
|
linux
|
c
|
free
| null |
04/17/2009 17:32:51
|
off topic
|
Is Redhat Linux server free?
===
I will maintain a C program which I was told it should only work on Redhat Linux. I want to setup a development environment for it but I'm wondering if Redhat Linux server is free? If it's not free, is there any other free Linux distros can relpace Redhat for me?
| 2
|
5,084,351
|
02/22/2011 21:45:02
| 348,056
|
05/22/2010 23:41:58
| 1,426
| 19
|
Online regex find and replace.
|
No standard editor is equipped with regex, but I often find myself in need of quick use of regex find and replace. Vim's regex is utterly inscrutable. Eclipse has great regex, but I hate to boot it up all the time. There are plenty of online regex testers, but none that I've found will let me past text, apply regex find and replace, and the copy the text and use it.
Do you know of any websites like this?
|
regex
| null | null | null | null |
02/23/2011 08:34:32
|
off topic
|
Online regex find and replace.
===
No standard editor is equipped with regex, but I often find myself in need of quick use of regex find and replace. Vim's regex is utterly inscrutable. Eclipse has great regex, but I hate to boot it up all the time. There are plenty of online regex testers, but none that I've found will let me past text, apply regex find and replace, and the copy the text and use it.
Do you know of any websites like this?
| 2
|
9,990,867
|
04/03/2012 09:51:00
| 1,310,075
|
04/03/2012 09:46:50
| 1
| 0
|
Egor can't make labs on C# and MySQL
|
I have problem. I can't make my programm from C# and MySQL. Please, take me some tutorials for **MySQL** and **C#**.
|
c#
|
mysql
|
mysql-connector
| null | null |
04/03/2012 12:05:20
|
not a real question
|
Egor can't make labs on C# and MySQL
===
I have problem. I can't make my programm from C# and MySQL. Please, take me some tutorials for **MySQL** and **C#**.
| 1
|
1,461,298
|
09/22/2009 17:01:42
| 149,045
|
08/01/2009 18:55:03
| 717
| 17
|
iterate from A to Z in a tcsh or csh shell
|
Say I want to iterate from letter A to letter Z in corn shell. How do I succinctly do that?
in bash I would do something like for i in 'A B C ...Z'; do echo $i; done
thanks
|
shell
|
tcsh
|
csh
|
unix
| null | null |
open
|
iterate from A to Z in a tcsh or csh shell
===
Say I want to iterate from letter A to letter Z in corn shell. How do I succinctly do that?
in bash I would do something like for i in 'A B C ...Z'; do echo $i; done
thanks
| 0
|
3,306,534
|
07/22/2010 07:10:47
| 161,628
|
08/23/2009 17:00:53
| 825
| 17
|
What is the difference between ASN.1 enumerated types and choice types?
|
Can you give me an example to show when to use an enumeration and when to use a choice type with ASN.1?
|
enumeration
|
choice
|
asn.1
| null | null | null |
open
|
What is the difference between ASN.1 enumerated types and choice types?
===
Can you give me an example to show when to use an enumeration and when to use a choice type with ASN.1?
| 0
|
6,073,897
|
05/20/2011 15:09:03
| 762,935
|
05/20/2011 14:51:57
| 1
| 0
|
How to create nested forms using rails 3 and datamapper?
|
**my models in Datamapper are:**
**Project:**
require "dm-accepts_nested_attributes"
class Project
include DataMapper::Resource
property :id, Serial
property :project_title, String
has n, :tasks
accepts_nested_attributes_for :tasks
end
**Task:**
class Task
include DataMapper::Resource
property :id, Serial
property :task_name, String
belongs_to :project
end
Now i wanted to create view for the Project with links for adding tasks.
I tried it with [nested_form][1] gem
and [cocoon][2] gem but no use.
[1]: https://github.com/madebydna/nested_form
[2]: https://github.com/nathanvda/cocoon
|
ruby-on-rails-3
|
datamapper
|
nested-forms
| null | null | null |
open
|
How to create nested forms using rails 3 and datamapper?
===
**my models in Datamapper are:**
**Project:**
require "dm-accepts_nested_attributes"
class Project
include DataMapper::Resource
property :id, Serial
property :project_title, String
has n, :tasks
accepts_nested_attributes_for :tasks
end
**Task:**
class Task
include DataMapper::Resource
property :id, Serial
property :task_name, String
belongs_to :project
end
Now i wanted to create view for the Project with links for adding tasks.
I tried it with [nested_form][1] gem
and [cocoon][2] gem but no use.
[1]: https://github.com/madebydna/nested_form
[2]: https://github.com/nathanvda/cocoon
| 0
|
5,900,782
|
05/05/2011 15:59:21
| 721,716
|
04/23/2011 12:16:47
| 27
| 1
|
xCode build [PLEASE HELP]
|
when i build it show an error:
Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 failed with exit code 1
how do i fix it?
thank you :)
|
xcode
|
build
|
command
|
problem-solving
| null |
05/05/2011 18:08:20
|
not a real question
|
xCode build [PLEASE HELP]
===
when i build it show an error:
Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 failed with exit code 1
how do i fix it?
thank you :)
| 1
|
8,414,486
|
12/07/2011 11:21:31
| 597,238
|
01/31/2011 17:31:37
| 89
| 2
|
Stanford's AI course materials
|
I've missed this cource:( Googling doesn't help me find materials of this cource.
Video lectures,labs e.t.c..
Is anybody here has a materials from this course?
|
artificial-intelligence
| null | null | null | null |
12/07/2011 16:55:59
|
too localized
|
Stanford's AI course materials
===
I've missed this cource:( Googling doesn't help me find materials of this cource.
Video lectures,labs e.t.c..
Is anybody here has a materials from this course?
| 3
|
8,963,003
|
01/22/2012 17:21:44
| 1,072,279
|
11/29/2011 22:12:58
| 1
| 1
|
How to manage different php.ini settings in production and development?
|
Is there a best practice for managing php.ini configurations from development to production? Obviously it can be done manually, but that is prone to human error. I'd like to try and have the production file in version control and then possibly modify the development version automatically.
Thoughts or ideas i've had which i dont know if they are feasible:
1. php.ini includes - just include the dev settings at the end of
the file?
2. conditional loads from apache conf?
3. write a script that when php.ini changes, a dynamic version of phpdev.ini gets generated - (i know this can be done)
4. use runtime php settings for display errors - i think this has limitations because if the script has fatal errors, then it wont run the runtime setting.
5. backup plan - keep the production version in SC, and manually change
phpdev.ini as needed as needed. Then if manual mistakes are made
they are done at the development level.
|
apache
|
php5
|
.htaccess
|
configuration
| null | null |
open
|
How to manage different php.ini settings in production and development?
===
Is there a best practice for managing php.ini configurations from development to production? Obviously it can be done manually, but that is prone to human error. I'd like to try and have the production file in version control and then possibly modify the development version automatically.
Thoughts or ideas i've had which i dont know if they are feasible:
1. php.ini includes - just include the dev settings at the end of
the file?
2. conditional loads from apache conf?
3. write a script that when php.ini changes, a dynamic version of phpdev.ini gets generated - (i know this can be done)
4. use runtime php settings for display errors - i think this has limitations because if the script has fatal errors, then it wont run the runtime setting.
5. backup plan - keep the production version in SC, and manually change
phpdev.ini as needed as needed. Then if manual mistakes are made
they are done at the development level.
| 0
|
6,661,819
|
07/12/2011 09:08:29
| 840,380
|
07/12/2011 09:08:29
| 1
| 0
|
error in following c code
|
I have written this code to reverse an array using functions. But there is an error in line 24 saying ' ) expected'. I have read it again and again but i couldn't find the error. Can anybody please reveal it and tell me how to remove it?
#include<stdio.h>
#include<conio.h>
#define max 5
/*function prototype*/
void reverse(int[],int);
void main()
{
int arr[max]={1,2,3,4,5};
int i,j;
clrscr();
printf("the list before reversing:\n");
for(i=0;i<max;i++)
printf("%d",arr[i]);
reverse(arr,max);
printf("\n the list after reversing:\n");
for(i=0;i<max;i++)
printf("%d",arr[i]);
getch();
}
/*function for reversing elements of array*/
void reverse(int num[],int max)
{
int i,j,temp;
(i=0,j=max-1;i<max/2;i++,j--)
{
temp=num[i];
num[i]=num[j];
num[j]=temp;
}
}
|
c
| null | null | null | null |
11/11/2011 09:48:11
|
not a real question
|
error in following c code
===
I have written this code to reverse an array using functions. But there is an error in line 24 saying ' ) expected'. I have read it again and again but i couldn't find the error. Can anybody please reveal it and tell me how to remove it?
#include<stdio.h>
#include<conio.h>
#define max 5
/*function prototype*/
void reverse(int[],int);
void main()
{
int arr[max]={1,2,3,4,5};
int i,j;
clrscr();
printf("the list before reversing:\n");
for(i=0;i<max;i++)
printf("%d",arr[i]);
reverse(arr,max);
printf("\n the list after reversing:\n");
for(i=0;i<max;i++)
printf("%d",arr[i]);
getch();
}
/*function for reversing elements of array*/
void reverse(int num[],int max)
{
int i,j,temp;
(i=0,j=max-1;i<max/2;i++,j--)
{
temp=num[i];
num[i]=num[j];
num[j]=temp;
}
}
| 1
|
9,065,041
|
01/30/2012 14:04:03
| 839,042
|
07/11/2011 14:10:17
| 21
| 1
|
View rendering in iOS 4.2
|
I built a custom view to make chat messages according to [this tutorial][1]
[1]: http://mobile.tutsplus.com/tutorials/iphone/building-a-jabber-client-for-ios-custom-chat-view-and-emoticons/.
It is working fine if the app is directly compiled on device.But while creating an ipa file and installing it via iTunes, in iOS 4.2, the height of the chat bubbles are stretched more than the required size and causes overlapping of chat bubbles. But it is working fine in iOS 5.What would be the reason for this?Thanks in advance.
|
iphone
|
ios
|
ios4
|
ios5
| null | null |
open
|
View rendering in iOS 4.2
===
I built a custom view to make chat messages according to [this tutorial][1]
[1]: http://mobile.tutsplus.com/tutorials/iphone/building-a-jabber-client-for-ios-custom-chat-view-and-emoticons/.
It is working fine if the app is directly compiled on device.But while creating an ipa file and installing it via iTunes, in iOS 4.2, the height of the chat bubbles are stretched more than the required size and causes overlapping of chat bubbles. But it is working fine in iOS 5.What would be the reason for this?Thanks in advance.
| 0
|
11,232,809
|
06/27/2012 18:33:39
| 1,054,358
|
11/18/2011 18:00:36
| 939
| 84
|
Getting pdf live cycle form field names
|
I want to extract adobe's liveCycle field(XFA) from pdf file.
I can extract form fiels from pdf using itextsharp using this code.....
OpenFileDialog ofd = new OpenFileDialog();
if (ofd.ShowDialog() == DialogResult.OK)
{
pdfTemplate = ofd.FileName;
PdfReader a = new PdfReader(pdfTemplate);
foreach (KeyValuePair<string,AcroFields.Item> de in pdfReader.AcroFields.Fields)
{
MessageBox.Show(de.Key.ToString());
}
}
It works fine for static form fields.
But it does not work with dynamic xfa froms. I searched internet for a solution to get all xfa form field names programmatically but failed. There exist some library but they have to buy.
I want free library like itextsharp.
> Is it possible with free library?
|
c#
|
.net
|
pdf
|
itextsharp
| null | null |
open
|
Getting pdf live cycle form field names
===
I want to extract adobe's liveCycle field(XFA) from pdf file.
I can extract form fiels from pdf using itextsharp using this code.....
OpenFileDialog ofd = new OpenFileDialog();
if (ofd.ShowDialog() == DialogResult.OK)
{
pdfTemplate = ofd.FileName;
PdfReader a = new PdfReader(pdfTemplate);
foreach (KeyValuePair<string,AcroFields.Item> de in pdfReader.AcroFields.Fields)
{
MessageBox.Show(de.Key.ToString());
}
}
It works fine for static form fields.
But it does not work with dynamic xfa froms. I searched internet for a solution to get all xfa form field names programmatically but failed. There exist some library but they have to buy.
I want free library like itextsharp.
> Is it possible with free library?
| 0
|
1,644,237
|
10/29/2009 14:44:52
| 148,332
|
07/31/2009 07:51:48
| 136
| 3
|
ebXml OpenSource java implementation
|
In our project we are looking for an OpenSource java implementation of the OASIS ebXml Registry 3.0 Specification (<a href="http://www.oasis-open.org/committees/regrep/">spec</a>).
It seems there is not a lot of OpenSource initiative for this standard, actually we only found <a href="http://ebxmlrr.sourceforge.net/">freebXml Registry</a> which is self-named Reference implementation of the specification.
The last release (3.1) is from 2007... and it does not seem to be a lot of activity in the different forums and bug tracking sections.
Do you guys know a little bit more about this particular project?
More generally do you know if there is another implementation available?
Thanks in advance for your help!
|
b2b
|
xml
|
open-source
|
registry
|
repository
| null |
open
|
ebXml OpenSource java implementation
===
In our project we are looking for an OpenSource java implementation of the OASIS ebXml Registry 3.0 Specification (<a href="http://www.oasis-open.org/committees/regrep/">spec</a>).
It seems there is not a lot of OpenSource initiative for this standard, actually we only found <a href="http://ebxmlrr.sourceforge.net/">freebXml Registry</a> which is self-named Reference implementation of the specification.
The last release (3.1) is from 2007... and it does not seem to be a lot of activity in the different forums and bug tracking sections.
Do you guys know a little bit more about this particular project?
More generally do you know if there is another implementation available?
Thanks in advance for your help!
| 0
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.