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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
11,370,300 | 07/06/2012 22:08:57 | 9,382 | 09/15/2008 18:36:29 | 12,949 | 229 | How to change the name of the document in Excel? | I have a Macro Enabled Template called TIP-PBI.xltm. When I create a document based on this template, Excel automatically names it TIP-PBI1. However, I want to give it a custom name.
I figured I could do that by modifying the .Title property of the Workbook. To that end, on startup the Workbook_Open event kicks off, and the following is executed:
Private Sub Workbook_Open()
Dim strPBI As String
strPBI = InputBox$("Enter PBI", "Enter PBI")
ThisWorkbook.Title = "TIP-PBI-" & strPBI
End Sub
However, this does nothing.
How can I change the Title of the document on startup?
| excel | vba | excel-vba | excel-2010 | null | null | open | How to change the name of the document in Excel?
===
I have a Macro Enabled Template called TIP-PBI.xltm. When I create a document based on this template, Excel automatically names it TIP-PBI1. However, I want to give it a custom name.
I figured I could do that by modifying the .Title property of the Workbook. To that end, on startup the Workbook_Open event kicks off, and the following is executed:
Private Sub Workbook_Open()
Dim strPBI As String
strPBI = InputBox$("Enter PBI", "Enter PBI")
ThisWorkbook.Title = "TIP-PBI-" & strPBI
End Sub
However, this does nothing.
How can I change the Title of the document on startup?
| 0 |
7,571,936 | 09/27/2011 15:45:41 | 452,432 | 09/20/2010 07:35:29 | 424 | 3 | Action specific JS Script just like view scripts | By default, every action has its specific view script like `index.phtml` for `index` action. However more to this, I also want to have js script specifics to actions as well. like `index.js` for `index` action.
I tried to use $this -> view -> headScript() -> prependScript('myjsfile.js');, but the script is added to top and not at the bottom as I was hoping for. I suppose a helper would do the trick. but i dont know how to create it. or there is a better solution of what i am hoping for. | zend-framework | null | null | null | null | null | open | Action specific JS Script just like view scripts
===
By default, every action has its specific view script like `index.phtml` for `index` action. However more to this, I also want to have js script specifics to actions as well. like `index.js` for `index` action.
I tried to use $this -> view -> headScript() -> prependScript('myjsfile.js');, but the script is added to top and not at the bottom as I was hoping for. I suppose a helper would do the trick. but i dont know how to create it. or there is a better solution of what i am hoping for. | 0 |
7,974,810 | 11/02/2011 01:18:56 | 1,023,702 | 11/01/2011 12:42:43 | 8 | 0 | MergeSort C program . This is compiling but not giving any output. Any help? | This is based on the algorithm given in the Cormen's book. pls help where i am wrong
#include<stdio.h>
#include<conio.h>
void mergesort(int a[],int,int);
void merge(int a[],int,int,int);
int main()
{
int i,num,a[50];
printf("Enter the number of elements : ");
scanf("%d",&num);
for(i=1;i<=num;i++)
{
printf("\n%d) ",i);
scanf("%d",&a[i]);
}
mergesort(a,1,num);
for(i=1;i<=num;i++)
{
printf("SoRTED ArrAy \n");
printf("\n%d) ",a[i]);
}
getch();
return 0;
}
void mergesort(int a[],int i, int k)
{
int j;
j=(i+k)/2;
while(i<k)
{
mergesort(a,i,j);
mergesort(a,j+1,k);
merge(a,i,j,k);
}
}
void merge(int a[],int p,int q,int r)
{
int i,j,k,n1,n2;
n1=q-p+1;
n2=r-q;
int l[n1],s[n2];
for(i=1;i<=n1;i++)
{
l[i]=a[p+i-1];
}
for(j=1;i<=n2;j++)
{
s[j]=a[q+j];
}
l[n1+1]=1000;
s[n2+1]=1000;
i=1;
j=1;
for(k=p;k<=r;k++)
{
if(l[k]<s[k])
{
a[k]=l[i];
i++;
}
else
{
a[k]=s[j];
j++;
}
}
}
| c | mergesort | null | null | null | null | open | MergeSort C program . This is compiling but not giving any output. Any help?
===
This is based on the algorithm given in the Cormen's book. pls help where i am wrong
#include<stdio.h>
#include<conio.h>
void mergesort(int a[],int,int);
void merge(int a[],int,int,int);
int main()
{
int i,num,a[50];
printf("Enter the number of elements : ");
scanf("%d",&num);
for(i=1;i<=num;i++)
{
printf("\n%d) ",i);
scanf("%d",&a[i]);
}
mergesort(a,1,num);
for(i=1;i<=num;i++)
{
printf("SoRTED ArrAy \n");
printf("\n%d) ",a[i]);
}
getch();
return 0;
}
void mergesort(int a[],int i, int k)
{
int j;
j=(i+k)/2;
while(i<k)
{
mergesort(a,i,j);
mergesort(a,j+1,k);
merge(a,i,j,k);
}
}
void merge(int a[],int p,int q,int r)
{
int i,j,k,n1,n2;
n1=q-p+1;
n2=r-q;
int l[n1],s[n2];
for(i=1;i<=n1;i++)
{
l[i]=a[p+i-1];
}
for(j=1;i<=n2;j++)
{
s[j]=a[q+j];
}
l[n1+1]=1000;
s[n2+1]=1000;
i=1;
j=1;
for(k=p;k<=r;k++)
{
if(l[k]<s[k])
{
a[k]=l[i];
i++;
}
else
{
a[k]=s[j];
j++;
}
}
}
| 0 |
10,128,641 | 04/12/2012 17:25:54 | 997,939 | 10/16/2011 15:23:38 | 158 | 3 | Cannot convert lamda expression | If I try:
List<Student> students = new List<Student>();
List<Group> Groups = new List<Group>();
Groups = students.Remove(f => f.StudentID.Equals(studentID));
I get an error on this line: `f => f.StudentID.Equals(studentID)`
I am having difficulty from my previous posts here http://stackoverflow.com/questions/10116685/linq-deleted-users-still-associated-with-groups and here http://stackoverflow.com/questions/10126645/delete-method-in-wcf
So I thought maybe I could delete the students contained within groups but I get an error Cannot convert lamda expression to type Student because it is not a delegate type. | c# | wcf | linq | web-services | null | null | open | Cannot convert lamda expression
===
If I try:
List<Student> students = new List<Student>();
List<Group> Groups = new List<Group>();
Groups = students.Remove(f => f.StudentID.Equals(studentID));
I get an error on this line: `f => f.StudentID.Equals(studentID)`
I am having difficulty from my previous posts here http://stackoverflow.com/questions/10116685/linq-deleted-users-still-associated-with-groups and here http://stackoverflow.com/questions/10126645/delete-method-in-wcf
So I thought maybe I could delete the students contained within groups but I get an error Cannot convert lamda expression to type Student because it is not a delegate type. | 0 |
11,174,321 | 06/24/2012 01:19:44 | 1,433,268 | 06/03/2012 07:21:15 | 47 | 3 | Solution Found: JPlayer Mp3 player not appearing but no errors in console | This started as a request for help but halfway through I found the issue but have decided to post this anyway so as to help anyone else out, as I spent ages trying to figure it out!
I had been trying to get a JQuery plugin JPlayer http://jplayer.org/ but it just doesnt work. I've copied everything from their JFiddle http://jsfiddle.net/jPlayer/Q4LMV/ and it all looks fine but no MP3 player appears.
The issue is the comments in the HTML:
<!-- you can comment out any of the following <div>s too -->
and
<!-- comment out any of the following <li>s to remove these buttons -->
The li and div tags are the issue. They render the --> end of the comment unreadable by the browser, thus all the code below them us commented out.
To fix, remove the comment lines all together. | javascript | jquery | mp3 | jplayer | solution | 06/24/2012 21:47:46 | not a real question | Solution Found: JPlayer Mp3 player not appearing but no errors in console
===
This started as a request for help but halfway through I found the issue but have decided to post this anyway so as to help anyone else out, as I spent ages trying to figure it out!
I had been trying to get a JQuery plugin JPlayer http://jplayer.org/ but it just doesnt work. I've copied everything from their JFiddle http://jsfiddle.net/jPlayer/Q4LMV/ and it all looks fine but no MP3 player appears.
The issue is the comments in the HTML:
<!-- you can comment out any of the following <div>s too -->
and
<!-- comment out any of the following <li>s to remove these buttons -->
The li and div tags are the issue. They render the --> end of the comment unreadable by the browser, thus all the code below them us commented out.
To fix, remove the comment lines all together. | 1 |
8,834,629 | 01/12/2012 11:51:36 | 1,072,791 | 11/30/2011 06:52:27 | 1 | 0 | PHP issue as I am not able to run it through terminal in background on fedora machine | Hello I am not able to run php file in background on fedora. However when I run the same file on terminal I am getting the output stored in a file. When I run the same php file using "&" at the end of the command to make the php run in background, I land up with the blank output file.
I need a solution for the above scenario.
Error :- "[4]+ Stopped php test.php > op.txt"
Thank you,
Gaurav. | php | fedora | null | null | null | null | open | PHP issue as I am not able to run it through terminal in background on fedora machine
===
Hello I am not able to run php file in background on fedora. However when I run the same file on terminal I am getting the output stored in a file. When I run the same php file using "&" at the end of the command to make the php run in background, I land up with the blank output file.
I need a solution for the above scenario.
Error :- "[4]+ Stopped php test.php > op.txt"
Thank you,
Gaurav. | 0 |
7,752,536 | 10/13/2011 10:09:44 | 439,693 | 09/04/2010 16:31:42 | 28 | 0 | How to structure my application for several tasks using redis with gevent or threading in Python | I have a process which sends financial tick data through redis pubsub in realtime. Now I want my Python Application to handle the input data (json) for instance calculations like moving average and so on. the results I want to be send back via redis to other tasks (doing further calculations based on the results of the 1st task). Further I want to trigger some tasks regularly once a day or each second. With this complex and unforseen structure issue I've stumbled upon solutions like gevent, Celery or just Threads.
But what I'm wondering is What are my options to do this the right way? How can I structure my redis pubsub by doing Worker/Task stuff the most efficient way? So, suggestions are welcome, in the lines of libraries (if you've used any of the mentioned please share your experiences), techniques (Python's structure Best Practice), how to make use of redis's pubsub to do the job the best way.
| python | multithreading | redis | celery | gevent | null | open | How to structure my application for several tasks using redis with gevent or threading in Python
===
I have a process which sends financial tick data through redis pubsub in realtime. Now I want my Python Application to handle the input data (json) for instance calculations like moving average and so on. the results I want to be send back via redis to other tasks (doing further calculations based on the results of the 1st task). Further I want to trigger some tasks regularly once a day or each second. With this complex and unforseen structure issue I've stumbled upon solutions like gevent, Celery or just Threads.
But what I'm wondering is What are my options to do this the right way? How can I structure my redis pubsub by doing Worker/Task stuff the most efficient way? So, suggestions are welcome, in the lines of libraries (if you've used any of the mentioned please share your experiences), techniques (Python's structure Best Practice), how to make use of redis's pubsub to do the job the best way.
| 0 |
7,249,294 | 08/30/2011 20:19:13 | 656,341 | 03/12/2011 05:43:35 | 73 | 4 | raw implementation of http upgrade in node.js not receiving header response | I am attempting to implement a WebSocket server in nodejs. I am ripping some concepts and logic out of the socket.io and node-websocket-server. My goal here is purely to understand how the underlying protocol is working.
My server is fairly straight forward. It accepts a socket connection when I use chrome to open a socket to the server however I am unable to have chrome receive the correct response headers. I've tried a variety of things including attempting to make sure that the socket is flushing the data and attempting to alter the encoding of the response in various ways, however nothing seems to change is behavior. I am not 100% sure that its actually pushing the response back even though I tested whether the write method returns true and added a call back which does run without a significant delay.
Here is the code for it, if anyone has any idea why it doesn't work I would be very interested to hear:
var http = require('http');
var net = require('net');
var crypto = require('crypto');
http_server = http.createServer()
.on('request', function (req, res) {
res.end('hello world');
})
.on('upgrade', function (req, socket, upgradeHead) {
headers = [
'HTTP/1.1 101 WebSocket Protocol Handshake',
'Upgrade: WebSocket',
'Connection: Upgrade',
'Sec-WebSocket-Origin: '+req.headers['origin'],
'Sec-WebSocket-Location: ws://'+req.headers['host']+req.url
];
socket.setNoDelay(true);
socket.write(headers.concat('','').join("\r\n"), function () { console.log('sent headers'); });
socket.setTimeout(0);
socket.setNoDelay(true);
socket.setEncoding('utf8');
hash = crypto.createHash('md5');
[req.headers['sec-websocket-key1'], req.headers['sec-websocket-key2']].forEach(function (k) {
var n = parseInt(k.replace(/[^\d]/g, '')),
s = k.replace(/[^\d]/g, '').length;
n /= s;
hash.update(String.fromCharCode(
n >> 24 & 0xFF,
n >> 16 & 0xFF,
n >> 8 & 0xFF,
n & 0xFF
));
});
hash.update(upgradeHead.toString('binary'));
socket.write(hash.digest('binary'), 'binary', function () { console.log("sent key"); });
})
.listen(8090); | sockets | node.js | null | null | null | null | open | raw implementation of http upgrade in node.js not receiving header response
===
I am attempting to implement a WebSocket server in nodejs. I am ripping some concepts and logic out of the socket.io and node-websocket-server. My goal here is purely to understand how the underlying protocol is working.
My server is fairly straight forward. It accepts a socket connection when I use chrome to open a socket to the server however I am unable to have chrome receive the correct response headers. I've tried a variety of things including attempting to make sure that the socket is flushing the data and attempting to alter the encoding of the response in various ways, however nothing seems to change is behavior. I am not 100% sure that its actually pushing the response back even though I tested whether the write method returns true and added a call back which does run without a significant delay.
Here is the code for it, if anyone has any idea why it doesn't work I would be very interested to hear:
var http = require('http');
var net = require('net');
var crypto = require('crypto');
http_server = http.createServer()
.on('request', function (req, res) {
res.end('hello world');
})
.on('upgrade', function (req, socket, upgradeHead) {
headers = [
'HTTP/1.1 101 WebSocket Protocol Handshake',
'Upgrade: WebSocket',
'Connection: Upgrade',
'Sec-WebSocket-Origin: '+req.headers['origin'],
'Sec-WebSocket-Location: ws://'+req.headers['host']+req.url
];
socket.setNoDelay(true);
socket.write(headers.concat('','').join("\r\n"), function () { console.log('sent headers'); });
socket.setTimeout(0);
socket.setNoDelay(true);
socket.setEncoding('utf8');
hash = crypto.createHash('md5');
[req.headers['sec-websocket-key1'], req.headers['sec-websocket-key2']].forEach(function (k) {
var n = parseInt(k.replace(/[^\d]/g, '')),
s = k.replace(/[^\d]/g, '').length;
n /= s;
hash.update(String.fromCharCode(
n >> 24 & 0xFF,
n >> 16 & 0xFF,
n >> 8 & 0xFF,
n & 0xFF
));
});
hash.update(upgradeHead.toString('binary'));
socket.write(hash.digest('binary'), 'binary', function () { console.log("sent key"); });
})
.listen(8090); | 0 |
3,605,665 | 08/31/2010 02:31:55 | 64,904 | 02/11/2009 04:06:51 | 4,412 | 279 | Alternative to fullcalendar? | [Fullcalendar][1] looks great. Do you know of any alternatives to it for comparisons?
Looking for
* Open source
* Ability to visually drag (change start time) and extend (change duration) of events.
[1]: http://arshaw.com/fullcalendar/ | calendar | fullcalendar | null | null | null | null | open | Alternative to fullcalendar?
===
[Fullcalendar][1] looks great. Do you know of any alternatives to it for comparisons?
Looking for
* Open source
* Ability to visually drag (change start time) and extend (change duration) of events.
[1]: http://arshaw.com/fullcalendar/ | 0 |
1,773,457 | 11/20/2009 21:49:46 | 44,547 | 12/09/2008 09:49:49 | 189 | 20 | Build status hardware | We have been using Teamcity for some time for the Continous Integration in the project. Now we want to have some kind of hardware in the room that shows everyone that a build was broken. I've seen mentions to lava lamps and rabbits that can do this, but couldn't see any examples for Teamcity.
Does anyone have a good suggestion on what to buy and how to integrate with Teamcity?
Thanks | teamcity | extreme-feedback-devices | null | null | null | null | open | Build status hardware
===
We have been using Teamcity for some time for the Continous Integration in the project. Now we want to have some kind of hardware in the room that shows everyone that a build was broken. I've seen mentions to lava lamps and rabbits that can do this, but couldn't see any examples for Teamcity.
Does anyone have a good suggestion on what to buy and how to integrate with Teamcity?
Thanks | 0 |
6,185,342 | 05/31/2011 09:09:39 | 378,767 | 06/29/2010 07:48:46 | 8 | 2 | coercing to Unicode: need string or buffer, tuple found | Trying to work with **ImageField** in django.
Here are my **models**
class Album(models.Model):
title = models.CharField(max_length=100)
def __unicode__(self):
return self.title
class Photo(models.Model):
image = models.ImageField(upload_to='/photos/')
album = models.ForeignKey(Album)
title = models.CharField(max_length=100, default="")
def __unicode__(self):
return self.title
Here is a part of **urls.py**
...
url(r'^trial/upload/$', 'trial.views.upload'),
...
**views.py**
def upload(request):
if request.method == 'POST':
form = PhotoForm(request.POST, request.FILES)
if form.is_valid():
title = form.cleaned_data['title']
image = request.FILES['image']
handleUploadedFile(image)
photo = Photo(image=image, title=title, album=form.cleaned_data['album'])
photo.save()
return render_to_response('trial/thanks_upload.html',{
'photo': photo
}, context_instance = RequestContext(request))
else:
form = PhotoForm()
return render_to_response('trial/upload.html', {
'form': form
}, context_instance = RequestContext(request))
def handleUploadedFile(file):
destination = open('%s'%(file.name), 'wb+')
for chunk in file.chunks():
destination.write(chunk)
destination.close()
return destination
**upload.html**
<form enctype="multipart/form-data" action="/trial/upload/" method="post">
{% csrf_token %}
{% for field in form %}
<div class="fieldWrapper">
{{ field.errors }}
{{ field.label_tag }}: {{ field }}
</div>
{% endfor %}
<p><input type="submit" value="Upload" /></p>
</form>
But on saving I have next error:
**TypeError at /trial/upload/
coercing to Unicode: need string or buffer, tuple found**
errors appears on **photo.save**
Does anybody has ideas why could it be? Why **tuple** appears at all? I'm sure there is a stupid bug... | django | image-uploading | image-field | null | null | null | open | coercing to Unicode: need string or buffer, tuple found
===
Trying to work with **ImageField** in django.
Here are my **models**
class Album(models.Model):
title = models.CharField(max_length=100)
def __unicode__(self):
return self.title
class Photo(models.Model):
image = models.ImageField(upload_to='/photos/')
album = models.ForeignKey(Album)
title = models.CharField(max_length=100, default="")
def __unicode__(self):
return self.title
Here is a part of **urls.py**
...
url(r'^trial/upload/$', 'trial.views.upload'),
...
**views.py**
def upload(request):
if request.method == 'POST':
form = PhotoForm(request.POST, request.FILES)
if form.is_valid():
title = form.cleaned_data['title']
image = request.FILES['image']
handleUploadedFile(image)
photo = Photo(image=image, title=title, album=form.cleaned_data['album'])
photo.save()
return render_to_response('trial/thanks_upload.html',{
'photo': photo
}, context_instance = RequestContext(request))
else:
form = PhotoForm()
return render_to_response('trial/upload.html', {
'form': form
}, context_instance = RequestContext(request))
def handleUploadedFile(file):
destination = open('%s'%(file.name), 'wb+')
for chunk in file.chunks():
destination.write(chunk)
destination.close()
return destination
**upload.html**
<form enctype="multipart/form-data" action="/trial/upload/" method="post">
{% csrf_token %}
{% for field in form %}
<div class="fieldWrapper">
{{ field.errors }}
{{ field.label_tag }}: {{ field }}
</div>
{% endfor %}
<p><input type="submit" value="Upload" /></p>
</form>
But on saving I have next error:
**TypeError at /trial/upload/
coercing to Unicode: need string or buffer, tuple found**
errors appears on **photo.save**
Does anybody has ideas why could it be? Why **tuple** appears at all? I'm sure there is a stupid bug... | 0 |
4,588,376 | 01/03/2011 21:07:06 | 162,167 | 08/24/2009 16:16:36 | 6,587 | 497 | CLR C++ VS C++ (pstsdk) | Considering Simon Mourier's answer to this question:<br>
[Processing Microsoft Office Outlook 2003/2007 email messages…][1]
I plan to use the [PST File Format SDK][2] which is written in C++.
I would take this opportunity to learn more about C++ and to renew with it, since it's been quite 15 years since the last time I used it. I have already downloaded and configured [Boost 1.45][3] which is required to work with `pstsdk`.
Now, I'm currently writing a Windows Forms application using CLR C++ and plan to use the `pstsdk` to read from PST files.
**Does it matter in any way that I'm using both CLR C++ and pure C++ altogether?**
**Shall I consider using it a different way, or is this okay?**
[1]: http://stackoverflow.com/questions/4395223/processing-microsoft-office-outlook-2003-2007-email-messages
[2]: http://pstsdk.codeplex.com/
[3]: http://file:///C:/Users/WILL/Downloads/Microsoft%20Office%20Outlook%20PST%20file%20SDK/boost_1_45_0/index.html | c++ | visual-studio-2010 | visual-c++ | clr | managed-c++ | null | open | CLR C++ VS C++ (pstsdk)
===
Considering Simon Mourier's answer to this question:<br>
[Processing Microsoft Office Outlook 2003/2007 email messages…][1]
I plan to use the [PST File Format SDK][2] which is written in C++.
I would take this opportunity to learn more about C++ and to renew with it, since it's been quite 15 years since the last time I used it. I have already downloaded and configured [Boost 1.45][3] which is required to work with `pstsdk`.
Now, I'm currently writing a Windows Forms application using CLR C++ and plan to use the `pstsdk` to read from PST files.
**Does it matter in any way that I'm using both CLR C++ and pure C++ altogether?**
**Shall I consider using it a different way, or is this okay?**
[1]: http://stackoverflow.com/questions/4395223/processing-microsoft-office-outlook-2003-2007-email-messages
[2]: http://pstsdk.codeplex.com/
[3]: http://file:///C:/Users/WILL/Downloads/Microsoft%20Office%20Outlook%20PST%20file%20SDK/boost_1_45_0/index.html | 0 |
7,396,798 | 09/13/2011 04:26:46 | 869,185 | 07/29/2011 10:34:44 | 94 | 21 | How to pass query string when using the debugger? | I cant pass the query string while using the
debugger or else i cant debug when there is a
query string.
please say how to use the both | flex | actionscript-3 | flex3 | null | null | 09/13/2011 10:31:25 | not a real question | How to pass query string when using the debugger?
===
I cant pass the query string while using the
debugger or else i cant debug when there is a
query string.
please say how to use the both | 1 |
6,295,717 | 06/09/2011 15:54:11 | 166,612 | 09/01/2009 13:21:28 | 351 | 9 | WPF and Custom Controls | I have an almost "political" question. Here it is:
How should a one man personal/free project get good controls when the suites all cost something like 2000$?!
I mean, there seem to be some nice free custom controls on codeplex such ass odyssey and wpf extended toolkit but when I look at viblend, dexexpress and telerik... How could I get such nice and powerful features for free?
They should all make a version for open source projects... I can't afford those, and without any of those my application looks so plain hehe.
Any suggestions, ideas, opinions?
Thanks! | c# | .net | wpf | wpf-controls | null | 06/09/2011 16:02:25 | not constructive | WPF and Custom Controls
===
I have an almost "political" question. Here it is:
How should a one man personal/free project get good controls when the suites all cost something like 2000$?!
I mean, there seem to be some nice free custom controls on codeplex such ass odyssey and wpf extended toolkit but when I look at viblend, dexexpress and telerik... How could I get such nice and powerful features for free?
They should all make a version for open source projects... I can't afford those, and without any of those my application looks so plain hehe.
Any suggestions, ideas, opinions?
Thanks! | 4 |
2,833,928 | 05/14/2010 12:03:13 | 6,258 | 09/13/2008 11:19:45 | 4,998 | 207 | How do I set buffer local variable from Eval: in .dir-local.el? | Why this works
((nil . ((compilation-directory . "/home/vava/code_directory/")
(compilation-command . "rake"))
))
and this doesn't?
((nil . ((Eval . (setq compilation-directory "/home/vava/code_directory"))
(compilation-command . "rake"))
))
What I'm doing wrong here?
I have set `enable-local-eval` in .emacs. | emacs | emacs23 | elisp | null | null | null | open | How do I set buffer local variable from Eval: in .dir-local.el?
===
Why this works
((nil . ((compilation-directory . "/home/vava/code_directory/")
(compilation-command . "rake"))
))
and this doesn't?
((nil . ((Eval . (setq compilation-directory "/home/vava/code_directory"))
(compilation-command . "rake"))
))
What I'm doing wrong here?
I have set `enable-local-eval` in .emacs. | 0 |
8,702,197 | 01/02/2012 14:50:30 | 282,076 | 02/26/2010 14:11:15 | 3 | 0 | Best way to make iPhone app catalogue? | I am looking for some advice with making a iPhone app that is like a catalogue. It will display information from a company.
What would be the best way of doing this? With a combination of tab and toolbars? Also I will be integrating XML into it so product descriptions can be changed on the fly.
Just looking for some advice to get me started.
Thank you, | iphone | xml | application | null | null | 01/02/2012 16:43:36 | not a real question | Best way to make iPhone app catalogue?
===
I am looking for some advice with making a iPhone app that is like a catalogue. It will display information from a company.
What would be the best way of doing this? With a combination of tab and toolbars? Also I will be integrating XML into it so product descriptions can be changed on the fly.
Just looking for some advice to get me started.
Thank you, | 1 |
2,332,357 | 02/25/2010 07:27:52 | 277,703 | 02/20/2010 15:53:54 | 1 | 0 | Recommend C# books besides Head First C# & Illustrated C# 2008 for beginner | I had searched related "book-recommend" threads before I post mine cause I didn't find what I'm looking for...
I'm a newbie with a bit of PHP experience, currently I'm trying to learn C#. I brought two books from the shop Head First C# & Illustrated C# 2008, I have this thing for learning stuff visually, that's why these two books are on the top of my list.
But it turns out they're not as good as I thought, please please dont get mad if you're fan of these books, let me allow me to explain why at the end.
Here's few key things I'm looking for in the book:
**- provides practical exercises at end of each chapter.
- kinda 5W1H style, What/Why/When/Where/Which/How (if it's possible)
- gives a target project, build on bit by bit at each chapter (if it's possible)**
And here's my problem with these two books:
Illustrated C# 2008, excellent reference book, nice and clean, I really wanna to love it but it tells you all about the trees, but very little about the forest, and another problem I have is that for example, delegate is the concept I really dont understand, why would I use a delegate? Or when would I use a struct instead of a class? That being said, I still think this book is one of the best C# books out there, and for sure I'm gonna re-visit it later on.
HFC, before I got HFC, I've read Head First Programming...using Python, which is really good, I had such a great time with it, but HFC kinda let me down, maybe C# is too complex, too big for this kinda style? The pages are so cluttered with doodles and pictures and snippets of text and faux-handwriting and arrows that it's just plain hard to follow the conceptual thread of the instruction. | c# | books | null | null | null | 09/17/2011 22:32:50 | not constructive | Recommend C# books besides Head First C# & Illustrated C# 2008 for beginner
===
I had searched related "book-recommend" threads before I post mine cause I didn't find what I'm looking for...
I'm a newbie with a bit of PHP experience, currently I'm trying to learn C#. I brought two books from the shop Head First C# & Illustrated C# 2008, I have this thing for learning stuff visually, that's why these two books are on the top of my list.
But it turns out they're not as good as I thought, please please dont get mad if you're fan of these books, let me allow me to explain why at the end.
Here's few key things I'm looking for in the book:
**- provides practical exercises at end of each chapter.
- kinda 5W1H style, What/Why/When/Where/Which/How (if it's possible)
- gives a target project, build on bit by bit at each chapter (if it's possible)**
And here's my problem with these two books:
Illustrated C# 2008, excellent reference book, nice and clean, I really wanna to love it but it tells you all about the trees, but very little about the forest, and another problem I have is that for example, delegate is the concept I really dont understand, why would I use a delegate? Or when would I use a struct instead of a class? That being said, I still think this book is one of the best C# books out there, and for sure I'm gonna re-visit it later on.
HFC, before I got HFC, I've read Head First Programming...using Python, which is really good, I had such a great time with it, but HFC kinda let me down, maybe C# is too complex, too big for this kinda style? The pages are so cluttered with doodles and pictures and snippets of text and faux-handwriting and arrows that it's just plain hard to follow the conceptual thread of the instruction. | 4 |
9,724,228 | 03/15/2012 16:43:26 | 316,700 | 04/14/2010 16:13:31 | 970 | 30 | CSS selectors denormalized | There is a written (several times) rule that sais that **an _#id_ selector identifies an unique element into a DOM tree**.
This is always followed by the conclusion that **only one alone element with this _#id_ can exist into the DOM tree**.
So if you need to use a CSS selector for a kind of element that has another occurrences into the DOM tree you have to use a _.class_ selector.
Well, I have serios doubts about this constriction also I think is not responding to a real need and avoiding a more intuitive use of the _#id_ and _.class_ selectors.
The question:
Existing the [chain selectors](http://www.w3.org/TR/CSS2/selector.html#descendant-selectors) like _'#id1 #id2'_ I could understand that _#id2_ better to be unique into the _#id1_ context, but **which is the meaning of forcing that _#id2_ should be unique into the whole DOM context?**
This rule is just fueling a degenerative hell of _id_ nonsense-naming. Also forcing us to over use the _class_ attribute.
I feel more confortable avoiding this rule and building structures like this, _(please understand that the code is simplified and not using concrete HTML structures in propose)_:
<div id="armys" class="list">
<div id="1" class="element">
<div id="orders" class="text">My orders</div>
<div id="soldiers" class="list">
<div id="1" class="element">
<div id="name" class="text">John</div>
</div>
<div id="2" class="element">
<div id="name" class="text">Esther</div>
</div>
</div>
<div>
<div id="2" class="element">
<div id="orders" class="text">My orders</div>
<div id="soldiers" class="list">
<div id="3" class="element">
<div id="name" class="text">Smith</div>
</div>
</div>
<div>
</div>
Which is a very much natural translation of an structure like this:
armys: [
{
id: 1,
orders: "My orders",
soldiers: [
{
id: 1,
name: "John"
},
{
id: 2,
name: "Esther"
}
]
},
{
id: 2,
orders: "My orders",
soldiers: [
{
id: 3,
name: "Smith"
}
]
}
] | html | css-selectors | null | null | null | 03/15/2012 19:37:38 | not a real question | CSS selectors denormalized
===
There is a written (several times) rule that sais that **an _#id_ selector identifies an unique element into a DOM tree**.
This is always followed by the conclusion that **only one alone element with this _#id_ can exist into the DOM tree**.
So if you need to use a CSS selector for a kind of element that has another occurrences into the DOM tree you have to use a _.class_ selector.
Well, I have serios doubts about this constriction also I think is not responding to a real need and avoiding a more intuitive use of the _#id_ and _.class_ selectors.
The question:
Existing the [chain selectors](http://www.w3.org/TR/CSS2/selector.html#descendant-selectors) like _'#id1 #id2'_ I could understand that _#id2_ better to be unique into the _#id1_ context, but **which is the meaning of forcing that _#id2_ should be unique into the whole DOM context?**
This rule is just fueling a degenerative hell of _id_ nonsense-naming. Also forcing us to over use the _class_ attribute.
I feel more confortable avoiding this rule and building structures like this, _(please understand that the code is simplified and not using concrete HTML structures in propose)_:
<div id="armys" class="list">
<div id="1" class="element">
<div id="orders" class="text">My orders</div>
<div id="soldiers" class="list">
<div id="1" class="element">
<div id="name" class="text">John</div>
</div>
<div id="2" class="element">
<div id="name" class="text">Esther</div>
</div>
</div>
<div>
<div id="2" class="element">
<div id="orders" class="text">My orders</div>
<div id="soldiers" class="list">
<div id="3" class="element">
<div id="name" class="text">Smith</div>
</div>
</div>
<div>
</div>
Which is a very much natural translation of an structure like this:
armys: [
{
id: 1,
orders: "My orders",
soldiers: [
{
id: 1,
name: "John"
},
{
id: 2,
name: "Esther"
}
]
},
{
id: 2,
orders: "My orders",
soldiers: [
{
id: 3,
name: "Smith"
}
]
}
] | 1 |
2,953,280 | 06/01/2010 20:57:51 | 248,237 | 01/11/2010 17:06:25 | 326 | 1 | taking intersection of N-many lists in python | what's the easiest way to take the intersection of N-many lists in python?
if I have two lists a and b, I know I can do:
a = set(a)
b = set(b)
intersect = a.intersection(b)
but I want to do something like a & b & c & d & ... for an arbitrary set of lists (ideally without converting to a set first, but if that's the easiest / most efficient way, I can deal with that.)
I.e. I want to write a function intersect(*args) that will do it for arbitrarily many sets efficiently. What's the easiest way to do that?
EDIT: My own solution is reduce(set.intersection, [a,b,c]) -- is that good?
thanks. | python | list | numpy | scipy | null | null | open | taking intersection of N-many lists in python
===
what's the easiest way to take the intersection of N-many lists in python?
if I have two lists a and b, I know I can do:
a = set(a)
b = set(b)
intersect = a.intersection(b)
but I want to do something like a & b & c & d & ... for an arbitrary set of lists (ideally without converting to a set first, but if that's the easiest / most efficient way, I can deal with that.)
I.e. I want to write a function intersect(*args) that will do it for arbitrarily many sets efficiently. What's the easiest way to do that?
EDIT: My own solution is reduce(set.intersection, [a,b,c]) -- is that good?
thanks. | 0 |
6,395,646 | 06/18/2011 11:26:37 | 329,104 | 04/29/2010 16:30:47 | 68 | 6 | my mail is being sent to Google's spam folder | I've just set up my webserver, rails app, with postfix, and dovecot. When I'm testing the mailer it works fine, but Gmail is automatically putting my sent mail into it's spam folder.
I checked the Spamhaus list for my IP address and nothing, I checked the mail log, and there is nothing surprising there ...
can anyone offer me guidance for what else I should be looking for?
Thanks! | ruby-on-rails | email | postfix | null | null | null | open | my mail is being sent to Google's spam folder
===
I've just set up my webserver, rails app, with postfix, and dovecot. When I'm testing the mailer it works fine, but Gmail is automatically putting my sent mail into it's spam folder.
I checked the Spamhaus list for my IP address and nothing, I checked the mail log, and there is nothing surprising there ...
can anyone offer me guidance for what else I should be looking for?
Thanks! | 0 |
5,463,968 | 03/28/2011 19:24:51 | 491,031 | 10/29/2010 08:17:05 | 1 | 1 | How to make a while to run until scanner get input? | I'm trying to write a loop which runs until I type a specific text in console where the application is running. Something like:
while (true) {
try {
System.out.println("Waiting for input...");
Thread.currentThread();
Thread.sleep(2000);
if (input_is_equal_to_STOP){ // if user type STOP in terminal
break;
}
} catch (InterruptedException ie) {
// If this thread was intrrupted by nother thread
}}
And I want it to write a line each time it pass through so I do not want it to stop within the while and wait for next input. Do I need to use multiple threads for this? | java | java-util-scanner | null | null | null | null | open | How to make a while to run until scanner get input?
===
I'm trying to write a loop which runs until I type a specific text in console where the application is running. Something like:
while (true) {
try {
System.out.println("Waiting for input...");
Thread.currentThread();
Thread.sleep(2000);
if (input_is_equal_to_STOP){ // if user type STOP in terminal
break;
}
} catch (InterruptedException ie) {
// If this thread was intrrupted by nother thread
}}
And I want it to write a line each time it pass through so I do not want it to stop within the while and wait for next input. Do I need to use multiple threads for this? | 0 |
3,397,778 | 08/03/2010 14:58:07 | 391,647 | 04/12/2010 12:25:26 | 1 | 0 | How can i change the __cmp__ function of an instance (not in class)? | How can i change the \_\_cmp\_\_ function of an instance (not in class)?
Ex:
class foo:
def __init__(self, num):
self.num = num
def cmp(self, other):
return self.num - other.num
# Change __cmp__ function in class works
foo.__cmp__ = cmp
a = foo(1)
b = foo(1)
# returns True
a == b
# Change __cmp__ function in instance that way doesnt work
def cmp2(self, other):
return -1
a.__cmp__ = cmp2
b.__cmp__ = cmp2
# Raise error
a == b
#Traceback (most recent call last):
# File "<stdin>", line 1, in <module>
#TypeError: cmp2() takes exactly 2 arguments (1 given)
| python | metaprogramming | cmp | null | null | null | open | How can i change the __cmp__ function of an instance (not in class)?
===
How can i change the \_\_cmp\_\_ function of an instance (not in class)?
Ex:
class foo:
def __init__(self, num):
self.num = num
def cmp(self, other):
return self.num - other.num
# Change __cmp__ function in class works
foo.__cmp__ = cmp
a = foo(1)
b = foo(1)
# returns True
a == b
# Change __cmp__ function in instance that way doesnt work
def cmp2(self, other):
return -1
a.__cmp__ = cmp2
b.__cmp__ = cmp2
# Raise error
a == b
#Traceback (most recent call last):
# File "<stdin>", line 1, in <module>
#TypeError: cmp2() takes exactly 2 arguments (1 given)
| 0 |
440,052 | 01/13/2009 17:56:21 | 16,883 | 09/17/2008 21:54:55 | 2,550 | 116 | Should identifiers and comments be always in English or in the native language of the application and developers | Given a programming language (such as Java) that allows you to use non-ASCII identifiers (class, method, variable names), and an application written for non-English users, by developers who speak English only as a foreign language at varying levels of proficiency, should you:
- Make using English mandatory for comments and identifiers?
- Use the native language of users and developers wherever possible?
- Have a comprehensive set of rules for where to use which language?
- Mix the two in whatever way feels appropriate?
Things to keep in mind:
- Identifiers in API libraries are most likely in English, and a lot of your code will be API library calls (keywords too, of course)
- Identifiers may represent domain concepts from the native-language spec for which there are no generally-agreed English translations
- Developers may not speak English well enough to write correctly and concisely in it
- New developers may not have the same native language as everyone else and may understand English better
- It may be harder to get support from vendors and/or communities like SO when the code you need help with is not in English
- ...More points? | nlp | identifiers | comments | internationalization | null | 05/28/2011 13:45:58 | off topic | Should identifiers and comments be always in English or in the native language of the application and developers
===
Given a programming language (such as Java) that allows you to use non-ASCII identifiers (class, method, variable names), and an application written for non-English users, by developers who speak English only as a foreign language at varying levels of proficiency, should you:
- Make using English mandatory for comments and identifiers?
- Use the native language of users and developers wherever possible?
- Have a comprehensive set of rules for where to use which language?
- Mix the two in whatever way feels appropriate?
Things to keep in mind:
- Identifiers in API libraries are most likely in English, and a lot of your code will be API library calls (keywords too, of course)
- Identifiers may represent domain concepts from the native-language spec for which there are no generally-agreed English translations
- Developers may not speak English well enough to write correctly and concisely in it
- New developers may not have the same native language as everyone else and may understand English better
- It may be harder to get support from vendors and/or communities like SO when the code you need help with is not in English
- ...More points? | 2 |
10,152,639 | 04/14/2012 09:49:35 | 993,526 | 10/13/2011 13:11:29 | 9 | 2 | iOS how load a viewController in a tab Bar Controller | i have a tabbarController application that has 4 tab bar item ,i need in first item to open a viewController only here.
I don't know how make it
Thank's for any suggest | ios | uitabbarcontroller | null | null | null | 04/14/2012 19:32:59 | not a real question | iOS how load a viewController in a tab Bar Controller
===
i have a tabbarController application that has 4 tab bar item ,i need in first item to open a viewController only here.
I don't know how make it
Thank's for any suggest | 1 |
8,622,304 | 12/24/2011 02:31:00 | 1,114,210 | 12/24/2011 02:27:14 | 1 | 0 | Turn matrix of decimal numbers into matrix of whole integers | I need a general algorithm to turn a vector of non-repeating decimal numbers into whole integers. For instance:
v1 = 3.3837475943, 89.391713934747847847, 23.282781272732734, 32.838723
Now what operations would I need to do to turn that vector/matrix uniformly into whole integers like:
v2 = 22828, 3838, 281, 3999
I've tried a bunch of things, but nothing seems to work all the time. Also, v1 and v2 are simply examples to demonstrate what I meant by "non-repeating decimal vector" and "whole integer vector" respectively. | algorithm | math | vector | matrix | linear-algebra | 12/24/2011 15:09:17 | not a real question | Turn matrix of decimal numbers into matrix of whole integers
===
I need a general algorithm to turn a vector of non-repeating decimal numbers into whole integers. For instance:
v1 = 3.3837475943, 89.391713934747847847, 23.282781272732734, 32.838723
Now what operations would I need to do to turn that vector/matrix uniformly into whole integers like:
v2 = 22828, 3838, 281, 3999
I've tried a bunch of things, but nothing seems to work all the time. Also, v1 and v2 are simply examples to demonstrate what I meant by "non-repeating decimal vector" and "whole integer vector" respectively. | 1 |
10,323,289 | 04/25/2012 20:31:54 | 1,246,142 | 03/02/2012 23:00:57 | 33 | 0 | Launch Eclipse Program Exported From File | I already read many questions it the same subject, but none solved my problem..
I know that I can easly launch my app using this command on console java -jar myappname.jar
But what I want is to click on my .jar file exported by eclipse and it launches console with my app inside, do u understand?
I done the export using this configs :
File>Export>Jar File
Selected all the classes of my project
Selected "Export generated class files and resources"
Selected "Export java source files and resources"
Selected "Compress the contents of the Jar File"
Pressed Next
Selected "Export class files with compile errors"
Selected "Export class files with compile warnings"
Pressed Next
Selected "Generate the manifest file"
Selected Seal the Jar
And on "Select the class of the Application entry point:"
I choose my class where is the void main method .
the jar appears on my desktop, but then, when I double click it doesnt launch the console. why??
Thanks in advance!! | java | console | manifest | launch | null | null | open | Launch Eclipse Program Exported From File
===
I already read many questions it the same subject, but none solved my problem..
I know that I can easly launch my app using this command on console java -jar myappname.jar
But what I want is to click on my .jar file exported by eclipse and it launches console with my app inside, do u understand?
I done the export using this configs :
File>Export>Jar File
Selected all the classes of my project
Selected "Export generated class files and resources"
Selected "Export java source files and resources"
Selected "Compress the contents of the Jar File"
Pressed Next
Selected "Export class files with compile errors"
Selected "Export class files with compile warnings"
Pressed Next
Selected "Generate the manifest file"
Selected Seal the Jar
And on "Select the class of the Application entry point:"
I choose my class where is the void main method .
the jar appears on my desktop, but then, when I double click it doesnt launch the console. why??
Thanks in advance!! | 0 |
443,398 | 01/14/2009 15:38:34 | 9,467 | 09/15/2008 18:54:34 | 318 | 9 | Delphi Printing Techniques | Where can I find a good resource for adding print capabilities to my program?
I found this page: http://efg2.com/Lab/Library/Delphi/Printing/index.html but it hasn't been updated in 5 years, and I'd like to know if, with Delphi 2009, StretchDIBits is still preferred to StretchDrawMap, how to best support pagination, preview, etc.
To date, I've cheated by creating html or pdf documents than printing those, but it is a bit onerous to go this far for all print tasks. | delphi | delphi-2009 | printing | null | null | 06/19/2012 11:56:33 | not constructive | Delphi Printing Techniques
===
Where can I find a good resource for adding print capabilities to my program?
I found this page: http://efg2.com/Lab/Library/Delphi/Printing/index.html but it hasn't been updated in 5 years, and I'd like to know if, with Delphi 2009, StretchDIBits is still preferred to StretchDrawMap, how to best support pagination, preview, etc.
To date, I've cheated by creating html or pdf documents than printing those, but it is a bit onerous to go this far for all print tasks. | 4 |
11,044,699 | 06/15/2012 04:43:51 | 1,456,898 | 06/14/2012 17:25:50 | 1 | 0 | java(How to create a text file and insert the student details and perform update and delete operation from that textfile) | This site has been used for everyone.... i hope it could me tooo..... i m learning java... how to create a text file and insert the students details and to perform update and delete from that text file..........
thanks in advance...!
i ve done some coding.... it ll create and insert values into a notepad.... but how could i update and delete the record from that inserted notepad data.... guys im so dying..... please help....... HAppy CoDinG......!!! Thanks in advance dears..............!!!
| x87 | null | null | null | null | 06/15/2012 08:08:33 | not a real question | java(How to create a text file and insert the student details and perform update and delete operation from that textfile)
===
This site has been used for everyone.... i hope it could me tooo..... i m learning java... how to create a text file and insert the students details and to perform update and delete from that text file..........
thanks in advance...!
i ve done some coding.... it ll create and insert values into a notepad.... but how could i update and delete the record from that inserted notepad data.... guys im so dying..... please help....... HAppy CoDinG......!!! Thanks in advance dears..............!!!
| 1 |
9,501,634 | 02/29/2012 15:13:34 | 450,602 | 09/17/2010 12:53:58 | 590 | 3 | jtable - how to set add between columns | Is there a way to add a gap between JTable columns or Rows?
(without using a cell renderer)
BTW: This quesstion was almost impossible to post. I was wondering getting a lot of the following message "Your question does not meet our quality standards."
without any explanation. I think it because the last two lines might be to short so I add this paragraph. An answer to this question would be nice two.
Thanks. | swing | null | null | null | null | null | open | jtable - how to set add between columns
===
Is there a way to add a gap between JTable columns or Rows?
(without using a cell renderer)
BTW: This quesstion was almost impossible to post. I was wondering getting a lot of the following message "Your question does not meet our quality standards."
without any explanation. I think it because the last two lines might be to short so I add this paragraph. An answer to this question would be nice two.
Thanks. | 0 |
184,414 | 10/08/2008 19:17:03 | 1,765 | 08/18/2008 13:26:48 | 311 | 29 | Execute action for automatically unchecked button in Delphi | I have one action I want to perform when a TSpeedButton is pressed and another I want to perform when the same button is "unpressed". I know there's no onunpress event, but is there any easy way for me to get an action to execute when a different button is pressed?
procedure ActionName.ActionNameExecute(Sender: TObject);
begin
PreviousActionName.execute(Sender);
//
end;
Seems to clunky. | delphi | taction | button | null | null | null | open | Execute action for automatically unchecked button in Delphi
===
I have one action I want to perform when a TSpeedButton is pressed and another I want to perform when the same button is "unpressed". I know there's no onunpress event, but is there any easy way for me to get an action to execute when a different button is pressed?
procedure ActionName.ActionNameExecute(Sender: TObject);
begin
PreviousActionName.execute(Sender);
//
end;
Seems to clunky. | 0 |
1,884,178 | 12/10/2009 21:31:04 | 229,167 | 12/10/2009 21:31:04 | 1 | 0 | sharepoint search server not installed on wss 3.0 box how do i add it? | I have wss 3.0 set up and in use, but the search is not working. most of the troubleshooting starts with "open central administration, click Operations then Services On Server, then start and stop WSS Search Server".. but there is no search server listed.. only services are central admin, help search, incoming email, and web app.
any ideas?
thanks!! | sharepoint | wss-3.0 | null | null | null | 09/22/2010 13:34:36 | off topic | sharepoint search server not installed on wss 3.0 box how do i add it?
===
I have wss 3.0 set up and in use, but the search is not working. most of the troubleshooting starts with "open central administration, click Operations then Services On Server, then start and stop WSS Search Server".. but there is no search server listed.. only services are central admin, help search, incoming email, and web app.
any ideas?
thanks!! | 2 |
4,687,636 | 01/14/2011 03:10:37 | 129,195 | 06/26/2009 04:27:31 | 7,306 | 581 | Upgrading to MVC 3 | I know this is a little subjective but are you planning on upgrading to MVC 3 in the very near future and why?
I can see there are some handy new features but at this point I'm wondering whether to use MVC 3 for a new project or stick with 2.
At present I don't see a compelling reason to move to 3. | asp.net-mvc | null | null | null | null | 01/15/2011 04:42:49 | not constructive | Upgrading to MVC 3
===
I know this is a little subjective but are you planning on upgrading to MVC 3 in the very near future and why?
I can see there are some handy new features but at this point I'm wondering whether to use MVC 3 for a new project or stick with 2.
At present I don't see a compelling reason to move to 3. | 4 |
9,108,505 | 02/02/2012 07:20:59 | 1,184,446 | 02/02/2012 06:41:38 | 1 | 0 | How to inject vars into the dict used for template by a decorator in TurboGears2? | When a method is exposed, it can return a dict used by a template :
class RootController(TGController):
@expose('myapp.templates.index')
def index(self):
self.mykey = "foo"
self.mymenu = ["item1", "item2", "item3"]
self.selected = "item1"
return dict( mykey=self.mykey, mymenu=self.mymenu, selected=self.selected)
This code works fine. Now I would like to encapsulate the menu boiler plate into a decorator like this :
class RootController(TGController):
@expose('myapp.templates.index')
@menu()
def index(self):
self.mykey = "foo"
self.mymenu = ["item1", "item2", "item3"]
self.selected = "item1"
return dict( mykey=self.mykey)
But I don't know how to write this menu decorator. If I use :
def before_render_cb(remainder, params, output):
return output.update( dict(mymenu=["item1", "item2", "item3"], selected="item1"))
class RootController(TGController):
@expose('myapp.templates.index')
@before_render(before_render_cb)
def index(self):
self.mykey = "foo"
self.mymenu = ["item1", "item2", "item3"]
self.selected = "item1"
return dict( mykey=self.mykey)
It will add mymenu and selected into the dict but I don't have access to the instance attribute of the controller (self.mymenu and self.selected)
If I use a decorator :
class menus(object):
def __call__(self, func):
deco = Decoration.get_decoration(func)
return func
I can have access to the decoration but not to the expose object neither to the controller
How can I do ?
Thanks in advance for your help
Laurent | menu | controller | decorator | turbogears2 | null | null | open | How to inject vars into the dict used for template by a decorator in TurboGears2?
===
When a method is exposed, it can return a dict used by a template :
class RootController(TGController):
@expose('myapp.templates.index')
def index(self):
self.mykey = "foo"
self.mymenu = ["item1", "item2", "item3"]
self.selected = "item1"
return dict( mykey=self.mykey, mymenu=self.mymenu, selected=self.selected)
This code works fine. Now I would like to encapsulate the menu boiler plate into a decorator like this :
class RootController(TGController):
@expose('myapp.templates.index')
@menu()
def index(self):
self.mykey = "foo"
self.mymenu = ["item1", "item2", "item3"]
self.selected = "item1"
return dict( mykey=self.mykey)
But I don't know how to write this menu decorator. If I use :
def before_render_cb(remainder, params, output):
return output.update( dict(mymenu=["item1", "item2", "item3"], selected="item1"))
class RootController(TGController):
@expose('myapp.templates.index')
@before_render(before_render_cb)
def index(self):
self.mykey = "foo"
self.mymenu = ["item1", "item2", "item3"]
self.selected = "item1"
return dict( mykey=self.mykey)
It will add mymenu and selected into the dict but I don't have access to the instance attribute of the controller (self.mymenu and self.selected)
If I use a decorator :
class menus(object):
def __call__(self, func):
deco = Decoration.get_decoration(func)
return func
I can have access to the decoration but not to the expose object neither to the controller
How can I do ?
Thanks in advance for your help
Laurent | 0 |
8,408,857 | 12/07/2011 00:25:12 | 390,227 | 07/01/2010 10:00:29 | 189 | 1 | Good practice when accessing a field in a class | When you have to access a "member variable"/field in a class, is it good practice to access it directly or call the getter and setter? and why? | java | software-design | null | null | null | 12/07/2011 01:44:16 | off topic | Good practice when accessing a field in a class
===
When you have to access a "member variable"/field in a class, is it good practice to access it directly or call the getter and setter? and why? | 2 |
10,219,278 | 04/18/2012 22:55:47 | 1,157,575 | 01/19/2012 02:44:31 | 48 | 0 | PHP Show error messages in order and re-display correct fields | I have an email form that checks three fields, name, valid email and comments. But the way it's set up now, since name and comments are in one function it first checks name and comments even if email is not valid, how can I re-write it so it checks the fields in order. Also, I would like to re-display the fields that have no errors, so the user doesn't have to type again. Please help. Thanks
<?php
$myemail = "comments@myemail.com";
$yourname = check_input($_POST['yourname'], "Enter your name!");
$email = check_input($_POST['email']);
$phone = check_input($_POST['phone']);
$subject = check_input($_POST['subject']);
$comments = check_input($_POST['comments'], "Write your comments!");
if (!preg_match("/([\w\-]+\@[\w\-]+\.[\w\-]+)/", $email))
{
show_error("Enter a valid E-mail address!");
}
exit();
function check_input($data, $problem='')
{
$data = trim($data);
$data = stripslashes($data);
$data = htmlspecialchars($data);
if ($problem && strlen($data) == 0)
{
show_error($problem);
}
return $data;
}
function show_error($myError)
{
?>
<!doctype html>
<html>
<body>
<form action="myform.php" method="post">
<p style="color: red;"><b>Please correct the following error:</b><br />
<?php echo $myError; ?></p>
<p>Name: <input type="text" name="yourname" /></P>
<P>Email: <input type="text" name="email" /></p>
<P>Phone: <input type="text" name="phone" /></p><br />
<P>Subject: <input type="text" style="width:75%;" name="subject" /></p>
<p>Comments:<br />
<textarea name="comments" rows="10" cols="50" style="width: 100%;"></textarea></p>
<p><input type="submit" value="Submit"></p>
</form>
</body>
</html>
<?php
exit();
}
?> | php | forms | null | null | null | null | open | PHP Show error messages in order and re-display correct fields
===
I have an email form that checks three fields, name, valid email and comments. But the way it's set up now, since name and comments are in one function it first checks name and comments even if email is not valid, how can I re-write it so it checks the fields in order. Also, I would like to re-display the fields that have no errors, so the user doesn't have to type again. Please help. Thanks
<?php
$myemail = "comments@myemail.com";
$yourname = check_input($_POST['yourname'], "Enter your name!");
$email = check_input($_POST['email']);
$phone = check_input($_POST['phone']);
$subject = check_input($_POST['subject']);
$comments = check_input($_POST['comments'], "Write your comments!");
if (!preg_match("/([\w\-]+\@[\w\-]+\.[\w\-]+)/", $email))
{
show_error("Enter a valid E-mail address!");
}
exit();
function check_input($data, $problem='')
{
$data = trim($data);
$data = stripslashes($data);
$data = htmlspecialchars($data);
if ($problem && strlen($data) == 0)
{
show_error($problem);
}
return $data;
}
function show_error($myError)
{
?>
<!doctype html>
<html>
<body>
<form action="myform.php" method="post">
<p style="color: red;"><b>Please correct the following error:</b><br />
<?php echo $myError; ?></p>
<p>Name: <input type="text" name="yourname" /></P>
<P>Email: <input type="text" name="email" /></p>
<P>Phone: <input type="text" name="phone" /></p><br />
<P>Subject: <input type="text" style="width:75%;" name="subject" /></p>
<p>Comments:<br />
<textarea name="comments" rows="10" cols="50" style="width: 100%;"></textarea></p>
<p><input type="submit" value="Submit"></p>
</form>
</body>
</html>
<?php
exit();
}
?> | 0 |
9,912,150 | 03/28/2012 16:49:36 | 1,004,278 | 10/20/2011 00:53:10 | 640 | 6 | How do you pull JavaScript code into an external script file? | I have my core web-app code in the header right now in a <script> tag but I want to move it to a separate file. When I do that an link it everything stops working. Basically the code first adds a listener onDeviceReady and from then on there are button click listeners, as well as acceleration event methods (this is a phonegap app).
I don't know what I am doing wrong?
This is the code the way I have it now:
<script type="text/javascript" charset="utf-8" src="phonegap.js"></script>
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
<script type="text/javascript" charset="utf-8" src="js/jquery.flot.js"></script>
<script type="text/javvscript" charset="utf-8" src="js/main.js"></script>
<script type="text/javascript" charset="utf-8">
// Wait for PhoneGap to load
//
document.addEventListener("deviceready", onDeviceReady, false);
// PhoneGap is ready
//
function onDeviceReady() {
var startButton = document.getElementById("start");
startButton.addEventListener("click", startWatch, false);
var stopButton = document.getElementById("stop");
stopButton.addEventListener("click", stopWatch, false);
}
</script> | javascript | null | null | null | null | 03/28/2012 17:27:50 | too localized | How do you pull JavaScript code into an external script file?
===
I have my core web-app code in the header right now in a <script> tag but I want to move it to a separate file. When I do that an link it everything stops working. Basically the code first adds a listener onDeviceReady and from then on there are button click listeners, as well as acceleration event methods (this is a phonegap app).
I don't know what I am doing wrong?
This is the code the way I have it now:
<script type="text/javascript" charset="utf-8" src="phonegap.js"></script>
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
<script type="text/javascript" charset="utf-8" src="js/jquery.flot.js"></script>
<script type="text/javvscript" charset="utf-8" src="js/main.js"></script>
<script type="text/javascript" charset="utf-8">
// Wait for PhoneGap to load
//
document.addEventListener("deviceready", onDeviceReady, false);
// PhoneGap is ready
//
function onDeviceReady() {
var startButton = document.getElementById("start");
startButton.addEventListener("click", startWatch, false);
var stopButton = document.getElementById("stop");
stopButton.addEventListener("click", stopWatch, false);
}
</script> | 3 |
8,724,915 | 01/04/2012 09:56:32 | 609,561 | 02/09/2011 10:31:20 | 54 | 3 | Magento rewrite Creditmemo Grid, class not found | I'm rewriting the class for the credit memo grid, I've added the following code to my config.xml
<blocks>
<adminhtml>
<rewrite>
<sales_creditmemo_grid>Myplugin_MyNamespace_Adminhtml_Block_Sales_Creditmemo_Grid</sales_creditmemo_grid>
</rewrite>
</adminhtml>
</blocks>
My Grid.php is located at
app/code/local/Myplugin/MyNamespace/Adminhtml/Block/Sales/Creditmemo/Grid.php
When I open the admin area I get this error
Fatal error: Class 'Myplugin_MyNamespace_Adminhtml_Block_Sales_Creditmemo_Grid' not found in /home/batman/public_html/app/code/core/Mage/Core/Model/Layout.php on line 465
maybe the config.xml is wrong? the path seems correct to me
Thanks!
| php | magento | plugins | null | null | 01/04/2012 19:33:52 | too localized | Magento rewrite Creditmemo Grid, class not found
===
I'm rewriting the class for the credit memo grid, I've added the following code to my config.xml
<blocks>
<adminhtml>
<rewrite>
<sales_creditmemo_grid>Myplugin_MyNamespace_Adminhtml_Block_Sales_Creditmemo_Grid</sales_creditmemo_grid>
</rewrite>
</adminhtml>
</blocks>
My Grid.php is located at
app/code/local/Myplugin/MyNamespace/Adminhtml/Block/Sales/Creditmemo/Grid.php
When I open the admin area I get this error
Fatal error: Class 'Myplugin_MyNamespace_Adminhtml_Block_Sales_Creditmemo_Grid' not found in /home/batman/public_html/app/code/core/Mage/Core/Model/Layout.php on line 465
maybe the config.xml is wrong? the path seems correct to me
Thanks!
| 3 |
11,457,914 | 07/12/2012 18:06:16 | 943,583 | 09/13/2011 23:32:02 | 19 | 0 | Spring MVC: Using @Autowire is getting references to different spring bean instances. | I have a UserCredetnialsDatSourceAdapter defined in my Spring app context file. I also have a custom filter added to the Spring via the DelegatingFilterProxy.
This filter is using the @Autowire to get a reference to the DataSource Bean. I also @Autowire the DataSource in my DAO. When I debug I see different instance id's to the datasource in the Filter and DAO instances. Why are there 2 instances whenthese are singletons by default?
I also fired up jvisualvm and I looked at the heap and all my beans in my app context have 2 instances? Thanks for any insight maybe the bean pre/post processing has something do with it or maybe I should not be using @Autowire in a Filter. Any help is apprciated. Thanks!
-Joe | java | spring | java-ee | spring-mvc | spring-security | null | open | Spring MVC: Using @Autowire is getting references to different spring bean instances.
===
I have a UserCredetnialsDatSourceAdapter defined in my Spring app context file. I also have a custom filter added to the Spring via the DelegatingFilterProxy.
This filter is using the @Autowire to get a reference to the DataSource Bean. I also @Autowire the DataSource in my DAO. When I debug I see different instance id's to the datasource in the Filter and DAO instances. Why are there 2 instances whenthese are singletons by default?
I also fired up jvisualvm and I looked at the heap and all my beans in my app context have 2 instances? Thanks for any insight maybe the bean pre/post processing has something do with it or maybe I should not be using @Autowire in a Filter. Any help is apprciated. Thanks!
-Joe | 0 |
7,228,462 | 08/29/2011 09:40:42 | 908,039 | 08/23/2011 15:35:00 | 4 | 0 | Php code to scrap the values from other site | i am trying to get a some values from other site using code below
$values = file_get_contents('http://www.domain.com/');
(MISSING CODE)
echo $values;
the site has only text all in first row. basically its just a text line. so i need to get 11th to 18th vale from it. | php | dom | xpath | curl | echo | 08/29/2011 18:39:16 | not a real question | Php code to scrap the values from other site
===
i am trying to get a some values from other site using code below
$values = file_get_contents('http://www.domain.com/');
(MISSING CODE)
echo $values;
the site has only text all in first row. basically its just a text line. so i need to get 11th to 18th vale from it. | 1 |
10,495,030 | 05/08/2012 08:18:10 | 1,337,996 | 04/17/2012 06:36:42 | 1 | 0 | Which is best in mongodb and hadoop | Which is the best in mongodb and hadoop for ruby on rails application? And why? | database | ruby-on-rails-3 | null | null | null | 05/08/2012 09:20:59 | not constructive | Which is best in mongodb and hadoop
===
Which is the best in mongodb and hadoop for ruby on rails application? And why? | 4 |
7,187,200 | 08/25/2011 08:25:28 | 418,507 | 08/12/2010 14:15:38 | 328 | 0 | Chmod recursively directories only? | It's not work fo me:
target_dir = "a/b/c/d/e/"
os.makedirs(target_dir,0777)
os.chmod work only for last directory ...
| python | null | null | null | null | null | open | Chmod recursively directories only?
===
It's not work fo me:
target_dir = "a/b/c/d/e/"
os.makedirs(target_dir,0777)
os.chmod work only for last directory ...
| 0 |
3,328,342 | 07/25/2010 06:49:57 | 285,686 | 03/03/2010 19:55:45 | 28 | 6 | How Can i convert a perl script into a C code? | How Can i convert a perl script into a C code? | perl | null | null | null | null | 07/25/2010 07:24:18 | not a real question | How Can i convert a perl script into a C code?
===
How Can i convert a perl script into a C code? | 1 |
5,223,937 | 03/07/2011 19:02:25 | 637,377 | 02/28/2011 08:46:39 | 1 | 0 | Decompiler For Exe File | I have question can we Decompile the Exe Files TO view There Code IF YEs Then By Which Resourses | c++ | c | null | null | null | 03/07/2011 19:35:58 | not a real question | Decompiler For Exe File
===
I have question can we Decompile the Exe Files TO view There Code IF YEs Then By Which Resourses | 1 |
11,372,012 | 07/07/2012 03:26:55 | 1,508,181 | 07/07/2012 03:04:02 | 1 | 0 | MPI several broadcast at the same time | I have a 2D processor grid (3\*3):
P00, P01, P02 are in R0, P10, P11, P12, are in R1, P20, P21, P22 are in R2.
P\*0 are in the same computer. So the same to P\*1 and P\*2.
Now I would like to let R0, R1, R2 call MPI\_Bcast at the same time to broadcast from P\*0 to p\*1 and P\*2.
I find that when I use MPI\_Bcast, it takes three times the time I need to broadcast in only one row.
For example, if I only call MPI\_Bcast in R0, it takes 1.00 s.
But if I call three MPI\_Bcast in all R[0, 1, 2], it takes 3.00 s in total.
It means the MPI\_Bcast cannot work parallel.
Is there any methods to make the MPI_Bcast broadcast at the same time?
(ONE node broadcast with three channels at the same time.)
Thanks. | mpi | broadcast | null | null | null | null | open | MPI several broadcast at the same time
===
I have a 2D processor grid (3\*3):
P00, P01, P02 are in R0, P10, P11, P12, are in R1, P20, P21, P22 are in R2.
P\*0 are in the same computer. So the same to P\*1 and P\*2.
Now I would like to let R0, R1, R2 call MPI\_Bcast at the same time to broadcast from P\*0 to p\*1 and P\*2.
I find that when I use MPI\_Bcast, it takes three times the time I need to broadcast in only one row.
For example, if I only call MPI\_Bcast in R0, it takes 1.00 s.
But if I call three MPI\_Bcast in all R[0, 1, 2], it takes 3.00 s in total.
It means the MPI\_Bcast cannot work parallel.
Is there any methods to make the MPI_Bcast broadcast at the same time?
(ONE node broadcast with three channels at the same time.)
Thanks. | 0 |
10,427,978 | 05/03/2012 08:47:33 | 408,709 | 08/14/2009 13:28:00 | 8 | 0 | Powershell: Combine ContainerInherit and ObjectInherit in FileSystemAccessRule? | I'm writing a script that should set filesystem access rights for a folder and all of it's contents.
To affect all content, both subfolders and files, one should combine ContainerInherit and ObjectInherit according to the .NET documentation. But I can't get that to work and I'm not sure about the syntax.
Sample code:
$ar = new-object System.Security.AccessControl.FileSystemAccessRule(New-Object System.Security.Principal.NTAccount($user),FullControl,ContainerInherit,InheritOnly,Allow)
That'll work and so would using `ObjectInherit` only, but how can I combine them? Using quotation marks and a comma, like this `"ContainerInherit,ObjectInherit"` won't work, since it's appearantly not allowed to mix string and non-string argument.
I've also tried using the `-and` operator, but that just gives me an error. Assigning the enums to a variable (`$inherit = ContainerInherit,ObjectInherit`) won't work either.
So, any tips on how to do this?
| powershell | enums | null | null | null | null | open | Powershell: Combine ContainerInherit and ObjectInherit in FileSystemAccessRule?
===
I'm writing a script that should set filesystem access rights for a folder and all of it's contents.
To affect all content, both subfolders and files, one should combine ContainerInherit and ObjectInherit according to the .NET documentation. But I can't get that to work and I'm not sure about the syntax.
Sample code:
$ar = new-object System.Security.AccessControl.FileSystemAccessRule(New-Object System.Security.Principal.NTAccount($user),FullControl,ContainerInherit,InheritOnly,Allow)
That'll work and so would using `ObjectInherit` only, but how can I combine them? Using quotation marks and a comma, like this `"ContainerInherit,ObjectInherit"` won't work, since it's appearantly not allowed to mix string and non-string argument.
I've also tried using the `-and` operator, but that just gives me an error. Assigning the enums to a variable (`$inherit = ContainerInherit,ObjectInherit`) won't work either.
So, any tips on how to do this?
| 0 |
9,422,038 | 02/23/2012 21:59:34 | 1,229,460 | 02/23/2012 21:53:42 | 1 | 0 | QT opengl add object on mouse click | I work with QT, openGl and glut and I try to add objects (sphere or cube...) in the scene
each click of a pushButton.
thank you in advance | qt | opengl | glut | null | null | 02/24/2012 03:12:54 | not a real question | QT opengl add object on mouse click
===
I work with QT, openGl and glut and I try to add objects (sphere or cube...) in the scene
each click of a pushButton.
thank you in advance | 1 |
4,326,623 | 12/01/2010 16:36:26 | 504,963 | 11/11/2010 19:28:04 | 17 | 0 | Assembly program help | I have a program that is supposed to clear the screen and print my name, then new line and print my name again. but when i run it nothing shows up. just program teminated normally. I'm doing this in windows command prompt using debug.
call 010E
call 0125
call 012D
call 0125
int 20
push ax #clearscreen(010E)
push bx
push cx
push dx
xor al, al
xor cx, cx
mov dh, 18
mov dl, 4f
mov bh, 07
mov ah, 06
int 20
pop dx
pop cx
pop bx
pop ax
ret
mov dx, 0200 #printline(0125)
mov ah, 09
int 21
ret
push ax #new line( 012D)
push dx
mov ah, 02
mov dl, 0d
int 21
mov dl, 0a
int 21,
pop dx
pop ax
ret
DB' Antarr$ #(0200) | assembly | windows-xp | masm32 | null | null | null | open | Assembly program help
===
I have a program that is supposed to clear the screen and print my name, then new line and print my name again. but when i run it nothing shows up. just program teminated normally. I'm doing this in windows command prompt using debug.
call 010E
call 0125
call 012D
call 0125
int 20
push ax #clearscreen(010E)
push bx
push cx
push dx
xor al, al
xor cx, cx
mov dh, 18
mov dl, 4f
mov bh, 07
mov ah, 06
int 20
pop dx
pop cx
pop bx
pop ax
ret
mov dx, 0200 #printline(0125)
mov ah, 09
int 21
ret
push ax #new line( 012D)
push dx
mov ah, 02
mov dl, 0d
int 21
mov dl, 0a
int 21,
pop dx
pop ax
ret
DB' Antarr$ #(0200) | 0 |
3,794,020 | 09/25/2010 13:33:29 | 458,174 | 09/25/2010 13:33:29 | 1 | 0 | How to create or modify the google maps controls?s | I wonder how sites like trulia.com and fotocasa.com customized the google maps ui for their website
ex1:
http://www.trulia.com/for_sale/Pinecrest,FL/x_map/#for_sale/Pinecrest,FL/x_map/2_p/ | gui | api | google-maps | usercontrols | null | null | open | How to create or modify the google maps controls?s
===
I wonder how sites like trulia.com and fotocasa.com customized the google maps ui for their website
ex1:
http://www.trulia.com/for_sale/Pinecrest,FL/x_map/#for_sale/Pinecrest,FL/x_map/2_p/ | 0 |
3,734,317 | 09/17/2010 09:56:51 | 424,083 | 08/18/2010 14:01:34 | 8 | 0 | Data Structure.. | What is the algorithm used in Microsoft BING for searching? | data-structures | data | search-engine | null | null | 09/17/2010 11:06:12 | not a real question | Data Structure..
===
What is the algorithm used in Microsoft BING for searching? | 1 |
3,432,984 | 08/08/2010 03:47:23 | 414,135 | 08/08/2010 03:23:49 | 1 | 0 | How do i store a swf file name and location in mySQL database and then use this to call it in the application | How do i store a swf file name and location in mySQL database and then use this to call it in the application?
Sabby77 | php | mysql | flash | dreamweaver | movie | null | open | How do i store a swf file name and location in mySQL database and then use this to call it in the application
===
How do i store a swf file name and location in mySQL database and then use this to call it in the application?
Sabby77 | 0 |
7,959,932 | 10/31/2011 21:24:36 | 222,400 | 12/01/2009 20:23:20 | 47 | 0 | Prevent URL parsing in IE for FTP | The URL for my server is “ftptest.mydomain.com”
This server hosts FTP and HTTP.
If I type that address in the internet explorer 8 address bar without typing http:// or https:// it resolves to ftp://ftptest.mydomain.com.
Does anyone know a reg hack to prevent this behavior in IE? | internet-explorer | internet-explorer-8 | ftp | null | null | null | open | Prevent URL parsing in IE for FTP
===
The URL for my server is “ftptest.mydomain.com”
This server hosts FTP and HTTP.
If I type that address in the internet explorer 8 address bar without typing http:// or https:// it resolves to ftp://ftptest.mydomain.com.
Does anyone know a reg hack to prevent this behavior in IE? | 0 |
3,053,397 | 06/16/2010 12:54:51 | 366,317 | 06/14/2010 12:23:38 | 6 | 0 | Python, Thread never exiting... | I'm developing a small media player in Python. A problem I have run into is that my thread which plays the .wav file never exits. I've provided the thread class, and how I handle the create of thread below.
class myThread (threading.Thread):
def __init__(self, threadID, wf):
self.threadID = threadID
self.wf = wf
threading.Thread.__init__(self)
def run(self):
global isPaused
global isStopped
self.waveFile = wave.open(self.wf, 'rb')
#initialize stream
self.p = pyaudio.PyAudio()
self.stream = self.p.open(format = self.p.get_format_from_width(self.waveFile.getsampwidth()), channels = self.waveFile.getnchannels(), rate = self.waveFile.getframerate(), output = True)
self.data = self.waveFile.readframes(1024)
isPaused = False
isStopped = False
#main play loop, with pause event checking
while self.data != '':
while isPaused != True:
if isStopped == False:
self.stream.write(self.data)
self.data = self.waveFile.readframes(1024)
elif isStopped == True:
self.stream.close()
self.p.terminate()
self.stream.close()
self.p.terminate()
And I control the thread creation with:
self.queue = foo.GetPaths()
self.threadID = 1
while len(self.queue) != 0:
self.song = myThread(threadID, self.queue[0])
self.song.start()
while self.song.isAlive():
time.sleep(2)
self.queue.pop(0)
self.threadID += 1
If you have any idea, I'd appreciate it. | python | null | null | null | null | null | open | Python, Thread never exiting...
===
I'm developing a small media player in Python. A problem I have run into is that my thread which plays the .wav file never exits. I've provided the thread class, and how I handle the create of thread below.
class myThread (threading.Thread):
def __init__(self, threadID, wf):
self.threadID = threadID
self.wf = wf
threading.Thread.__init__(self)
def run(self):
global isPaused
global isStopped
self.waveFile = wave.open(self.wf, 'rb')
#initialize stream
self.p = pyaudio.PyAudio()
self.stream = self.p.open(format = self.p.get_format_from_width(self.waveFile.getsampwidth()), channels = self.waveFile.getnchannels(), rate = self.waveFile.getframerate(), output = True)
self.data = self.waveFile.readframes(1024)
isPaused = False
isStopped = False
#main play loop, with pause event checking
while self.data != '':
while isPaused != True:
if isStopped == False:
self.stream.write(self.data)
self.data = self.waveFile.readframes(1024)
elif isStopped == True:
self.stream.close()
self.p.terminate()
self.stream.close()
self.p.terminate()
And I control the thread creation with:
self.queue = foo.GetPaths()
self.threadID = 1
while len(self.queue) != 0:
self.song = myThread(threadID, self.queue[0])
self.song.start()
while self.song.isAlive():
time.sleep(2)
self.queue.pop(0)
self.threadID += 1
If you have any idea, I'd appreciate it. | 0 |
8,473,797 | 12/12/2011 11:46:23 | 1,067,320 | 11/26/2011 21:33:44 | 1 | 0 | socket programming learning | i have been learning how to program sockets, but when i try practice writing codes, i have some problems. the code works for connecting to computers on the same LAN but when i try to connect to two computers on a different network over the internet, i was unable to.
is this because of the program or is this because of network security?
Where can i find more information on it if i want to make applications communicate over the internet. i was thinking of making a chat program so that i understanding it better but i can't even make the program communicate over the internet!
Thank you
any help is appreciated. | c++ | sockets | tcp | ip | null | null | open | socket programming learning
===
i have been learning how to program sockets, but when i try practice writing codes, i have some problems. the code works for connecting to computers on the same LAN but when i try to connect to two computers on a different network over the internet, i was unable to.
is this because of the program or is this because of network security?
Where can i find more information on it if i want to make applications communicate over the internet. i was thinking of making a chat program so that i understanding it better but i can't even make the program communicate over the internet!
Thank you
any help is appreciated. | 0 |
6,962,132 | 08/05/2011 20:18:21 | 881,272 | 08/05/2011 20:18:21 | 1 | 0 | maven assembly plugin - correct use of the exclude term | short: I need to filter all java Files and every META-INF Folder from a set of jars and package the class files and resources into one single jar.
I currently use the maven assembly plugin, but am fully willing to try something else as long as it can easily be integrated into a maven build process.
long: I use maven to manage different stages of development for my tool (basic stage is freeware, second has some more features, third stage is all features).
That works fine so far, I use profiles to add the different source directories to the classpath and the sources are neatly compiled into the project jar.
- Here is the first problem: The .java sources included into the project via the profiles end up in the project jar.
Then I use the maven assembly plugin to construct a single jar and in the end use launch4j to produce an executable for windows (the current target platform).
- Here is the second problem: The various META-INF parts from the dependency jars mix in the final jar and I would want them all to be skipped.
I have searched for examples of the assembly.xml using the exclude tag, but did not find any that used my combination of dependencySet and <exclude>*.java</exclude> (I'm not even positive that I can do that...).
Here is my assembly.xml: http://pastebin.com/dGwRMUBK
My research so far:
I have googled with "example assembly.xml exclude java" but could not find examples that covered my problem. (I have also googled a lot the past days but did not save all I found)
I have read http://maven.apache.org/plugins/maven-assembly-plugin/advanced-descriptor-topics.html but could not apply that knowledge to my problem.
So, thanks a lot in advance if you can point me to the right direction.
As said before, I am fully willing to use something different than the assembly plugin if it solves the problem :) If I can't find the answer I will most likely begin to write my own after-build shellscript to do what I want, but I would prefer not to.
Have a lot of fun
Angelo | assembly | maven | exclude | sources | meta-inf | null | open | maven assembly plugin - correct use of the exclude term
===
short: I need to filter all java Files and every META-INF Folder from a set of jars and package the class files and resources into one single jar.
I currently use the maven assembly plugin, but am fully willing to try something else as long as it can easily be integrated into a maven build process.
long: I use maven to manage different stages of development for my tool (basic stage is freeware, second has some more features, third stage is all features).
That works fine so far, I use profiles to add the different source directories to the classpath and the sources are neatly compiled into the project jar.
- Here is the first problem: The .java sources included into the project via the profiles end up in the project jar.
Then I use the maven assembly plugin to construct a single jar and in the end use launch4j to produce an executable for windows (the current target platform).
- Here is the second problem: The various META-INF parts from the dependency jars mix in the final jar and I would want them all to be skipped.
I have searched for examples of the assembly.xml using the exclude tag, but did not find any that used my combination of dependencySet and <exclude>*.java</exclude> (I'm not even positive that I can do that...).
Here is my assembly.xml: http://pastebin.com/dGwRMUBK
My research so far:
I have googled with "example assembly.xml exclude java" but could not find examples that covered my problem. (I have also googled a lot the past days but did not save all I found)
I have read http://maven.apache.org/plugins/maven-assembly-plugin/advanced-descriptor-topics.html but could not apply that knowledge to my problem.
So, thanks a lot in advance if you can point me to the right direction.
As said before, I am fully willing to use something different than the assembly plugin if it solves the problem :) If I can't find the answer I will most likely begin to write my own after-build shellscript to do what I want, but I would prefer not to.
Have a lot of fun
Angelo | 0 |
5,989 | 08/08/2008 14:24:17 | 750 | 08/08/2008 14:24:17 | 1 | 0 | What's the best way to kick ass in programming? | I've been programming since college, was a hobbyist programmer as a kid, but never got serious until I was a freshman. That was almost a decade and a half ago. One thing I've noticed is that when people reach a certain point in their skills they never really move beyond that. That is if they suck as a developer when you hire them, they will always suck. 10 years of C# experience doesn't necessarily make you a better developer than someone with 6 months of experience. (yeah, yeah, some people will get angry at reading this, but it's true, live with it).
So my question is, just how the hell do you get to be one of those super programming freaks that everyone worships? I've been doing coding puzzles as often as I can -- example: reverse a string in place using no swap buffers. (that is a fun one) and I've noticed myself get a little sharper. I'm not improving as fast as I wish I could so I would love to hear some tips from people here. | improvement | null | null | null | null | 12/20/2011 17:50:33 | not constructive | What's the best way to kick ass in programming?
===
I've been programming since college, was a hobbyist programmer as a kid, but never got serious until I was a freshman. That was almost a decade and a half ago. One thing I've noticed is that when people reach a certain point in their skills they never really move beyond that. That is if they suck as a developer when you hire them, they will always suck. 10 years of C# experience doesn't necessarily make you a better developer than someone with 6 months of experience. (yeah, yeah, some people will get angry at reading this, but it's true, live with it).
So my question is, just how the hell do you get to be one of those super programming freaks that everyone worships? I've been doing coding puzzles as often as I can -- example: reverse a string in place using no swap buffers. (that is a fun one) and I've noticed myself get a little sharper. I'm not improving as fast as I wish I could so I would love to hear some tips from people here. | 4 |
6,392,340 | 06/17/2011 22:12:42 | 38,743 | 11/18/2008 23:19:02 | 3,493 | 125 | SQL Server 2008 - split multi-value column into rows with unique values | In a SQL Server 2008 database, I have a column with multiple values separated by semi-colons. Sample data:
key:value;key2:value;blah;foo;bar;A sample value:whee;others
key:value;blah;bar;others
A sample value:whee
I want to get all the unique values from each row in separate rows:
key:value
key2:value
blah
foo
bar
A sample value:whee
others
I've looked at various `split` functions, but they all seem to deal with hard-coded strings, not strings coming from a column in a table. How can I do this? | tsql | sql-server-2008 | query | split | pivot | null | open | SQL Server 2008 - split multi-value column into rows with unique values
===
In a SQL Server 2008 database, I have a column with multiple values separated by semi-colons. Sample data:
key:value;key2:value;blah;foo;bar;A sample value:whee;others
key:value;blah;bar;others
A sample value:whee
I want to get all the unique values from each row in separate rows:
key:value
key2:value
blah
foo
bar
A sample value:whee
others
I've looked at various `split` functions, but they all seem to deal with hard-coded strings, not strings coming from a column in a table. How can I do this? | 0 |
5,816,703 | 04/28/2011 09:48:15 | 689,820 | 04/03/2011 13:11:36 | 20 | 4 | modify href of a tab with CSS | is there any way to modify href attribut of a tab with CSS ?
thanks | css | null | null | null | null | null | open | modify href of a tab with CSS
===
is there any way to modify href attribut of a tab with CSS ?
thanks | 0 |
4,734,482 | 01/19/2011 11:03:37 | 581,306 | 01/19/2011 11:03:37 | 1 | 0 | button1.PerformClick() in wpf | Why this code in WPF does not work ?
> private void button1_Click(object sender, EventArgs e)
{
MessageBox.Show("yes");
}
private void Form1_Load(object sender, EventArgs e)
{
button1.PerformClick();
}
I need to command. | c# | wpf | null | null | null | null | open | button1.PerformClick() in wpf
===
Why this code in WPF does not work ?
> private void button1_Click(object sender, EventArgs e)
{
MessageBox.Show("yes");
}
private void Form1_Load(object sender, EventArgs e)
{
button1.PerformClick();
}
I need to command. | 0 |
6,693,621 | 07/14/2011 13:06:23 | 825,200 | 07/01/2011 16:14:33 | 1 | 0 | Php + mysql drop down db list and mysqldump | as i m new to php
i want to make a web page which should give the drop down list of all the databases which are present there and after chosing one it should fire a mysqldump command and store the backup at /tmp of the server.
how i can do that using html and php ?
any help would be good help :-)
Thanks
| mysql | database | php5 | mysqldump | null | 07/14/2011 13:14:24 | not a real question | Php + mysql drop down db list and mysqldump
===
as i m new to php
i want to make a web page which should give the drop down list of all the databases which are present there and after chosing one it should fire a mysqldump command and store the backup at /tmp of the server.
how i can do that using html and php ?
any help would be good help :-)
Thanks
| 1 |
1,034,758 | 06/23/2009 19:45:12 | 127,716 | 06/23/2009 17:01:21 | 21 | 3 | Documentation on web design | **I just wanted to know what are the best websites about web designing?**
The websites posted should either be about web design, CSS, photoshop for the web or web development in general (like new web technologies). Please try to not post websites that have already been posted. | design | css | photoshop | null | null | 04/12/2012 20:43:51 | not constructive | Documentation on web design
===
**I just wanted to know what are the best websites about web designing?**
The websites posted should either be about web design, CSS, photoshop for the web or web development in general (like new web technologies). Please try to not post websites that have already been posted. | 4 |
11,190,595 | 06/25/2012 13:52:32 | 438,758 | 09/03/2010 08:07:23 | 722 | 61 | Repeated POST request is causing error "socket.error: (99, 'Cannot assign requested address')" | I have a web-service deployed in my box. I want to check the result of this service with various input. Here is the code I am using:
import sys
import httplib
import urllib
apUrl = "someUrl:somePort"
fileName = sys.argv[1]
conn = httplib.HTTPConnection(apUrl)
#print fileName
#print expectedOutput
titlesFile = open(fileName, 'r')
try:
for title in titlesFile:
title = title.strip()
params = urllib.urlencode({'search': 'abcd', 'text': title})
conn.request("POST", "/somePath/", params)
response = conn.getresponse()
data = response.read().strip()
print data+"\t"+title
conn.close()
# break
finally:
titlesFile.close()
This code is giving an error after same number of lines printed (28233). Error message:
Traceback (most recent call last):
File "testService.py", line 19, in ?
conn.request("POST", "/somePath/", params)
File "/usr/lib/python2.4/httplib.py", line 810, in request
self._send_request(method, url, body, headers)
File "/usr/lib/python2.4/httplib.py", line 833, in _send_request
self.endheaders()
File "/usr/lib/python2.4/httplib.py", line 804, in endheaders
self._send_output()
File "/usr/lib/python2.4/httplib.py", line 685, in _send_output
self.send(msg)
File "/usr/lib/python2.4/httplib.py", line 652, in send
self.connect()
File "/usr/lib/python2.4/httplib.py", line 636, in connect
raise socket.error, msg
socket.error: (99, 'Cannot assign requested address')
I am using Python 2.4.3. I am doing `conn.close()` also. But why is this error being given? | python | network-programming | null | null | null | null | open | Repeated POST request is causing error "socket.error: (99, 'Cannot assign requested address')"
===
I have a web-service deployed in my box. I want to check the result of this service with various input. Here is the code I am using:
import sys
import httplib
import urllib
apUrl = "someUrl:somePort"
fileName = sys.argv[1]
conn = httplib.HTTPConnection(apUrl)
#print fileName
#print expectedOutput
titlesFile = open(fileName, 'r')
try:
for title in titlesFile:
title = title.strip()
params = urllib.urlencode({'search': 'abcd', 'text': title})
conn.request("POST", "/somePath/", params)
response = conn.getresponse()
data = response.read().strip()
print data+"\t"+title
conn.close()
# break
finally:
titlesFile.close()
This code is giving an error after same number of lines printed (28233). Error message:
Traceback (most recent call last):
File "testService.py", line 19, in ?
conn.request("POST", "/somePath/", params)
File "/usr/lib/python2.4/httplib.py", line 810, in request
self._send_request(method, url, body, headers)
File "/usr/lib/python2.4/httplib.py", line 833, in _send_request
self.endheaders()
File "/usr/lib/python2.4/httplib.py", line 804, in endheaders
self._send_output()
File "/usr/lib/python2.4/httplib.py", line 685, in _send_output
self.send(msg)
File "/usr/lib/python2.4/httplib.py", line 652, in send
self.connect()
File "/usr/lib/python2.4/httplib.py", line 636, in connect
raise socket.error, msg
socket.error: (99, 'Cannot assign requested address')
I am using Python 2.4.3. I am doing `conn.close()` also. But why is this error being given? | 0 |
7,330,212 | 09/07/2011 07:22:41 | 932,188 | 09/07/2011 07:22:41 | 1 | 0 | How to create layout when using spinner | hello android developers i am using spinner control in my application.when i click the spinner i need to get new layout in the right side of the spinner.How to code that.please help me. | java | android | null | null | null | 01/14/2012 17:51:11 | not a real question | How to create layout when using spinner
===
hello android developers i am using spinner control in my application.when i click the spinner i need to get new layout in the right side of the spinner.How to code that.please help me. | 1 |
11,511,326 | 07/16/2012 19:37:57 | 1,009,661 | 10/23/2011 15:52:04 | 98 | 6 | Not unique guids. Real cases? | Are there real cases when equal guids have been generated? It is possible in theory, but what about practice?
And what if some day it happens? | c# | guid | null | null | null | 07/16/2012 19:43:27 | not a real question | Not unique guids. Real cases?
===
Are there real cases when equal guids have been generated? It is possible in theory, but what about practice?
And what if some day it happens? | 1 |
6,515,155 | 06/29/2011 02:28:53 | 778,659 | 06/01/2011 02:56:08 | 27 | 2 | please recommand material for open Source licenses (GPL, EGPL, apache, EPL....) | I need some in-depth understanding of each general open source/free license. (GPL, EGPL, apache, EPL....)
I know there are many web site , wiki on this topic. also here at stackoverflow... But i can not find one that covers all.
I don't need the detail knowledge at this question. I need to know how to learn in this area.
BTW: Is there any books systematically explain on this area? I am not a native English, the license file itself is quite formal and not easy for to understand, just like any other legal document:) | open-source | licensing | null | null | null | 06/29/2011 02:35:27 | off topic | please recommand material for open Source licenses (GPL, EGPL, apache, EPL....)
===
I need some in-depth understanding of each general open source/free license. (GPL, EGPL, apache, EPL....)
I know there are many web site , wiki on this topic. also here at stackoverflow... But i can not find one that covers all.
I don't need the detail knowledge at this question. I need to know how to learn in this area.
BTW: Is there any books systematically explain on this area? I am not a native English, the license file itself is quite formal and not easy for to understand, just like any other legal document:) | 2 |
10,837,602 | 05/31/2012 16:30:08 | 1,236,720 | 02/27/2012 23:21:33 | 919 | 10 | Getting a seg fault when tokenizing string in c | I just started programming in C a few days ago so I'm sure I'm making a rookie mistake but I'm not sure what. My program opens a file, reads it line by line then removes stuff I don't need (brackets, newline,etc..), then once I just have the data in a comma separated format I want to add it to an array(then add that array to a array of arrays.). I'm at the point where I am tokenize the comma separated string but I keep getting `EXC_BAD_ACCESS, Could not access memory.` when I run it in debugger.
Can someone let me know what I'm doing wrong? Here's the section of my code that is giving me the problem:
//now data(variable: line) looks like this: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 4
char *str_ptr;
str_ptr = strtok(line, ",");
for(; str_ptr != NULL ;){
fprintf(stdout, "%s\n", str_ptr);
str_ptr = strtok(NULL, ",");
}
If it helps(ignore it if the above is helpful enough), here's my entire code:
#include <stdio.h>
int main() {
char line[1024];
FILE *fp = fopen("/Users/me/Desktop/output.txt","r");
printf("Starting.. \n");
if( fp == NULL ) {
return 1;
}
int count = 0;
int list[30]; //items will be stored here
while(fgets(line, 1024, fp) != EOF) {
count++;
//parse the text in the line Remove the open bracket, then remove the last newline,comma and close bracket
// data looks like this: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 4],
size_t len = strlen(line);
memmove(line, line+1, len-4);
line[len-4] = 0;
printf("%s \n",line);
//parse the numbers in the char
//now data looks like this: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 4
char *str_ptr;
str_ptr = strtok(line, ",");
for(; str_ptr != NULL ;){
fprintf(stdout, "%s\n", str_ptr);
str_ptr = strtok(NULL, ",");
}
//for testing just stop the file after two lines
if (count == 2) {
break;
}
if ( count > 1000000) {
printf("count is higher than 1,000,000 \n");
count = 0;
}
}
printf(" num of lines is %i \n", count);
return 0;
}
Thanks, I tried to explain it as I see it but if I'm missing anything let me know. Other than the debugger I'm not sure how to get meaningful information in this case, if there's a way I could get more helpful errors let me know. | c | null | null | null | null | null | open | Getting a seg fault when tokenizing string in c
===
I just started programming in C a few days ago so I'm sure I'm making a rookie mistake but I'm not sure what. My program opens a file, reads it line by line then removes stuff I don't need (brackets, newline,etc..), then once I just have the data in a comma separated format I want to add it to an array(then add that array to a array of arrays.). I'm at the point where I am tokenize the comma separated string but I keep getting `EXC_BAD_ACCESS, Could not access memory.` when I run it in debugger.
Can someone let me know what I'm doing wrong? Here's the section of my code that is giving me the problem:
//now data(variable: line) looks like this: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 4
char *str_ptr;
str_ptr = strtok(line, ",");
for(; str_ptr != NULL ;){
fprintf(stdout, "%s\n", str_ptr);
str_ptr = strtok(NULL, ",");
}
If it helps(ignore it if the above is helpful enough), here's my entire code:
#include <stdio.h>
int main() {
char line[1024];
FILE *fp = fopen("/Users/me/Desktop/output.txt","r");
printf("Starting.. \n");
if( fp == NULL ) {
return 1;
}
int count = 0;
int list[30]; //items will be stored here
while(fgets(line, 1024, fp) != EOF) {
count++;
//parse the text in the line Remove the open bracket, then remove the last newline,comma and close bracket
// data looks like this: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 4],
size_t len = strlen(line);
memmove(line, line+1, len-4);
line[len-4] = 0;
printf("%s \n",line);
//parse the numbers in the char
//now data looks like this: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 4
char *str_ptr;
str_ptr = strtok(line, ",");
for(; str_ptr != NULL ;){
fprintf(stdout, "%s\n", str_ptr);
str_ptr = strtok(NULL, ",");
}
//for testing just stop the file after two lines
if (count == 2) {
break;
}
if ( count > 1000000) {
printf("count is higher than 1,000,000 \n");
count = 0;
}
}
printf(" num of lines is %i \n", count);
return 0;
}
Thanks, I tried to explain it as I see it but if I'm missing anything let me know. Other than the debugger I'm not sure how to get meaningful information in this case, if there's a way I could get more helpful errors let me know. | 0 |
7,155,008 | 08/23/2011 00:12:33 | 234,638 | 12/18/2009 15:39:38 | 1,041 | 10 | JSON over POST with curl (to pylons) | I have a pylons controller action that accepts POST
@restrict('POST')
def myaction(self):
payload = json.loads(request.body)
I put properly formed JSON (I can do json.loads on it from python command line) in a file.
I am using the following command to send it to the controller:
$ curl -F payload=@./myfile -X POST -H 'Content-type:application/json' -v http://localhost:5000/mycontroller/myaction
on the controller side I'm expecting well formed JSON, but instead of getting JSON in *request.body* I'm getting a string with other stuff like
*-----------------------6588b6680ebb\r\nContent-Disposition: form-data;*
before the string containing a string representation of JSON I sent to myaction
What am I doing wrong? | json | post | curl | controller | pylons | null | open | JSON over POST with curl (to pylons)
===
I have a pylons controller action that accepts POST
@restrict('POST')
def myaction(self):
payload = json.loads(request.body)
I put properly formed JSON (I can do json.loads on it from python command line) in a file.
I am using the following command to send it to the controller:
$ curl -F payload=@./myfile -X POST -H 'Content-type:application/json' -v http://localhost:5000/mycontroller/myaction
on the controller side I'm expecting well formed JSON, but instead of getting JSON in *request.body* I'm getting a string with other stuff like
*-----------------------6588b6680ebb\r\nContent-Disposition: form-data;*
before the string containing a string representation of JSON I sent to myaction
What am I doing wrong? | 0 |
2,962,884 | 06/03/2010 01:57:14 | 357,033 | 06/03/2010 01:46:27 | 1 | 0 | 100+ tables to joined | I was wondering if anyone ever had a change to measure how a would 100 joined tables perform?
Each table would have an ID column with primary index and all table are 1:1 related.
It is a common problem within many data entry applications where we need to collect 1000+ data points. One solution would be to have one big table with 1000+ columns and the alternative would be to split them into multiple tables and join them when it is necessary.
So perhaps more real question would be how 30 tables (30 columns each) would behave with multitable join.
500K-1M rows should be the expected size of the tables.
Cheers
| sql | join | null | null | null | null | open | 100+ tables to joined
===
I was wondering if anyone ever had a change to measure how a would 100 joined tables perform?
Each table would have an ID column with primary index and all table are 1:1 related.
It is a common problem within many data entry applications where we need to collect 1000+ data points. One solution would be to have one big table with 1000+ columns and the alternative would be to split them into multiple tables and join them when it is necessary.
So perhaps more real question would be how 30 tables (30 columns each) would behave with multitable join.
500K-1M rows should be the expected size of the tables.
Cheers
| 0 |
2,382,640 | 03/04/2010 20:53:35 | 455,292 | 11/04/2008 03:34:17 | 244 | 11 | Can't Deploy Report Models in SSRS 2008 | I created a data model in BIDS for SSRS 2008 SP1. When I try to deploy, I get the following error:
Exception of type 'Microsoft.ReportingServices.RsProxy.AccessDeniedException' was thrown.
When I Googled the issue, all I can find is information such as this:
> 1. Open “Report Manager” using http://<servername>/reports;
>
> 2. Click “Site Settings”;
>
> 3. Click :Configure item-level role definitions”;
>
> 4. Click “Content Manager”;
>
> 5. Make sure everything is ticked off especially “Manage models” and “ View
> models”;
However, when I open my Report Manager URL, number 3 doesn't apply. I am an admin on this machine. What am I doing wrong?
| ssrs-2008 | sql-server-2008 | reportingservices-2008 | null | null | null | open | Can't Deploy Report Models in SSRS 2008
===
I created a data model in BIDS for SSRS 2008 SP1. When I try to deploy, I get the following error:
Exception of type 'Microsoft.ReportingServices.RsProxy.AccessDeniedException' was thrown.
When I Googled the issue, all I can find is information such as this:
> 1. Open “Report Manager” using http://<servername>/reports;
>
> 2. Click “Site Settings”;
>
> 3. Click :Configure item-level role definitions”;
>
> 4. Click “Content Manager”;
>
> 5. Make sure everything is ticked off especially “Manage models” and “ View
> models”;
However, when I open my Report Manager URL, number 3 doesn't apply. I am an admin on this machine. What am I doing wrong?
| 0 |
11,387,181 | 07/08/2012 22:17:50 | 95,195 | 04/23/2009 21:10:22 | 2,458 | 143 | What is the name of a pair of brackets inside a C# function that only exists for an extra level of scope? | Take as an example the following C# function:
static void Main(string[] args)
{
var r = new Random();
{
var i = r.Next(); ;
Console.WriteLine("i = {0}", i);
}
var action = new Action(delegate()
{
var i = r.Next();
Console.WriteLine("Delegate: i = {0}", i);
});
action();
}
The following block only exists as C# syntactic sugar to enforce an extra layer of variable scope in the source code.
{
var i = r.Next(); ;
Console.WriteLine("i = {0}", i);
}
I proved this by decompiling the generated assembly with ILSpy and getting this:
private static void Main(string[] args)
{
Random r = new Random();
int i = r.Next();
Console.WriteLine("i = {0}", i);
Action action = delegate
{
int j = r.Next();
Console.WriteLine("Delegate: i = {0}", j);
}
;
action();
}
So does this C# construct have a name? If so what is it? | c# | .net | null | null | null | null | open | What is the name of a pair of brackets inside a C# function that only exists for an extra level of scope?
===
Take as an example the following C# function:
static void Main(string[] args)
{
var r = new Random();
{
var i = r.Next(); ;
Console.WriteLine("i = {0}", i);
}
var action = new Action(delegate()
{
var i = r.Next();
Console.WriteLine("Delegate: i = {0}", i);
});
action();
}
The following block only exists as C# syntactic sugar to enforce an extra layer of variable scope in the source code.
{
var i = r.Next(); ;
Console.WriteLine("i = {0}", i);
}
I proved this by decompiling the generated assembly with ILSpy and getting this:
private static void Main(string[] args)
{
Random r = new Random();
int i = r.Next();
Console.WriteLine("i = {0}", i);
Action action = delegate
{
int j = r.Next();
Console.WriteLine("Delegate: i = {0}", j);
}
;
action();
}
So does this C# construct have a name? If so what is it? | 0 |
4,231,561 | 11/20/2010 06:52:51 | 514,271 | 11/20/2010 06:52:51 | 1 | 0 | PHP coding in HTML to create front end of a website | how exactly a PHP code in HTML document helps to navigate to different web page on clicking on a link?.pls help .thankful if given asimple example of PHP code.i am using CMS as back end
(PHP/Mysql).pls help me in creating front end in PHP for a website.pls pls .....help | php | mysql | null | null | null | null | open | PHP coding in HTML to create front end of a website
===
how exactly a PHP code in HTML document helps to navigate to different web page on clicking on a link?.pls help .thankful if given asimple example of PHP code.i am using CMS as back end
(PHP/Mysql).pls help me in creating front end in PHP for a website.pls pls .....help | 0 |
1,360,963 | 09/01/2009 07:08:09 | 63,051 | 02/05/2009 20:53:34 | 2,400 | 63 | Best Java RAD web framework | What is the best web framework in Java for RAD development?
Preferably,actual Java web app and not just JVM.
| java | web-frameworks | java-web-framework | rad | null | 09/11/2011 17:20:54 | not constructive | Best Java RAD web framework
===
What is the best web framework in Java for RAD development?
Preferably,actual Java web app and not just JVM.
| 4 |
9,465,809 | 02/27/2012 13:28:29 | 1,235,658 | 02/27/2012 13:16:10 | 1 | 0 | How to memorize Java coding, and project solving easier? | I've used this site hundreds of times over in the past, and finally decided to make an account, since it has helped me so much. Which, is why I would first off like to say thanks to this awesome community. =) Anyways, my question/issue is this: I am a sophmore in college, studying in the Comp Sci field. The courses offered right now are only in Java. I love the field, and have been around it all my life (via family members). My problem is that I have a hard time starting problems out for when we get assigned projects to do. Other classmates seems to take everything the professor said once from a lecture, and can take that to every little end point and memorize it in a flash. Myself on the otherhand, even after vigerous notes, and multiple times looking over the material, still struggle on figuring out what to do to start different problems, or procede at times when I am stuck. Sadly enough though, I can remember random details about anything else, or look over other things one time over, and be in that same situation of knowledge. Now, Im not looking for the general, "practice, practice, practice' answer, but more if anyone any tips/tricks they used to help remember things during the coding process. Would greatly appriciate it to hear everyone's comments.
Thanks!
Tl:DR - Tips/Tricks to help a struggling programmer remember Java code easier besides just "practice". | java | tips-and-tricks | null | null | null | 02/27/2012 13:39:01 | not a real question | How to memorize Java coding, and project solving easier?
===
I've used this site hundreds of times over in the past, and finally decided to make an account, since it has helped me so much. Which, is why I would first off like to say thanks to this awesome community. =) Anyways, my question/issue is this: I am a sophmore in college, studying in the Comp Sci field. The courses offered right now are only in Java. I love the field, and have been around it all my life (via family members). My problem is that I have a hard time starting problems out for when we get assigned projects to do. Other classmates seems to take everything the professor said once from a lecture, and can take that to every little end point and memorize it in a flash. Myself on the otherhand, even after vigerous notes, and multiple times looking over the material, still struggle on figuring out what to do to start different problems, or procede at times when I am stuck. Sadly enough though, I can remember random details about anything else, or look over other things one time over, and be in that same situation of knowledge. Now, Im not looking for the general, "practice, practice, practice' answer, but more if anyone any tips/tricks they used to help remember things during the coding process. Would greatly appriciate it to hear everyone's comments.
Thanks!
Tl:DR - Tips/Tricks to help a struggling programmer remember Java code easier besides just "practice". | 1 |
362,360 | 12/12/2008 10:07:58 | 11,193 | 09/16/2008 06:02:43 | 390 | 6 | Image resize in Grails | I am developing a Web Album using Grails and for image processing, I am using grails-image-tools plugin. I need a functionality to resize the images if the uploaded images size is too big (for eg: more than 600 * 840 ) . In this case I need to resize this image to 600 * 840). What is the most efficient way to do this? Thanks a lot. | grails | java | frameworks | null | null | null | open | Image resize in Grails
===
I am developing a Web Album using Grails and for image processing, I am using grails-image-tools plugin. I need a functionality to resize the images if the uploaded images size is too big (for eg: more than 600 * 840 ) . In this case I need to resize this image to 600 * 840). What is the most efficient way to do this? Thanks a lot. | 0 |
671,049 | 03/22/2009 14:04:34 | 63,051 | 02/05/2009 20:53:34 | 597 | 32 | How do you kill a thread in Java? | How do you kill a thread in Java? | java | multithreading | null | null | null | null | open | How do you kill a thread in Java?
===
How do you kill a thread in Java? | 0 |
11,315,930 | 07/03/2012 17:17:49 | 1,305,007 | 03/31/2012 12:22:40 | 1 | 0 | which is better to use axlsx or spreadsheet gem? | Which gem is better to use to create & read excel files using Rails 3 - axlsx or spreadsheet ? | ruby-on-rails | ruby-on-rails-3 | spreadsheet | null | null | 07/04/2012 02:31:59 | not constructive | which is better to use axlsx or spreadsheet gem?
===
Which gem is better to use to create & read excel files using Rails 3 - axlsx or spreadsheet ? | 4 |
5,286,469 | 03/13/2011 00:00:17 | 656,456 | 03/12/2011 09:28:51 | 1 | 0 | Android phone bricked | I think my qualcomm mobile development platform MSM8655 based android phone has been bricked.
I was trying to install browser.apk on my phone from my computer using adb. I followed the instructions below.
adb push (location of stock Browser.apk) /system/app/Browser.apk
adb shell
mount -o ro,remount -t yaffs2 /dev/block/mtdblock4 /system
sync
For some reason, when I was "mounting" the phone, it gave me a message that " the device is busy". I still went ahead and did the "sync".
After that, I switched off the phone. When I tried to switch on the phone, nothing comes on the screen. Not even the android logo!
I tried to do a hard reset by holding both the power and volume up button. But it still didnot work.
In some forums, I read that this problem may occur because of USB charging. They had suggested to charge the phone using the plug and removing the battery and placing it again. I tried it and it also did not work.
I did found that adb is detecting the device. Is there anything that I can do using adb?
I am very desperate. Please help me..
Thanks | android | android-widget | adb | null | null | 03/13/2011 00:18:24 | off topic | Android phone bricked
===
I think my qualcomm mobile development platform MSM8655 based android phone has been bricked.
I was trying to install browser.apk on my phone from my computer using adb. I followed the instructions below.
adb push (location of stock Browser.apk) /system/app/Browser.apk
adb shell
mount -o ro,remount -t yaffs2 /dev/block/mtdblock4 /system
sync
For some reason, when I was "mounting" the phone, it gave me a message that " the device is busy". I still went ahead and did the "sync".
After that, I switched off the phone. When I tried to switch on the phone, nothing comes on the screen. Not even the android logo!
I tried to do a hard reset by holding both the power and volume up button. But it still didnot work.
In some forums, I read that this problem may occur because of USB charging. They had suggested to charge the phone using the plug and removing the battery and placing it again. I tried it and it also did not work.
I did found that adb is detecting the device. Is there anything that I can do using adb?
I am very desperate. Please help me..
Thanks | 2 |
7,475,056 | 09/19/2011 17:46:07 | 949,228 | 09/16/2011 16:05:51 | 1 | 0 | Configuring php with Mysql | i tried to install apache + php + Mysql + phpMyadmin , but when i test a page i get
" Fatal error: Call to undefined function mysql_connect() in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\mysql_test.php on line 9 " . although "http://localhost/info.php"
shows the php details. ( i tried all the answers given here ) | mysql | null | null | null | null | 09/19/2011 18:50:54 | too localized | Configuring php with Mysql
===
i tried to install apache + php + Mysql + phpMyadmin , but when i test a page i get
" Fatal error: Call to undefined function mysql_connect() in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\mysql_test.php on line 9 " . although "http://localhost/info.php"
shows the php details. ( i tried all the answers given here ) | 3 |
2,910,263 | 05/26/2010 05:28:24 | 291,247 | 03/11/2010 07:00:05 | 6 | 4 | Why I am not able to see recorded video in app's photogallery? | I have recorded video in kitchensink(phone >>
save to gallery >> from video). After recording video it was give message "Check your photo gallery", but when I have open photo gallery(phone >> photo gallery) recorded video was not there.I am not getting why this was happened.Can any body help me?
| iphone | video | record | null | null | 05/26/2010 08:58:18 | off topic | Why I am not able to see recorded video in app's photogallery?
===
I have recorded video in kitchensink(phone >>
save to gallery >> from video). After recording video it was give message "Check your photo gallery", but when I have open photo gallery(phone >> photo gallery) recorded video was not there.I am not getting why this was happened.Can any body help me?
| 2 |
1,292,897 | 08/18/2009 09:44:55 | 153,094 | 08/08/2009 21:37:21 | 1 | 0 | Problem in maintaining session between two different domains on a website done in CakePHP | Well as I have posted earlier too...I have created a site in two languages.One with URL www.mainDomain.com(English) and other with www.fr.subDomain.com(French).Both are done in CakePHP,in french I have just changed the views of it to French.But the problem is,when anybody login's in English version and then switches to the French version,the session does'nt recognizes it and ask for login again.It has become to be the biggest bug in the Web application which I have done till far.
For that,as Swanny told me to go through a link http://www.cake-toppings.com/tag/subdomains/ and I did it on my application as it was said on the link.Apparently,it worked for login which shared session between two domains(main domain and it's subdomain).But when I checked it thourogly,i recognized that both the sites are throwing the latest NEWS from Database,both data are different.Just to check if I was wrong I changed the some save variable to database in session array.But now it refused to remember anything(session).Could anyone suggest me what could be problem with this and how can I resolve this...???
Thanks in advance
| cakephp | null | null | null | null | null | open | Problem in maintaining session between two different domains on a website done in CakePHP
===
Well as I have posted earlier too...I have created a site in two languages.One with URL www.mainDomain.com(English) and other with www.fr.subDomain.com(French).Both are done in CakePHP,in french I have just changed the views of it to French.But the problem is,when anybody login's in English version and then switches to the French version,the session does'nt recognizes it and ask for login again.It has become to be the biggest bug in the Web application which I have done till far.
For that,as Swanny told me to go through a link http://www.cake-toppings.com/tag/subdomains/ and I did it on my application as it was said on the link.Apparently,it worked for login which shared session between two domains(main domain and it's subdomain).But when I checked it thourogly,i recognized that both the sites are throwing the latest NEWS from Database,both data are different.Just to check if I was wrong I changed the some save variable to database in session array.But now it refused to remember anything(session).Could anyone suggest me what could be problem with this and how can I resolve this...???
Thanks in advance
| 0 |
3,798,855 | 09/26/2010 17:03:27 | 414,596 | 08/08/2010 23:10:13 | 20 | 1 | sql ce escape '(single quote) C# | I am writing some code to store names in a database. I limit the names to only certain characters, but last names are a challenge. Since some people have single quotes in their name (example O'Brian) I need to allow this. So I wrote a regex replace to replace the ' with a \' which I assumed should make the ' a literal. It works as far as replacement goes, but it still marks the end of the string, and I get the error
There was an error parsing the query. [ Token line number=1, token line offeset = 71, token in error=Brian]
I understand the error, the single quote marks the end of the string to be entered leaving the rest of the string Brian outside the quotes.
The code I am using:
Regex reg = new Regex("\'");
firstName = reg.Replace(firstName, "\\'");
lastName = reg.Replace(lastName, "\\'"):
Then the select query is built with string.format
sqlInsertObj.CommandText = string.Format("INSERT INTO childNameId (childFName, childLName) VALUES ('{0}', '{1}')", fName, lName);
sqlInsertObj.ExecuteNonQuery();
This works for any entry, except when there is a quote in the name.
| c# | regex | visual-studio-2010 | insert | sql-server-ce | null | open | sql ce escape '(single quote) C#
===
I am writing some code to store names in a database. I limit the names to only certain characters, but last names are a challenge. Since some people have single quotes in their name (example O'Brian) I need to allow this. So I wrote a regex replace to replace the ' with a \' which I assumed should make the ' a literal. It works as far as replacement goes, but it still marks the end of the string, and I get the error
There was an error parsing the query. [ Token line number=1, token line offeset = 71, token in error=Brian]
I understand the error, the single quote marks the end of the string to be entered leaving the rest of the string Brian outside the quotes.
The code I am using:
Regex reg = new Regex("\'");
firstName = reg.Replace(firstName, "\\'");
lastName = reg.Replace(lastName, "\\'"):
Then the select query is built with string.format
sqlInsertObj.CommandText = string.Format("INSERT INTO childNameId (childFName, childLName) VALUES ('{0}', '{1}')", fName, lName);
sqlInsertObj.ExecuteNonQuery();
This works for any entry, except when there is a quote in the name.
| 0 |
5,604,893 | 04/09/2011 11:58:03 | 425 | 08/05/2008 15:31:37 | 1,628 | 41 | The financial domain, what do I need to know? | I will shortly be moving roles and it appears that I will likely be working in the financial/banking sector which (for some reason) scares me. I have never worked in this domain, and I feel that I personally know nothing about it. I would say that I am a relatively solid developer, but a lack of understanding of how the financial industry operates, at a core level, really makes me nervous.
My understanding, from workmates and friends, is that actually the quality of the dev staff in these places can vary tremendously and that I shouldn't be so worried. What are others experiences of working in this industry? What do I need to read up in in order to feel less intimidated? | self-improvement | finance | banking | null | null | 04/09/2011 12:10:44 | off topic | The financial domain, what do I need to know?
===
I will shortly be moving roles and it appears that I will likely be working in the financial/banking sector which (for some reason) scares me. I have never worked in this domain, and I feel that I personally know nothing about it. I would say that I am a relatively solid developer, but a lack of understanding of how the financial industry operates, at a core level, really makes me nervous.
My understanding, from workmates and friends, is that actually the quality of the dev staff in these places can vary tremendously and that I shouldn't be so worried. What are others experiences of working in this industry? What do I need to read up in in order to feel less intimidated? | 2 |
8,234,564 | 11/22/2011 22:10:45 | 275,414 | 02/17/2010 16:44:35 | 261 | 9 | Use CakePHP or just use PHP? | Ok, so a quick question, I have developed in PHP ever since I was 16 now 23 I need to know should I use CakePHP with Smarty Templating or should I just use OOPHP which is what I currently do.
The issue I have with CakePHP is how many files are there, are they all really needed, and as I don't have time to really go through CakePHP and remove cake code that is not being used by my script.
I cant use Druple or Joomla as this clients needs need to use there old site, and slowly integrate the new site.
Let me know your thoughts. | php | cakephp | smarty3 | null | null | 12/03/2011 15:37:44 | not constructive | Use CakePHP or just use PHP?
===
Ok, so a quick question, I have developed in PHP ever since I was 16 now 23 I need to know should I use CakePHP with Smarty Templating or should I just use OOPHP which is what I currently do.
The issue I have with CakePHP is how many files are there, are they all really needed, and as I don't have time to really go through CakePHP and remove cake code that is not being used by my script.
I cant use Druple or Joomla as this clients needs need to use there old site, and slowly integrate the new site.
Let me know your thoughts. | 4 |
10,693,962 | 05/21/2012 23:31:44 | 590,421 | 01/26/2011 10:27:46 | 422 | 3 | Does perf counters on the primary machine reflect the values on the mirror for Sql Server? | Is it enough if we monitor the Database Mirroring RedoQueue KB performance object on the primary and not on the mirror? I find that the value is the same if collected on the primary or the mirror. | sql-server | sql-server-2008 | perfmon | null | null | 05/22/2012 12:13:56 | not a real question | Does perf counters on the primary machine reflect the values on the mirror for Sql Server?
===
Is it enough if we monitor the Database Mirroring RedoQueue KB performance object on the primary and not on the mirror? I find that the value is the same if collected on the primary or the mirror. | 1 |
7,970,288 | 11/01/2011 17:23:59 | 1,017,632 | 10/28/2011 02:29:10 | 6 | 0 | c/c++ data type with fastest portable access by pointer? | I need to implement a large dynamic multi-dimensional bitmap (as in a map of bits) and speed and portability are both important. My first choise is `int`(doh!) but perhaps `long` or `long long` or maybe even `char` are better? | c++ | c | pointers | primitive-types | null | 11/02/2011 06:39:02 | not a real question | c/c++ data type with fastest portable access by pointer?
===
I need to implement a large dynamic multi-dimensional bitmap (as in a map of bits) and speed and portability are both important. My first choise is `int`(doh!) but perhaps `long` or `long long` or maybe even `char` are better? | 1 |
2,054,293 | 01/13/2010 03:59:53 | 198,571 | 10/29/2009 01:11:19 | 45 | 1 | fslex lexing javascript regular expressions | I am attempting to lex javascript regular exression literals. These start with a "/" and end with a "/" (and sometimes some other modifiers). The issue is that the only way to determine whether it is a regular expression as opposed to a division operator is by reading the tokens previous to the "/" character.
One can read a little more on this [here][1].
As it is, I can't find any documentation on how to get the previous token. Hopefully this is possible and someone can tell me how.
Thanks.
[1]: http://www.mozilla.org/js/language/js20-2000-07/rationale/syntax.html#regular-expressions | f# | fsyacc | null | null | null | null | open | fslex lexing javascript regular expressions
===
I am attempting to lex javascript regular exression literals. These start with a "/" and end with a "/" (and sometimes some other modifiers). The issue is that the only way to determine whether it is a regular expression as opposed to a division operator is by reading the tokens previous to the "/" character.
One can read a little more on this [here][1].
As it is, I can't find any documentation on how to get the previous token. Hopefully this is possible and someone can tell me how.
Thanks.
[1]: http://www.mozilla.org/js/language/js20-2000-07/rationale/syntax.html#regular-expressions | 0 |
6,842,762 | 07/27/2011 10:20:01 | 624,094 | 04/23/2010 07:41:41 | 129 | 19 | I am trying to play .m4a file using stream method. but its not working | var video:Video = new Video();
addChild(video);
var netCon:NetConnection = new NetConnection();
netCon.connect(null);
var streamNS:NetStream = new NetStream(netCon);
//streamNS.client = this;
//video.attachNetStream(streamNS);
streamNS.play("AfricanElengwen.m4a");
streamNS.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
function netStatusHandler(e:NetStatusEvent):void
{
if (e.info.code == "NetStream.Play.FileStructureInvalid")
{
trace("The MP4's file structure is invalid.");
} else if (e.info.code == "NetStream.Play.NoSupportedTrackFound")
{
trace("The MP4 doesn't contain any supported tracks");
}
}
I get this code from the below link,
http://www.adobe.com/devnet/flashplayer/articles/hd_video_flash_player.html#articlecontentAdobe_numberedheader_0
I didn't get any error.
Can anyone say what is the bug? | actionscript-3 | flash-cs4 | flash-cs5 | flash-cs3 | null | 09/10/2011 20:15:50 | not a real question | I am trying to play .m4a file using stream method. but its not working
===
var video:Video = new Video();
addChild(video);
var netCon:NetConnection = new NetConnection();
netCon.connect(null);
var streamNS:NetStream = new NetStream(netCon);
//streamNS.client = this;
//video.attachNetStream(streamNS);
streamNS.play("AfricanElengwen.m4a");
streamNS.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
function netStatusHandler(e:NetStatusEvent):void
{
if (e.info.code == "NetStream.Play.FileStructureInvalid")
{
trace("The MP4's file structure is invalid.");
} else if (e.info.code == "NetStream.Play.NoSupportedTrackFound")
{
trace("The MP4 doesn't contain any supported tracks");
}
}
I get this code from the below link,
http://www.adobe.com/devnet/flashplayer/articles/hd_video_flash_player.html#articlecontentAdobe_numberedheader_0
I didn't get any error.
Can anyone say what is the bug? | 1 |
10,318,304 | 04/25/2012 14:58:41 | 498,735 | 11/05/2010 19:51:01 | 228 | 4 | Should I cache iPod Music Library? | Is there a need to cache the entire iPod music library to a local database, or I can go just fine with [MPMediaQuery songsQuery]? It finishes in under 0.1 seconds for my library of 600 songs, but maybe for larger collections it will make a difference? What do you think? | ios | caching | music | ipod | null | null | open | Should I cache iPod Music Library?
===
Is there a need to cache the entire iPod music library to a local database, or I can go just fine with [MPMediaQuery songsQuery]? It finishes in under 0.1 seconds for my library of 600 songs, but maybe for larger collections it will make a difference? What do you think? | 0 |
22,720 | 08/22/2008 15:58:13 | 2,362 | 08/21/2008 20:46:43 | 3 | 1 | How to configure a Java Socket to fail-fast on disconnect | I have a listening port on my server that I'm connecting to using a Java class and the Socket interface, i.e.
Socket mySocket = new Socket(host,port);
I then grab an OutputStream, decorate with a PrintWriter in autoflush mode and I'm laughing - except if the listening port closes. Then I get
tcp4 0 0 *.9999 *.* LISTEN
tcp 0 0 127.0.0.1.45737 127.0.0.1.9999 CLOSE_WAIT
and I can't seem to detect the problem in the program - I've tried using the isConnected() Socket method but it doesn't seem to know that the connection is closed.
I want to be aware of the problem the next time I try and write to the Socket so that I can try and reconnect and report the issue.
Any advice please?
Thanks all
| java | socket | networking | exception | null | null | open | How to configure a Java Socket to fail-fast on disconnect
===
I have a listening port on my server that I'm connecting to using a Java class and the Socket interface, i.e.
Socket mySocket = new Socket(host,port);
I then grab an OutputStream, decorate with a PrintWriter in autoflush mode and I'm laughing - except if the listening port closes. Then I get
tcp4 0 0 *.9999 *.* LISTEN
tcp 0 0 127.0.0.1.45737 127.0.0.1.9999 CLOSE_WAIT
and I can't seem to detect the problem in the program - I've tried using the isConnected() Socket method but it doesn't seem to know that the connection is closed.
I want to be aware of the problem the next time I try and write to the Socket so that I can try and reconnect and report the issue.
Any advice please?
Thanks all
| 0 |
7,536,867 | 09/24/2011 03:41:42 | 874,737 | 08/02/2011 13:42:42 | 62 | 0 | CSS navigation cool left and right edges | How can I make this happen?

As you can see, it has some cool css effects from the left and right bottom edges. Are there any tutorials for this? I've found that there are some sites that uses this effect for their navs. | html | css | navigation | null | null | 09/24/2011 04:14:02 | not a real question | CSS navigation cool left and right edges
===
How can I make this happen?

As you can see, it has some cool css effects from the left and right bottom edges. Are there any tutorials for this? I've found that there are some sites that uses this effect for their navs. | 1 |
1,981,188 | 12/30/2009 16:54:28 | 4,927 | 09/06/2008 18:02:06 | 853 | 27 | Error using ColdFusion cfexchangeconnection to connect to Exchange server | I am getting an error when trying to connect to an Exchange server using the cfexchangeconnection tag. First some code:
<cfexchangeconnection action="open"
server="****"
username="****"
password="****"
connection="myEX"
protocol="https"
port="443">
I know its the right server because it fails when not processing via https. I have tried:
- Following all the instructions here http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSc3ff6d0ea77859461172e0811cbec14f31-7fed.html
- Prefixing username with a domain name, adding @domain name, etc and no luck.
The error I get is:
**Access to the Exchange server denied.**
Ensure that the user name and password are correct.
Any ideas | coldfusion | exchange | null | null | null | null | open | Error using ColdFusion cfexchangeconnection to connect to Exchange server
===
I am getting an error when trying to connect to an Exchange server using the cfexchangeconnection tag. First some code:
<cfexchangeconnection action="open"
server="****"
username="****"
password="****"
connection="myEX"
protocol="https"
port="443">
I know its the right server because it fails when not processing via https. I have tried:
- Following all the instructions here http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSc3ff6d0ea77859461172e0811cbec14f31-7fed.html
- Prefixing username with a domain name, adding @domain name, etc and no luck.
The error I get is:
**Access to the Exchange server denied.**
Ensure that the user name and password are correct.
Any ideas | 0 |
3,510,001 | 08/18/2010 07:55:45 | 415,204 | 08/09/2010 14:41:18 | 1 | 0 | which is the best CMS solution for PHP mysql | which is the best CMS solution for PHP mysql | php | mysql | content-management-system | null | null | 08/18/2010 07:59:52 | not constructive | which is the best CMS solution for PHP mysql
===
which is the best CMS solution for PHP mysql | 4 |
8,749,039 | 01/05/2012 20:08:33 | 1,123,012 | 12/30/2011 13:52:11 | 13 | 0 | questi0n on simple calculation in c programming | #include <stdio.h>
#include <stdlib.h>
#include <conio.h>
int main()
{
int c,count=0,count1=0;
float d;
while ((c=getch()))
{
count = count++;
if (c=='1'||c=='2'||c=='3'||c=='4'||c=='5'||c=='6'||c=='7'||c=='8'||c=='9'||c=='0')
{
count1=count1++;
}
if (c=='!')
{
d=(count1/count*100);
printf("\nnumbers of keys is %d percentage of number keys is %.3 percent",count,d);
}
}
return 0;
}
___________________________________________________________________________________________
THE CODE ABOVE IS TO COUNT THE NUMBER OF KEYS PRESSED AND PRINT IT TO THE SCREEN ALONG WITH THE PERCENTAGE OF NUMBER KEYS PRESSED. HOWEVER WHENEVER I RUN IT I GET THE PERCENTAGE TO B 0. WHY??? (PLEASE SHOW CORRECTION)
___________________________________________________________________________________________ | c | null | null | null | null | 01/05/2012 20:16:41 | too localized | questi0n on simple calculation in c programming
===
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
int main()
{
int c,count=0,count1=0;
float d;
while ((c=getch()))
{
count = count++;
if (c=='1'||c=='2'||c=='3'||c=='4'||c=='5'||c=='6'||c=='7'||c=='8'||c=='9'||c=='0')
{
count1=count1++;
}
if (c=='!')
{
d=(count1/count*100);
printf("\nnumbers of keys is %d percentage of number keys is %.3 percent",count,d);
}
}
return 0;
}
___________________________________________________________________________________________
THE CODE ABOVE IS TO COUNT THE NUMBER OF KEYS PRESSED AND PRINT IT TO THE SCREEN ALONG WITH THE PERCENTAGE OF NUMBER KEYS PRESSED. HOWEVER WHENEVER I RUN IT I GET THE PERCENTAGE TO B 0. WHY??? (PLEASE SHOW CORRECTION)
___________________________________________________________________________________________ | 3 |
8,645,630 | 12/27/2011 14:19:51 | 345,280 | 05/19/2010 16:09:17 | 5 | 3 | File search based on wild card string as Name | I am writing a File Search program in java as a part of my project. It has to search file(location) by name using wild card string as input parameter for name.
<br>What would be the best approach to follow for this. Any tips would be welcome on this. | java | null | null | null | null | 12/27/2011 14:30:09 | not a real question | File search based on wild card string as Name
===
I am writing a File Search program in java as a part of my project. It has to search file(location) by name using wild card string as input parameter for name.
<br>What would be the best approach to follow for this. Any tips would be welcome on this. | 1 |
5,699,152 | 04/18/2011 06:09:50 | 533,399 | 12/07/2010 08:52:27 | 1,787 | 153 | Does logging output to an output file affect mongoDB performance ? | MongoDB outputs to a file speficied in command line parameters when it is started.
My question is : is that log writing a blocking operation ? Does it write previous operation
to log before executing the next one ?
Will disabling logging enhance the performance of a write heavy setup in anyway ? | mongodb | null | null | null | null | null | open | Does logging output to an output file affect mongoDB performance ?
===
MongoDB outputs to a file speficied in command line parameters when it is started.
My question is : is that log writing a blocking operation ? Does it write previous operation
to log before executing the next one ?
Will disabling logging enhance the performance of a write heavy setup in anyway ? | 0 |
4,217,214 | 11/18/2010 16:33:30 | 285,780 | 03/03/2010 22:06:46 | 46 | 0 | How do I keep track of when what is the text entered in the form when the user navigates away from the page? | I have a piece of code like this.
<form method="get" action="{$self}" name="addcommentform">
<textarea title="{$enterComment}" name="comment" class="commentarea" </textarea>
<input class="Button" type="submit" value="{$postComment}" />
</form>
How do I keep track of when what is the text entered in the form's textarea when the user navigates away from the page? I want to prompt the user with a warning message so he/she doesn't lose the text.
Thanks. | forms | text | null | null | null | null | open | How do I keep track of when what is the text entered in the form when the user navigates away from the page?
===
I have a piece of code like this.
<form method="get" action="{$self}" name="addcommentform">
<textarea title="{$enterComment}" name="comment" class="commentarea" </textarea>
<input class="Button" type="submit" value="{$postComment}" />
</form>
How do I keep track of when what is the text entered in the form's textarea when the user navigates away from the page? I want to prompt the user with a warning message so he/she doesn't lose the text.
Thanks. | 0 |
9,203,125 | 02/08/2012 23:22:14 | 166,303 | 08/31/2009 23:48:43 | 1,068 | 41 | Clear Facebook Web Context on Server-side | I've implemented client-side authentication using the Facebook Javascript SDK. I check the FacebookWeb context in the Application_AuthenticateRequest event in order to establish if the user is logged in and set the HttpCoontext.Current.User IPrincipal accordingly.
If I delete a user from the database I would like to delete the Facebook web context to ensure that HttpContext.Current.User.IsAuthenticated is false. Also if a user de-authorizes my app I would like to delete the facebook web context. I don't want to log them out of facebook - just delete the facebook web context so the session isn't Authenticated any more.
How do I do this on the server side? | facebook | facebook-c#-sdk | null | null | null | null | open | Clear Facebook Web Context on Server-side
===
I've implemented client-side authentication using the Facebook Javascript SDK. I check the FacebookWeb context in the Application_AuthenticateRequest event in order to establish if the user is logged in and set the HttpCoontext.Current.User IPrincipal accordingly.
If I delete a user from the database I would like to delete the Facebook web context to ensure that HttpContext.Current.User.IsAuthenticated is false. Also if a user de-authorizes my app I would like to delete the facebook web context. I don't want to log them out of facebook - just delete the facebook web context so the session isn't Authenticated any more.
How do I do this on the server side? | 0 |
7,498,525 | 09/21/2011 10:53:32 | 712,486 | 04/17/2011 20:20:09 | 79 | 1 | merging two arrays of different objects in rails | OK, Ive built a status feed for this site Im making which shows a user the recently added artwork of a user they are following. I have another feed that shows recently added comments by the followed user, which will soon be changed to comments added to the current user's submitted work.
Anyway, I was wondering how to go about merging the two arrays into the same feed. So that way the feed will display both arrays, in order of created by.
Im thinking that in my controller, I would call the two queries, then add them together, then sort by created_at.
And in the view I would loop through the array, and use an if/else statement to correctly display the activity.
How would I go about actually merging and sorting the arrays? | ruby-on-rails | ruby-on-rails-3 | null | null | null | null | open | merging two arrays of different objects in rails
===
OK, Ive built a status feed for this site Im making which shows a user the recently added artwork of a user they are following. I have another feed that shows recently added comments by the followed user, which will soon be changed to comments added to the current user's submitted work.
Anyway, I was wondering how to go about merging the two arrays into the same feed. So that way the feed will display both arrays, in order of created by.
Im thinking that in my controller, I would call the two queries, then add them together, then sort by created_at.
And in the view I would loop through the array, and use an if/else statement to correctly display the activity.
How would I go about actually merging and sorting the arrays? | 0 |
8,358,830 | 12/02/2011 15:44:59 | 568,498 | 01/09/2011 02:12:03 | 1 | 0 | Windows Phone Emulator Crash | I have a problem with Windows Phone Emulator. When i try run it, it shows "Windows Phone Emulator is doing a complete OS Boot", and after this is shows "Windows Phone Emulator has stopeed working", and after press "Close the program" its restarting again with error.
> Problem signature:
> Problem Event Name: APPCRASH
> Application Name: XDE.exe
> Application Version: 10.1.40219.209
> Application Timestamp: 4e7286c7
> Fault Module Name: nvumdshim.dll
> Fault Module Version: 8.17.12.8562
> Fault Module Timestamp: 4e991f5c
> Exception Code: c0000005
> Exception Offset: 000305a8
> OS Version: 6.1.7601.2.1.0.256.48
> Locale ID: 1045
> Additional Information 1: 0a9e
> Additional Information 2: 0a9e372d3b4ad19135b953a78882e789
> Additional Information 3: 0a9e
> Additional Information 4: 0a9e372d3b4ad19135b953a78882e789
My system specification: windows 7 amd64, 4GB RAM, GeForce 310M Optimus (285 drivers).
Thanks from the up for the answers.
| windows-phone-7 | null | null | null | null | 12/02/2011 16:27:30 | too localized | Windows Phone Emulator Crash
===
I have a problem with Windows Phone Emulator. When i try run it, it shows "Windows Phone Emulator is doing a complete OS Boot", and after this is shows "Windows Phone Emulator has stopeed working", and after press "Close the program" its restarting again with error.
> Problem signature:
> Problem Event Name: APPCRASH
> Application Name: XDE.exe
> Application Version: 10.1.40219.209
> Application Timestamp: 4e7286c7
> Fault Module Name: nvumdshim.dll
> Fault Module Version: 8.17.12.8562
> Fault Module Timestamp: 4e991f5c
> Exception Code: c0000005
> Exception Offset: 000305a8
> OS Version: 6.1.7601.2.1.0.256.48
> Locale ID: 1045
> Additional Information 1: 0a9e
> Additional Information 2: 0a9e372d3b4ad19135b953a78882e789
> Additional Information 3: 0a9e
> Additional Information 4: 0a9e372d3b4ad19135b953a78882e789
My system specification: windows 7 amd64, 4GB RAM, GeForce 310M Optimus (285 drivers).
Thanks from the up for the answers.
| 3 |
2,298,085 | 02/19/2010 16:53:45 | 241,996 | 01/01/2010 17:37:20 | 1 | 0 | embedded file into delphi exe application (not as a separate file from the appliaction) | i want to embedded a file (any kind of type) to my exe appllication and be able to extract in the remote to use it, i know how do it by embedded into resource,but i don't want to place the files in the app directory, i want to store all files (like .rec) into my exe, in c# it is pussible to store as text file and then read it by FileStream but in delphi the resource files is separate from the exe file.
is there any solution to do this ? thx alot | delphi-7 | delphi | null | null | null | null | open | embedded file into delphi exe application (not as a separate file from the appliaction)
===
i want to embedded a file (any kind of type) to my exe appllication and be able to extract in the remote to use it, i know how do it by embedded into resource,but i don't want to place the files in the app directory, i want to store all files (like .rec) into my exe, in c# it is pussible to store as text file and then read it by FileStream but in delphi the resource files is separate from the exe file.
is there any solution to do this ? thx alot | 0 |
8,225,209 | 11/22/2011 10:21:26 | 1,059,542 | 11/22/2011 10:11:53 | 1 | 0 | How can i check the privacy of a photo Uploaded by a user in facebook | I have a Fbaccount Id and a Photo url.How can i check whether the photo is visible or accessable to the fbaccount, that i have ?Plz Help | facebook | api | graph | null | null | 11/22/2011 16:34:31 | not a real question | How can i check the privacy of a photo Uploaded by a user in facebook
===
I have a Fbaccount Id and a Photo url.How can i check whether the photo is visible or accessable to the fbaccount, that i have ?Plz Help | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.