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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7,535,685 | 09/23/2011 23:00:00 | 775,355 | 05/29/2011 18:06:46 | 115 | 1 | How Firewalls Work | Just a general question here. If a network isn't protected by a firewall, how does a virus spread to your computer? Does another computer just have to send a UDP packet or open TCP stream with the virus on it? Could another computer get access to my shell and run scripts on my computer remotely? | security | networking | connection | port | firewall | 09/23/2011 23:11:11 | off topic | How Firewalls Work
===
Just a general question here. If a network isn't protected by a firewall, how does a virus spread to your computer? Does another computer just have to send a UDP packet or open TCP stream with the virus on it? Could another computer get access to my shell and run scripts on my computer remotely? | 2 |
9,953,481 | 03/31/2012 06:10:14 | 1,109,475 | 12/21/2011 08:53:24 | 11 | 0 | Getting content displayed in box with jQuery | I am working with PHP till now but now I want to display a message associated with a user from the drop down box in a content box you can say with jQuery. How can I achieve this? I am using code igniter as a framework. | php | jquery | codeigniter | null | null | 04/16/2012 13:53:14 | not a real question | Getting content displayed in box with jQuery
===
I am working with PHP till now but now I want to display a message associated with a user from the drop down box in a content box you can say with jQuery. How can I achieve this? I am using code igniter as a framework. | 1 |
8,727,523 | 01/04/2012 13:16:17 | 742,084 | 05/06/2011 15:49:03 | 181 | 0 | generic NOT constraint where T : !IEnumerable | As per the title, is it possible to declare type-negating constraints in c# 4 ? | c# | .net | generics | ienumerable | null | null | open | generic NOT constraint where T : !IEnumerable
===
As per the title, is it possible to declare type-negating constraints in c# 4 ? | 0 |
1,428,916 | 09/15/2009 18:31:17 | 3,129 | 08/26/2008 21:46:56 | 97 | 4 | .Net Source Debugging on Windows 7 | We are trying to debug through a Sql Server CE issue on a Windows 7 Enterprise RTM desktop running the .Net Framework 3.5, SP1. The application is crashing consistently and we are trying to set up .Net Framework debugging for Visual Studio 2008, SP1. Using the scattered resoures around the internet, we set the options:
- Symbol Server =
http://referencesource.microsoft.com/symbols
- Tools->Options->Debugging->Just My
code = Disabled
- Tools->Options->Debugging->Enable
.Net Framework Debugging = Enabled
- Tools->Options->Debugging->Enabled
Source Server Support = Enabled
When we run the application, we are unable to step into the source and we still get the error "There is no source code at this location." We do get the stack trace indicating that the Sql Server CE symbols have loaded and when we click the details on the error dialog, we get a message indicating that the Sql Server CE pdb file was loaded correctly.
I did find a blog post indicating that this is an issue with the symbols not being updated for Windows 7 yet here:
[http://software.intel.com/en-us/blogs/2009/09/07/visual-studio-2008-sp1-net-framework-source-debugging/][1]
However, I cannot find anything official about this issue. Is there anything I'm missing? Has anyone heard anything about Windows 7 Symbols being incorrect and/or when they will be updated? Thanks in advance.
[1]: http://software.intel.com/en-us/blogs/2009/09/07/visual-studio-2008-sp1-net-framework-source-debugging/ | .net | windows-7 | sql-server-ce | debugging | null | null | open | .Net Source Debugging on Windows 7
===
We are trying to debug through a Sql Server CE issue on a Windows 7 Enterprise RTM desktop running the .Net Framework 3.5, SP1. The application is crashing consistently and we are trying to set up .Net Framework debugging for Visual Studio 2008, SP1. Using the scattered resoures around the internet, we set the options:
- Symbol Server =
http://referencesource.microsoft.com/symbols
- Tools->Options->Debugging->Just My
code = Disabled
- Tools->Options->Debugging->Enable
.Net Framework Debugging = Enabled
- Tools->Options->Debugging->Enabled
Source Server Support = Enabled
When we run the application, we are unable to step into the source and we still get the error "There is no source code at this location." We do get the stack trace indicating that the Sql Server CE symbols have loaded and when we click the details on the error dialog, we get a message indicating that the Sql Server CE pdb file was loaded correctly.
I did find a blog post indicating that this is an issue with the symbols not being updated for Windows 7 yet here:
[http://software.intel.com/en-us/blogs/2009/09/07/visual-studio-2008-sp1-net-framework-source-debugging/][1]
However, I cannot find anything official about this issue. Is there anything I'm missing? Has anyone heard anything about Windows 7 Symbols being incorrect and/or when they will be updated? Thanks in advance.
[1]: http://software.intel.com/en-us/blogs/2009/09/07/visual-studio-2008-sp1-net-framework-source-debugging/ | 0 |
9,068,405 | 01/30/2012 17:55:11 | 232,082 | 12/15/2009 12:36:21 | 176 | 15 | Vimeo's couch mode ported to jQuery? | Is there any attempt to re-make something like Vimeo's couch mode http://vimeo.com/couchmode in jQuery?
I mean a video player which you feed with video links (either from vimeo or youtube) and acts like vimeos couch mode or youtube 's lean back. | jquery | youtube | vimeo | android-video-player | null | 01/30/2012 18:17:21 | not constructive | Vimeo's couch mode ported to jQuery?
===
Is there any attempt to re-make something like Vimeo's couch mode http://vimeo.com/couchmode in jQuery?
I mean a video player which you feed with video links (either from vimeo or youtube) and acts like vimeos couch mode or youtube 's lean back. | 4 |
5,382,646 | 03/21/2011 19:34:02 | 192,217 | 10/19/2009 04:36:59 | 66 | 0 | Conflicting results when unit testing MVC controller | I'm writing unit tests (using NUnit) for my MVC 2 controllers, and am following examples in the Pro ASP.net MVC 2 Framework book by Steven Sanderson (great book, btw). However, I've run into problems, which I think are just due to my lack of understanding of NUnit.
Here's an excerpt, with the irrelevant parts removed:
[Test]
public void Cannot_Save_Invalid_Event()
{
...
repository.Setup(x => x.SaveEvent(evt)).Callback(Assert.Fail);
...
repository.Verify(x => x.SaveEvent(evt));
}
This test is passing for me, although from what I understand, those two statements should directly conflict with each other. The second one wasn't there originally, but I put it in to verify that it was passing for the right reasons.
From what I understand, my repository is set up to fail if "repository.SaveEvent(evt)" is called. However, later in the test, I try to verify that "repository.SaveEvent(evt)" was called. Since it passes, doesn't this mean that it was both called, and not called? Perhaps those statements don't act as I suspect they do.
Can someone explain how these two statements are not opposites, and how they can both exist and the test still pass? | asp.net-mvc | unit-testing | nunit | null | null | null | open | Conflicting results when unit testing MVC controller
===
I'm writing unit tests (using NUnit) for my MVC 2 controllers, and am following examples in the Pro ASP.net MVC 2 Framework book by Steven Sanderson (great book, btw). However, I've run into problems, which I think are just due to my lack of understanding of NUnit.
Here's an excerpt, with the irrelevant parts removed:
[Test]
public void Cannot_Save_Invalid_Event()
{
...
repository.Setup(x => x.SaveEvent(evt)).Callback(Assert.Fail);
...
repository.Verify(x => x.SaveEvent(evt));
}
This test is passing for me, although from what I understand, those two statements should directly conflict with each other. The second one wasn't there originally, but I put it in to verify that it was passing for the right reasons.
From what I understand, my repository is set up to fail if "repository.SaveEvent(evt)" is called. However, later in the test, I try to verify that "repository.SaveEvent(evt)" was called. Since it passes, doesn't this mean that it was both called, and not called? Perhaps those statements don't act as I suspect they do.
Can someone explain how these two statements are not opposites, and how they can both exist and the test still pass? | 0 |
5,097,199 | 02/23/2011 21:13:34 | 400,327 | 07/23/2010 14:15:55 | 3 | 0 | How do I parse a decimal UUID string in C? | I've got a UUID (128-bit number) represented as a decimal number and I need to parse it into numeric form in C. My target data structure is a char[16] and using a bignum library is not an option. Can someone point me to a suitable algorithm? | c | algorithm | parsing | string | bignum | null | open | How do I parse a decimal UUID string in C?
===
I've got a UUID (128-bit number) represented as a decimal number and I need to parse it into numeric form in C. My target data structure is a char[16] and using a bignum library is not an option. Can someone point me to a suitable algorithm? | 0 |
2,544,977 | 03/30/2010 12:15:24 | 163,394 | 08/26/2009 10:01:31 | 280 | 9 | Qt - resize QTextEdit in a QWidget while it is being resized the QWidget | How to make QTextEdit to be resized in a QWidget while the QWidget is being resized? Should I overload resizeEvent functin for the QWidget? | qt | qt4 | resize | c++ | null | null | open | Qt - resize QTextEdit in a QWidget while it is being resized the QWidget
===
How to make QTextEdit to be resized in a QWidget while the QWidget is being resized? Should I overload resizeEvent functin for the QWidget? | 0 |
2,994,359 | 06/08/2010 02:05:45 | 112,355 | 05/26/2009 03:58:14 | 1,797 | 30 | How can I break into the development business scene if I'm the new kid on the block? | I'm about 1 semester short of graduating from college with my Systems Engineer degree.
I've started my own software development company here in a country in South America last week, and so far I managed to land myself a nice account. I have to build a simple enough program that will take me 6-7weeks to complete and I'll charge 2000$. 40% up front and the rest on completion.
While this is great and I'm really excited about my first project (*Hell it's a landmark for any professional!*), I'm already setting my eye on landing projects that will be visible for other companies to see.
I've spoken with many people in my trade around town and it seems there are two companies that manage the big accounts with other small companies scrounging around for the scraps.
How can I break this so called fellowship that is pretty much a monopoly here?
Any and all suggestions will be massively appreciated. | networking | business | null | null | null | 06/08/2010 09:44:30 | off topic | How can I break into the development business scene if I'm the new kid on the block?
===
I'm about 1 semester short of graduating from college with my Systems Engineer degree.
I've started my own software development company here in a country in South America last week, and so far I managed to land myself a nice account. I have to build a simple enough program that will take me 6-7weeks to complete and I'll charge 2000$. 40% up front and the rest on completion.
While this is great and I'm really excited about my first project (*Hell it's a landmark for any professional!*), I'm already setting my eye on landing projects that will be visible for other companies to see.
I've spoken with many people in my trade around town and it seems there are two companies that manage the big accounts with other small companies scrounging around for the scraps.
How can I break this so called fellowship that is pretty much a monopoly here?
Any and all suggestions will be massively appreciated. | 2 |
7,698,655 | 10/08/2011 17:50:56 | 946,462 | 09/15/2011 09:33:38 | 1 | 0 | Sending select option with jquery to a php file...? | I have looked for 2 days to find out how to send a variable with jquery to php. I have searched for over 100 posts on stackoverflow, i tried multiple examples. But i just get it done. So i really hope someone over here would be kind enough to help me find out what i am doing wrong....
<?php
print_r(json_decode($_POST['country']));
?>
<html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
<script type="text/javascript">
$(function() {
$('#country').change(function() {
var country = $('#country').val();
$.ajax({
type: 'POST',
data: country,
dataType: 'json',
url: 'timezone/timezone.php',
})
alert("Country: " + country);
});
});
</script>
</head>
<body>
<form method = "post" name="form1">
<select name="country" class="country" id="country">
<option value="NL">Nederland</option>
<option value="BE">Belgie</option>
</select>
</form>
</body>
</html> | jquery | null | null | null | null | null | open | Sending select option with jquery to a php file...?
===
I have looked for 2 days to find out how to send a variable with jquery to php. I have searched for over 100 posts on stackoverflow, i tried multiple examples. But i just get it done. So i really hope someone over here would be kind enough to help me find out what i am doing wrong....
<?php
print_r(json_decode($_POST['country']));
?>
<html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
<script type="text/javascript">
$(function() {
$('#country').change(function() {
var country = $('#country').val();
$.ajax({
type: 'POST',
data: country,
dataType: 'json',
url: 'timezone/timezone.php',
})
alert("Country: " + country);
});
});
</script>
</head>
<body>
<form method = "post" name="form1">
<select name="country" class="country" id="country">
<option value="NL">Nederland</option>
<option value="BE">Belgie</option>
</select>
</form>
</body>
</html> | 0 |
4,584,121 | 01/03/2011 11:40:25 | 560,641 | 01/02/2011 22:11:11 | 1 | 2 | Subdomain locations on server | I have had a look to see if this has been answered but to no avail.
Perhaps is so obvious that it doesn't need answering?
I have made a subdomains folder on my server where I want to keep all my subdomains in.
Does this folder have to be in the public_html folder or can I have this folder on the root (same level as the public_html folder)?
I know this works as I have tried it, but is this good practice?
The reason I ask is because the subdomains can be access like a subfolder
e.g. www.mywebsite.com/subdomains/aNewSubdomain
Many thanks | apache | null | null | null | null | null | open | Subdomain locations on server
===
I have had a look to see if this has been answered but to no avail.
Perhaps is so obvious that it doesn't need answering?
I have made a subdomains folder on my server where I want to keep all my subdomains in.
Does this folder have to be in the public_html folder or can I have this folder on the root (same level as the public_html folder)?
I know this works as I have tried it, but is this good practice?
The reason I ask is because the subdomains can be access like a subfolder
e.g. www.mywebsite.com/subdomains/aNewSubdomain
Many thanks | 0 |
1,686,698 | 11/06/2009 10:23:27 | 133,584 | 07/06/2009 09:07:52 | 345 | 20 | ASP.Net Form send click but nothing happens | I must build in a german payment provider in my site.
But when I click on "Submit", nothing happens. Can someone please help me? I think I am to involved, I didn't see any tree in the forest any more...
<form method="post" action="https://www.sofortueberweisung.de/payment/start">
<input name="currency_id" type="hidden" value="EUR" />
<input name="reason_1" type="hidden" value="Zambuu" />
<input name="user_id" type="hidden" value="29593" />
<input name="project_id" type="hidden" value="80145" />
<input type="submit" value="Absenden" />
</form>
| asp.net | forms | null | null | null | null | open | ASP.Net Form send click but nothing happens
===
I must build in a german payment provider in my site.
But when I click on "Submit", nothing happens. Can someone please help me? I think I am to involved, I didn't see any tree in the forest any more...
<form method="post" action="https://www.sofortueberweisung.de/payment/start">
<input name="currency_id" type="hidden" value="EUR" />
<input name="reason_1" type="hidden" value="Zambuu" />
<input name="user_id" type="hidden" value="29593" />
<input name="project_id" type="hidden" value="80145" />
<input type="submit" value="Absenden" />
</form>
| 0 |
8,779,511 | 01/08/2012 17:17:19 | 1,085,825 | 12/07/2011 14:29:07 | 1 | 1 | How to get unique column values in php using join query ? | I have joined two table and getting values for report. But when i am trying to put distinct for particular column its showing error. And now i am getting repeated label from db. I need only unique labels not all. I am working with PHP(Codeigniter).
**Can any one help me out ??** | php5 | phpmyadmin | codeigniter-2 | null | null | 07/31/2012 07:47:54 | not constructive | How to get unique column values in php using join query ?
===
I have joined two table and getting values for report. But when i am trying to put distinct for particular column its showing error. And now i am getting repeated label from db. I need only unique labels not all. I am working with PHP(Codeigniter).
**Can any one help me out ??** | 4 |
10,974,564 | 06/11/2012 04:39:43 | 1,319,021 | 04/07/2012 11:59:18 | 137 | 19 | I dont't understand a proof for the second-order condition for convexity | I find a proof here
http://mathhelpforum.com/advanced-math-topics/129503-second-order-condition-convexity.html
But I don't understand the second part. For example.
What does
> For the converse, if f is convex, then certain subdeterminants of the
> Hessian matrix satisfy certain conditions.
mean?
can someone help me?
| calculus | convex | null | null | null | 06/11/2012 11:04:20 | off topic | I dont't understand a proof for the second-order condition for convexity
===
I find a proof here
http://mathhelpforum.com/advanced-math-topics/129503-second-order-condition-convexity.html
But I don't understand the second part. For example.
What does
> For the converse, if f is convex, then certain subdeterminants of the
> Hessian matrix satisfy certain conditions.
mean?
can someone help me?
| 2 |
5,977,032 | 05/12/2011 11:03:40 | 5,017 | 09/07/2008 11:47:30 | 8,765 | 149 | Can I get TeamCity to DISABLE a build if a different build has failing tests? | I have a TeamCity job that builds my project and runs all the unit tests, and another one that deploys the build to the production server.
Can I disable the "deploy" job so that it's impossible to deploy code if there's currently a failing test in the build project? | unit-testing | continuous-integration | teamcity | continuous-deployment | null | null | open | Can I get TeamCity to DISABLE a build if a different build has failing tests?
===
I have a TeamCity job that builds my project and runs all the unit tests, and another one that deploys the build to the production server.
Can I disable the "deploy" job so that it's impossible to deploy code if there's currently a failing test in the build project? | 0 |
2,731,324 | 04/28/2010 16:24:48 | 328,095 | 04/28/2010 16:24:48 | 1 | 0 | jQuery Dropdown Check List: jQuery click() anomaly | I have a page with several dropdownchecklists, all with checkboxes (multiple selects possible). On document ready, I have this simple code:
$(":checkbox").click(alert('TEST');
The problem is that when the page first loads, the alert fires. What I want to do is only fire the alert when one of the dropdownchecklist boxes is clicked. I know I am being dull of wit here. Can someone enlighten me?
Another way to state the problem is simply "How can I activate a function when a dropdownchecklist checkbox is clicked?"
Thanks in advance. | jquery-ui | checkbox | null | null | null | null | open | jQuery Dropdown Check List: jQuery click() anomaly
===
I have a page with several dropdownchecklists, all with checkboxes (multiple selects possible). On document ready, I have this simple code:
$(":checkbox").click(alert('TEST');
The problem is that when the page first loads, the alert fires. What I want to do is only fire the alert when one of the dropdownchecklist boxes is clicked. I know I am being dull of wit here. Can someone enlighten me?
Another way to state the problem is simply "How can I activate a function when a dropdownchecklist checkbox is clicked?"
Thanks in advance. | 0 |
5,533,365 | 04/03/2011 23:59:49 | 690,370 | 04/03/2011 23:59:49 | 1 | 0 | My unblocked iphone 3g it's not booting up after restoring. | I have and unlocked and jail broken 3g.after getting back up I tried to upgrade it to newest firmware with itune but I got 1015 error code! Now I'm keep getting same error after trying ziphone, sn0wbreez, redsn0w and... you name it? it stays in recovery mode (image with USB cable and itune sign), I appreciate if anyone can help me out to get me out of this hassle. | iphone | actionscript-3 | null | null | null | 04/04/2011 00:22:20 | off topic | My unblocked iphone 3g it's not booting up after restoring.
===
I have and unlocked and jail broken 3g.after getting back up I tried to upgrade it to newest firmware with itune but I got 1015 error code! Now I'm keep getting same error after trying ziphone, sn0wbreez, redsn0w and... you name it? it stays in recovery mode (image with USB cable and itune sign), I appreciate if anyone can help me out to get me out of this hassle. | 2 |
8,586,039 | 12/21/2011 06:46:57 | 1,109,075 | 12/21/2011 03:37:27 | 1 | 0 | How can I make a search form that searches for snippets of text? | Okay, so, I want to make a search form on my website that when a user searches something, the results come up on a new page and those results are snippets of code, no database. Umm, so something like
'this is a search result <br>
this is a link under it';
'this is another search result <br>
this is a link under it';
'this is a 3rd, bob has a cat <br>
this is a link under it'
and basically the search form would search through these snippets of code and show the results, so lets say i typed in "bob has a cat" then the search form goes through the snippets of code and on the results page displays
this is a 3rd, bob has a cat <br>
http://thelink.net
I will pray for you on Christmas Eve if you answer this hard-to-explain question. :) | php | javascript | jquery | html | null | 12/21/2011 14:24:52 | not a real question | How can I make a search form that searches for snippets of text?
===
Okay, so, I want to make a search form on my website that when a user searches something, the results come up on a new page and those results are snippets of code, no database. Umm, so something like
'this is a search result <br>
this is a link under it';
'this is another search result <br>
this is a link under it';
'this is a 3rd, bob has a cat <br>
this is a link under it'
and basically the search form would search through these snippets of code and show the results, so lets say i typed in "bob has a cat" then the search form goes through the snippets of code and on the results page displays
this is a 3rd, bob has a cat <br>
http://thelink.net
I will pray for you on Christmas Eve if you answer this hard-to-explain question. :) | 1 |
7,600,387 | 09/29/2011 16:25:02 | 921,682 | 08/29/2011 10:06:34 | 32 | 0 | How multiple Users works in Asp.net web application | As in Web application multiple users work simultaneously and each user has their own copy of data so how application managed this. Whether different user's data are stored n different heap/stack. As HTTP is a stateless protocol and session maintain every users data so is session is pointing to a block of data that is stored for that users based on activities he/she has doing on web application or something else.
Regards,
Ashish Khandelwal | c# | asp.net | user | multiple | null | 09/29/2011 16:42:44 | not a real question | How multiple Users works in Asp.net web application
===
As in Web application multiple users work simultaneously and each user has their own copy of data so how application managed this. Whether different user's data are stored n different heap/stack. As HTTP is a stateless protocol and session maintain every users data so is session is pointing to a block of data that is stored for that users based on activities he/she has doing on web application or something else.
Regards,
Ashish Khandelwal | 1 |
8,226,089 | 11/22/2011 11:31:24 | 969,161 | 09/28/2011 13:21:44 | 4 | 0 | Restrict opening .xls files with notepad | I have an requirement to restrict users opening .xls file with notepad.
I have an application where it exports the data into xls. Now when i open the same file with notepad i could able to see the contents clearly but if i open a normal excel file with notepad it will show the contents in corrupted format.
How can i make the contents corrupted of xls file when opened with notepad using asp.net?
Thanks | asp.net | null | null | null | null | 11/22/2011 19:21:28 | off topic | Restrict opening .xls files with notepad
===
I have an requirement to restrict users opening .xls file with notepad.
I have an application where it exports the data into xls. Now when i open the same file with notepad i could able to see the contents clearly but if i open a normal excel file with notepad it will show the contents in corrupted format.
How can i make the contents corrupted of xls file when opened with notepad using asp.net?
Thanks | 2 |
8,834,569 | 01/12/2012 11:47:26 | 609,712 | 02/09/2011 12:15:02 | 309 | 1 | Operation Systems and common stacks | I have to learn something about Operating Systems (especially Linux), but I have problems with the different types of stacks.. There are Interrupt, System, User, Kernel ,... stacks.
Where are the differences, implementations and where are they stored (special-CPU-sections, RAM,..)?
How many are there? (one per cpu, cpu-core, process, thread, kernel)
| linux | operating-system | stack | kernel | ram | 01/13/2012 13:08:09 | not constructive | Operation Systems and common stacks
===
I have to learn something about Operating Systems (especially Linux), but I have problems with the different types of stacks.. There are Interrupt, System, User, Kernel ,... stacks.
Where are the differences, implementations and where are they stored (special-CPU-sections, RAM,..)?
How many are there? (one per cpu, cpu-core, process, thread, kernel)
| 4 |
10,197,049 | 04/17/2012 18:39:00 | 478,296 | 10/13/2010 04:19:22 | 356 | 7 | css and page layout like FB and similar sites | ANyone know a good tutorial on how to to use css+html to define a layout similar to FB?
I am looking for a good example on how to have a header that is 100% and then a middle column as a body that is about 700px wide with one column on each side. | html | css | div-layouts | null | null | 04/19/2012 02:39:06 | not a real question | css and page layout like FB and similar sites
===
ANyone know a good tutorial on how to to use css+html to define a layout similar to FB?
I am looking for a good example on how to have a header that is 100% and then a middle column as a body that is about 700px wide with one column on each side. | 1 |
6,824,459 | 07/26/2011 02:05:01 | 807,893 | 06/21/2011 06:21:19 | 482 | 0 | What's %^H used for in Perl? | Anyone knows what this global variable does?
I can't find any information by google because of the special characters . | perl | null | null | null | null | null | open | What's %^H used for in Perl?
===
Anyone knows what this global variable does?
I can't find any information by google because of the special characters . | 0 |
11,491,047 | 07/15/2012 10:04:10 | 1,490,145 | 06/29/2012 02:42:01 | 66 | 0 | buttons turn off everytime I make a change | Here is a [demo][1] of part of an application I am currently working on. Please follow the steps below:
- Step 1: On left hand side you will see a green plus button, click on
it and it opens up a modal window.
- Step 2: In modal window there is a search bar, type in "AAA" and
submit search, you will see a bunch of rows appear.
- Step 3: In the first row click on the "Add" button, you will see a
bunch of letter buttons appear on the right hand side with a button
highlighted green.
- Step 4: Now click on the "Add Question" button, this will add a row
below where it copies the option and answer control from top into the
row.
Now repeat the steps 1 to 3 again except in step 3, add a different row by clicking on "Add" button in a different row.
Problem:
The problem is that after you repeat steps 1-3, you will see that the letter buttons within the row you have just appeanded, turns back to white again (in other words all letter buttons are turned off), this should not happen, the letter buttons within the row should not be affected at all if you are using the option and answer control on top.
So my question is what is causing the letter buttons within the row(s) to be turned off after you have clicked on the "Add" button for the top option and answer control?
[1]: http://helios.hud.ac.uk/u0867587/Mobile_app/Text16.php | javascript | jquery | null | null | null | 07/17/2012 04:37:39 | too localized | buttons turn off everytime I make a change
===
Here is a [demo][1] of part of an application I am currently working on. Please follow the steps below:
- Step 1: On left hand side you will see a green plus button, click on
it and it opens up a modal window.
- Step 2: In modal window there is a search bar, type in "AAA" and
submit search, you will see a bunch of rows appear.
- Step 3: In the first row click on the "Add" button, you will see a
bunch of letter buttons appear on the right hand side with a button
highlighted green.
- Step 4: Now click on the "Add Question" button, this will add a row
below where it copies the option and answer control from top into the
row.
Now repeat the steps 1 to 3 again except in step 3, add a different row by clicking on "Add" button in a different row.
Problem:
The problem is that after you repeat steps 1-3, you will see that the letter buttons within the row you have just appeanded, turns back to white again (in other words all letter buttons are turned off), this should not happen, the letter buttons within the row should not be affected at all if you are using the option and answer control on top.
So my question is what is causing the letter buttons within the row(s) to be turned off after you have clicked on the "Add" button for the top option and answer control?
[1]: http://helios.hud.ac.uk/u0867587/Mobile_app/Text16.php | 3 |
4,380,985 | 12/07/2010 19:56:41 | 389,745 | 07/12/2010 18:23:51 | 405 | 77 | Variable naming discussion: C# vs JavaScript? | I was reading [this post][1] and it left me wondering...
Why is it wrong to use a variable named `_` in `C#` for a intensively used library (should one ever surface), but perfectly fine to use `$` for the same purpose under `JavaScript`?
[1]: http://stackoverflow.com/questions/4380185/super-short-and-awesome-variable-name-in-c-closed | c# | javascript | conventions | null | null | 12/07/2010 20:03:35 | not constructive | Variable naming discussion: C# vs JavaScript?
===
I was reading [this post][1] and it left me wondering...
Why is it wrong to use a variable named `_` in `C#` for a intensively used library (should one ever surface), but perfectly fine to use `$` for the same purpose under `JavaScript`?
[1]: http://stackoverflow.com/questions/4380185/super-short-and-awesome-variable-name-in-c-closed | 4 |
10,416,291 | 05/02/2012 14:55:22 | 1,171,143 | 01/26/2012 11:27:36 | 20 | 0 | How to upload multiple files and save the information into the database? | I am using primefaces3.2 ,glassfish3,jsf2.
I have a form should be filled by a user.
The user shoul upload his CV (single upload) and other articles(multiple upload).
I have a database contain the tables Person and FileUploaded (a person has many files)
person(idUser,name...), FileUploaded(idfile,name,path ,idUser)
what I have did it's when a user upload a CV I insert in the table FileUploaded the id of the user(so I can identify
a person's files)
my problem is I can just save the CV information but I can't do it with the articles.
index.xhtml
<h:form>
<p:panelGrid columns="2">
<f:facet name="header"> Add User </f:facet>
<h:outputLabel value="Nom" /><h:inputText value="#{AddPerson.nom}" />
<h:outputLabel value="Prenom"/> <h:inputText value="#{AddPerson.prenom}" />
<h:outputLabel value="Etat Civil"/>
<h:selectOneMenu id="etatcivil" value="#{AddPerson.etatCivil}">
<f:selectItem itemValue="Monsieur" itemLabel="M"/>
<f:selectItem itemValue="Madam" itemLabel="Mme"/>
<f:selectItem itemValue="Madmoiselle" itemLabel="Mlle"/>
</h:selectOneMenu>
<h:outputLabel value="Date de naissance "/>
<h:panelGroup style="display:inline;color:yellow;">
<h:selectOneMenu id="jour" value="#{AddPerson.jour}">
<f:selectItem itemValue="00" itemLabel=""/>
<f:selectItem itemValue="01" itemLabel="01"/> <f:selectItem itemValue="02" itemLabel="02"/><f:selectItem itemValue="03" itemLabel="03"/>
<f:selectItem itemValue="04" itemLabel="04"/><f:selectItem itemValue="05" itemLabel="05"/><f:selectItem itemValue="06" itemLabel="06"/>
<f:selectItem itemValue="07" itemLabel="07"/><f:selectItem itemValue="08" itemLabel="08"/><f:selectItem itemValue="09" itemLabel="09"/>
<f:selectItem itemValue="10" itemLabel="10"/><f:selectItem itemValue="11" itemLabel="11"/><f:selectItem itemValue="12" itemLabel="12"/>
<f:selectItem itemValue="13" itemLabel="13"/><f:selectItem itemValue="14" itemLabel="14"/><f:selectItem itemValue="15" itemLabel="15"/>
<f:selectItem itemValue="16" itemLabel="16"/><f:selectItem itemValue="17" itemLabel="17"/><f:selectItem itemValue="18" itemLabel="18"/>
<f:selectItem itemValue="19" itemLabel="19"/><f:selectItem itemValue="20" itemLabel="20"/><f:selectItem itemValue="21" itemLabel="21"/>
<f:selectItem itemValue="22" itemLabel="22"/><f:selectItem itemValue="23" itemLabel="23"/><f:selectItem itemValue="24" itemLabel="24"/>
<f:selectItem itemValue="25" itemLabel="25"/><f:selectItem itemValue="26" itemLabel="26"/><f:selectItem itemValue="27" itemLabel="27"/>
<f:selectItem itemValue="28" itemLabel="28"/><f:selectItem itemValue="29" itemLabel="29"/><f:selectItem itemValue="30" itemLabel="30"/>
<f:selectItem itemValue="31" itemLabel="31"/>
</h:selectOneMenu>
<h:selectOneMenu id="mois" value="#{AddPerson.mois}">
<f:selectItem itemValue="00" itemLabel=""/>
<f:selectItem itemValue="01" itemLabel="Janvier"/> <f:selectItem itemValue="02" itemLabel="Fevrier"/><f:selectItem itemValue="03" itemLabel="Mars"/>
<f:selectItem itemValue="04" itemLabel="Avril"/><f:selectItem itemValue="05" itemLabel="May"/><f:selectItem itemValue="06" itemLabel="Juin"/>
<f:selectItem itemValue="07" itemLabel="Juillet"/><f:selectItem itemValue="08" itemLabel="Aout"/><f:selectItem itemValue="09" itemLabel="Septembre"/>
<f:selectItem itemValue="10" itemLabel="Octobre"/><f:selectItem itemValue="11" itemLabel="Novembre"/><f:selectItem itemValue="12" itemLabel="Decembre"/>
</h:selectOneMenu>
<h:selectOneMenu id="annee" value="#{AddPerson.annee}" >
<f:selectItem itemValue="1940" itemLabel="1940"/> <f:selectItem itemValue="1941" itemLabel="1941"/><f:selectItem itemValue="1942" itemLabel="1942"/><f:selectItem itemValue="1943" itemLabel="1943"/><f:selectItem itemValue="1944" itemLabel="1944"/><f:selectItem itemValue="1945" itemLabel="1945"/><f:selectItem itemValue="1946" itemLabel="1946"/><f:selectItem itemValue="1947" itemLabel="1947"/><f:selectItem itemValue="1948" itemLabel="1948"/><f:selectItem itemValue="1949" itemLabel="1949"/>
<f:selectItem itemValue="1950" itemLabel="1950"/><f:selectItem itemValue="1951" itemLabel="1951"/><f:selectItem itemValue="1952" itemLabel="1952"/><f:selectItem itemValue="1953" itemLabel="1953"/><f:selectItem itemValue="1954" itemLabel="1954"/><f:selectItem itemValue="1955" itemLabel="1955"/><f:selectItem itemValue="1956" itemLabel="1956"/><f:selectItem itemValue="1957" itemLabel="1957"/><f:selectItem itemValue="1958" itemLabel="1958"/><f:selectItem itemValue="1959" itemLabel="1959"/>
<f:selectItem itemValue="1960" itemLabel="1960"/><f:selectItem itemValue="1961" itemLabel="1961"/><f:selectItem itemValue="1962" itemLabel="1962"/><f:selectItem itemValue="1963" itemLabel="1963"/><f:selectItem itemValue="1964" itemLabel="1964"/><f:selectItem itemValue="1965" itemLabel="1965"/><f:selectItem itemValue="1966" itemLabel="1966"/><f:selectItem itemValue="1967" itemLabel="1967"/><f:selectItem itemValue="1968" itemLabel="1968"/><f:selectItem itemValue="1969" itemLabel="1969"/>
<f:selectItem itemValue="1970" itemLabel="1970"/><f:selectItem itemValue="1971" itemLabel="1971"/><f:selectItem itemValue="1972" itemLabel="1972"/><f:selectItem itemValue="1973" itemLabel="1973"/><f:selectItem itemValue="1974" itemLabel="1974"/><f:selectItem itemValue="1975" itemLabel="1975"/><f:selectItem itemValue="1976" itemLabel="1976"/><f:selectItem itemValue="1977" itemLabel="1977"/><f:selectItem itemValue="1978" itemLabel="1978"/><f:selectItem itemValue="1979" itemLabel="1979"/>
<f:selectItem itemValue="1980" itemLabel="1980"/><f:selectItem itemValue="1981" itemLabel="1981"/><f:selectItem itemValue="1982" itemLabel="1982"/><f:selectItem itemValue="1983" itemLabel="1983"/><f:selectItem itemValue="1984" itemLabel="1984"/><f:selectItem itemValue="1985" itemLabel="1985"/><f:selectItem itemValue="1986" itemLabel="1986"/><f:selectItem itemValue="1987" itemLabel="1987"/><f:selectItem itemValue="1988" itemLabel="1988"/><f:selectItem itemValue="1989" itemLabel="1989"/>
<f:selectItem itemValue="1990" itemLabel="1990"/><f:selectItem itemValue="1991" itemLabel="1991"/><f:selectItem itemValue="1992" itemLabel="1992"/><f:selectItem itemValue="1993" itemLabel="1993"/><f:selectItem itemValue="1994" itemLabel="1994"/><f:selectItem itemValue="1995" itemLabel="1995"/><f:selectItem itemValue="1996" itemLabel="1996"/><f:selectItem itemValue="1997" itemLabel="1997"/><f:selectItem itemValue="1998" itemLabel="1998"/><f:selectItem itemValue="1999" itemLabel="1999"/>
<f:selectItem itemValue="2000" itemLabel="2000"/><f:selectItem itemValue="2001" itemLabel="2001"/><f:selectItem itemValue="2002" itemLabel="2002"/><f:selectItem itemValue="2003" itemLabel="2003"/><f:selectItem itemValue="2004" itemLabel="2004"/><f:selectItem itemValue="2005" itemLabel="2005"/><f:selectItem itemValue="2006" itemLabel="2006"/><f:selectItem itemValue="2007" itemLabel="2007"/><f:selectItem itemValue="2008" itemLabel="2008"/><f:selectItem itemValue="2009" itemLabel="2009"/>
<f:selectItem itemValue="2010" itemLabel="2010"/><f:selectItem itemValue="2011" itemLabel="2011"/><f:selectItem itemValue="2012" itemLabel="2012"/>
</h:selectOneMenu>
</h:panelGroup>
<h:outputLabel value="Domaine de Competence"/>
<h:selectOneMenu value="#{AddPerson.domain}" id="domaine" >
<f:selectItem itemLabel="-- Select Domaine de Competence-- " itemValue="0"/>
<f:selectItems value="#{AddPerson.listDomaine}" />
</h:selectOneMenu>
<h:outputLabel value="Files"/>
<p:fileUpload style="display:inline" fileUploadListener="#{AddPerson.fileUpload}"
sizeLimit="500000"
allowTypes="/(\.|\/)(gif|jpe?g|png)$/"/>
<h:outputLabel value="Articles"/>
<h:panelGroup style="display:inline-block"> <p:fileUpload fileUploadListener="#{AddPerson.fileUploadArticles}"
update="messages"
auto="true"
sizeLimit="800000"
allowTypes="/(\.|\/)(gif|jpe?g|png)$/"/>
</h:panelGroup>
<f:facet name="footer">
<p:commandButton style="margin:0" value="Add User" action="#{AddPerson.addUserDB}" />
</f:facet>
</p:panelGrid>
</h:form>
addUser.java ==>function that add a user work fine when I add just a CV (one file)
public void addUserDB() {
try {
EntityTransaction entr = em.getTransaction();
entr.begin();
Personne user = new Personne();
Fileuploaded fileup =new Fileuploaded();
Domainecompetence dom=new Domainecompetence();
System.out.println("++++++test1++++");
user.setNom(nom);
user.setPrenom(prenom);
user.setDateNaissance(formatingDateTime2());//formatter la date pr l'insertion BD mysql
dom.setDomaine(domain);
user.setDomaine(dom);
System.out.println("++++++test2++++");
fileup.setFileName(file.getName());
fileup.setFilePath(file.getPath());
fileup.setIdPersonne(user);
fileupAr.setIdPersonne(user);
System.out.println("++++++test3++++");
em.persist(user);
System.out.println("++++++test4++++");
em.persist(fileup);
entr.commit();
} catch (Exception e) {
System.out.println(e.getMessage());
} finally {
em.close();
}
}
If I add the following lines to add the articles files it didn't work and generate an error
Fileuploaded fileupAr =new Fileuploaded();
fileupAr.setFileName(fileArticle.getName());
fileupAr.setFileName(fileArticle.getPath());
fileupAr.setIdPersonne(user);
em.persist(fileupAr);
the error:
Infos: ++++++test1++++
Infos: ++++++test2++++
Infos: ++++++test3++++
Infos: Object: DTO.Personne[ idPersonne=null ] is not a known entity type. | java | jsf-2.0 | glassfish | primefaces | null | 06/05/2012 22:28:58 | too localized | How to upload multiple files and save the information into the database?
===
I am using primefaces3.2 ,glassfish3,jsf2.
I have a form should be filled by a user.
The user shoul upload his CV (single upload) and other articles(multiple upload).
I have a database contain the tables Person and FileUploaded (a person has many files)
person(idUser,name...), FileUploaded(idfile,name,path ,idUser)
what I have did it's when a user upload a CV I insert in the table FileUploaded the id of the user(so I can identify
a person's files)
my problem is I can just save the CV information but I can't do it with the articles.
index.xhtml
<h:form>
<p:panelGrid columns="2">
<f:facet name="header"> Add User </f:facet>
<h:outputLabel value="Nom" /><h:inputText value="#{AddPerson.nom}" />
<h:outputLabel value="Prenom"/> <h:inputText value="#{AddPerson.prenom}" />
<h:outputLabel value="Etat Civil"/>
<h:selectOneMenu id="etatcivil" value="#{AddPerson.etatCivil}">
<f:selectItem itemValue="Monsieur" itemLabel="M"/>
<f:selectItem itemValue="Madam" itemLabel="Mme"/>
<f:selectItem itemValue="Madmoiselle" itemLabel="Mlle"/>
</h:selectOneMenu>
<h:outputLabel value="Date de naissance "/>
<h:panelGroup style="display:inline;color:yellow;">
<h:selectOneMenu id="jour" value="#{AddPerson.jour}">
<f:selectItem itemValue="00" itemLabel=""/>
<f:selectItem itemValue="01" itemLabel="01"/> <f:selectItem itemValue="02" itemLabel="02"/><f:selectItem itemValue="03" itemLabel="03"/>
<f:selectItem itemValue="04" itemLabel="04"/><f:selectItem itemValue="05" itemLabel="05"/><f:selectItem itemValue="06" itemLabel="06"/>
<f:selectItem itemValue="07" itemLabel="07"/><f:selectItem itemValue="08" itemLabel="08"/><f:selectItem itemValue="09" itemLabel="09"/>
<f:selectItem itemValue="10" itemLabel="10"/><f:selectItem itemValue="11" itemLabel="11"/><f:selectItem itemValue="12" itemLabel="12"/>
<f:selectItem itemValue="13" itemLabel="13"/><f:selectItem itemValue="14" itemLabel="14"/><f:selectItem itemValue="15" itemLabel="15"/>
<f:selectItem itemValue="16" itemLabel="16"/><f:selectItem itemValue="17" itemLabel="17"/><f:selectItem itemValue="18" itemLabel="18"/>
<f:selectItem itemValue="19" itemLabel="19"/><f:selectItem itemValue="20" itemLabel="20"/><f:selectItem itemValue="21" itemLabel="21"/>
<f:selectItem itemValue="22" itemLabel="22"/><f:selectItem itemValue="23" itemLabel="23"/><f:selectItem itemValue="24" itemLabel="24"/>
<f:selectItem itemValue="25" itemLabel="25"/><f:selectItem itemValue="26" itemLabel="26"/><f:selectItem itemValue="27" itemLabel="27"/>
<f:selectItem itemValue="28" itemLabel="28"/><f:selectItem itemValue="29" itemLabel="29"/><f:selectItem itemValue="30" itemLabel="30"/>
<f:selectItem itemValue="31" itemLabel="31"/>
</h:selectOneMenu>
<h:selectOneMenu id="mois" value="#{AddPerson.mois}">
<f:selectItem itemValue="00" itemLabel=""/>
<f:selectItem itemValue="01" itemLabel="Janvier"/> <f:selectItem itemValue="02" itemLabel="Fevrier"/><f:selectItem itemValue="03" itemLabel="Mars"/>
<f:selectItem itemValue="04" itemLabel="Avril"/><f:selectItem itemValue="05" itemLabel="May"/><f:selectItem itemValue="06" itemLabel="Juin"/>
<f:selectItem itemValue="07" itemLabel="Juillet"/><f:selectItem itemValue="08" itemLabel="Aout"/><f:selectItem itemValue="09" itemLabel="Septembre"/>
<f:selectItem itemValue="10" itemLabel="Octobre"/><f:selectItem itemValue="11" itemLabel="Novembre"/><f:selectItem itemValue="12" itemLabel="Decembre"/>
</h:selectOneMenu>
<h:selectOneMenu id="annee" value="#{AddPerson.annee}" >
<f:selectItem itemValue="1940" itemLabel="1940"/> <f:selectItem itemValue="1941" itemLabel="1941"/><f:selectItem itemValue="1942" itemLabel="1942"/><f:selectItem itemValue="1943" itemLabel="1943"/><f:selectItem itemValue="1944" itemLabel="1944"/><f:selectItem itemValue="1945" itemLabel="1945"/><f:selectItem itemValue="1946" itemLabel="1946"/><f:selectItem itemValue="1947" itemLabel="1947"/><f:selectItem itemValue="1948" itemLabel="1948"/><f:selectItem itemValue="1949" itemLabel="1949"/>
<f:selectItem itemValue="1950" itemLabel="1950"/><f:selectItem itemValue="1951" itemLabel="1951"/><f:selectItem itemValue="1952" itemLabel="1952"/><f:selectItem itemValue="1953" itemLabel="1953"/><f:selectItem itemValue="1954" itemLabel="1954"/><f:selectItem itemValue="1955" itemLabel="1955"/><f:selectItem itemValue="1956" itemLabel="1956"/><f:selectItem itemValue="1957" itemLabel="1957"/><f:selectItem itemValue="1958" itemLabel="1958"/><f:selectItem itemValue="1959" itemLabel="1959"/>
<f:selectItem itemValue="1960" itemLabel="1960"/><f:selectItem itemValue="1961" itemLabel="1961"/><f:selectItem itemValue="1962" itemLabel="1962"/><f:selectItem itemValue="1963" itemLabel="1963"/><f:selectItem itemValue="1964" itemLabel="1964"/><f:selectItem itemValue="1965" itemLabel="1965"/><f:selectItem itemValue="1966" itemLabel="1966"/><f:selectItem itemValue="1967" itemLabel="1967"/><f:selectItem itemValue="1968" itemLabel="1968"/><f:selectItem itemValue="1969" itemLabel="1969"/>
<f:selectItem itemValue="1970" itemLabel="1970"/><f:selectItem itemValue="1971" itemLabel="1971"/><f:selectItem itemValue="1972" itemLabel="1972"/><f:selectItem itemValue="1973" itemLabel="1973"/><f:selectItem itemValue="1974" itemLabel="1974"/><f:selectItem itemValue="1975" itemLabel="1975"/><f:selectItem itemValue="1976" itemLabel="1976"/><f:selectItem itemValue="1977" itemLabel="1977"/><f:selectItem itemValue="1978" itemLabel="1978"/><f:selectItem itemValue="1979" itemLabel="1979"/>
<f:selectItem itemValue="1980" itemLabel="1980"/><f:selectItem itemValue="1981" itemLabel="1981"/><f:selectItem itemValue="1982" itemLabel="1982"/><f:selectItem itemValue="1983" itemLabel="1983"/><f:selectItem itemValue="1984" itemLabel="1984"/><f:selectItem itemValue="1985" itemLabel="1985"/><f:selectItem itemValue="1986" itemLabel="1986"/><f:selectItem itemValue="1987" itemLabel="1987"/><f:selectItem itemValue="1988" itemLabel="1988"/><f:selectItem itemValue="1989" itemLabel="1989"/>
<f:selectItem itemValue="1990" itemLabel="1990"/><f:selectItem itemValue="1991" itemLabel="1991"/><f:selectItem itemValue="1992" itemLabel="1992"/><f:selectItem itemValue="1993" itemLabel="1993"/><f:selectItem itemValue="1994" itemLabel="1994"/><f:selectItem itemValue="1995" itemLabel="1995"/><f:selectItem itemValue="1996" itemLabel="1996"/><f:selectItem itemValue="1997" itemLabel="1997"/><f:selectItem itemValue="1998" itemLabel="1998"/><f:selectItem itemValue="1999" itemLabel="1999"/>
<f:selectItem itemValue="2000" itemLabel="2000"/><f:selectItem itemValue="2001" itemLabel="2001"/><f:selectItem itemValue="2002" itemLabel="2002"/><f:selectItem itemValue="2003" itemLabel="2003"/><f:selectItem itemValue="2004" itemLabel="2004"/><f:selectItem itemValue="2005" itemLabel="2005"/><f:selectItem itemValue="2006" itemLabel="2006"/><f:selectItem itemValue="2007" itemLabel="2007"/><f:selectItem itemValue="2008" itemLabel="2008"/><f:selectItem itemValue="2009" itemLabel="2009"/>
<f:selectItem itemValue="2010" itemLabel="2010"/><f:selectItem itemValue="2011" itemLabel="2011"/><f:selectItem itemValue="2012" itemLabel="2012"/>
</h:selectOneMenu>
</h:panelGroup>
<h:outputLabel value="Domaine de Competence"/>
<h:selectOneMenu value="#{AddPerson.domain}" id="domaine" >
<f:selectItem itemLabel="-- Select Domaine de Competence-- " itemValue="0"/>
<f:selectItems value="#{AddPerson.listDomaine}" />
</h:selectOneMenu>
<h:outputLabel value="Files"/>
<p:fileUpload style="display:inline" fileUploadListener="#{AddPerson.fileUpload}"
sizeLimit="500000"
allowTypes="/(\.|\/)(gif|jpe?g|png)$/"/>
<h:outputLabel value="Articles"/>
<h:panelGroup style="display:inline-block"> <p:fileUpload fileUploadListener="#{AddPerson.fileUploadArticles}"
update="messages"
auto="true"
sizeLimit="800000"
allowTypes="/(\.|\/)(gif|jpe?g|png)$/"/>
</h:panelGroup>
<f:facet name="footer">
<p:commandButton style="margin:0" value="Add User" action="#{AddPerson.addUserDB}" />
</f:facet>
</p:panelGrid>
</h:form>
addUser.java ==>function that add a user work fine when I add just a CV (one file)
public void addUserDB() {
try {
EntityTransaction entr = em.getTransaction();
entr.begin();
Personne user = new Personne();
Fileuploaded fileup =new Fileuploaded();
Domainecompetence dom=new Domainecompetence();
System.out.println("++++++test1++++");
user.setNom(nom);
user.setPrenom(prenom);
user.setDateNaissance(formatingDateTime2());//formatter la date pr l'insertion BD mysql
dom.setDomaine(domain);
user.setDomaine(dom);
System.out.println("++++++test2++++");
fileup.setFileName(file.getName());
fileup.setFilePath(file.getPath());
fileup.setIdPersonne(user);
fileupAr.setIdPersonne(user);
System.out.println("++++++test3++++");
em.persist(user);
System.out.println("++++++test4++++");
em.persist(fileup);
entr.commit();
} catch (Exception e) {
System.out.println(e.getMessage());
} finally {
em.close();
}
}
If I add the following lines to add the articles files it didn't work and generate an error
Fileuploaded fileupAr =new Fileuploaded();
fileupAr.setFileName(fileArticle.getName());
fileupAr.setFileName(fileArticle.getPath());
fileupAr.setIdPersonne(user);
em.persist(fileupAr);
the error:
Infos: ++++++test1++++
Infos: ++++++test2++++
Infos: ++++++test3++++
Infos: Object: DTO.Personne[ idPersonne=null ] is not a known entity type. | 3 |
10,315,793 | 04/25/2012 12:38:42 | 1,289,097 | 03/23/2012 20:04:03 | 1 | 0 | Does C have classes? | Okay, you may call me a noob but I'm realling confused.
My ex classmate paid me to write a program in C. She gave me the task and it said something like "blah blah blah make at least TWO CLASSES, write at least ONE CONSTRUCTOR and rewrite at least ONE METHOD" it says that word by word.
And then I told her "this is C++ not C" she said "but we're learning C"
I ignored it and wrote the program in c++ and sent to her as I thought she didn't know what she was talking about. She said "it doesn't work on code blocks, and wtf is cout <<" and then she sent me a chunk of code that they write and instead of cout and cin there was printf and scanf. It had to be C. So, I rewrote the program with printf and scanf and she still says codeblocks throw errors (I still left classes as task demanded).
I want to ask wtf? Does C have classes? Or is there a misunderstanding or something? | c | class | null | null | null | 04/25/2012 17:09:02 | not a real question | Does C have classes?
===
Okay, you may call me a noob but I'm realling confused.
My ex classmate paid me to write a program in C. She gave me the task and it said something like "blah blah blah make at least TWO CLASSES, write at least ONE CONSTRUCTOR and rewrite at least ONE METHOD" it says that word by word.
And then I told her "this is C++ not C" she said "but we're learning C"
I ignored it and wrote the program in c++ and sent to her as I thought she didn't know what she was talking about. She said "it doesn't work on code blocks, and wtf is cout <<" and then she sent me a chunk of code that they write and instead of cout and cin there was printf and scanf. It had to be C. So, I rewrote the program with printf and scanf and she still says codeblocks throw errors (I still left classes as task demanded).
I want to ask wtf? Does C have classes? Or is there a misunderstanding or something? | 1 |
8,917,997 | 01/18/2012 21:51:30 | 543,572 | 07/28/2010 20:27:47 | 637 | 52 | Clear list of distinctions between an API, Library, Framework, and Toolkit in Java | I've lots of varying definitions for the following terms, but I'm not clear as to the distinctions between them. Would someone please clarify the following and the distinction(s) between each item?
- API
- Library
- Framework
- Toolkit
I'm not seeing what makes an API different from a library or a toolkit from a framework or a framework from a library. | java | terminology | null | null | null | 01/19/2012 03:27:10 | off topic | Clear list of distinctions between an API, Library, Framework, and Toolkit in Java
===
I've lots of varying definitions for the following terms, but I'm not clear as to the distinctions between them. Would someone please clarify the following and the distinction(s) between each item?
- API
- Library
- Framework
- Toolkit
I'm not seeing what makes an API different from a library or a toolkit from a framework or a framework from a library. | 2 |
1,680,971 | 11/05/2009 14:39:40 | 34,145 | 11/04/2008 13:22:19 | 113 | 6 | Patterns for making c++ code easy to test | Should you design your code to make testing easier? And if so how to design **c++** code so that it is easy to test.
- How do you apply dependency-injection in c++?
- Should I implement the classes using a pure interface class as the base in order to simplify the creation of fake test objects?
- That would force me into making a lot of **virtual** methods. Will that affect performance?
- What else should I think about when designing for testability in c++? | c++ | testability | testing | dependency-injection | null | null | open | Patterns for making c++ code easy to test
===
Should you design your code to make testing easier? And if so how to design **c++** code so that it is easy to test.
- How do you apply dependency-injection in c++?
- Should I implement the classes using a pure interface class as the base in order to simplify the creation of fake test objects?
- That would force me into making a lot of **virtual** methods. Will that affect performance?
- What else should I think about when designing for testability in c++? | 0 |
10,910,155 | 06/06/2012 07:48:01 | 1,235,155 | 02/27/2012 08:54:10 | 12 | 1 | Cocos2D parent-child no interaction | I have a parent with two children that I want to communicate with each other. For some reason it is not working. Here is what I have:
Parent
GameplayLayer *gameplaylayer = [GameplayLayer node]; // 1
[self addChild:gameplaylayer z:2 tag:1];
GameplayLayer2 *gameplaylayer2 = [GameplayLayer2 node]; // 1
[self addChild:gameplaylayer2 z:20 tag:2];
Child
.h
#import "GameplayLayer2.h"
@interface GameplayLayer : CCLayer {
GameplayLayer2* game;
}
.m
game = (GameplayLayer2*)[[self parent] getChildByTag:2];
But when I try to run a function in `game` like so `[game runfun]` it doesn't run. | cocos2d | parent | child | null | null | null | open | Cocos2D parent-child no interaction
===
I have a parent with two children that I want to communicate with each other. For some reason it is not working. Here is what I have:
Parent
GameplayLayer *gameplaylayer = [GameplayLayer node]; // 1
[self addChild:gameplaylayer z:2 tag:1];
GameplayLayer2 *gameplaylayer2 = [GameplayLayer2 node]; // 1
[self addChild:gameplaylayer2 z:20 tag:2];
Child
.h
#import "GameplayLayer2.h"
@interface GameplayLayer : CCLayer {
GameplayLayer2* game;
}
.m
game = (GameplayLayer2*)[[self parent] getChildByTag:2];
But when I try to run a function in `game` like so `[game runfun]` it doesn't run. | 0 |
8,634,353 | 12/26/2011 09:13:17 | 332,210 | 05/04/2010 09:54:46 | 1,705 | 78 | Constructing Min/Max Binary Heap | Given an inorder-traversal list, what's the best way to create a Binary Min/Max Heap?
I'm trying to confine with the following constructs:
1. No array to be used in the binary-heap. Implementation is node-based.
`BinaryNode { value, parent, l_child, r_child }`
2. Let's just stick to Max-Heap.
**Question:** Can we do better than standard insertion that involves BubbleDown.
| algorithm | binary-heap | min-heap | max-heap | null | null | open | Constructing Min/Max Binary Heap
===
Given an inorder-traversal list, what's the best way to create a Binary Min/Max Heap?
I'm trying to confine with the following constructs:
1. No array to be used in the binary-heap. Implementation is node-based.
`BinaryNode { value, parent, l_child, r_child }`
2. Let's just stick to Max-Heap.
**Question:** Can we do better than standard insertion that involves BubbleDown.
| 0 |
189,293 | 10/09/2008 21:32:27 | 6,406 | 09/15/2008 09:31:30 | 46 | 5 | how do i get a filehandle from the command line? | i have a subroutine that takes a file handle as an argument. how do i make a file handle from a file path specified on the command line? i don't want to do any processing of this file myself, i just want to pass it off to this other subroutine, which returns an array of hashes with all the parsed data from the file.
here's what the command line input i'm using looks like:
`$ ./getfile.pl /path/to/some/file.csv` | perl | null | null | null | null | null | open | how do i get a filehandle from the command line?
===
i have a subroutine that takes a file handle as an argument. how do i make a file handle from a file path specified on the command line? i don't want to do any processing of this file myself, i just want to pass it off to this other subroutine, which returns an array of hashes with all the parsed data from the file.
here's what the command line input i'm using looks like:
`$ ./getfile.pl /path/to/some/file.csv` | 0 |
11,340,486 | 07/05/2012 08:25:13 | 685,547 | 03/31/2011 10:42:41 | 85 | 8 | Modifying Spring beans programmatically | I'm currently developing a web application. I know some basics of Spring, however I haven't been working with it that much, hence I've decided to improve my Spring-skills and I've faced a problem that I can't really find a good solution for.
I'd like to implement in my app a feature that will allow the user to configure everything without touching any config file (e.g. spring beans), basically the person that wants to deploy, launch and use the app should only copy the .WAR file into for example tomcat and all the configuration should be done within the app (like in OpenFire for example).
So I imagine that the user deploys the app goes to certain URL and everything is done through UI, he is being asked about some parameters (e.g. DB connection details) once all details are given everything is stored in cfg file, app restarted and the configuration process is over.
I wanted to have all the configuration details in spring beans, but I've discovered that I can't really change them programmatically (one solution would be to modify the file 'out of spring' and reload the app context after wards - is that good approach?).
Another one would be to store xml file in WEB-INF for example and save the data there once it's gathered from the user, but then how to load the data from non-bean file into application context?
Any advices appriciated! | java | spring | spring-mvc | null | null | null | open | Modifying Spring beans programmatically
===
I'm currently developing a web application. I know some basics of Spring, however I haven't been working with it that much, hence I've decided to improve my Spring-skills and I've faced a problem that I can't really find a good solution for.
I'd like to implement in my app a feature that will allow the user to configure everything without touching any config file (e.g. spring beans), basically the person that wants to deploy, launch and use the app should only copy the .WAR file into for example tomcat and all the configuration should be done within the app (like in OpenFire for example).
So I imagine that the user deploys the app goes to certain URL and everything is done through UI, he is being asked about some parameters (e.g. DB connection details) once all details are given everything is stored in cfg file, app restarted and the configuration process is over.
I wanted to have all the configuration details in spring beans, but I've discovered that I can't really change them programmatically (one solution would be to modify the file 'out of spring' and reload the app context after wards - is that good approach?).
Another one would be to store xml file in WEB-INF for example and save the data there once it's gathered from the user, but then how to load the data from non-bean file into application context?
Any advices appriciated! | 0 |
3,434,513 | 08/08/2010 13:42:11 | 79,109 | 03/17/2009 17:12:29 | 655 | 11 | What's the best optimization you've ever used? | One of biggest optimizations I've used is regard to this question:
http://stackoverflow.com/questions/1152414/import-from-text-file-to-sql-server-database-is-ado-net-too-slow
with the initialized version, insert each row per query use ADO.NET, I was able to insert about 100 rows/second. When I switched to batch insert, it rose to 1000 rows/second, and then, BulkCopy, I can get, about 7000 rows/second. All in same machine. 70 times better and even smaller, more-readable code.
So, what's the best optimization you've ever used to improve your code? Optimization means better tactic/strategy, not premature optimization :)
| optimization | self-improvement | null | null | null | 08/10/2010 04:24:53 | not constructive | What's the best optimization you've ever used?
===
One of biggest optimizations I've used is regard to this question:
http://stackoverflow.com/questions/1152414/import-from-text-file-to-sql-server-database-is-ado-net-too-slow
with the initialized version, insert each row per query use ADO.NET, I was able to insert about 100 rows/second. When I switched to batch insert, it rose to 1000 rows/second, and then, BulkCopy, I can get, about 7000 rows/second. All in same machine. 70 times better and even smaller, more-readable code.
So, what's the best optimization you've ever used to improve your code? Optimization means better tactic/strategy, not premature optimization :)
| 4 |
1,485,973 | 09/28/2009 08:24:58 | 159,837 | 08/20/2009 07:54:57 | 1 | 2 | facelets totally escape xml | i use
> <h:outputText value="#{bean.value}" escape="true" />
and i cannot escape from xml
> <h:inputText value="#{bean.value}" />
is there a way to escape in facelets.
for instance
> <context-param>
> <param-name>facelets.DEVELOPMENT</param-name>
> <param-value>false</param-value>
> </context-param> | facelets | jsf | null | null | null | null | open | facelets totally escape xml
===
i use
> <h:outputText value="#{bean.value}" escape="true" />
and i cannot escape from xml
> <h:inputText value="#{bean.value}" />
is there a way to escape in facelets.
for instance
> <context-param>
> <param-name>facelets.DEVELOPMENT</param-name>
> <param-value>false</param-value>
> </context-param> | 0 |
8,388,957 | 12/05/2011 17:03:09 | 969,331 | 09/28/2011 14:50:55 | 30 | 2 | Silverlight Disabling, Hiding all controls in a container | I'm trying to create a method to disable and hide all controls inside a container. For testing purposes I'm trying to do this with a Grid first but I would like something to work with any container type.
At first I was going to do this for the whole view but I realized that the `UserControl` class does not have a Children collection (or at least not by that name and I couldn't find anything like it), so I decided to go for a Grid instead, since that is how it's gonna go in 90% of the cases I'll use it.
Keeping in mind that this would be for any type of control I tried something like
foreach (Control c in myGrid.Children)
{
c.IsEnabled = false;
c.Visibility = Visibility.Collapsed;
}
By doing this I realized that the Children property is a `UIElementCollection`, therefore the loop couldn't be used like that.
I changed the type of c in the `foreach` to from `Control` to `UIElement`, and that presented antoher problem: `UIElement` doesn't have the `IsEnabled` property. So after playing around with my code a bit, I came to have this method:
private void DisableHideControls(UIElementCollection source)
{
foreach (UIElement ctrl in source)
{
ctrl.Visibility = System.Windows.Visibility.Collapsed;
Control c;
c = ((ctrl as TextBox) != null) ? (TextBox)ctrl : null;
if (c != null)
c.IsEnabled = false;
}
}
I figured I had to convert the `UIElement` to Control, and since I wasn't sure every `UIElement` can be safely converted to a `Control` I tried first with `TextBox`.
This has 2 problems:
1. I would need to have to have all the types of controls I need to disable in there
2. I don't think it would disable/hide controls inside other controls (for example a `TextBox` inside a `TabGroup`)
So, is there a way to disable and hide all controls in a container (and their children) that could be type independent? | c# | silverlight-4.0 | null | null | null | 03/15/2012 23:02:58 | too localized | Silverlight Disabling, Hiding all controls in a container
===
I'm trying to create a method to disable and hide all controls inside a container. For testing purposes I'm trying to do this with a Grid first but I would like something to work with any container type.
At first I was going to do this for the whole view but I realized that the `UserControl` class does not have a Children collection (or at least not by that name and I couldn't find anything like it), so I decided to go for a Grid instead, since that is how it's gonna go in 90% of the cases I'll use it.
Keeping in mind that this would be for any type of control I tried something like
foreach (Control c in myGrid.Children)
{
c.IsEnabled = false;
c.Visibility = Visibility.Collapsed;
}
By doing this I realized that the Children property is a `UIElementCollection`, therefore the loop couldn't be used like that.
I changed the type of c in the `foreach` to from `Control` to `UIElement`, and that presented antoher problem: `UIElement` doesn't have the `IsEnabled` property. So after playing around with my code a bit, I came to have this method:
private void DisableHideControls(UIElementCollection source)
{
foreach (UIElement ctrl in source)
{
ctrl.Visibility = System.Windows.Visibility.Collapsed;
Control c;
c = ((ctrl as TextBox) != null) ? (TextBox)ctrl : null;
if (c != null)
c.IsEnabled = false;
}
}
I figured I had to convert the `UIElement` to Control, and since I wasn't sure every `UIElement` can be safely converted to a `Control` I tried first with `TextBox`.
This has 2 problems:
1. I would need to have to have all the types of controls I need to disable in there
2. I don't think it would disable/hide controls inside other controls (for example a `TextBox` inside a `TabGroup`)
So, is there a way to disable and hide all controls in a container (and their children) that could be type independent? | 3 |
10,151,602 | 04/14/2012 06:35:48 | 1,310,253 | 04/03/2012 11:05:31 | 6 | 0 | How to use facebook login openid? | The goal is for people who use facebook to easily login to our website, not to necessarily integrate with facebook and add things to it (yet). I have read the documentation on facebook connect and am still having trouble grasping exactly what we need to do to accomplish this. I referred the link http://developers.facebook.com/docs/authentication/ | facebook | openid | null | null | null | null | open | How to use facebook login openid?
===
The goal is for people who use facebook to easily login to our website, not to necessarily integrate with facebook and add things to it (yet). I have read the documentation on facebook connect and am still having trouble grasping exactly what we need to do to accomplish this. I referred the link http://developers.facebook.com/docs/authentication/ | 0 |
183,336 | 10/08/2008 15:18:34 | 3,886 | 08/31/2008 16:55:28 | 179 | 29 | What was the funnest programming challenge you were ever tasked with? | The funnest thing I ever got paid to do was a compete in a competition. I the "Unix Guy" was tasked with using C# and .NET to build a client/server database application. Our resident "Windows Guy" was given the same specification and tasked with building the same application on Linux with Trolltech QT toolkit. I had NO .NET experience and he had zero Linux experience... I had the app done in 2 days. At two weeks, the boss called the competition done even though my competition wasn't complete yet. This was all done so my boss could prove to the higher ups that .NET was the way to go.
What fun programming tasks have you been paid to complete? | fun | challenge | null | null | null | 10/25/2011 16:08:01 | not constructive | What was the funnest programming challenge you were ever tasked with?
===
The funnest thing I ever got paid to do was a compete in a competition. I the "Unix Guy" was tasked with using C# and .NET to build a client/server database application. Our resident "Windows Guy" was given the same specification and tasked with building the same application on Linux with Trolltech QT toolkit. I had NO .NET experience and he had zero Linux experience... I had the app done in 2 days. At two weeks, the boss called the competition done even though my competition wasn't complete yet. This was all done so my boss could prove to the higher ups that .NET was the way to go.
What fun programming tasks have you been paid to complete? | 4 |
8,233,768 | 11/22/2011 21:01:36 | 1,060,615 | 11/22/2011 20:42:10 | 1 | 0 | Best way to organize back-end for .NET project I'm doing(C#) | I am currently working on a large project. This project has about 20 relevant tables that are all related. I have a back-end set up where Admins can add new items, edit them, view them etc....
I took this project over from someone else, so in the interest of getting things done in a timely fashion, I'm currently handling everything in 2 pages.
The basic layout of both pages is a sidebar including 17 different categories(Products, Brands, Users etc...), with the content of the page displaying the relevant info for the selected category.
I am using the first page to display the info. When I click on say Products, the products load in a table from new to old, paginated in the content portion with options to edit/delete for each, as well as an option to add a new item.
I'm handling the delete on this page, but the edit and add are on the second page.
The second page is the same layout, but the content portion will either be a blank form with the relevant fields, or those fields pre-populated for the item from the edit command on the previous page
Now, I am doing this for all different categories in the code-behind of each page. Even though everything works well, and is not even slow really, I don't like the lack of organization, even though the different categories are clearly separated and organized properly in the code-behind.
I'm wondering the best way to divide this up.
Should I just make a page for each category and have each of those pages handle both displaying as well as editing/adding? Then I can share the common functions through a central base page?
Or should I make use of the ASP user controls, and create a control for each category to handle this stuff, again sharing a base control?
I'm just not sure which is the most efficient, or even the more standard way to approach this. I'd like to get some feedback before I decide how to break this down, and would appreciate any other suggestions as well.
Thanks | c# | .net | asp | code-organization | null | 11/22/2011 21:05:05 | not constructive | Best way to organize back-end for .NET project I'm doing(C#)
===
I am currently working on a large project. This project has about 20 relevant tables that are all related. I have a back-end set up where Admins can add new items, edit them, view them etc....
I took this project over from someone else, so in the interest of getting things done in a timely fashion, I'm currently handling everything in 2 pages.
The basic layout of both pages is a sidebar including 17 different categories(Products, Brands, Users etc...), with the content of the page displaying the relevant info for the selected category.
I am using the first page to display the info. When I click on say Products, the products load in a table from new to old, paginated in the content portion with options to edit/delete for each, as well as an option to add a new item.
I'm handling the delete on this page, but the edit and add are on the second page.
The second page is the same layout, but the content portion will either be a blank form with the relevant fields, or those fields pre-populated for the item from the edit command on the previous page
Now, I am doing this for all different categories in the code-behind of each page. Even though everything works well, and is not even slow really, I don't like the lack of organization, even though the different categories are clearly separated and organized properly in the code-behind.
I'm wondering the best way to divide this up.
Should I just make a page for each category and have each of those pages handle both displaying as well as editing/adding? Then I can share the common functions through a central base page?
Or should I make use of the ASP user controls, and create a control for each category to handle this stuff, again sharing a base control?
I'm just not sure which is the most efficient, or even the more standard way to approach this. I'd like to get some feedback before I decide how to break this down, and would appreciate any other suggestions as well.
Thanks | 4 |
8,983,989 | 01/24/2012 08:44:09 | 519,836 | 11/25/2010 08:15:45 | 1,377 | 17 | How to plot a 3d graph starting from a set of points as a ground XY base | This question might seem a little strange but for my purposes is not that crazy.
Its easy but I need you to follow me.
The aim
--------
My aim is plotting a tridimensional graph.
The problem
-----------
The problem is the material I have in my hands to start building this graph. Actually I have a collection of points in the 2D space (thus tuples of two real ordered values). Consider a moment to have these collection of points stored into an array and now consider to plot them on a 2D diagram. You will just have a nice sparse view of these points.
Well, the second step is this: consider the surface with these points and create a third axis orthogonal to the plane where those points are drawn. The aim is assigning to every point a numerical scalar value (using a function that accepts the couple and returns a numerical value). So the graph should show bars starting from every point and having a specific value according to the assignment function.
How can I achieve this in Mathematica?
A little note
-------------
Basically my points in the 2d space are also connected by a graph. Is it possible to connect the top of the bars to the top of other bars whose base point are connected together in the 2d graph?
Some other notes
----------------
My graph doesn`t have to be a surface but just a collection of bars placed on a plane in the exact place where the correspondent point they refer to is located. But if you have a good hint how to draw a surface other than bars, it will be gladly accepted.
I hope I was clear. I would like to point that I have Mathematica 8 so all functionalities are available. Thank you. | mathematica | mathematica-8 | null | null | null | null | open | How to plot a 3d graph starting from a set of points as a ground XY base
===
This question might seem a little strange but for my purposes is not that crazy.
Its easy but I need you to follow me.
The aim
--------
My aim is plotting a tridimensional graph.
The problem
-----------
The problem is the material I have in my hands to start building this graph. Actually I have a collection of points in the 2D space (thus tuples of two real ordered values). Consider a moment to have these collection of points stored into an array and now consider to plot them on a 2D diagram. You will just have a nice sparse view of these points.
Well, the second step is this: consider the surface with these points and create a third axis orthogonal to the plane where those points are drawn. The aim is assigning to every point a numerical scalar value (using a function that accepts the couple and returns a numerical value). So the graph should show bars starting from every point and having a specific value according to the assignment function.
How can I achieve this in Mathematica?
A little note
-------------
Basically my points in the 2d space are also connected by a graph. Is it possible to connect the top of the bars to the top of other bars whose base point are connected together in the 2d graph?
Some other notes
----------------
My graph doesn`t have to be a surface but just a collection of bars placed on a plane in the exact place where the correspondent point they refer to is located. But if you have a good hint how to draw a surface other than bars, it will be gladly accepted.
I hope I was clear. I would like to point that I have Mathematica 8 so all functionalities are available. Thank you. | 0 |
9,164,610 | 02/06/2012 17:46:53 | 1,089,668 | 12/09/2011 11:58:23 | 129 | 16 | Custom columns using Django admin | I had a model `Data`, associated to a table like that. (The model `Data` is made up of only integeField)
subject | year | quarter | sales |
----------------------------------
1 | 2010 | 1 | 20 |
1 | 2010 | 2 | 100 |
1 | 2010 | 3 | 100 |
1 | 2010 | 4 | 20 |
1 | 2011 | 1 | 30 |
1 | 2011 | 2 | 50 |
1 | 2011 | 4 | 40 |
2 | 2010 | 1 | 30 |
2 | 2010 | 2 | 20 |
[..-GO ON this way...]
I want to have a django-admin table, in read-only having columns (`current year = 2011, quarter = 1`)
subject | sales current year | sales current quarter | sales last year | sales current quarter last year |
----------------------------------------------------------------------------------------------------------
1 | 110 | 30 | 240 | 20
[AND SO ON]
The question is: **It is possible do that using django-admin? What's the way out?** | python | django | django-admin | null | null | null | open | Custom columns using Django admin
===
I had a model `Data`, associated to a table like that. (The model `Data` is made up of only integeField)
subject | year | quarter | sales |
----------------------------------
1 | 2010 | 1 | 20 |
1 | 2010 | 2 | 100 |
1 | 2010 | 3 | 100 |
1 | 2010 | 4 | 20 |
1 | 2011 | 1 | 30 |
1 | 2011 | 2 | 50 |
1 | 2011 | 4 | 40 |
2 | 2010 | 1 | 30 |
2 | 2010 | 2 | 20 |
[..-GO ON this way...]
I want to have a django-admin table, in read-only having columns (`current year = 2011, quarter = 1`)
subject | sales current year | sales current quarter | sales last year | sales current quarter last year |
----------------------------------------------------------------------------------------------------------
1 | 110 | 30 | 240 | 20
[AND SO ON]
The question is: **It is possible do that using django-admin? What's the way out?** | 0 |
8,161,064 | 11/17/2011 01:36:46 | 982,284 | 10/06/2011 13:48:06 | 1 | 0 | How to develop web based voice chat app in C# | I'm looking for a set of library in C# that could help me develop a web based voice chat app. I would prefer to avoid using Flash or Silverlight if i can.
From searching the internet i found WebRTC, libjingle, FreeSwitch, Asterisk could possibly provide what i need, but none is written for C#.
Could someone point me to the right direction ? | c# | asp.net | chat | voip | voice | 11/17/2011 16:54:43 | not a real question | How to develop web based voice chat app in C#
===
I'm looking for a set of library in C# that could help me develop a web based voice chat app. I would prefer to avoid using Flash or Silverlight if i can.
From searching the internet i found WebRTC, libjingle, FreeSwitch, Asterisk could possibly provide what i need, but none is written for C#.
Could someone point me to the right direction ? | 1 |
9,600,576 | 03/07/2012 11:26:38 | 905,513 | 08/22/2011 08:39:43 | 12 | 0 | tool for creating interpreters using java | I am currently looking for tools(either software programs or frameworks) on how to make a compiler using java. I already have the GUI prepared. But I still don't have a clue on how to start creating a compiler.
Maybe anyone could give me links or tutorials in creating compilers using java.I am not looking for the exact source code really, but tips, and algorithms on how to create compilers going through the lexical,syntactical and semantic analysis. | java | compiler | semantic | yacc | lexical-analysis | null | open | tool for creating interpreters using java
===
I am currently looking for tools(either software programs or frameworks) on how to make a compiler using java. I already have the GUI prepared. But I still don't have a clue on how to start creating a compiler.
Maybe anyone could give me links or tutorials in creating compilers using java.I am not looking for the exact source code really, but tips, and algorithms on how to create compilers going through the lexical,syntactical and semantic analysis. | 0 |
4,470,920 | 12/17/2010 13:33:18 | 457,445 | 09/24/2010 15:07:17 | 488 | 2 | polymorphic lists in ML | I have this snippet of the code in ML:
local
fun unfolder( [] , n ) = []
| unfolder( l::ls, n ) = (n, l) :: unfolder( ls, n )
in
fun flat list = unfolder(list, 1)
end;
it gives me an error:
unexpected exception (bug?) in SML/NJ: EA [EA]
raised at: ../../MLRISC/x86/mltree/x86.sml:417.32-417.34
../compiler/Basics/stats/stats.sml:198.40
../compiler/Basics/stats/stats.sml:198.40
../compiler/Basics/stats/stats.sml:198.40
../compiler/TopLevel/interact/evalloop.sml:44.55
but when I change `its (n, l) to (n, l:int)` it works, and when to `(n, l:'a)`, can somebody please explain why polymorphic type doesn't work, thanks in advance | sml | smlnj | null | null | null | null | open | polymorphic lists in ML
===
I have this snippet of the code in ML:
local
fun unfolder( [] , n ) = []
| unfolder( l::ls, n ) = (n, l) :: unfolder( ls, n )
in
fun flat list = unfolder(list, 1)
end;
it gives me an error:
unexpected exception (bug?) in SML/NJ: EA [EA]
raised at: ../../MLRISC/x86/mltree/x86.sml:417.32-417.34
../compiler/Basics/stats/stats.sml:198.40
../compiler/Basics/stats/stats.sml:198.40
../compiler/Basics/stats/stats.sml:198.40
../compiler/TopLevel/interact/evalloop.sml:44.55
but when I change `its (n, l) to (n, l:int)` it works, and when to `(n, l:'a)`, can somebody please explain why polymorphic type doesn't work, thanks in advance | 0 |
10,235,329 | 04/19/2012 19:26:05 | 931,377 | 09/06/2011 19:04:50 | 157 | 4 | How to update GOOGLE MAPS | Sorry guys to ask this broad question, but I am in a pinch and need a solution ASAP.
I have no knowledge of google maps, and have to update this page within 1 day.
If I had the time, I would learn how to work with google maps, but I REALLY have a time constraint and must meet the deadline >_<
**All I need is to learn how to add more addresses to this google map/webpage:**
[tiny.cc/4z00cw][1]
This page was already in place and designed by someone else years before me. To make things worst, this site uses CodeIgnigter (which I have no clue how to work it)
I do not need to redesign or anything. I just need to know how to add more addresses.
Can you guys PLEASE help me get out of this hole?
**PHP code/codeigniter**
<? $this->load->view("inc/header");
?>
<script src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAALG0LY9VczfCgBGR3gYl-OhSYZ3oXbzqsmNbiZCTxCau3LOQmUxTyi2riEMwN4Qit7X7U2xmd_NND1w"
type="text/javascript"></script>
<script type="text/javascript">
//<![CDATA[
var cm_map;
var cm_mapMarkers = [];
var cm_mapHTMLS = [];
// Create a base icon for all of our markers that specifies the
// shadow, icon dimensions, etc.
var cm_baseIcon = new GIcon();
cm_baseIcon.shadow = "http://www.google.com/mapfiles/shdow50.png";
cm_baseIcon.iconSize = new GSize(20, 34);
cm_baseIcon.shadowSize = new GSize(37, 34);
cm_baseIcon.iconAnchor = new GPoint(9, 34);
cm_baseIcon.infoWindowAnchor = new GPoint(9, 2);
cm_baseIcon.infoShadowAnchor = new GPoint(18, 25);
// Change these parameters to customize map
var param_wsId = "od6";
var param_ssKey = "t63uNv1JYAjjbdSo2NVr0ew";
var param_useSidebar = true;
var param_titleColumn = "address";
var param_descriptionColumn = "link";
var param_latColumn = "latitude";
var param_lngColumn = "longitude";
var param_rankColumn = "";
var param_iconType = "red";
var param_iconOverType = "green";
/**
* Loads map and calls function to load in worksheet data.
*/
function cm_load() {
if (GBrowserIsCompatible()) {
// create the map
cm_map = new GMap2(document.getElementById("cm_map"));
cm_map.addControl(new GLargeMapControl());
cm_map.addControl(new GMapTypeControl());
cm_map.setCenter(new GLatLng( 43.907787,-79.359741), 2);
cm_getJSON();
} else {
alert("Sorry, the Google Maps API is not compatible with this browser");
}
}
/**
* Function called when marker on the map is clicked.
* Opens an info window (bubble) above the marker.
* @param {Number} markerNum Number of marker in global array
*/
function cm_markerClicked(markerNum) {
cm_mapMarkers[markerNum].openInfoWindowHtml(cm_mapHTMLS[markerNum]);
}
/**
* Function that sorts 2 worksheet rows from JSON feed
* based on their rank column. Only called if column is defined.
* @param {rowA} Object Represents row in JSON feed
* @param {rowB} Object Represents row in JSON feed
* @return {Number} Difference between row values
*/
function cm_sortRows(rowA, rowB) {
var rowAValue = parseFloat(rowA["gsx$" + param_rankColumn].$t);
var rowBValue = parseFloat(rowB["gsx$" + param_rankColumn].$t);
return rowAValue - rowBValue;
}
/**
* Called when JSON is loaded. Creates sidebar if param_sideBar is true.
* Sorts rows if param_rankColumn is valid column. Iterates through worksheet rows,
* creating marker and sidebar entries for each row.
* @param {JSON} json Worksheet feed
*/
function cm_loadMapJSON(json) {
var usingRank = false;
if(param_useSidebar == true) {
var sidebarTD = document.createElement("td");
sidebarTD.setAttribute("width","150");
sidebarTD.setAttribute("valign","top");
var sidebarDIV = document.createElement("div");
sidebarDIV.id = "cm_sidebarDIV";
sidebarDIV.style.overflow = "auto";
sidebarDIV.style.height = "860px";
sidebarDIV.style.fontSize = "11px";
sidebarDIV.style.color = "#000000";
sidebarTD.appendChild(sidebarDIV);
document.getElementById("cm_mapTR").appendChild(sidebarTD);
}
var bounds = new GLatLngBounds();
if(json.feed.entry[0]["gsx$" + param_rankColumn]) {
usingRank = true;
json.feed.entry.sort(cm_sortRows);
}
for (var i = 0; i < <?=count($address)+1?>; i++) {
var entry = json.feed.entry[i];
if(entry["gsx$" + param_latColumn]) {
var lat = parseFloat(entry["gsx$" + param_latColumn].$t);
var lng = parseFloat(entry["gsx$" + param_lngColumn].$t);
var point = new GLatLng(lat,lng);
var html = "<div style='font-size:12px'>";
html += "<strong>" + entry["gsx$"+param_titleColumn].$t
+ "</strong>";
var label = entry["gsx$"+param_titleColumn].$t;
var rank = 0;
if(usingRank && entry["gsx$" + param_rankColumn]) {
rank = parseInt(entry["gsx$"+param_rankColumn].$t);
}
var trimmed = label.replace(/^\s+|\s+$/g, '') ;
var link_label = label.replace(/ /gi,'-');
link_label = link_label.toLowerCase();
link_label = link_label.replace(/^\s+|\s+$/g, '') ;
if(trimmed == "1286 West Adams Blvd" )
{
if(entry["gsx$" + param_descriptionColumn]) {
html += "<br/><a href=\"<?=base_url()?>Housing/propertyDetail/1286-west-adams-blvd.html\">Click here for housing option</a>" ;
}
}
else if(trimmed == "1239 West 30th Street")
{
if(entry["gsx$" + param_descriptionColumn]) {
html += "<br/><a href=\"<?=base_url()?>Housing/propertyDetail/1352-west-29th-street.html\">Click here for housing option</a>" ;
}
}
else if(trimmed == "2150 Oak Street")
{
if(entry["gsx$" + param_descriptionColumn]) {
html += "<br/><a href=\"<?=base_url()?>Housing/propertyDetail/2126-50-south-oak-867-889-west-23rd-street.html\">Click here for housing option</a>" ;
}
}
else if(trimmed == "1146 West 36th Place")
{
if(entry["gsx$" + param_descriptionColumn]) {
html += "<br/><a href=\"<?=base_url()?>Housing/propertyDetail/1140--1168-west-36th-place.html\">Click here for housing option</a>" ;
}
}else if(trimmed == "1199 West 37th Drive")
{
if(entry["gsx$" + param_descriptionColumn]) {
html += "<br/><a href=\"<?=base_url()?>Housing/propertyDetail/1189--1199-west-37th-drive.html\">Click here for housing option</a>" ;
}
}
else if(trimmed == "2611 South Portland Street")
{
if(entry["gsx$" + param_descriptionColumn]) {
html += "<br/><a href=\"<?=base_url()?>Housing/propertyDetail/2611-south-portland.html\">Click here for housing option</a>" ;
}
}
else
{
if(entry["gsx$" + param_descriptionColumn]) {
html += "<br/><a href=\"<?=base_url()?>Housing/propertyDetail/"+link_label+".html\">Click here for housing option</a>" ;
}
}
html += "</div>";
// create the marker
var marker = cm_createMarker(point,label,html,rank);
//label = 'hello';
cm_map.addOverlay(marker);
cm_mapMarkers.push(marker);
cm_mapHTMLS.push(html);
bounds.extend(point);
if(param_useSidebar == true) {
var markerA = document.createElement("a");
markerA.setAttribute("href","javascript:cm_markerClicked('" + i +"')");
markerA.style.color = "#000000";
var sidebarText= "";
if(usingRank) {
sidebarText += rank + ") ";
}
sidebarText += label;
markerA.appendChild(document.createTextNode(sidebarText));
// condition to remove an address from the list....
/*if(trimmed != '1155 24th Street')
{*/
sidebarDIV.appendChild(markerA);
sidebarDIV.appendChild(document.createElement("br"));
sidebarDIV.appendChild(document.createElement("br"));
//}
}
}
}
cm_map.setZoom(cm_map.getBoundsZoomLevel(bounds));
cm_map.setCenter(bounds.getCenter());
}
/**
* Creates marker with ranked Icon or blank icon,
* depending if rank is defined. Assigns onclick function.
* @param {GLatLng} point Point to create marker at
* @param {String} title Tooltip title to display for marker
* @param {String} html HTML to display in InfoWindow
* @param {Number} rank Number rank of marker, used in creating icon
* @return {GMarker} Marker created
*/
function cm_createMarker(point, title, html, rank) {
var markerOpts = {};
var nIcon = new GIcon(cm_baseIcon);
if(rank > 0 && rank < 100) {
nIcon.imageOut = "http://gmaps-samples.googlecode.com/svn/trunk/" +
"markers/" + param_iconType + "/marker" + rank + ".png";
nIcon.imageOver = "http://gmaps-samples.googlecode.com/svn/trunk/" +
"markers/" + param_iconOverType + "/marker" + rank + ".png";
nIcon.image = nIcon.imageOut;
} else {
nIcon.imageOut = "http://gmaps-samples.googlecode.com/svn/trunk/" +
"markers/" + param_iconType + "/blank.png";
nIcon.imageOver = "http://gmaps-samples.googlecode.com/svn/trunk/" +
"markers/" + param_iconOverType + "/blank.png";
nIcon.image = nIcon.imageOut;
}
markerOpts.icon = nIcon;
markerOpts.title = title;
var marker = new GMarker(point, markerOpts);
GEvent.addListener(marker, "click", function() {
marker.openInfoWindowHtml(html);
});
GEvent.addListener(marker, "mouseover", function() {
marker.setImage(marker.getIcon().imageOver);
});
GEvent.addListener(marker, "mouseout", function() {
marker.setImage(marker.getIcon().imageOut);
});
GEvent.addListener(marker, "infowindowopen", function() {
marker.setImage(marker.getIcon().imageOver);
});
GEvent.addListener(marker, "infowindowclose", function() {
marker.setImage(marker.getIcon().imageOut);
});
return marker;
}
/**
* Creates a script tag in the page that loads in the
* JSON feed for the specified key/ID.
* Once loaded, it calls cm_loadMapJSON.
*/
function cm_getJSON() {
// Retrieve the JSON feed.
var script = document.createElement('script');
script.setAttribute('src', 'http://spreadsheets.google.com/feeds/list'
+ '/' + param_ssKey + '/' + param_wsId + '/public/values' +
'?alt=json-in-script&callback=cm_loadMapJSON');
script.setAttribute('id', 'jsonScript');
script.setAttribute('type', 'text/javascript');
document.documentElement.firstChild.appendChild(script);
}
setTimeout('cm_load()', 500);
//]]>
</script>
<body onLoad="FP_preloadImgs(/*url*/'button18.jpg', /*url*/'button19.jpg'); if (document.getElementById('zoom_searchbox')) {document.getElementById('zoom_searchbox').focus();}" bgcolor=#969696>
<div id="junaid"></div>
<div class="body_main">
<div class="banner_contianer">
<div class="banner_bg"><img src="<?=base_url()?>banners/properties.png" alt="" /></div>
<div class="banner_btm_flear"></div></div>
<div class="body_left_cont">
<div class="welcome_message">
<h1><?=$page_data['heading']?></h1>
</div>
<div class="tabs_main_cont" >
<div class="tabs_md_show"><img src="<?=base_url()?>images/search-top-bg.png" alt="" /></div>
<div class="tabs_data_cont">
<div class="tabs_repeat_inner">
<div class="show_detail_contianer">
<div class="show_In_cont">
<div class="show_In_properties">
<table bgcolor="#FFFFFF" id="cm_mapTABLE">
<tbody> <tr id="cm_mapTR">
<td> <div id="cm_map" style="width:530px; height:860px"></div> </td>
</tr> </tbody>
</table>
</div>
</div>
</div>
</div>
<div class="tabs_md_show"><img src="<?=base_url()?>images/search-btm-bg.png" alt="" /></div>
</div>
</div>
</div>
</body>
<?PHP
//$this->load->view("inc/right_panel");
?>
<div class="opportunities">We Do Business In Accordance With The Federal Fair Housing Law Equal Housing Opportunity</div>
</div>
<?PHP
$this->load->view("inc/footer");
?>
[1]: http://tiny.cc/4z00cw
| php | javascript | google-maps | null | null | 04/19/2012 20:24:17 | not a real question | How to update GOOGLE MAPS
===
Sorry guys to ask this broad question, but I am in a pinch and need a solution ASAP.
I have no knowledge of google maps, and have to update this page within 1 day.
If I had the time, I would learn how to work with google maps, but I REALLY have a time constraint and must meet the deadline >_<
**All I need is to learn how to add more addresses to this google map/webpage:**
[tiny.cc/4z00cw][1]
This page was already in place and designed by someone else years before me. To make things worst, this site uses CodeIgnigter (which I have no clue how to work it)
I do not need to redesign or anything. I just need to know how to add more addresses.
Can you guys PLEASE help me get out of this hole?
**PHP code/codeigniter**
<? $this->load->view("inc/header");
?>
<script src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAALG0LY9VczfCgBGR3gYl-OhSYZ3oXbzqsmNbiZCTxCau3LOQmUxTyi2riEMwN4Qit7X7U2xmd_NND1w"
type="text/javascript"></script>
<script type="text/javascript">
//<![CDATA[
var cm_map;
var cm_mapMarkers = [];
var cm_mapHTMLS = [];
// Create a base icon for all of our markers that specifies the
// shadow, icon dimensions, etc.
var cm_baseIcon = new GIcon();
cm_baseIcon.shadow = "http://www.google.com/mapfiles/shdow50.png";
cm_baseIcon.iconSize = new GSize(20, 34);
cm_baseIcon.shadowSize = new GSize(37, 34);
cm_baseIcon.iconAnchor = new GPoint(9, 34);
cm_baseIcon.infoWindowAnchor = new GPoint(9, 2);
cm_baseIcon.infoShadowAnchor = new GPoint(18, 25);
// Change these parameters to customize map
var param_wsId = "od6";
var param_ssKey = "t63uNv1JYAjjbdSo2NVr0ew";
var param_useSidebar = true;
var param_titleColumn = "address";
var param_descriptionColumn = "link";
var param_latColumn = "latitude";
var param_lngColumn = "longitude";
var param_rankColumn = "";
var param_iconType = "red";
var param_iconOverType = "green";
/**
* Loads map and calls function to load in worksheet data.
*/
function cm_load() {
if (GBrowserIsCompatible()) {
// create the map
cm_map = new GMap2(document.getElementById("cm_map"));
cm_map.addControl(new GLargeMapControl());
cm_map.addControl(new GMapTypeControl());
cm_map.setCenter(new GLatLng( 43.907787,-79.359741), 2);
cm_getJSON();
} else {
alert("Sorry, the Google Maps API is not compatible with this browser");
}
}
/**
* Function called when marker on the map is clicked.
* Opens an info window (bubble) above the marker.
* @param {Number} markerNum Number of marker in global array
*/
function cm_markerClicked(markerNum) {
cm_mapMarkers[markerNum].openInfoWindowHtml(cm_mapHTMLS[markerNum]);
}
/**
* Function that sorts 2 worksheet rows from JSON feed
* based on their rank column. Only called if column is defined.
* @param {rowA} Object Represents row in JSON feed
* @param {rowB} Object Represents row in JSON feed
* @return {Number} Difference between row values
*/
function cm_sortRows(rowA, rowB) {
var rowAValue = parseFloat(rowA["gsx$" + param_rankColumn].$t);
var rowBValue = parseFloat(rowB["gsx$" + param_rankColumn].$t);
return rowAValue - rowBValue;
}
/**
* Called when JSON is loaded. Creates sidebar if param_sideBar is true.
* Sorts rows if param_rankColumn is valid column. Iterates through worksheet rows,
* creating marker and sidebar entries for each row.
* @param {JSON} json Worksheet feed
*/
function cm_loadMapJSON(json) {
var usingRank = false;
if(param_useSidebar == true) {
var sidebarTD = document.createElement("td");
sidebarTD.setAttribute("width","150");
sidebarTD.setAttribute("valign","top");
var sidebarDIV = document.createElement("div");
sidebarDIV.id = "cm_sidebarDIV";
sidebarDIV.style.overflow = "auto";
sidebarDIV.style.height = "860px";
sidebarDIV.style.fontSize = "11px";
sidebarDIV.style.color = "#000000";
sidebarTD.appendChild(sidebarDIV);
document.getElementById("cm_mapTR").appendChild(sidebarTD);
}
var bounds = new GLatLngBounds();
if(json.feed.entry[0]["gsx$" + param_rankColumn]) {
usingRank = true;
json.feed.entry.sort(cm_sortRows);
}
for (var i = 0; i < <?=count($address)+1?>; i++) {
var entry = json.feed.entry[i];
if(entry["gsx$" + param_latColumn]) {
var lat = parseFloat(entry["gsx$" + param_latColumn].$t);
var lng = parseFloat(entry["gsx$" + param_lngColumn].$t);
var point = new GLatLng(lat,lng);
var html = "<div style='font-size:12px'>";
html += "<strong>" + entry["gsx$"+param_titleColumn].$t
+ "</strong>";
var label = entry["gsx$"+param_titleColumn].$t;
var rank = 0;
if(usingRank && entry["gsx$" + param_rankColumn]) {
rank = parseInt(entry["gsx$"+param_rankColumn].$t);
}
var trimmed = label.replace(/^\s+|\s+$/g, '') ;
var link_label = label.replace(/ /gi,'-');
link_label = link_label.toLowerCase();
link_label = link_label.replace(/^\s+|\s+$/g, '') ;
if(trimmed == "1286 West Adams Blvd" )
{
if(entry["gsx$" + param_descriptionColumn]) {
html += "<br/><a href=\"<?=base_url()?>Housing/propertyDetail/1286-west-adams-blvd.html\">Click here for housing option</a>" ;
}
}
else if(trimmed == "1239 West 30th Street")
{
if(entry["gsx$" + param_descriptionColumn]) {
html += "<br/><a href=\"<?=base_url()?>Housing/propertyDetail/1352-west-29th-street.html\">Click here for housing option</a>" ;
}
}
else if(trimmed == "2150 Oak Street")
{
if(entry["gsx$" + param_descriptionColumn]) {
html += "<br/><a href=\"<?=base_url()?>Housing/propertyDetail/2126-50-south-oak-867-889-west-23rd-street.html\">Click here for housing option</a>" ;
}
}
else if(trimmed == "1146 West 36th Place")
{
if(entry["gsx$" + param_descriptionColumn]) {
html += "<br/><a href=\"<?=base_url()?>Housing/propertyDetail/1140--1168-west-36th-place.html\">Click here for housing option</a>" ;
}
}else if(trimmed == "1199 West 37th Drive")
{
if(entry["gsx$" + param_descriptionColumn]) {
html += "<br/><a href=\"<?=base_url()?>Housing/propertyDetail/1189--1199-west-37th-drive.html\">Click here for housing option</a>" ;
}
}
else if(trimmed == "2611 South Portland Street")
{
if(entry["gsx$" + param_descriptionColumn]) {
html += "<br/><a href=\"<?=base_url()?>Housing/propertyDetail/2611-south-portland.html\">Click here for housing option</a>" ;
}
}
else
{
if(entry["gsx$" + param_descriptionColumn]) {
html += "<br/><a href=\"<?=base_url()?>Housing/propertyDetail/"+link_label+".html\">Click here for housing option</a>" ;
}
}
html += "</div>";
// create the marker
var marker = cm_createMarker(point,label,html,rank);
//label = 'hello';
cm_map.addOverlay(marker);
cm_mapMarkers.push(marker);
cm_mapHTMLS.push(html);
bounds.extend(point);
if(param_useSidebar == true) {
var markerA = document.createElement("a");
markerA.setAttribute("href","javascript:cm_markerClicked('" + i +"')");
markerA.style.color = "#000000";
var sidebarText= "";
if(usingRank) {
sidebarText += rank + ") ";
}
sidebarText += label;
markerA.appendChild(document.createTextNode(sidebarText));
// condition to remove an address from the list....
/*if(trimmed != '1155 24th Street')
{*/
sidebarDIV.appendChild(markerA);
sidebarDIV.appendChild(document.createElement("br"));
sidebarDIV.appendChild(document.createElement("br"));
//}
}
}
}
cm_map.setZoom(cm_map.getBoundsZoomLevel(bounds));
cm_map.setCenter(bounds.getCenter());
}
/**
* Creates marker with ranked Icon or blank icon,
* depending if rank is defined. Assigns onclick function.
* @param {GLatLng} point Point to create marker at
* @param {String} title Tooltip title to display for marker
* @param {String} html HTML to display in InfoWindow
* @param {Number} rank Number rank of marker, used in creating icon
* @return {GMarker} Marker created
*/
function cm_createMarker(point, title, html, rank) {
var markerOpts = {};
var nIcon = new GIcon(cm_baseIcon);
if(rank > 0 && rank < 100) {
nIcon.imageOut = "http://gmaps-samples.googlecode.com/svn/trunk/" +
"markers/" + param_iconType + "/marker" + rank + ".png";
nIcon.imageOver = "http://gmaps-samples.googlecode.com/svn/trunk/" +
"markers/" + param_iconOverType + "/marker" + rank + ".png";
nIcon.image = nIcon.imageOut;
} else {
nIcon.imageOut = "http://gmaps-samples.googlecode.com/svn/trunk/" +
"markers/" + param_iconType + "/blank.png";
nIcon.imageOver = "http://gmaps-samples.googlecode.com/svn/trunk/" +
"markers/" + param_iconOverType + "/blank.png";
nIcon.image = nIcon.imageOut;
}
markerOpts.icon = nIcon;
markerOpts.title = title;
var marker = new GMarker(point, markerOpts);
GEvent.addListener(marker, "click", function() {
marker.openInfoWindowHtml(html);
});
GEvent.addListener(marker, "mouseover", function() {
marker.setImage(marker.getIcon().imageOver);
});
GEvent.addListener(marker, "mouseout", function() {
marker.setImage(marker.getIcon().imageOut);
});
GEvent.addListener(marker, "infowindowopen", function() {
marker.setImage(marker.getIcon().imageOver);
});
GEvent.addListener(marker, "infowindowclose", function() {
marker.setImage(marker.getIcon().imageOut);
});
return marker;
}
/**
* Creates a script tag in the page that loads in the
* JSON feed for the specified key/ID.
* Once loaded, it calls cm_loadMapJSON.
*/
function cm_getJSON() {
// Retrieve the JSON feed.
var script = document.createElement('script');
script.setAttribute('src', 'http://spreadsheets.google.com/feeds/list'
+ '/' + param_ssKey + '/' + param_wsId + '/public/values' +
'?alt=json-in-script&callback=cm_loadMapJSON');
script.setAttribute('id', 'jsonScript');
script.setAttribute('type', 'text/javascript');
document.documentElement.firstChild.appendChild(script);
}
setTimeout('cm_load()', 500);
//]]>
</script>
<body onLoad="FP_preloadImgs(/*url*/'button18.jpg', /*url*/'button19.jpg'); if (document.getElementById('zoom_searchbox')) {document.getElementById('zoom_searchbox').focus();}" bgcolor=#969696>
<div id="junaid"></div>
<div class="body_main">
<div class="banner_contianer">
<div class="banner_bg"><img src="<?=base_url()?>banners/properties.png" alt="" /></div>
<div class="banner_btm_flear"></div></div>
<div class="body_left_cont">
<div class="welcome_message">
<h1><?=$page_data['heading']?></h1>
</div>
<div class="tabs_main_cont" >
<div class="tabs_md_show"><img src="<?=base_url()?>images/search-top-bg.png" alt="" /></div>
<div class="tabs_data_cont">
<div class="tabs_repeat_inner">
<div class="show_detail_contianer">
<div class="show_In_cont">
<div class="show_In_properties">
<table bgcolor="#FFFFFF" id="cm_mapTABLE">
<tbody> <tr id="cm_mapTR">
<td> <div id="cm_map" style="width:530px; height:860px"></div> </td>
</tr> </tbody>
</table>
</div>
</div>
</div>
</div>
<div class="tabs_md_show"><img src="<?=base_url()?>images/search-btm-bg.png" alt="" /></div>
</div>
</div>
</div>
</body>
<?PHP
//$this->load->view("inc/right_panel");
?>
<div class="opportunities">We Do Business In Accordance With The Federal Fair Housing Law Equal Housing Opportunity</div>
</div>
<?PHP
$this->load->view("inc/footer");
?>
[1]: http://tiny.cc/4z00cw
| 1 |
8,344,128 | 12/01/2011 15:47:25 | 778,338 | 05/31/2011 20:43:20 | 1 | 0 | Use a SMTP proxy to modifiy mail content | I have a commercial software sending mails and I have modify their content. I can't access to source code of the software.
A simplified example :
Mail sent by the software :
TO : mike@mail.com, john@mail.com.
BODY : "Hello #guy# !".
I want to modify the content so that mike@mail.com receive "Hello Mike !" and john@mail.com receive "Hello John !".
The idea is to use a proxy to transform the mails before forwarding them to the SMTP server.
What's the best way to do that ?
The solution will be hosted on Linux and has to be in Java or PHP which are the technologies used on the project. | linux | open-source | proxy | smtp | null | 12/01/2011 19:33:19 | off topic | Use a SMTP proxy to modifiy mail content
===
I have a commercial software sending mails and I have modify their content. I can't access to source code of the software.
A simplified example :
Mail sent by the software :
TO : mike@mail.com, john@mail.com.
BODY : "Hello #guy# !".
I want to modify the content so that mike@mail.com receive "Hello Mike !" and john@mail.com receive "Hello John !".
The idea is to use a proxy to transform the mails before forwarding them to the SMTP server.
What's the best way to do that ?
The solution will be hosted on Linux and has to be in Java or PHP which are the technologies used on the project. | 2 |
4,797,455 | 01/25/2011 18:34:40 | 397,538 | 08/01/2009 14:02:46 | 16 | 7 | Codeigniter with Wordpressintegration | Is there any way to use Wordpress authontication with Codeigniter framework? | wordpress | authentication | codeigniter | null | null | null | open | Codeigniter with Wordpressintegration
===
Is there any way to use Wordpress authontication with Codeigniter framework? | 0 |
1,368,012 | 09/02/2009 14:22:19 | 17,815 | 09/18/2008 15:06:59 | 979 | 38 | What are good books to study C/C++ programming in Windows? | I'm an experienced Java/C# developer. I studied C/C++ in university but have never used them to build any non-trivial software. Now I'm interested in learning about C/C++ programming in Windows and looking for good books to get started.
Specifically, I want to learn about Win32 API, MFC, COM, event hook, screen capturing, multithreading, and networking. Good books that cover many of these topics, even at introductory level (sufficient to start coding in the respective topic & explore more later), are of more interest to me than books covering only one or two of those areas in depth.
What are good books which meet these criteria? | c | c++ | windows | books | null | 01/06/2012 20:45:38 | not constructive | What are good books to study C/C++ programming in Windows?
===
I'm an experienced Java/C# developer. I studied C/C++ in university but have never used them to build any non-trivial software. Now I'm interested in learning about C/C++ programming in Windows and looking for good books to get started.
Specifically, I want to learn about Win32 API, MFC, COM, event hook, screen capturing, multithreading, and networking. Good books that cover many of these topics, even at introductory level (sufficient to start coding in the respective topic & explore more later), are of more interest to me than books covering only one or two of those areas in depth.
What are good books which meet these criteria? | 4 |
3,210,566 | 07/09/2010 07:19:12 | 82,908 | 03/26/2009 01:46:05 | 168 | 17 | Need help in registration/sign-up (OAuth/OpenId with Facebook and Yahoo) and sign in | I have an application that will accept both Facebook and Yahoo registrations as well as normal registration (providing username, email, password).
I'm confused on the Facebook and Yahoo side of the registration. The scenario is, upon clicking the Facebook/Yahoo registration links, users will be redirected to the provider's site for login, then redirect to our site with a form pre-filled with their email address and other profile data (photo/profile pic, birthday, gender, address, etc). With OpenId, as far as I know, you can't have access to most of those information since its concern is authentication. So, on the signup part, I'm thinking of using OAuth.
However, I saw on Yahoo's registration for an API key (http://developer.yahoo.com/oauth/ or http://developer.yahoo.com/dashboard/createKey.html) that you can't access the user's email under Yahoo! Profiles. I need that email address to save on my accounts database.
Then, on sign in, I plan to use OpenID both for Facebook and Yahoo. Is that ok? Using OAuth for sign-up, and OpenID for login/sign-in? Or can I use OAuth for signing in? (I know you can do this on Facebook with their Javascript SDK, but I am not aware about Yahoo's). | facebook | openid | oauth | yahoo | registration | null | open | Need help in registration/sign-up (OAuth/OpenId with Facebook and Yahoo) and sign in
===
I have an application that will accept both Facebook and Yahoo registrations as well as normal registration (providing username, email, password).
I'm confused on the Facebook and Yahoo side of the registration. The scenario is, upon clicking the Facebook/Yahoo registration links, users will be redirected to the provider's site for login, then redirect to our site with a form pre-filled with their email address and other profile data (photo/profile pic, birthday, gender, address, etc). With OpenId, as far as I know, you can't have access to most of those information since its concern is authentication. So, on the signup part, I'm thinking of using OAuth.
However, I saw on Yahoo's registration for an API key (http://developer.yahoo.com/oauth/ or http://developer.yahoo.com/dashboard/createKey.html) that you can't access the user's email under Yahoo! Profiles. I need that email address to save on my accounts database.
Then, on sign in, I plan to use OpenID both for Facebook and Yahoo. Is that ok? Using OAuth for sign-up, and OpenID for login/sign-in? Or can I use OAuth for signing in? (I know you can do this on Facebook with their Javascript SDK, but I am not aware about Yahoo's). | 0 |
9,887,713 | 03/27/2012 10:25:43 | 114,124 | 05/29/2009 05:54:04 | 885 | 35 | How to print out Java jvm memory use for debugging purposes? | I have a large Java app that uses massive amounts of memory at times and I would like to monitor this at intervals to see if heap or permgen limits are reached or have gotten near to them.
How can I print out the most relevant pieces of mem usage information using java? | java | memory-management | null | null | null | null | open | How to print out Java jvm memory use for debugging purposes?
===
I have a large Java app that uses massive amounts of memory at times and I would like to monitor this at intervals to see if heap or permgen limits are reached or have gotten near to them.
How can I print out the most relevant pieces of mem usage information using java? | 0 |
8,773,179 | 01/07/2012 21:15:02 | 69,358 | 02/21/2009 16:53:13 | 1,143 | 35 | What is the best way to suggest a new feature for Delphi? | So far I have been suggesting new features to [http://delphi.uservoice.com][1]
Since it is managed by Nick Hodges (who is no longer an employee of Embarcadero) I decided to report my future improvements requests to [http://qc.embarcadero.com][2]
Is QC this the right way to go or is there a dedecated Idea Share solution I am not aware of?
Just as a reference I will point one of my suggestions [Add Patterns.pas to allow easily document code][3]
Please advise which is best place to submit such stuff to?
[1]: http://delphi.uservoice.com
[2]: http://qc.embarcadero.com
[3]: http://qc.embarcadero.com/wc/qcmain.aspx?d=102417 | delphi | bug-tracking | delphi-xe2 | project-ideas | suggestions | 01/07/2012 22:51:53 | off topic | What is the best way to suggest a new feature for Delphi?
===
So far I have been suggesting new features to [http://delphi.uservoice.com][1]
Since it is managed by Nick Hodges (who is no longer an employee of Embarcadero) I decided to report my future improvements requests to [http://qc.embarcadero.com][2]
Is QC this the right way to go or is there a dedecated Idea Share solution I am not aware of?
Just as a reference I will point one of my suggestions [Add Patterns.pas to allow easily document code][3]
Please advise which is best place to submit such stuff to?
[1]: http://delphi.uservoice.com
[2]: http://qc.embarcadero.com
[3]: http://qc.embarcadero.com/wc/qcmain.aspx?d=102417 | 2 |
8,905,662 | 01/18/2012 05:37:27 | 714,178 | 04/18/2011 21:17:50 | 547 | 3 | How to change all occurances of a word in all files in a directory | I was in the process of creating a `User` class where one of the methods was `get_privileges();`.
After hours of slamming my head into the keyboard, I finally discovered that the previous coder who I inherited this particular database spelled the word "**privileges**" as "**privelages**" in the MySQL database, and thus also everywhere in the hundreds of files that access these "**privelages**" it is spelled that way.
Is there a way in Linux (*Ubuntu Server*) that I can go through every place in the `/var/www` folder and replace "**privelages**" with "**privileges**", so that I don't have to deal with this typo and code around it?
| linux | ubuntu | preg-replace | null | null | null | open | How to change all occurances of a word in all files in a directory
===
I was in the process of creating a `User` class where one of the methods was `get_privileges();`.
After hours of slamming my head into the keyboard, I finally discovered that the previous coder who I inherited this particular database spelled the word "**privileges**" as "**privelages**" in the MySQL database, and thus also everywhere in the hundreds of files that access these "**privelages**" it is spelled that way.
Is there a way in Linux (*Ubuntu Server*) that I can go through every place in the `/var/www` folder and replace "**privelages**" with "**privileges**", so that I don't have to deal with this typo and code around it?
| 0 |
8,991,566 | 01/24/2012 17:49:07 | 1,167,606 | 01/24/2012 17:44:11 | 1 | 0 | Gesture Search Application | It's my first time doing application in android.. and i wanted to create a gesture application , where you can draw gesture and automatically search for files. I have read tutorials in android for that application. but it really is hard for me to understand those tutorials.. can someone help me or rather suggest me some tutorials that could help me.? thanks.. God bless. | android | null | null | null | null | 01/29/2012 15:43:17 | not a real question | Gesture Search Application
===
It's my first time doing application in android.. and i wanted to create a gesture application , where you can draw gesture and automatically search for files. I have read tutorials in android for that application. but it really is hard for me to understand those tutorials.. can someone help me or rather suggest me some tutorials that could help me.? thanks.. God bless. | 1 |
6,233,402 | 06/03/2011 22:51:40 | 535,359 | 12/08/2010 17:39:54 | 76 | 6 | Building a common set of methods that can operate on any linq table | **Problem:** We make extensive use of a repository pattern to facilitate read/write operations on our datastore (MS SQL using LINQ) across multiple applications and subsections of functionality. We have series of methods that all do something similar to each other.
For example, we have the ProcessAndSortXXXXX class of methods.
private static IEnumerable<ClassErrorEntry> ProcessAndSortClassErrorLog(IQueryable<ClassErrorDb> queryable, string sortOrder)
{
var dynamic = queryable;
if (!String.IsNullOrEmpty(sortOrder.Trim()))
{
dynamic = dynamic.OrderBy(sortOrder);
}
return dynamic
.Select(l =>
new ClassErrorEntry(l.Id)
{
ClassId = l.ClassId,
Code = l.Code,
Message = l.Message,
Severity = l.Severity,
Target = l.Target
}
);
}
...and...
private static IEnumerable<ClassTimerLogEntry> ProcessAndSortClassTimerLog(IQueryable<ClassTimerDb> queryable, string sortOrder)
{
var dynamic = queryable;
if (!String.IsNullOrEmpty(sortOrder.Trim()))
{
dynamic = dynamic.OrderBy(sortOrder);
}
return dynamic
.Select(l =>
new ClassTimerLogEntry(l.Id)
{
ClassName = l.ClassName,
MethodName = l.MethodName,
StartTime = l.StartTime,
EndTime = l.EndTime,
ParentId = l.ParentId,
ExecutionOrder = l.ExecutionOrder
}
);
}
As you can tell by the code, they're all very similar until you look at the signature and then get to the the return statement where we're building out the instances of the ClassErrorEntry and ClassTimerLogEntry.
I want to build a utility method that I'll add into the base class that all of the repositories inherit from.
I want to be able to pass in arguments that can be used to instantiate the objects and pack them into the returning IEnumerable.
I found [this post](http://weblogs.asp.net/scottgu/archive/2008/01/07/dynamic-linq-part-1-using-the-linq-dynamic-query-library.aspx) by [ScottGu](http://weblogs.asp.net/scottgu/) and that gets me most of what I need. It looks like this (from the sample in the documentation):
var query =
db.Customers.
Where("City = @0 and Orders.Count >= @1", "London", 10).
OrderBy("CompanyName").
Select("new(CompanyName as Name, Phone)");
Here's where I get stuck, though. I need a pointer or suggestion how I can pass in the LINQ tables and DataContext in a generic fashion so I can build out the dynamic query.
If I were to mock up the signature in pseudocode I think it would look something like this:
protected internal IEnumerable ProcessAndSort(IQueryable source, string selectClause, string whereClause, string orderByClause);
I realize that the finished signature may look different as we figure this out.
Thank you! | c# | linq | dynamic-linq | null | null | null | open | Building a common set of methods that can operate on any linq table
===
**Problem:** We make extensive use of a repository pattern to facilitate read/write operations on our datastore (MS SQL using LINQ) across multiple applications and subsections of functionality. We have series of methods that all do something similar to each other.
For example, we have the ProcessAndSortXXXXX class of methods.
private static IEnumerable<ClassErrorEntry> ProcessAndSortClassErrorLog(IQueryable<ClassErrorDb> queryable, string sortOrder)
{
var dynamic = queryable;
if (!String.IsNullOrEmpty(sortOrder.Trim()))
{
dynamic = dynamic.OrderBy(sortOrder);
}
return dynamic
.Select(l =>
new ClassErrorEntry(l.Id)
{
ClassId = l.ClassId,
Code = l.Code,
Message = l.Message,
Severity = l.Severity,
Target = l.Target
}
);
}
...and...
private static IEnumerable<ClassTimerLogEntry> ProcessAndSortClassTimerLog(IQueryable<ClassTimerDb> queryable, string sortOrder)
{
var dynamic = queryable;
if (!String.IsNullOrEmpty(sortOrder.Trim()))
{
dynamic = dynamic.OrderBy(sortOrder);
}
return dynamic
.Select(l =>
new ClassTimerLogEntry(l.Id)
{
ClassName = l.ClassName,
MethodName = l.MethodName,
StartTime = l.StartTime,
EndTime = l.EndTime,
ParentId = l.ParentId,
ExecutionOrder = l.ExecutionOrder
}
);
}
As you can tell by the code, they're all very similar until you look at the signature and then get to the the return statement where we're building out the instances of the ClassErrorEntry and ClassTimerLogEntry.
I want to build a utility method that I'll add into the base class that all of the repositories inherit from.
I want to be able to pass in arguments that can be used to instantiate the objects and pack them into the returning IEnumerable.
I found [this post](http://weblogs.asp.net/scottgu/archive/2008/01/07/dynamic-linq-part-1-using-the-linq-dynamic-query-library.aspx) by [ScottGu](http://weblogs.asp.net/scottgu/) and that gets me most of what I need. It looks like this (from the sample in the documentation):
var query =
db.Customers.
Where("City = @0 and Orders.Count >= @1", "London", 10).
OrderBy("CompanyName").
Select("new(CompanyName as Name, Phone)");
Here's where I get stuck, though. I need a pointer or suggestion how I can pass in the LINQ tables and DataContext in a generic fashion so I can build out the dynamic query.
If I were to mock up the signature in pseudocode I think it would look something like this:
protected internal IEnumerable ProcessAndSort(IQueryable source, string selectClause, string whereClause, string orderByClause);
I realize that the finished signature may look different as we figure this out.
Thank you! | 0 |
2,033,436 | 01/09/2010 13:05:03 | 452,877 | 01/09/2010 12:51:05 | 1 | 0 | Looking for a simple blog engine or service oriented toward developpers | I'm looking for a blog engine to share some code snippets with nice syntax hilighting.
I already know about services http://refactormycode.com/ , but i'm really looking for a blog where people could subcribe to my feed. | blogs | syntax-highlighting | null | null | null | 11/25/2011 13:59:14 | not constructive | Looking for a simple blog engine or service oriented toward developpers
===
I'm looking for a blog engine to share some code snippets with nice syntax hilighting.
I already know about services http://refactormycode.com/ , but i'm really looking for a blog where people could subcribe to my feed. | 4 |
9,021,639 | 01/26/2012 16:38:24 | 254,257 | 01/19/2010 18:07:39 | 612 | 18 | Having trouble understanding ninject (or just IOC container in general) over factory DI? | Okay, so recently I've been reading into ninject but I am having trouble understanding what makes it better over why they referred do as 'poor man's' DI on the wiki page. The sad thing is I went over all their pages on the wiki and still don't get it =(.
Typically I will wrap my service classes in a factory pattern that handles the DI like so:
public static class SomeTypeServiceFactory
{
public static SomeTypeService GetService()
{
SomeTypeRepository someTypeRepository = new SomeTypeRepository();
return = new SomeTypeService(someTypeRepository);
}
}
Which to me seems a lot like the modules:
public class WarriorModule : NinjectModule {
public override void Load() {
Bind<IWeapon>().To<Sword>();
Bind<Samurai>().ToSelf().InSingletonScope();
}
}
Where each class would have it's associated module and you Bind it's constructor to a concrete implementation. While the ninject code is 1 less line I am just not seeing the advantage, anytime you add/remove constructors or change the implementation of an interface constructor, you'd have to change the module pretty much the same way as you would in the factory no? So not seeing the advantage here.
Then I thought I could come up with a generic convention based factory like so:
public static TServiceClass GetService<TServiceClass>()
where TServiceClass : class
{
TServiceClass serviceClass = null;
string repositoryName = typeof(TServiceClass).ToString().Replace("Service", "Repository");
Type repositoryType = Type.GetType(repositoryName);
if (repositoryType != null)
{
object repository = Activator.CreateInstance(repositoryType);
serviceClass = (TServiceClass)Activator.CreateInstance(typeof (TServiceClass), new[]{repository});
}
return serviceClass;
}
However, this is crappy for 2 reasons: 1) Its tightly dependent on the naming convention, 2) It assumed the repository will never have any constructors (not true) and the service's only constructor will be it's corresponding repo (also not true). I was told hey this is where you should use an IoC container! And thus my research began...but I am just not seeing it and am having trouble understanding it...
Is there some way ninject can automatically resolve constructors of a class without a specific declaration such that it would be great to use in my generic factory (I also realize I could just do this manually using reflection but that's a performance hit and ninject says right on their page they don't use reflection).
Enlightment on this issue and showing how it could be used in my generic factory would be much appreciated! | inversion-of-control | ninject | ioc-container | null | null | null | open | Having trouble understanding ninject (or just IOC container in general) over factory DI?
===
Okay, so recently I've been reading into ninject but I am having trouble understanding what makes it better over why they referred do as 'poor man's' DI on the wiki page. The sad thing is I went over all their pages on the wiki and still don't get it =(.
Typically I will wrap my service classes in a factory pattern that handles the DI like so:
public static class SomeTypeServiceFactory
{
public static SomeTypeService GetService()
{
SomeTypeRepository someTypeRepository = new SomeTypeRepository();
return = new SomeTypeService(someTypeRepository);
}
}
Which to me seems a lot like the modules:
public class WarriorModule : NinjectModule {
public override void Load() {
Bind<IWeapon>().To<Sword>();
Bind<Samurai>().ToSelf().InSingletonScope();
}
}
Where each class would have it's associated module and you Bind it's constructor to a concrete implementation. While the ninject code is 1 less line I am just not seeing the advantage, anytime you add/remove constructors or change the implementation of an interface constructor, you'd have to change the module pretty much the same way as you would in the factory no? So not seeing the advantage here.
Then I thought I could come up with a generic convention based factory like so:
public static TServiceClass GetService<TServiceClass>()
where TServiceClass : class
{
TServiceClass serviceClass = null;
string repositoryName = typeof(TServiceClass).ToString().Replace("Service", "Repository");
Type repositoryType = Type.GetType(repositoryName);
if (repositoryType != null)
{
object repository = Activator.CreateInstance(repositoryType);
serviceClass = (TServiceClass)Activator.CreateInstance(typeof (TServiceClass), new[]{repository});
}
return serviceClass;
}
However, this is crappy for 2 reasons: 1) Its tightly dependent on the naming convention, 2) It assumed the repository will never have any constructors (not true) and the service's only constructor will be it's corresponding repo (also not true). I was told hey this is where you should use an IoC container! And thus my research began...but I am just not seeing it and am having trouble understanding it...
Is there some way ninject can automatically resolve constructors of a class without a specific declaration such that it would be great to use in my generic factory (I also realize I could just do this manually using reflection but that's a performance hit and ninject says right on their page they don't use reflection).
Enlightment on this issue and showing how it could be used in my generic factory would be much appreciated! | 0 |
1,441,686 | 09/17/2009 22:42:30 | 143,030 | 07/22/2009 17:14:12 | 1,897 | 27 | How to autoload extended classes? | I am planning to use PHP's autoload function to dynamicly load only class files that are needed. Now this could create a huge mess if every single function has a seperate file, So I am hoping and asking is there a way to have related classes remain in 1 class file and still be auto-loaded
function __autoload($class_name){
include('classes/' . $class_name . '.class.php');
}
Let's say there is a class name animals and then another class named dogs. Dogs class extends animals class, now if I were to call the dogs class but NOT call the animals class, would the animals class file still be loaded? | php | class | autoload | null | null | null | open | How to autoload extended classes?
===
I am planning to use PHP's autoload function to dynamicly load only class files that are needed. Now this could create a huge mess if every single function has a seperate file, So I am hoping and asking is there a way to have related classes remain in 1 class file and still be auto-loaded
function __autoload($class_name){
include('classes/' . $class_name . '.class.php');
}
Let's say there is a class name animals and then another class named dogs. Dogs class extends animals class, now if I were to call the dogs class but NOT call the animals class, would the animals class file still be loaded? | 0 |
3,649,416 | 09/06/2010 06:24:50 | 158,455 | 08/18/2009 13:24:13 | 447 | 11 | jQuery VS Flash | MOST of what the Flash is capable of jQuery can do that too...
plus jQuery has its own advantage of being light and its integration and interaction with HTML directly...
forget about falsh games for a while.... just consider flash based websites
only for website designs and their interaction i am thinking jQuery + AJAX is **VERY ENOUGH**... if i quit flash and stick to jQuery & advance in it....
- what is the limit or point where i will have to go back to flash...
**AGAIN** forget flash animated movies and games... and ignore stupid flash animation requirements by clients... and don't think about it in terms of that jQuery can't do Frames.. think about the final product that the frames provide...
| jquery | ajax | flash | null | null | 09/07/2010 00:08:02 | not constructive | jQuery VS Flash
===
MOST of what the Flash is capable of jQuery can do that too...
plus jQuery has its own advantage of being light and its integration and interaction with HTML directly...
forget about falsh games for a while.... just consider flash based websites
only for website designs and their interaction i am thinking jQuery + AJAX is **VERY ENOUGH**... if i quit flash and stick to jQuery & advance in it....
- what is the limit or point where i will have to go back to flash...
**AGAIN** forget flash animated movies and games... and ignore stupid flash animation requirements by clients... and don't think about it in terms of that jQuery can't do Frames.. think about the final product that the frames provide...
| 4 |
2,073,904 | 01/15/2010 18:38:41 | 217,867 | 11/24/2009 14:59:15 | 8 | 0 | CMD.exe C# Emulator? | I've been trying very hard to automatically ssh into a Linux server. What's crazy, is that I can create a .bat script, that will do it, but I have to be there physically, to type in the password.
I've tried automating this using System.Diagnostics.Process object in c# to no end. There is no way, I've found to make this object allow you to see the password prompt. It out puts every line up until that point, and then doesn't output any more lines.
cmd.exe, does really well at allow you to jump process to process in a script. I consolidates everything into one screen, and just prompts you for things such as passwords, and then you type them in.
Is any simple way, in C#, to make cmd.exe think you are a human being typing in it, so I can simulated this programmatically? Otherwise, System.Diagnostics.Process, doesn't seem to offer a way to interacted with at process that outputs a password prompt. You never get to see the login prompt that clearly happens when you run the same thing in cmd.exe | c# | cmd | automation | null | null | null | open | CMD.exe C# Emulator?
===
I've been trying very hard to automatically ssh into a Linux server. What's crazy, is that I can create a .bat script, that will do it, but I have to be there physically, to type in the password.
I've tried automating this using System.Diagnostics.Process object in c# to no end. There is no way, I've found to make this object allow you to see the password prompt. It out puts every line up until that point, and then doesn't output any more lines.
cmd.exe, does really well at allow you to jump process to process in a script. I consolidates everything into one screen, and just prompts you for things such as passwords, and then you type them in.
Is any simple way, in C#, to make cmd.exe think you are a human being typing in it, so I can simulated this programmatically? Otherwise, System.Diagnostics.Process, doesn't seem to offer a way to interacted with at process that outputs a password prompt. You never get to see the login prompt that clearly happens when you run the same thing in cmd.exe | 0 |
5,821,492 | 04/28/2011 15:56:24 | 707,549 | 04/14/2011 08:24:07 | 129 | 0 | How could we handle memory overflow in C language | How could we handle memory overflow in C language?
| c | overflow | null | null | null | 04/28/2011 17:04:27 | not a real question | How could we handle memory overflow in C language
===
How could we handle memory overflow in C language?
| 1 |
1,642,768 | 10/29/2009 10:28:25 | 198,800 | 10/29/2009 10:28:25 | 1 | 0 | strange java socket problem on windows |
I've a strange problem with a java server application running on a windows machine;
sometimes the SocketChannel I just obtained by ServerSocketChannel.accept immediately returns an error when I try to read data from it - the strange thing is that at the same time the client that started the incoming connection is stuck waiting for the answer it expects to receive from the server, that is the pattern is something like this:
1. client from another machine calls connect, connect returns, client writes logon request, client starts waiting for logon response
2. server wakes up on accept, tries to read and fails immediately, so it closes the socket
3. client keeps on waiting, as if the connection was established and no data was flowing in
this pattern keeps repeating for a while (the client eventually times out in a few seconds and retries again) until eventually logon succeeds some minutes later.
Has anyone an explanation for this? This looks like some kind of resource exhaustion problem on the server side, but I really have no clear idea of what is going on because I can't reproduce the problem and all I had to understand what is going on is logfiles.
TIA
| java | sockets | windows | null | null | null | open | strange java socket problem on windows
===
I've a strange problem with a java server application running on a windows machine;
sometimes the SocketChannel I just obtained by ServerSocketChannel.accept immediately returns an error when I try to read data from it - the strange thing is that at the same time the client that started the incoming connection is stuck waiting for the answer it expects to receive from the server, that is the pattern is something like this:
1. client from another machine calls connect, connect returns, client writes logon request, client starts waiting for logon response
2. server wakes up on accept, tries to read and fails immediately, so it closes the socket
3. client keeps on waiting, as if the connection was established and no data was flowing in
this pattern keeps repeating for a while (the client eventually times out in a few seconds and retries again) until eventually logon succeeds some minutes later.
Has anyone an explanation for this? This looks like some kind of resource exhaustion problem on the server side, but I really have no clear idea of what is going on because I can't reproduce the problem and all I had to understand what is going on is logfiles.
TIA
| 0 |
10,937,022 | 06/07/2012 17:44:03 | 781,238 | 06/02/2011 13:53:52 | 250 | 10 | Javascript/html: How to store div, and hide its children later | I am storing a div which gets selected
var selectedCell = null;
$(".selectableBox").on('click', function (event) {
selectedCell = $(this);
}
Later I want to hide one of selectableCell's children name selectableCellChild
$('#deleteConfirmed').on('click', function (event) {
selectedCellList.($'selectableCellChild').hide();
});
How can I correctly hide this child div? I know the syntax of the above example isn't right, and I have tried it many ways including using children() and next() methods of selectedCellList
| javascript | jquery | html | null | null | null | open | Javascript/html: How to store div, and hide its children later
===
I am storing a div which gets selected
var selectedCell = null;
$(".selectableBox").on('click', function (event) {
selectedCell = $(this);
}
Later I want to hide one of selectableCell's children name selectableCellChild
$('#deleteConfirmed').on('click', function (event) {
selectedCellList.($'selectableCellChild').hide();
});
How can I correctly hide this child div? I know the syntax of the above example isn't right, and I have tried it many ways including using children() and next() methods of selectedCellList
| 0 |
10,715,382 | 05/23/2012 07:32:50 | 875,943 | 08/03/2011 05:41:24 | 30 | 3 | Some Time Build File Not Creating under PRODUCT in Xcode 4.3.2? | Some time when i create the **Adhoc build** , the build file which generates under **PRODUCT** in Xcode is not creating there.Do you have any idea about why it was not created there??
I clean the Project so many times.
Thank You !!! | iphone | build | product | null | null | 07/17/2012 11:33:26 | not a real question | Some Time Build File Not Creating under PRODUCT in Xcode 4.3.2?
===
Some time when i create the **Adhoc build** , the build file which generates under **PRODUCT** in Xcode is not creating there.Do you have any idea about why it was not created there??
I clean the Project so many times.
Thank You !!! | 1 |
8,942,119 | 01/20/2012 13:27:09 | 410,823 | 08/04/2010 13:22:28 | 1,245 | 75 | How to integrate http://www.alibaba.com to my application | I would like to search, check new RFQ, and offers on http://www.alibaba.com in my application. I was looking for API but I cannot find any information about it. I wonder how such an integration could be implemented. I suppose that there must be some paid service.
Of course, the brute force approach would be to a browser automation with e.g., [Watir][1].
[1]: http://watir.com/ | web-services | integration | null | null | null | null | open | How to integrate http://www.alibaba.com to my application
===
I would like to search, check new RFQ, and offers on http://www.alibaba.com in my application. I was looking for API but I cannot find any information about it. I wonder how such an integration could be implemented. I suppose that there must be some paid service.
Of course, the brute force approach would be to a browser automation with e.g., [Watir][1].
[1]: http://watir.com/ | 0 |
8,565,101 | 12/19/2011 17:33:37 | 611,977 | 02/10/2011 19:36:11 | 46 | 2 | Can't display markers (google maps api) in flex gives error #1009 | I'm trying to display some markers on the map, but each time I run it, it gives me the error:
> TypeError: Error #1009: Cannot access a property or method of a null
> object reference.at com.google.maps.overlays::Marker()
I can't find the problem in the code. I think I covered all the objects.
Here is the code:
<?xml version="1.0" encoding="utf-8"?>
<s:Group xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx">
<maps:Map xmlns:maps="com.google.maps.*" id="map" mapevent_mapready="onMapReady(event)"
width="100%" height="100%" key="AIzaSyCAWDQ2xsFIOEXcqxoMHLQCsvaWb9MNYA4" sensor="false"/>
<fx:Declarations>
<s:HTTPService id="srvl" url="http://ws.audioscrobbler.com/2.0/?method=artist.getevents&artist={groep}&api_key=3555dfef48e473d04028c3a3bcbb8a1c" resultFormat="e4x" fault="srvl_faultHandler(event)" result="srvl_resultHandler(event)"/>
</fx:Declarations>
<fx:Script>
<![CDATA[
import com.google.maps.InfoWindowOptions;
import com.google.maps.LatLng;
import com.google.maps.Map;
import com.google.maps.MapEvent;
import com.google.maps.MapMouseEvent;
import com.google.maps.MapType;
import com.google.maps.controls.ZoomControl;
import com.google.maps.overlays.Marker;
import com.google.maps.overlays.MarkerOptions;
import events.ChangeView;
import mx.collections.ArrayCollection;
import mx.controls.Alert;
import mx.events.FlexEvent;
import mx.rpc.events.FaultEvent;
import mx.rpc.events.ResultEvent;
[Bindable]
public var groep:String;
public var Goverlay:int = 0;
public var tweetsobj:Object
private function onMapReady(event:Event):void {
map.setCenter(new LatLng(50,4), 3, MapType.SATELLITE_MAP_TYPE);
}
public function populateMap():void{
srvl.send();
}
protected function back_clickHandler(event:MouseEvent):void
{
dispatchEvent( new ChangeView( false , ChangeView.DATA_LOADED ) );
}
protected function srvl_resultHandler(event:ResultEvent):void
{
var artistList:XMLList = new XMLList(event.result);
var artistXML:XML;
for each(artistXML in artistList.events.event)
{
var gLat:int = artistXML.venue.location.*::point.*::lat;
var gLong:int = artistXML.venue.location.*::point.*::long;
var evntLng:LatLng = new LatLng(gLat,gLong);
Alert.show(evntLng.toString());
var my_marker1:Marker = new Marker(new LatLng(23.618811, 58.586226));
map.addOverlay(my_marker1);
}
}
protected function srvl_faultHandler(event:FaultEvent):void
{
Alert.show("call is gefailed");
}
]]>
</fx:Script>
<s:BorderContainer x="0" y="0" width="100%" height="60" backgroundColor="#000000" backgroundAlpha="0.8">
<s:HGroup gap="10" paddingLeft="50" paddingTop="20">
<s:Button id="back" label="Terug naar overzicht" click="back_clickHandler(event)"/>
<s:Label id="title" text="Toon locaties voor {groep}" height="31" fontSize="35" fontFamily="Arial" fontWeight="bold" color="#ffffff" right="38"/>
</s:HGroup>
</s:BorderContainer>
<mx:UIComponent id="mapContainer" width="100%" height="100%"/>
</s:Group>
Thanks.
| actionscript-3 | flex | google-maps | google-maps-markers | google-maps-api-2 | 02/06/2012 01:23:39 | too localized | Can't display markers (google maps api) in flex gives error #1009
===
I'm trying to display some markers on the map, but each time I run it, it gives me the error:
> TypeError: Error #1009: Cannot access a property or method of a null
> object reference.at com.google.maps.overlays::Marker()
I can't find the problem in the code. I think I covered all the objects.
Here is the code:
<?xml version="1.0" encoding="utf-8"?>
<s:Group xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx">
<maps:Map xmlns:maps="com.google.maps.*" id="map" mapevent_mapready="onMapReady(event)"
width="100%" height="100%" key="AIzaSyCAWDQ2xsFIOEXcqxoMHLQCsvaWb9MNYA4" sensor="false"/>
<fx:Declarations>
<s:HTTPService id="srvl" url="http://ws.audioscrobbler.com/2.0/?method=artist.getevents&artist={groep}&api_key=3555dfef48e473d04028c3a3bcbb8a1c" resultFormat="e4x" fault="srvl_faultHandler(event)" result="srvl_resultHandler(event)"/>
</fx:Declarations>
<fx:Script>
<![CDATA[
import com.google.maps.InfoWindowOptions;
import com.google.maps.LatLng;
import com.google.maps.Map;
import com.google.maps.MapEvent;
import com.google.maps.MapMouseEvent;
import com.google.maps.MapType;
import com.google.maps.controls.ZoomControl;
import com.google.maps.overlays.Marker;
import com.google.maps.overlays.MarkerOptions;
import events.ChangeView;
import mx.collections.ArrayCollection;
import mx.controls.Alert;
import mx.events.FlexEvent;
import mx.rpc.events.FaultEvent;
import mx.rpc.events.ResultEvent;
[Bindable]
public var groep:String;
public var Goverlay:int = 0;
public var tweetsobj:Object
private function onMapReady(event:Event):void {
map.setCenter(new LatLng(50,4), 3, MapType.SATELLITE_MAP_TYPE);
}
public function populateMap():void{
srvl.send();
}
protected function back_clickHandler(event:MouseEvent):void
{
dispatchEvent( new ChangeView( false , ChangeView.DATA_LOADED ) );
}
protected function srvl_resultHandler(event:ResultEvent):void
{
var artistList:XMLList = new XMLList(event.result);
var artistXML:XML;
for each(artistXML in artistList.events.event)
{
var gLat:int = artistXML.venue.location.*::point.*::lat;
var gLong:int = artistXML.venue.location.*::point.*::long;
var evntLng:LatLng = new LatLng(gLat,gLong);
Alert.show(evntLng.toString());
var my_marker1:Marker = new Marker(new LatLng(23.618811, 58.586226));
map.addOverlay(my_marker1);
}
}
protected function srvl_faultHandler(event:FaultEvent):void
{
Alert.show("call is gefailed");
}
]]>
</fx:Script>
<s:BorderContainer x="0" y="0" width="100%" height="60" backgroundColor="#000000" backgroundAlpha="0.8">
<s:HGroup gap="10" paddingLeft="50" paddingTop="20">
<s:Button id="back" label="Terug naar overzicht" click="back_clickHandler(event)"/>
<s:Label id="title" text="Toon locaties voor {groep}" height="31" fontSize="35" fontFamily="Arial" fontWeight="bold" color="#ffffff" right="38"/>
</s:HGroup>
</s:BorderContainer>
<mx:UIComponent id="mapContainer" width="100%" height="100%"/>
</s:Group>
Thanks.
| 3 |
7,662,701 | 10/05/2011 14:14:04 | 253,447 | 01/18/2010 18:58:33 | 1 | 0 | “Open Type” command does not respond in Eclipse workspace | As described [in this question][1] I could not open "Open Type" in Eclipse via Ctrl+Shift+T.
The clue is: When I go to Preferences -> Keys and delete the shortcut, I'm not able to re-add it with ctrl+shift+T. Every other combination works, but when I press "T", the box gets empty.
I use KDE 4.7.1
[1]: http://stackoverflow.com/questions/5870153/open-type-command-does-not-respond-in-eclipse-workspace?answertab=votes#tab-top | eclipse | hotkey | kde | null | null | null | open | “Open Type” command does not respond in Eclipse workspace
===
As described [in this question][1] I could not open "Open Type" in Eclipse via Ctrl+Shift+T.
The clue is: When I go to Preferences -> Keys and delete the shortcut, I'm not able to re-add it with ctrl+shift+T. Every other combination works, but when I press "T", the box gets empty.
I use KDE 4.7.1
[1]: http://stackoverflow.com/questions/5870153/open-type-command-does-not-respond-in-eclipse-workspace?answertab=votes#tab-top | 0 |
8,134,432 | 11/15/2011 09:56:40 | 615,780 | 02/14/2011 06:07:39 | 796 | 0 | How do I build android emulator? | I want to modify qemu source code to get some lower level information
I got this link
http://www.google.com/codesearch/p?hl=en#cZwlSNS7aEw/sdk/emulator/
and I was wondering how I can build the emulator source code after I modify the qemu source code?
Thanks in advance | android | null | null | null | null | null | open | How do I build android emulator?
===
I want to modify qemu source code to get some lower level information
I got this link
http://www.google.com/codesearch/p?hl=en#cZwlSNS7aEw/sdk/emulator/
and I was wondering how I can build the emulator source code after I modify the qemu source code?
Thanks in advance | 0 |
8,506,317 | 12/14/2011 14:43:18 | 597,605 | 01/31/2011 22:44:08 | 72 | 0 | Fixed-point unsigned division in C | I need an algorithm to do unsigned fixed-point division in C. I can use at most 32-bit words.
I want to minimize the number of bits needed to represent the integer part while being able to use numbers in the range [0..15]. So apparently the minimum number of bits is 4. Problem is the algorithm which I came up only works using 5 bits. Because it compares the remainder with the divisor and then shifts the remainder until it is bigger than the divisor, if the divisor has the most significant bit 1, then the algorithm will do nothing but shift the remainder (it will never be bigger). Here's the code:
int divu(int a, int b){
int pt_int, r, pt_frac=0;
int i;
pt_int = ((unsigned) a/b) << BITS_FRAC;
r = (unsigned) a%b;
for (i=BITS_FRAC; i>=0; i--){
if ((unsigned) r < b)
r <<= 1;
else{
r -= b;
pt_frac += 01 << i;
r <<= 1;
}
}
return pt_int + pt_frac;
}
If you do have a solution but don't want to understand the code, please, just post it. :) | c | division | fixed-point | null | null | null | open | Fixed-point unsigned division in C
===
I need an algorithm to do unsigned fixed-point division in C. I can use at most 32-bit words.
I want to minimize the number of bits needed to represent the integer part while being able to use numbers in the range [0..15]. So apparently the minimum number of bits is 4. Problem is the algorithm which I came up only works using 5 bits. Because it compares the remainder with the divisor and then shifts the remainder until it is bigger than the divisor, if the divisor has the most significant bit 1, then the algorithm will do nothing but shift the remainder (it will never be bigger). Here's the code:
int divu(int a, int b){
int pt_int, r, pt_frac=0;
int i;
pt_int = ((unsigned) a/b) << BITS_FRAC;
r = (unsigned) a%b;
for (i=BITS_FRAC; i>=0; i--){
if ((unsigned) r < b)
r <<= 1;
else{
r -= b;
pt_frac += 01 << i;
r <<= 1;
}
}
return pt_int + pt_frac;
}
If you do have a solution but don't want to understand the code, please, just post it. :) | 0 |
6,638,634 | 07/10/2011 01:40:47 | 837,240 | 07/10/2011 01:40:47 | 1 | 0 | What is Non Object Oriented System? | What it really mean Non Object Oriented System, if it is implemented using Java and classes, Doesn't it belong to OO system.What features amount to non Object Oriented system.Please tell me. | java | query | null | null | null | 07/10/2011 01:56:51 | not a real question | What is Non Object Oriented System?
===
What it really mean Non Object Oriented System, if it is implemented using Java and classes, Doesn't it belong to OO system.What features amount to non Object Oriented system.Please tell me. | 1 |
11,433,257 | 07/11/2012 13:01:51 | 644,978 | 03/04/2011 15:24:22 | 447 | 5 | Reposition 'absolute' elements on web page - CSS | I really like the Image Slider on this site home page: http://festival.co.nz/
However, I was wondering, **is it possible to move the 'previous' and 'next' buttons to be on either side of the main 'active' image**. Currently they are fixed to the extreme left & right.
The styling of these elements is handled by this **CSS file**: http://css.festival.co.nz/yk-minifier/72cdcb814eb3e3beaa50436a9f869b1c.css however I'm really unsure where to begin if I was to try and move the buttons to be on either side of the centre image.
Many thanks for any pointers with this. | jquery | html | css | slider | position | 07/11/2012 13:34:45 | not a real question | Reposition 'absolute' elements on web page - CSS
===
I really like the Image Slider on this site home page: http://festival.co.nz/
However, I was wondering, **is it possible to move the 'previous' and 'next' buttons to be on either side of the main 'active' image**. Currently they are fixed to the extreme left & right.
The styling of these elements is handled by this **CSS file**: http://css.festival.co.nz/yk-minifier/72cdcb814eb3e3beaa50436a9f869b1c.css however I'm really unsure where to begin if I was to try and move the buttons to be on either side of the centre image.
Many thanks for any pointers with this. | 1 |
1,305,994 | 08/20/2009 12:51:35 | 31,760 | 10/27/2008 11:08:42 | 59 | 2 | Native equivalent of NetworkChange class; how to spot IP address changes in Windows | Is there a native Windows API which does the same as the .NET System.Net.NetworkInformation.NetworkChange class?
Basically I'm looking for something to report changes to connectivity and IP address changes. | windows | winapi | sockets | networking | api | null | open | Native equivalent of NetworkChange class; how to spot IP address changes in Windows
===
Is there a native Windows API which does the same as the .NET System.Net.NetworkInformation.NetworkChange class?
Basically I'm looking for something to report changes to connectivity and IP address changes. | 0 |
11,709,175 | 07/29/2012 12:16:54 | 214,419 | 11/19/2009 08:38:12 | 729 | 53 | Convert url in asp? | I have Web-App. Somewhere in my page I used this below code to create `Hiperlink`.
<a href="<%= Eval("NavigateUrl") %>"> <%= Eval("text") %> </a>
as you see this code must be work but there is a little problem. content of `NavigateUrl` is something like this url.
"~/account/login.aspx"
>**How I must resolve that URL?**
| c# | asp.net | null | null | null | null | open | Convert url in asp?
===
I have Web-App. Somewhere in my page I used this below code to create `Hiperlink`.
<a href="<%= Eval("NavigateUrl") %>"> <%= Eval("text") %> </a>
as you see this code must be work but there is a little problem. content of `NavigateUrl` is something like this url.
"~/account/login.aspx"
>**How I must resolve that URL?**
| 0 |
1,350,030 | 08/29/2009 00:34:30 | 77,413 | 03/12/2009 20:46:03 | 47 | 2 | Need help with libcurl username/password authentication. | I'm trying to access a secure webpage on one of our servers. The webpage is inside a .htaccess protected directory that requires a username and password. I'm trying to get libcurl to submit the authentication request so it can access the file. After finding some guidance in various places, I've come up with what I believe should work, but it doesn't.
$url="https://www.myurl.com/htaccess_secured_directory/file.php";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($ch, CURLOPT_USERPWD, 'myusername:mypassword');
$result = curl_exec($ch);
echo $result;
The file.php file should simply echo "Hello World!", but the $result variable is coming up blank. Is there a way to get error messages back from curl? Am I doing something wrong? I've also used CURLLAUTH_ALL without success, but I believe I just have basic authorization anyway. | libcurl | curl | php5 | null | null | null | open | Need help with libcurl username/password authentication.
===
I'm trying to access a secure webpage on one of our servers. The webpage is inside a .htaccess protected directory that requires a username and password. I'm trying to get libcurl to submit the authentication request so it can access the file. After finding some guidance in various places, I've come up with what I believe should work, but it doesn't.
$url="https://www.myurl.com/htaccess_secured_directory/file.php";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($ch, CURLOPT_USERPWD, 'myusername:mypassword');
$result = curl_exec($ch);
echo $result;
The file.php file should simply echo "Hello World!", but the $result variable is coming up blank. Is there a way to get error messages back from curl? Am I doing something wrong? I've also used CURLLAUTH_ALL without success, but I believe I just have basic authorization anyway. | 0 |
6,489,345 | 06/27/2011 06:34:07 | 468,774 | 10/07/2010 06:37:33 | 43 | 0 | String and memory | class A{
String var="Abhi";
String var="Abhishek";
public void someMethod()
{
//
}
}
Will the var variable store Abhi and Abhishek in different memory location or Abhishek overwrites Abhi ?? please explain in respect of memory in java
If i use this expression String var= new String();
then what happens in respect of memory please tell me.
| string | null | null | null | null | 06/27/2011 14:38:31 | not a real question | String and memory
===
class A{
String var="Abhi";
String var="Abhishek";
public void someMethod()
{
//
}
}
Will the var variable store Abhi and Abhishek in different memory location or Abhishek overwrites Abhi ?? please explain in respect of memory in java
If i use this expression String var= new String();
then what happens in respect of memory please tell me.
| 1 |
7,918,370 | 10/27/2011 15:30:48 | 1,016,789 | 10/27/2011 15:22:12 | 1 | 0 | Convert this c# to vb.net | I have a datagrid and a pager which renders at the bottom, however there is a problem with the colspan that does not get rendered correctly. I have this code below in C# but I need to convert it to vb.net. I've already used a conversion site but it does not seem to work and just generates errors (i'm not really a vb.net guy, more a C#-er)
protected void dGrid_PreRender(object sender, EventArgs e)
{
try
{
DataGrid dgSidDetails = (DataGrid)sender;
//Fix for numbering being in a left aligned column
//For some reason, the ColumnSpan property is ignored andnot rendered
//unless set using the Attributes
if (dgSidDetails.AllowPaging == true && dgSidDetails.AutoGenerateColumns == false)
{
//Get the Table
System.Web.UI.WebControls.Table tab =
(System.Web.UI.WebControls.Table)dgSidDetails.Controls[0];
if (dgSidDetails.PagerStyle.Position == PagerPosition.Top ||
dgSidDetails.PagerStyle.Position == PagerPosition.TopAndBottom)
{
tab.Rows[0].Cells[0].Attributes.Add("colspan",
tab.Rows[1].Cells.Count.ToString());
}
}
}
catch (Exception ex)
{
}
} | c# | vb.net | datagrid | null | null | 10/28/2011 02:04:53 | too localized | Convert this c# to vb.net
===
I have a datagrid and a pager which renders at the bottom, however there is a problem with the colspan that does not get rendered correctly. I have this code below in C# but I need to convert it to vb.net. I've already used a conversion site but it does not seem to work and just generates errors (i'm not really a vb.net guy, more a C#-er)
protected void dGrid_PreRender(object sender, EventArgs e)
{
try
{
DataGrid dgSidDetails = (DataGrid)sender;
//Fix for numbering being in a left aligned column
//For some reason, the ColumnSpan property is ignored andnot rendered
//unless set using the Attributes
if (dgSidDetails.AllowPaging == true && dgSidDetails.AutoGenerateColumns == false)
{
//Get the Table
System.Web.UI.WebControls.Table tab =
(System.Web.UI.WebControls.Table)dgSidDetails.Controls[0];
if (dgSidDetails.PagerStyle.Position == PagerPosition.Top ||
dgSidDetails.PagerStyle.Position == PagerPosition.TopAndBottom)
{
tab.Rows[0].Cells[0].Attributes.Add("colspan",
tab.Rows[1].Cells.Count.ToString());
}
}
}
catch (Exception ex)
{
}
} | 3 |
10,594,910 | 05/15/2012 05:59:23 | 333,255 | 05/05/2010 09:27:33 | 12,363 | 452 | Persist User Data in ASP.NET MVC | Similar questions have been asked before but I'm still without an answer and have spent a decent amount of time trying to find one.
The scenario is this. We have an ASP.NET MVC application which is using Forms Authentication / LINQ-to-SQL data model.
Each user can be associated with 1 or more **Accounts**. Upon login, the application checks how many Accounts they're associated with.
**0** = Go to error page and let them know they have no access <br />
**1** = Set The *User Data* to use that account <br />
**2 or more** = Go to a page which allows them to select which account they'd like to use (with ability to change during their visit)
**How would you store this information?**
Furthermore, I'd like to use this Account as the base for my controller actions. i.e. Data on subsequent pages they visit will be related to the Account they've selected.
Singleton ***cough*** comes to mind but am unsure how to implement that.
An approach which I'm currently investigating is a Base Controller that all controllers will inherit from that will
1. Check whether a user is logged in.
2. If so, check whether they have an Account Selected
- No - redirect them to Account Selection page
- Yes - proceed with original request
What is a recommended/best-practice way of doing this?
Thanks
Marko | c# | asp.net-mvc | session-state | null | null | null | open | Persist User Data in ASP.NET MVC
===
Similar questions have been asked before but I'm still without an answer and have spent a decent amount of time trying to find one.
The scenario is this. We have an ASP.NET MVC application which is using Forms Authentication / LINQ-to-SQL data model.
Each user can be associated with 1 or more **Accounts**. Upon login, the application checks how many Accounts they're associated with.
**0** = Go to error page and let them know they have no access <br />
**1** = Set The *User Data* to use that account <br />
**2 or more** = Go to a page which allows them to select which account they'd like to use (with ability to change during their visit)
**How would you store this information?**
Furthermore, I'd like to use this Account as the base for my controller actions. i.e. Data on subsequent pages they visit will be related to the Account they've selected.
Singleton ***cough*** comes to mind but am unsure how to implement that.
An approach which I'm currently investigating is a Base Controller that all controllers will inherit from that will
1. Check whether a user is logged in.
2. If so, check whether they have an Account Selected
- No - redirect them to Account Selection page
- Yes - proceed with original request
What is a recommended/best-practice way of doing this?
Thanks
Marko | 0 |
9,035,284 | 01/27/2012 15:00:19 | 1,173,741 | 01/27/2012 14:56:49 | 1 | 0 | Lotus Notes Migration | Our company wants to migrate a critical Lotus Notes application to J2EE? What are the various things one should keep in mind to be successful? I came to know Lotus Notes is not relational, so thats something we are keeping in mind for data migration.
Please share your experiences if you have done similar migration in the past. | java-ee | lotus-notes | null | null | null | 04/09/2012 19:07:52 | not constructive | Lotus Notes Migration
===
Our company wants to migrate a critical Lotus Notes application to J2EE? What are the various things one should keep in mind to be successful? I came to know Lotus Notes is not relational, so thats something we are keeping in mind for data migration.
Please share your experiences if you have done similar migration in the past. | 4 |
8,102,049 | 11/12/2011 02:15:20 | 1,042,720 | 11/12/2011 02:08:02 | 1 | 0 | For loops python problemos | Write a function that takes as an input parameter a string and a number n and returns a newly created string made of every nth letter.
Can anyone help? | loops | for-loop | null | null | null | 11/12/2011 02:39:31 | not a real question | For loops python problemos
===
Write a function that takes as an input parameter a string and a number n and returns a newly created string made of every nth letter.
Can anyone help? | 1 |
9,608,592 | 03/07/2012 20:31:13 | 1,255,648 | 03/07/2012 20:24:27 | 1 | 0 | BackTracking Issue in DFS Java Maze Q? | Right now, I am dealing with an ArrayDeque functioning as a stack.
I have one to represent my "steps taken" and one to represent my "current position."
I need help to figure out how to backtrack all the way to the positions in which there is more than one option. Essentially, I need to trace the path of the maze so that it is left with ONLY the solution. Right now, my whole maze is covered with 'x's except ONLY the positions in which I ran into a wall (are changed back to 0's).
Sample output:
0 1 0 1 0
0 0 0 1 0
0 1 0 0 0
0 1 0 1 1
0 1 0 0 0
i'm at0 0
x
SOUTH
i'm at1 0
x
SOUTH
EAST
i'm at1 1
x
EAST
i'm at1 2
x
SOUTH
NORTH
i'm at0 2
x
NOWHERE TO GO
i'm at2 2
x
SOUTH
EAST
i'm at2 3
x
EAST
i'm at2 4
x
NORTH
i'm at1 4
x
NORTH
i'm at0 4
x
NOWHERE TO GO
i'm at3 2
x
SOUTH
i'm at4 2
x
EAST
i'm at4 3
x
EAST
i'm at4 4
x
NOWHERE TO GO
i'm at2 0
x
SOUTH
i'm at3 0
x
SOUTH
i'm at4 0
x
NOWHERE TO GO
stackSearch Solution:
null
x 1 0 1 0
x x x 1 x
x 1 x x x
x 1 x 1 1
0 1 x x 0
queueSearch Solution:
null
0 1 0 1 0
0 0 0 1 0
0 1 0 0 0
0 1 0 1 1
0 1 0 0 0
My code:
import java.io.*;
import java.util.Scanner;
import java.util.ArrayDeque;
/*
* minimal class to represent position [i,j] in the maze
*/
class Position{
public int i; //row
public int j; //column
public char val; //1, 0, or 'X'
Position (int a, int b, char v){ i = a; j=b; val = v; }
}
public class PathFinder {
public static void main(String[] args) throws IOException {
if(args.length<1){
System.err.println("***Usage: java PathFinder maze_file");
System.exit(-1);
}
// use stackSearch
char [][] maze;
maze = readMaze(args[0]);
printMaze(maze);
Position [] path = stackSearch(maze);
System.out.println("stackSearch Solution:");
printPath(path);
printMaze(maze);
}
public static Position [] stackSearch(char [] [] maze){
//todo: your path finding algorithm here using the stack to manage search list
//your algorithm should modify maze to mark positions on the path, and also
//return array of Position objects corresponding to path, or null if no path found
//creates array deque to store search list
ArrayDeque <Position> searchList = new ArrayDeque<Position>();
ArrayDeque <Position> stepsTaken = new ArrayDeque<Position>();
//creates position object
Position pos = new Position(0,0,'x');
int i = 0; int j = 0;
//push (0,0) onto stack
searchList.push(pos);
while (!searchList.isEmpty())
{
int ifCounter = 0;
int stepCounter = 0;
pos = searchList.pop(); //current position
i = pos.i; j = pos.j;
stepsTaken.push(pos); //current position is a step taken
maze[i][j] = 'x';
int directionFork = 0;
System.out.println("i'm at" + i + " " + j);
System.out.println(maze[i][j]);
if (i == maze.length-1 && j == maze[0].length-1 && maze[i][j] == '0')
{
System.out.println("WIN!");
break;
/**for (int z = 0; !stepsTaken.isEmpty(); ++z)
{
Position[] path = {stepsTaken.pop()};
PathFinder.printPath(path);
}**/
}
//if (ifCounter > 1)
//{
// ++directionFork;
// ++stepCounter;
// ifCounter = 0;
//}
//check south, add its position to the list.
if (i+1 > 0 && i+1 < maze.length && maze[i+1][j] != '1' && maze[i+1][j] != 'x')
{
Position south = new Position(pos.i + 1,j, 'x');
searchList.push(south);
++ifCounter;
System.out.println("SOUTH");
}
//check east.
if (j+1 > 0 && j+1 < maze[0].length && maze[i][j+1] != '1' && maze[i][j+1] != 'x')
{
Position east = new Position(pos.i,j+1, 'x');
searchList.push(east);
++ifCounter;
System.out.println("EAST");
}
//check north
if (i-1 >= 0 && i-1 < maze.length && maze[i-1][j] != '1' && maze[i-1][j] != 'x')
{
Position north = new Position(pos.i-1,j, 'x');
searchList.push(north);
++ifCounter;
System.out.println("NORTH");
}
//check west.
if (j-1 >= 0 && j-1 < maze[0].length && maze[i][j-1] != '1' && maze[i][j-1] != 'x')
{
Position west = new Position(pos.i,j-1, 'x');
searchList.push(west);
++ifCounter;
System.out.println("WEST ");
}
if (ifCounter == 0) //if nowhere to go
{
System.out.println("NOWHERE TO GO");
stepsTaken.pop();
++stepCounter;
for (int z = 0; z < stepCounter; z++)
{
pos = stepsTaken.pop();
Position repeat = new Position(pos.i,pos.j, 'x');
maze[i][j] = '0';
}
}
}
return null;
}
//
/***
Create a search list for positions yet to explore, add the entrance position, (0,0), to the search list
While the list is not empty
remove the next position from the search list
if it is the exit position, [n-1, n-1]
then a path is found, construct the path and return the path
else mark the position as visited, add all valid up, down, left, or right neighbor positions to the search list
If the list is empty and the method has not returned, there is no path
**/
//ignore
public static void printPath(Position [] path){
System.out.println(path);
}
/**
* Reads maze file in format:
* N -- size of maze
* 0 1 0 1 0 1 -- space-separated
* @param filename
* @return
* @throws IOException
*/
public static char [][] readMaze(String filename) throws IOException{
char [][] maze;
Scanner scanner;
try{
scanner = new Scanner(new FileInputStream(filename));
}
catch(IOException ex){
System.err.println("*** Invalid filename: " + filename);
return null;
}
int N = scanner.nextInt();
scanner.nextLine();
maze = new char[N][N];
int i=0;
while(i < N && scanner.hasNext()){
String line = scanner.nextLine();
String [] tokens = line.split("\\s+");
int j = 0;
for (; j< tokens.length; j++){
maze[i][j] = tokens[j].charAt(0);
}
if(j!=N){
System.err.println("*** Invalid line: " + i + " has wrong # columns: " + j);
return null;
}
i++;
}
if(i!=N){
System.err.println("*** Invalid file: has wrong number of rows: " + i);
return null;
}
return maze;
}
public static void printMaze(char[][] maze){
if(maze==null || maze[0] == null){
System.err.println("*** Invalid maze array");
return;
}
for(int i=0; i< maze.length; i++){
for(int j = 0; j< maze[0].length; j++){
System.out.print(maze[i][j] + " ");
}
System.out.println();
}
System.out.println();
}
} | java | backtracking | maze | dfs | null | 03/09/2012 19:09:21 | not a real question | BackTracking Issue in DFS Java Maze Q?
===
Right now, I am dealing with an ArrayDeque functioning as a stack.
I have one to represent my "steps taken" and one to represent my "current position."
I need help to figure out how to backtrack all the way to the positions in which there is more than one option. Essentially, I need to trace the path of the maze so that it is left with ONLY the solution. Right now, my whole maze is covered with 'x's except ONLY the positions in which I ran into a wall (are changed back to 0's).
Sample output:
0 1 0 1 0
0 0 0 1 0
0 1 0 0 0
0 1 0 1 1
0 1 0 0 0
i'm at0 0
x
SOUTH
i'm at1 0
x
SOUTH
EAST
i'm at1 1
x
EAST
i'm at1 2
x
SOUTH
NORTH
i'm at0 2
x
NOWHERE TO GO
i'm at2 2
x
SOUTH
EAST
i'm at2 3
x
EAST
i'm at2 4
x
NORTH
i'm at1 4
x
NORTH
i'm at0 4
x
NOWHERE TO GO
i'm at3 2
x
SOUTH
i'm at4 2
x
EAST
i'm at4 3
x
EAST
i'm at4 4
x
NOWHERE TO GO
i'm at2 0
x
SOUTH
i'm at3 0
x
SOUTH
i'm at4 0
x
NOWHERE TO GO
stackSearch Solution:
null
x 1 0 1 0
x x x 1 x
x 1 x x x
x 1 x 1 1
0 1 x x 0
queueSearch Solution:
null
0 1 0 1 0
0 0 0 1 0
0 1 0 0 0
0 1 0 1 1
0 1 0 0 0
My code:
import java.io.*;
import java.util.Scanner;
import java.util.ArrayDeque;
/*
* minimal class to represent position [i,j] in the maze
*/
class Position{
public int i; //row
public int j; //column
public char val; //1, 0, or 'X'
Position (int a, int b, char v){ i = a; j=b; val = v; }
}
public class PathFinder {
public static void main(String[] args) throws IOException {
if(args.length<1){
System.err.println("***Usage: java PathFinder maze_file");
System.exit(-1);
}
// use stackSearch
char [][] maze;
maze = readMaze(args[0]);
printMaze(maze);
Position [] path = stackSearch(maze);
System.out.println("stackSearch Solution:");
printPath(path);
printMaze(maze);
}
public static Position [] stackSearch(char [] [] maze){
//todo: your path finding algorithm here using the stack to manage search list
//your algorithm should modify maze to mark positions on the path, and also
//return array of Position objects corresponding to path, or null if no path found
//creates array deque to store search list
ArrayDeque <Position> searchList = new ArrayDeque<Position>();
ArrayDeque <Position> stepsTaken = new ArrayDeque<Position>();
//creates position object
Position pos = new Position(0,0,'x');
int i = 0; int j = 0;
//push (0,0) onto stack
searchList.push(pos);
while (!searchList.isEmpty())
{
int ifCounter = 0;
int stepCounter = 0;
pos = searchList.pop(); //current position
i = pos.i; j = pos.j;
stepsTaken.push(pos); //current position is a step taken
maze[i][j] = 'x';
int directionFork = 0;
System.out.println("i'm at" + i + " " + j);
System.out.println(maze[i][j]);
if (i == maze.length-1 && j == maze[0].length-1 && maze[i][j] == '0')
{
System.out.println("WIN!");
break;
/**for (int z = 0; !stepsTaken.isEmpty(); ++z)
{
Position[] path = {stepsTaken.pop()};
PathFinder.printPath(path);
}**/
}
//if (ifCounter > 1)
//{
// ++directionFork;
// ++stepCounter;
// ifCounter = 0;
//}
//check south, add its position to the list.
if (i+1 > 0 && i+1 < maze.length && maze[i+1][j] != '1' && maze[i+1][j] != 'x')
{
Position south = new Position(pos.i + 1,j, 'x');
searchList.push(south);
++ifCounter;
System.out.println("SOUTH");
}
//check east.
if (j+1 > 0 && j+1 < maze[0].length && maze[i][j+1] != '1' && maze[i][j+1] != 'x')
{
Position east = new Position(pos.i,j+1, 'x');
searchList.push(east);
++ifCounter;
System.out.println("EAST");
}
//check north
if (i-1 >= 0 && i-1 < maze.length && maze[i-1][j] != '1' && maze[i-1][j] != 'x')
{
Position north = new Position(pos.i-1,j, 'x');
searchList.push(north);
++ifCounter;
System.out.println("NORTH");
}
//check west.
if (j-1 >= 0 && j-1 < maze[0].length && maze[i][j-1] != '1' && maze[i][j-1] != 'x')
{
Position west = new Position(pos.i,j-1, 'x');
searchList.push(west);
++ifCounter;
System.out.println("WEST ");
}
if (ifCounter == 0) //if nowhere to go
{
System.out.println("NOWHERE TO GO");
stepsTaken.pop();
++stepCounter;
for (int z = 0; z < stepCounter; z++)
{
pos = stepsTaken.pop();
Position repeat = new Position(pos.i,pos.j, 'x');
maze[i][j] = '0';
}
}
}
return null;
}
//
/***
Create a search list for positions yet to explore, add the entrance position, (0,0), to the search list
While the list is not empty
remove the next position from the search list
if it is the exit position, [n-1, n-1]
then a path is found, construct the path and return the path
else mark the position as visited, add all valid up, down, left, or right neighbor positions to the search list
If the list is empty and the method has not returned, there is no path
**/
//ignore
public static void printPath(Position [] path){
System.out.println(path);
}
/**
* Reads maze file in format:
* N -- size of maze
* 0 1 0 1 0 1 -- space-separated
* @param filename
* @return
* @throws IOException
*/
public static char [][] readMaze(String filename) throws IOException{
char [][] maze;
Scanner scanner;
try{
scanner = new Scanner(new FileInputStream(filename));
}
catch(IOException ex){
System.err.println("*** Invalid filename: " + filename);
return null;
}
int N = scanner.nextInt();
scanner.nextLine();
maze = new char[N][N];
int i=0;
while(i < N && scanner.hasNext()){
String line = scanner.nextLine();
String [] tokens = line.split("\\s+");
int j = 0;
for (; j< tokens.length; j++){
maze[i][j] = tokens[j].charAt(0);
}
if(j!=N){
System.err.println("*** Invalid line: " + i + " has wrong # columns: " + j);
return null;
}
i++;
}
if(i!=N){
System.err.println("*** Invalid file: has wrong number of rows: " + i);
return null;
}
return maze;
}
public static void printMaze(char[][] maze){
if(maze==null || maze[0] == null){
System.err.println("*** Invalid maze array");
return;
}
for(int i=0; i< maze.length; i++){
for(int j = 0; j< maze[0].length; j++){
System.out.print(maze[i][j] + " ");
}
System.out.println();
}
System.out.println();
}
} | 1 |
6,454,506 | 06/23/2011 13:08:03 | 639,486 | 03/01/2011 14:17:03 | 72 | 3 | Flip video input horizontally C# DirectshowNet | I'm using the dxSnap sample from the directshownet library http://directshownet.sourceforge.net/about.html to capture an image from my webcam. Does anybody know how to flip the video capture horizontally?
| c# | directshow | directshow.net | null | null | null | open | Flip video input horizontally C# DirectshowNet
===
I'm using the dxSnap sample from the directshownet library http://directshownet.sourceforge.net/about.html to capture an image from my webcam. Does anybody know how to flip the video capture horizontally?
| 0 |
7,344,288 | 09/08/2011 07:00:02 | 934,236 | 09/08/2011 07:00:02 | 1 | 0 | Apache Tomcat linux server export display problem | I have a application on server that produces image that is to display it on client machine. The application display image on that client machine if and only the server is restarted using putty or ssh from that client itself .I think the problem is in exporting display property.
Thanks in advance.
| linux | tomcat | export | display | null | 09/08/2011 09:34:13 | not a real question | Apache Tomcat linux server export display problem
===
I have a application on server that produces image that is to display it on client machine. The application display image on that client machine if and only the server is restarted using putty or ssh from that client itself .I think the problem is in exporting display property.
Thanks in advance.
| 1 |
9,371,669 | 02/21/2012 03:19:36 | 720,323 | 04/22/2011 09:18:02 | 931 | 4 | How to place a text next to the picture? | I want to place 2 pictures, one on top of the page and the other right below it. Then, I want to write something about each picture and I want the text to be located to the right of each picture.
How can this be done?
I am formatting my pictures as following, but the problem is that the pictures are like they were suppose to, but the text appear to be only by first image.
<p style="float: left; clear: left"><img src="image.jpg" height="200px" width="200px" border="1px"></p>
<p>Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text</p>
<p style="float: left; clear: left"><img src="image.jpg" height="200" width="200" border="1px"></p>
<p>Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text</p> | html | css | image | text | paragraph | 02/21/2012 15:14:13 | not a real question | How to place a text next to the picture?
===
I want to place 2 pictures, one on top of the page and the other right below it. Then, I want to write something about each picture and I want the text to be located to the right of each picture.
How can this be done?
I am formatting my pictures as following, but the problem is that the pictures are like they were suppose to, but the text appear to be only by first image.
<p style="float: left; clear: left"><img src="image.jpg" height="200px" width="200px" border="1px"></p>
<p>Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text</p>
<p style="float: left; clear: left"><img src="image.jpg" height="200" width="200" border="1px"></p>
<p>Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text</p> | 1 |
5,495,164 | 03/31/2011 03:55:52 | 233,618 | 12/17/2009 08:53:13 | 280 | 30 | how to Call Recorder | i want to know if i can Call Recorder ,Records on the other side of the phone,not myself said? for example 911,can record your said. if yes,how to do thank you | android | null | null | null | null | null | open | how to Call Recorder
===
i want to know if i can Call Recorder ,Records on the other side of the phone,not myself said? for example 911,can record your said. if yes,how to do thank you | 0 |
8,401,843 | 12/06/2011 14:53:01 | 343,209 | 05/17/2010 15:39:33 | 82 | 0 | usnig enums in jquery grid | i´m using datagrid with ExtJs .net
I bind an object to the store which contains member of enum type:
enum Colors
{red,yellow,black,brown}
and where the enum type is loaded in the grid ->
{ header: "colors",
width: 170,
sortable: true,
dataIndex: 'colors',
editor: {
xtype: 'textfield',
allowBlank: true
}
},
When the grid is loaded up it displays just a numbers 2,3,1 for example instead of "red", "yellow" or "black"
How can i print out enums values as a string ?
| c# | jquery | datagrid | null | null | null | open | usnig enums in jquery grid
===
i´m using datagrid with ExtJs .net
I bind an object to the store which contains member of enum type:
enum Colors
{red,yellow,black,brown}
and where the enum type is loaded in the grid ->
{ header: "colors",
width: 170,
sortable: true,
dataIndex: 'colors',
editor: {
xtype: 'textfield',
allowBlank: true
}
},
When the grid is loaded up it displays just a numbers 2,3,1 for example instead of "red", "yellow" or "black"
How can i print out enums values as a string ?
| 0 |
1,807,692 | 11/27/2009 09:36:58 | 148,855 | 08/01/2009 05:44:28 | 12 | 0 | mobile application in asp.net | how to switch off remote server by sending sms from mobile using asp.net | asp.net | null | null | null | null | null | open | mobile application in asp.net
===
how to switch off remote server by sending sms from mobile using asp.net | 0 |
1,189,038 | 07/27/2009 16:04:17 | 143,616 | 07/23/2009 11:03:16 | 3 | 2 | Unwanted Prefixing of Hyperlinks Internet Explorer [Javascript] | What's The Problem?
Only in Internet Explorer (surprise) is my code executed incorrectly. The short crap of code below should append an "onclick" action to each "a" tag. This works wonderfully but look at the fifth line, it should set the second function argument to the value of the "href" attribute of the anchor tag. In WebKit, Mozilla etc. it's fine. If we set "href" to say "lorem_ipsum" then WebKit, Mozilla etc. retrieve the correct result and set the second function argument to "lorem_ipsum", Internet Explorer prefixes "http://www.some.site/" so we see "http://www.some.site/lorem_ipsum" reported as the second argument. Internet Explorer is incorrect as that is not the "href" attribute of the anchor tag's actual value.
Anchors=Parent.getElementsByTagName("a");
Anchor=0;
while(Anchor<Anchors.length){
Anchors[Anchor].onclick=function(){
Plot("",this.getAttribute("href"));
return false;
};
Anchor++;
};
How can I get around this absurd problem? Would I need to strip away from the string everything before the final slash? That seems a long winded approach! Any Ideas?
| javascript | internet-explorer | null | null | null | null | open | Unwanted Prefixing of Hyperlinks Internet Explorer [Javascript]
===
What's The Problem?
Only in Internet Explorer (surprise) is my code executed incorrectly. The short crap of code below should append an "onclick" action to each "a" tag. This works wonderfully but look at the fifth line, it should set the second function argument to the value of the "href" attribute of the anchor tag. In WebKit, Mozilla etc. it's fine. If we set "href" to say "lorem_ipsum" then WebKit, Mozilla etc. retrieve the correct result and set the second function argument to "lorem_ipsum", Internet Explorer prefixes "http://www.some.site/" so we see "http://www.some.site/lorem_ipsum" reported as the second argument. Internet Explorer is incorrect as that is not the "href" attribute of the anchor tag's actual value.
Anchors=Parent.getElementsByTagName("a");
Anchor=0;
while(Anchor<Anchors.length){
Anchors[Anchor].onclick=function(){
Plot("",this.getAttribute("href"));
return false;
};
Anchor++;
};
How can I get around this absurd problem? Would I need to strip away from the string everything before the final slash? That seems a long winded approach! Any Ideas?
| 0 |
5,866,511 | 05/03/2011 07:38:27 | 445,897 | 09/13/2010 01:43:18 | 39 | 4 | iphone learn to design and create own GUI | I want to know what is good start point to work on creating own GUI on iphone/objective-c. I've never done this part before, and I know I'm kinda attracted to make my own slick GUI, something like convertbot, which I really love :)
Any suggestion would be appreciated! Thanks | iphone | gui | null | null | null | null | open | iphone learn to design and create own GUI
===
I want to know what is good start point to work on creating own GUI on iphone/objective-c. I've never done this part before, and I know I'm kinda attracted to make my own slick GUI, something like convertbot, which I really love :)
Any suggestion would be appreciated! Thanks | 0 |
7,218,319 | 08/28/2011 00:41:26 | 845,230 | 07/14/2011 18:54:28 | 16 | 0 | Should I trust LinqDataSource to clean up properly? | Taking my first stab as using the OnSelecting method of LinqDataSource so that I can specify a more complex query, I wrote this:
protected void CategoriesDataSource_OnSelecting(object sender, LinqDataSourceSelectEventArgs e)
{
using (DataLayerDataContext db = new DataLayerDataContext())
{
e.Result = (from feed in db.Feeds
where feed.FeedName.StartsWith("Google")
select feed.MainCategory).Distinct();
}
}
The problem, of course, is that the using clause will Dispose the DataLayerDataContext. The 'solution' is to write it without it, but I'm afraid then that the context won't be disposed of in a timely fashion, that it will leave a bunch of connections open until garbage collection runs, and so on.
I'm no expert in this area, so any comments on whether this is a real problem, or am I worried for naught? | linq | garbage-collection | dispose | linqdatasource | null | null | open | Should I trust LinqDataSource to clean up properly?
===
Taking my first stab as using the OnSelecting method of LinqDataSource so that I can specify a more complex query, I wrote this:
protected void CategoriesDataSource_OnSelecting(object sender, LinqDataSourceSelectEventArgs e)
{
using (DataLayerDataContext db = new DataLayerDataContext())
{
e.Result = (from feed in db.Feeds
where feed.FeedName.StartsWith("Google")
select feed.MainCategory).Distinct();
}
}
The problem, of course, is that the using clause will Dispose the DataLayerDataContext. The 'solution' is to write it without it, but I'm afraid then that the context won't be disposed of in a timely fashion, that it will leave a bunch of connections open until garbage collection runs, and so on.
I'm no expert in this area, so any comments on whether this is a real problem, or am I worried for naught? | 0 |
8,917,793 | 01/18/2012 21:34:05 | 959,470 | 09/22/2011 15:32:31 | 1 | 0 | Using facebook.katana aka facebook app from the code | i´m trying to achieve a solution where the app ask if facebook.katana aka facebook app is installed in your android phone, if it is installed, check if the user is logged, and if it's logged send a picture with a text (better if it is to a folder), if the user is not logged go to the facebook.katana.LoginActivity and log him, after that make the procedure.
I have this working with a Web View, but i'm interested on how to do it using the app if possible, what i got so far is the uncompiled facebook.katana in this URL where i'm testing the activities:
http://xt720.ru/miui-trans/apk-decompiled/Facebook/smali/com/facebook/katana/
I also know that an image can be attached to that app, since can start the facebook app using this:
final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
emailIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
emailIntent.putExtra(Intent.EXTRA_STREAM,imageUri);
emailIntent.setType("image/png");
emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "Whatever");
startActivity(Intent.createChooser(emailIntent, "Send email using"));
This method would be great for an email, but as it says it creates a chooser, but i don't want to let that option open. So i tried something like:
Intent intent = new Intent("android.intent.category.LAUNCHER");
intent.setClassName("com.facebook.katana", "com.facebook.katana.LoginActivity");
startActivity(intent);
Also you can use the ShareLinkActivity to add an extra to your intent like this:
intent.putExtra(Intent.EXTRA_TEXT, "http://www.google.com/");
The problem is that i don't see how to attach the image to the katana, neither, how to add it to a folder, or how to add it through an application, of course this is much easier via facebook API for android, but like i said that's already done, i want to make it with the facebook App, i have tried, attaching the Bundle to the app as a parcelable, with the usual way it is done in the API, but not luck, this is the snippet:
Bundle params = new Bundle();
params.putByteArray("picture", bitmapdata);
params.putString("title", url);
params.putString("message","Wathever message");
and try to send the params, also tried sending only the image, but not luck, maybe i'm not using the right class (see the uncopiled facebook.katana URL) or i´m attaching in a bad way the info, it should work somehow, cause it works for ACTION_SEND, so, anybody knows how to solve any of this problems:
1. Attach an image to the facebook.katana
2. Attach an image to the facebook.katana in a folder
3. Attach an image to the facebook.katana as an external app
4. Request the log status of the user to the facebook.katana (i think this would be automatically)
5. Attach the picture, title, message params to the facebook.katana.
| android | facebook | attachment | launcher | null | null | open | Using facebook.katana aka facebook app from the code
===
i´m trying to achieve a solution where the app ask if facebook.katana aka facebook app is installed in your android phone, if it is installed, check if the user is logged, and if it's logged send a picture with a text (better if it is to a folder), if the user is not logged go to the facebook.katana.LoginActivity and log him, after that make the procedure.
I have this working with a Web View, but i'm interested on how to do it using the app if possible, what i got so far is the uncompiled facebook.katana in this URL where i'm testing the activities:
http://xt720.ru/miui-trans/apk-decompiled/Facebook/smali/com/facebook/katana/
I also know that an image can be attached to that app, since can start the facebook app using this:
final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
emailIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
emailIntent.putExtra(Intent.EXTRA_STREAM,imageUri);
emailIntent.setType("image/png");
emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "Whatever");
startActivity(Intent.createChooser(emailIntent, "Send email using"));
This method would be great for an email, but as it says it creates a chooser, but i don't want to let that option open. So i tried something like:
Intent intent = new Intent("android.intent.category.LAUNCHER");
intent.setClassName("com.facebook.katana", "com.facebook.katana.LoginActivity");
startActivity(intent);
Also you can use the ShareLinkActivity to add an extra to your intent like this:
intent.putExtra(Intent.EXTRA_TEXT, "http://www.google.com/");
The problem is that i don't see how to attach the image to the katana, neither, how to add it to a folder, or how to add it through an application, of course this is much easier via facebook API for android, but like i said that's already done, i want to make it with the facebook App, i have tried, attaching the Bundle to the app as a parcelable, with the usual way it is done in the API, but not luck, this is the snippet:
Bundle params = new Bundle();
params.putByteArray("picture", bitmapdata);
params.putString("title", url);
params.putString("message","Wathever message");
and try to send the params, also tried sending only the image, but not luck, maybe i'm not using the right class (see the uncopiled facebook.katana URL) or i´m attaching in a bad way the info, it should work somehow, cause it works for ACTION_SEND, so, anybody knows how to solve any of this problems:
1. Attach an image to the facebook.katana
2. Attach an image to the facebook.katana in a folder
3. Attach an image to the facebook.katana as an external app
4. Request the log status of the user to the facebook.katana (i think this would be automatically)
5. Attach the picture, title, message params to the facebook.katana.
| 0 |
4,928,457 | 02/08/2011 00:46:30 | 436,336 | 08/31/2010 20:05:40 | 50 | 0 | Why wont this move effect work on my sprites when the fade effect does? | Could someone please explain why this doesn't want to work? It's a bit of decoration to go behind a logo.
When the dMove var is commented out I get the appropriate line of squares fading in and out at random spots along the x = 78 axis, but when introduced nothing appears at all...
private var floatBG:UIComponent = new UIComponent();
private function addDP(event:TimerEvent):void{
var dY:Number = 5+Math.ceil(Math.random()*60);
var dSize:Number = Math.ceil(Math.random()*12);
var dAlpha:Number = Math.random()*0.5 + 0.2
var dDuration:Number = Math.ceil(Math.random()*5000) + 1000;
var d:Sprite = new Sprite();
d.graphics.beginFill(0x1C75BC,dAlpha);
d.graphics.drawRect(78, dY, dSize,dSize);
d.graphics.endFill();
floatBG.addChild(d);
var dMove:Move = new Move(d);
dMove.xBy = 300;
dMove.duration = dDuration;
dMove.play();
var dFade:Fade = new Fade(d);
dFade.alphaFrom = 1;
dFade.alphaTo = 0;
dFade.duration = dDuration;
dFade.play();
this.addElement(floatBG);
}
Also, what would be the best/correct method for destroying the sprites at the end of each cycle?
Thanks a lot in advance, massively appreciate it!
Josh
| flex | actionscript-3 | animation | sprite | move | null | open | Why wont this move effect work on my sprites when the fade effect does?
===
Could someone please explain why this doesn't want to work? It's a bit of decoration to go behind a logo.
When the dMove var is commented out I get the appropriate line of squares fading in and out at random spots along the x = 78 axis, but when introduced nothing appears at all...
private var floatBG:UIComponent = new UIComponent();
private function addDP(event:TimerEvent):void{
var dY:Number = 5+Math.ceil(Math.random()*60);
var dSize:Number = Math.ceil(Math.random()*12);
var dAlpha:Number = Math.random()*0.5 + 0.2
var dDuration:Number = Math.ceil(Math.random()*5000) + 1000;
var d:Sprite = new Sprite();
d.graphics.beginFill(0x1C75BC,dAlpha);
d.graphics.drawRect(78, dY, dSize,dSize);
d.graphics.endFill();
floatBG.addChild(d);
var dMove:Move = new Move(d);
dMove.xBy = 300;
dMove.duration = dDuration;
dMove.play();
var dFade:Fade = new Fade(d);
dFade.alphaFrom = 1;
dFade.alphaTo = 0;
dFade.duration = dDuration;
dFade.play();
this.addElement(floatBG);
}
Also, what would be the best/correct method for destroying the sprites at the end of each cycle?
Thanks a lot in advance, massively appreciate it!
Josh
| 0 |
10,255,094 | 04/21/2012 00:27:35 | 1,323,014 | 04/10/2012 01:42:18 | 3 | 0 | How to change ListActivity to ListFragment | I have a Pager adapter that will call a ListFragment like this:
public Fragment getItem(int position) {
Fragment fragment = new ListViewFragment();
// set arguments here, if required
Bundle args = new Bundle();
fragment.setArguments(args);
return fragment;
Then I have a ListActivity that I want to change to ListViewFragment.
public class ImageListActivity extends ListActivity implements RadioGroup.OnCheckedChangeListener {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.imagelist);
RadioGroup radioGroup = (RadioGroup) findViewById(R.id.radioGroup);
radioGroup.setOnCheckedChangeListener(this);
setListAdapter(new ImageAdapter());
}
public void onCheckedChanged(RadioGroup group, int checkedId) {
ImageDownloader.Mode mode = ImageDownloader.Mode.NO_ASYNC_TASK;
if (checkedId == R.id.correctButton) {
mode = ImageDownloader.Mode.CORRECT;
}else if (checkedId == R.id.randomButton) {
mode = ImageDownloader.Mode.NO_DOWNLOADED_DRAWABLE;
}
((ImageAdapter) getListAdapter()).getImageDownloader().setMode(mode);
}
}
But I really cant put it to work.. Ive tried that:
public class ListViewFragment extends ListFragment {
int mNum;
Context ctx;
View v;
static int p;
/**
* Create a new instance of CountingFragment, providing "num"
* as an argument.
*/
static ListFragment newInstance(int num) {
ListFragment f = new ListFragment();
// Supply num input as an argument.
Bundle args = new Bundle();
args.putInt("num", num);
f.setArguments(args);
return f;
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
v = inflater.inflate(R.layout.imagelist, container, false);
ImageDownloader.Mode mode = ImageDownloader.Mode.NO_ASYNC_TASK;
mode = ImageDownloader.Mode.CORRECT;
((ImageAdapter) getListAdapter()).getImageDownloader().setMode(mode);
setListAdapter(new ImageAdapter());
return container;
}
}
This always crash, I want to use this ImageAdapter that will populate listview with images. | android | listview | listactivity | listadapter | android-listfragment | null | open | How to change ListActivity to ListFragment
===
I have a Pager adapter that will call a ListFragment like this:
public Fragment getItem(int position) {
Fragment fragment = new ListViewFragment();
// set arguments here, if required
Bundle args = new Bundle();
fragment.setArguments(args);
return fragment;
Then I have a ListActivity that I want to change to ListViewFragment.
public class ImageListActivity extends ListActivity implements RadioGroup.OnCheckedChangeListener {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.imagelist);
RadioGroup radioGroup = (RadioGroup) findViewById(R.id.radioGroup);
radioGroup.setOnCheckedChangeListener(this);
setListAdapter(new ImageAdapter());
}
public void onCheckedChanged(RadioGroup group, int checkedId) {
ImageDownloader.Mode mode = ImageDownloader.Mode.NO_ASYNC_TASK;
if (checkedId == R.id.correctButton) {
mode = ImageDownloader.Mode.CORRECT;
}else if (checkedId == R.id.randomButton) {
mode = ImageDownloader.Mode.NO_DOWNLOADED_DRAWABLE;
}
((ImageAdapter) getListAdapter()).getImageDownloader().setMode(mode);
}
}
But I really cant put it to work.. Ive tried that:
public class ListViewFragment extends ListFragment {
int mNum;
Context ctx;
View v;
static int p;
/**
* Create a new instance of CountingFragment, providing "num"
* as an argument.
*/
static ListFragment newInstance(int num) {
ListFragment f = new ListFragment();
// Supply num input as an argument.
Bundle args = new Bundle();
args.putInt("num", num);
f.setArguments(args);
return f;
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
v = inflater.inflate(R.layout.imagelist, container, false);
ImageDownloader.Mode mode = ImageDownloader.Mode.NO_ASYNC_TASK;
mode = ImageDownloader.Mode.CORRECT;
((ImageAdapter) getListAdapter()).getImageDownloader().setMode(mode);
setListAdapter(new ImageAdapter());
return container;
}
}
This always crash, I want to use this ImageAdapter that will populate listview with images. | 0 |
7,663,643 | 10/05/2011 15:19:27 | 833,179 | 07/07/2011 08:57:33 | 38 | 4 | Delayed Job passenger production undefined method error | I am using delayed job version 2.1.4 with action mailer 3.0.8 to send my emails in background.
UserMailer.delay.newsletter(email)
It works with me fine in development and production Rails console. But when it is called from my live production passenger server, it creates DJ but when this DJ runs, it throws
{undefined method `newsletter' for #<Class:0xc08afa0>
Any help? | passenger | actionmailer | delayed-job | null | null | null | open | Delayed Job passenger production undefined method error
===
I am using delayed job version 2.1.4 with action mailer 3.0.8 to send my emails in background.
UserMailer.delay.newsletter(email)
It works with me fine in development and production Rails console. But when it is called from my live production passenger server, it creates DJ but when this DJ runs, it throws
{undefined method `newsletter' for #<Class:0xc08afa0>
Any help? | 0 |
7,302,331 | 09/04/2011 21:49:19 | 560,096 | 01/02/2011 02:06:34 | 82 | 0 | Best Advanced Java Tutorial With Code? | So far all I've been able to find are the foundations of Java. I need code examples. And I want to be able to make a good applet or application. | java | tutorials | null | null | null | 09/04/2011 22:20:09 | not constructive | Best Advanced Java Tutorial With Code?
===
So far all I've been able to find are the foundations of Java. I need code examples. And I want to be able to make a good applet or application. | 4 |
4,254,703 | 11/23/2010 09:49:36 | 517,230 | 11/23/2010 09:45:15 | 1 | 0 | Side-by-side execution and MS Unit Test | Environment here is C#/.Net 4.
In my MS Unit Test unit test project I'm testing a piece of code which uses a COM dll for some date conversion calculations (this in turn uses some other COM DLLs so in all three COM DLLs are involved).
When running in a normal application/service set-up, I have no problem getting the side-by-side execution to work through use of manifests linking to the COM dlls' assembly identities, but when trying to do the same from my unit test project, I always get failure due to 'class not registered' exceptions.
Now, I've tried this already:
- Embedding the test DLL manifest
- Embedding both the test DLL manifest, the COM dlls manifests + the COM DLLs themselves
But to no avail. So I'm wondering: how could I make the unit test environment aware of the COM linking through the manifests? To me, it seems like the DLL manifest linking isn't quite working (the EXE manifests are working fine), but usually those kinds of thoughts equals doing something wrong ...
I'm usually pretty successful in searching for stuff like this, but on this one, I've had very few hits, and nothing which resembles this, so please, if you have any thoughts or input, do share :) And if elaboration is needed, please let me know.
(I know, that the use of the COM dlls could probably be avoided by some dependency injection the right place, but for now I'd like to explore this case regarding unit testing a side-by-side setup).
Kind Regards
Jesper
| .net | unit-testing | side-by-side | null | null | null | open | Side-by-side execution and MS Unit Test
===
Environment here is C#/.Net 4.
In my MS Unit Test unit test project I'm testing a piece of code which uses a COM dll for some date conversion calculations (this in turn uses some other COM DLLs so in all three COM DLLs are involved).
When running in a normal application/service set-up, I have no problem getting the side-by-side execution to work through use of manifests linking to the COM dlls' assembly identities, but when trying to do the same from my unit test project, I always get failure due to 'class not registered' exceptions.
Now, I've tried this already:
- Embedding the test DLL manifest
- Embedding both the test DLL manifest, the COM dlls manifests + the COM DLLs themselves
But to no avail. So I'm wondering: how could I make the unit test environment aware of the COM linking through the manifests? To me, it seems like the DLL manifest linking isn't quite working (the EXE manifests are working fine), but usually those kinds of thoughts equals doing something wrong ...
I'm usually pretty successful in searching for stuff like this, but on this one, I've had very few hits, and nothing which resembles this, so please, if you have any thoughts or input, do share :) And if elaboration is needed, please let me know.
(I know, that the use of the COM dlls could probably be avoided by some dependency injection the right place, but for now I'd like to explore this case regarding unit testing a side-by-side setup).
Kind Regards
Jesper
| 0 |
11,357,961 | 07/06/2012 07:45:31 | 962,890 | 09/24/2011 18:07:28 | 105 | 6 | Amazon S3 + CloudFront, 4TB Traffic/Month, 16k Concurrent Users | this is a copy of my question at the amazon aws forum (where no one answered yet :-) ). Maybe someone here can help me out.
The post:
https://forums.aws.amazon.com/thread.jspa?threadID=99124&tstart=0
The question:
Dear Forum,
i am currently in the lucky situation to set up a video delivery network system. Besides some other alternatives I really consider to use the Amazon AW Services for the job.
I was thinking about using the S3 storage servers together with CloudFront (as a Load Balancer).
My question is if someone has experience with that and if he could share some knowledge with me (and all the other readers of this thread).
Some background data:
891 GB videos
4.4 TB download transfer / Month
5k to 16k concurrent users.
It is VERY IMPORTANT that no user will have lag which can be traced back to the backend. Lag is only allowed to occur if there are problems on the user side.
If more information is needed please let me know.
Appendix:
Hello,
I also would like to know if it is possible to easily duplicate S3 instances. For example: cloudFront tells me that we are running over a certain amount of concurrent clients. A script launches a new S3 instance, copies all date from the original S3 to the new one and connects the new S3 to cloudFront. If the high peek goes down again, the S3 instance gets terminated, with all data on it.
Is a scenario like this possible? And if not, how can I handle something like this with Amazon?
----
Thanks a lot in advance. :-)
Markus
| amazon-s3 | amazon-web-services | video-streaming | amazon | amazon-cloudfront | 07/07/2012 16:09:46 | off topic | Amazon S3 + CloudFront, 4TB Traffic/Month, 16k Concurrent Users
===
this is a copy of my question at the amazon aws forum (where no one answered yet :-) ). Maybe someone here can help me out.
The post:
https://forums.aws.amazon.com/thread.jspa?threadID=99124&tstart=0
The question:
Dear Forum,
i am currently in the lucky situation to set up a video delivery network system. Besides some other alternatives I really consider to use the Amazon AW Services for the job.
I was thinking about using the S3 storage servers together with CloudFront (as a Load Balancer).
My question is if someone has experience with that and if he could share some knowledge with me (and all the other readers of this thread).
Some background data:
891 GB videos
4.4 TB download transfer / Month
5k to 16k concurrent users.
It is VERY IMPORTANT that no user will have lag which can be traced back to the backend. Lag is only allowed to occur if there are problems on the user side.
If more information is needed please let me know.
Appendix:
Hello,
I also would like to know if it is possible to easily duplicate S3 instances. For example: cloudFront tells me that we are running over a certain amount of concurrent clients. A script launches a new S3 instance, copies all date from the original S3 to the new one and connects the new S3 to cloudFront. If the high peek goes down again, the S3 instance gets terminated, with all data on it.
Is a scenario like this possible? And if not, how can I handle something like this with Amazon?
----
Thanks a lot in advance. :-)
Markus
| 2 |
2,687,742 | 04/22/2010 01:48:04 | 309,381 | 04/05/2010 17:20:27 | 13 | 0 | i have problem with include file | <?php
//this is intializer.php
defined('DS')? null :define('DS',DIRECTORY_SEPARATOR);
defined('SITE_ROOT')? null :
define('SITE_ROOT',DS.'C:',DS.'wamp',DS.'www',DS.'photo_gallery');
defined('LIB_PATH')?null:define('LIB_PATH',SITE_ROOT.DS.'includes');
require_once(LIB_PATH.DS.'datainfo.php');
require_once(LIB_PATH.DS.'function.php');
require_once(LIB_PATH.DS.'session.php');
require_once(LIB_PATH.DS.'database.php');
require_once(LIB_PATH.DS.'user.php');
?>
<?php
//this is other file where i call php file
// ERROR Use of undefined constant LIB_PATH - assumed 'LIB_PATH' in //C:\wamp\www\photo_gallery\includes\database.php on
//Notice: Use of undefined constant DS - assumed 'DS' in //C:\wamp\www\photo_gallery\includes\database.php on
include(LIB_PATH.DS."database.php")
?> | php5 | php | null | null | null | null | open | i have problem with include file
===
<?php
//this is intializer.php
defined('DS')? null :define('DS',DIRECTORY_SEPARATOR);
defined('SITE_ROOT')? null :
define('SITE_ROOT',DS.'C:',DS.'wamp',DS.'www',DS.'photo_gallery');
defined('LIB_PATH')?null:define('LIB_PATH',SITE_ROOT.DS.'includes');
require_once(LIB_PATH.DS.'datainfo.php');
require_once(LIB_PATH.DS.'function.php');
require_once(LIB_PATH.DS.'session.php');
require_once(LIB_PATH.DS.'database.php');
require_once(LIB_PATH.DS.'user.php');
?>
<?php
//this is other file where i call php file
// ERROR Use of undefined constant LIB_PATH - assumed 'LIB_PATH' in //C:\wamp\www\photo_gallery\includes\database.php on
//Notice: Use of undefined constant DS - assumed 'DS' in //C:\wamp\www\photo_gallery\includes\database.php on
include(LIB_PATH.DS."database.php")
?> | 0 |
1,715,695 | 11/11/2009 14:56:04 | 21,918 | 09/24/2008 22:22:17 | 77 | 7 | .NET windows service getting stopped abruptly | HI Guys,
I have created a windows service which spawns three threads.The first thread wakes up every 15 sec, the second thread wakes up every min. and the third thread once in a day.
My COde looks something like this:
var timer1 = new Timer();
timer1.Elapsed += ProcessTimerEvent1;
timer1.Interval = 60000;
timer1.Start();
var timer2 = new Timer();
timer2.Elapsed += ProcessTimerEvent2;
timer2.Interval = 15000;
timer2.Start();
var timer3 = new Timer();
timer3.Elapsed += ProcessTimerEvent3;
timer3.Interval = 86400000;
timer3.Start();
From my event logs I can see that it is saying .NET Runtime 2.0 Error Reporting EVENTID:5000.
I looked through the net and it says invalid operationexception.
DO you guys think whether this stopping of service has to do anything with threads.
And the other silly question is am I spawning 3 new threads everytime or the same threads gets up evey 15 sec or 1 min.
| windows | windows-services | asp.net | c# | exception | null | open | .NET windows service getting stopped abruptly
===
HI Guys,
I have created a windows service which spawns three threads.The first thread wakes up every 15 sec, the second thread wakes up every min. and the third thread once in a day.
My COde looks something like this:
var timer1 = new Timer();
timer1.Elapsed += ProcessTimerEvent1;
timer1.Interval = 60000;
timer1.Start();
var timer2 = new Timer();
timer2.Elapsed += ProcessTimerEvent2;
timer2.Interval = 15000;
timer2.Start();
var timer3 = new Timer();
timer3.Elapsed += ProcessTimerEvent3;
timer3.Interval = 86400000;
timer3.Start();
From my event logs I can see that it is saying .NET Runtime 2.0 Error Reporting EVENTID:5000.
I looked through the net and it says invalid operationexception.
DO you guys think whether this stopping of service has to do anything with threads.
And the other silly question is am I spawning 3 new threads everytime or the same threads gets up evey 15 sec or 1 min.
| 0 |
10,415,410 | 05/02/2012 14:05:43 | 974,375 | 10/01/2011 10:30:49 | 1 | 0 | Web Client Programming | How do implement a simple web client that will fetch all the required embedded images. More like, if a web page contains the elements like img src=”abcd.gif”, the client should fetch the image file abcd.gif. The client should work with any standard web server. After the contents are fetched, if the html file is opened in a browser locally, it should display the page properly. The client will be invoked as follows:cilent http:// webserver /a.html.
How do i go about?
| web | null | null | null | null | 05/03/2012 12:19:25 | not a real question | Web Client Programming
===
How do implement a simple web client that will fetch all the required embedded images. More like, if a web page contains the elements like img src=”abcd.gif”, the client should fetch the image file abcd.gif. The client should work with any standard web server. After the contents are fetched, if the html file is opened in a browser locally, it should display the page properly. The client will be invoked as follows:cilent http:// webserver /a.html.
How do i go about?
| 1 |
8,727,065 | 01/04/2012 12:43:09 | 1,129,934 | 01/04/2012 12:41:35 | 1 | 0 | Intersection points of two circles in c++ | I want to find the Intersection point of two cricles in c++ .I have the center and radius of the two circles. can anyone help me ?? | c++ | math | null | null | null | 01/04/2012 14:49:29 | off topic | Intersection points of two circles in c++
===
I want to find the Intersection point of two cricles in c++ .I have the center and radius of the two circles. can anyone help me ?? | 2 |
10,854,193 | 06/01/2012 16:36:56 | 352,477 | 05/28/2010 00:40:54 | 714 | 3 | Is this method of static file serving safe in node.js? (potential security hole?) | I want to create the simplest node.js server to serve static files.
Here's what I came up with:
fs = require('fs');
server = require('http').createServer(function(req, res) {
res.end(fs.readFileSync(__dirname + '/public/' + req.url));
});
server.listen(8080);
Clearly this would map `http://localhost:8080/index.html` to `project_dir/public/index.html`, and similarly so for all other files.
My one concern is that someone could abuse this to access files outside of `project_dir/public`. Something like this, for example:
http://localhost:8080/../../sensitive_file.txt
I tried this a little bit, and it wasn't working. But, it seems like my browser was removing the ".." itself. Which leads me to believe that someone could abuse my poor little node.js server.
I know there are npm packages that do static file serving. But I'm actually curious to write my own here. So my questions are:
1. Is this safe?
2. If so, why? If not, why not?
3. And, if further, if not, what is the "right" way to do this? My one constraint is I don't want to have to have an if clause for each possible file, I want the server to serve whatever files I throw in a directory. | node.js | null | null | null | null | null | open | Is this method of static file serving safe in node.js? (potential security hole?)
===
I want to create the simplest node.js server to serve static files.
Here's what I came up with:
fs = require('fs');
server = require('http').createServer(function(req, res) {
res.end(fs.readFileSync(__dirname + '/public/' + req.url));
});
server.listen(8080);
Clearly this would map `http://localhost:8080/index.html` to `project_dir/public/index.html`, and similarly so for all other files.
My one concern is that someone could abuse this to access files outside of `project_dir/public`. Something like this, for example:
http://localhost:8080/../../sensitive_file.txt
I tried this a little bit, and it wasn't working. But, it seems like my browser was removing the ".." itself. Which leads me to believe that someone could abuse my poor little node.js server.
I know there are npm packages that do static file serving. But I'm actually curious to write my own here. So my questions are:
1. Is this safe?
2. If so, why? If not, why not?
3. And, if further, if not, what is the "right" way to do this? My one constraint is I don't want to have to have an if clause for each possible file, I want the server to serve whatever files I throw in a directory. | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.