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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
8,323,426 | 11/30/2011 09:08:59 | 276,595 | 02/19/2010 00:33:36 | 363 | 6 | setup a linux server using CentOS | im really new to the linux side of things,iv instlled CentOS on a virtual machines using WMware and was wondering how i should go about setting it up to be a server. the main thing i want to be able to do is putty/ssh into CentOS.
any ideas on how this may be done | ssh | centos | putty | null | null | 11/30/2011 18:25:46 | off topic | setup a linux server using CentOS
===
im really new to the linux side of things,iv instlled CentOS on a virtual machines using WMware and was wondering how i should go about setting it up to be a server. the main thing i want to be able to do is putty/ssh into CentOS.
any ideas on how this may be done | 2 |
3,823,403 | 09/29/2010 15:55:57 | 3,798 | 08/30/2008 22:09:59 | 5,895 | 192 | Node.js Web Application examples/tutorials... | So I finished watching [Douglas Crockford][1]'s excellent series on Javascript, and in the final episode (so far), [loopage][2] he lays out why Node.js is a near perfect solution for server side code. He talks about keeping state, not in the database, but in closures running in Node.js, he also states that templating systems (like JSP, PHP, and ASP) are a poor abstraction for more complicated Web Applications and that node.js provides a solution to this. And I am ready to buy in, but I can't find any examples of Web Applications using this pattern, or any books or tutorials about how to go about doing this. I am not talking about a [simple application][3], but something that would use the patterns that Crockford spoke of in his talk. Anyone know where I can find some tutorials/examples of Web Applications written in Node.js (and yes I know about [Geddy][4] and [ExpressJs][5], but they don't seem to follow the radically different patterns that Crockford was speaking of, and were more like getting a Railsy experience on Node.js).
[1]: http://crockfordfacts.com/
[2]: http://www.yuiblog.com/blog/2010/08/30/yui-theater-douglas-crockford-crockford-on-javascript-scene-6-loopage-52-min/
[3]: http://stackoverflow.com/questions/2974083/could-someone-give-me-an-example-of-node-js-application
[4]: http://geddyjs.org/
[5]: http://expressjs.com/ | web-applications | node.js | null | null | null | 04/29/2012 09:24:40 | not constructive | Node.js Web Application examples/tutorials...
===
So I finished watching [Douglas Crockford][1]'s excellent series on Javascript, and in the final episode (so far), [loopage][2] he lays out why Node.js is a near perfect solution for server side code. He talks about keeping state, not in the database, but in closures running in Node.js, he also states that templating systems (like JSP, PHP, and ASP) are a poor abstraction for more complicated Web Applications and that node.js provides a solution to this. And I am ready to buy in, but I can't find any examples of Web Applications using this pattern, or any books or tutorials about how to go about doing this. I am not talking about a [simple application][3], but something that would use the patterns that Crockford spoke of in his talk. Anyone know where I can find some tutorials/examples of Web Applications written in Node.js (and yes I know about [Geddy][4] and [ExpressJs][5], but they don't seem to follow the radically different patterns that Crockford was speaking of, and were more like getting a Railsy experience on Node.js).
[1]: http://crockfordfacts.com/
[2]: http://www.yuiblog.com/blog/2010/08/30/yui-theater-douglas-crockford-crockford-on-javascript-scene-6-loopage-52-min/
[3]: http://stackoverflow.com/questions/2974083/could-someone-give-me-an-example-of-node-js-application
[4]: http://geddyjs.org/
[5]: http://expressjs.com/ | 4 |
1,774,905 | 11/21/2009 08:07:39 | 216,001 | 11/21/2009 08:07:39 | 1 | 0 | Silverlight data binding from VM issue | I have a SL 3.0 page with a lot of textblock controls laid out. Each textblock is bound to a property of the Account class. The XAML page codebehind (mypage.xaml.cs) has a OnNavigatedTo method in which the VM instance is created and set to the data context like this:
this.DataContext = new VM();
In the VM there is a public property of datatype Account and in the ctor of the VM a WCF service method is called asynchronously and in the callback method the Account property is set.
With all this, the data is not showing in the XAML view. Any help? | silverlight | data-binding | null | null | null | null | open | Silverlight data binding from VM issue
===
I have a SL 3.0 page with a lot of textblock controls laid out. Each textblock is bound to a property of the Account class. The XAML page codebehind (mypage.xaml.cs) has a OnNavigatedTo method in which the VM instance is created and set to the data context like this:
this.DataContext = new VM();
In the VM there is a public property of datatype Account and in the ctor of the VM a WCF service method is called asynchronously and in the callback method the Account property is set.
With all this, the data is not showing in the XAML view. Any help? | 0 |
10,891,086 | 06/05/2012 03:11:35 | 499,439 | 11/06/2010 20:17:28 | 872 | 9 | Algorithm for immediate string search in a number of text files | I'm writing a help system and I would like to implement the search in modern way, like e.g. it works now in Google search: when user only starts to type in query letters he immediately gets the result and each next letter makes the result set more specific.
What are the algorithms for indexing text and searching it this way?
Wikipedia or/and other links will be fine, no need to waste your time to detailed explanation. | search | full-text-search | null | null | null | null | open | Algorithm for immediate string search in a number of text files
===
I'm writing a help system and I would like to implement the search in modern way, like e.g. it works now in Google search: when user only starts to type in query letters he immediately gets the result and each next letter makes the result set more specific.
What are the algorithms for indexing text and searching it this way?
Wikipedia or/and other links will be fine, no need to waste your time to detailed explanation. | 0 |
2,144,091 | 01/27/2010 02:01:54 | 259,723 | 01/27/2010 02:01:54 | 1 | 0 | flash external ExternalInterface call in as2 | I have an external interface call which should retrieve some text from the html that the swf is embedded in.
var name:Object = flash.external.ExternalInterface.call("function(){return JSObject.get('Resource', 'name');}");
When I put the variable name into a textbox I get the correct text.
when I use geturl with a clickTag, under some circumstances it works (unencoded clickTag url). Sometimes it's undefined (encoded clickTag urls). If I use name.toString then it opens http://www.someurl.com/[type%20Function] or displays [type%20Function] in a textbox.
So I suspect that I'm having encoding issues when passing on the clickTag url. My question is, how do I convert this object to a string or assign the contents of the object to a string variable to avoid all this?
Thanks | actionscript-2 | flash | externalinterface | null | null | null | open | flash external ExternalInterface call in as2
===
I have an external interface call which should retrieve some text from the html that the swf is embedded in.
var name:Object = flash.external.ExternalInterface.call("function(){return JSObject.get('Resource', 'name');}");
When I put the variable name into a textbox I get the correct text.
when I use geturl with a clickTag, under some circumstances it works (unencoded clickTag url). Sometimes it's undefined (encoded clickTag urls). If I use name.toString then it opens http://www.someurl.com/[type%20Function] or displays [type%20Function] in a textbox.
So I suspect that I'm having encoding issues when passing on the clickTag url. My question is, how do I convert this object to a string or assign the contents of the object to a string variable to avoid all this?
Thanks | 0 |
7,204,545 | 08/26/2011 12:20:44 | 518,500 | 11/24/2010 08:40:13 | 341 | 26 | Output HTML in a RJ ERB template | This might be something silly really, but I can't get it to work at all...
I have vacation.js.erb which generates some javascript to update a page when the ajax call is done. The source of the file looks like this:
$('semantic').replace('<div id="semantic"></div>');
<%
html = '<table class="ajax">'
html += "<tr><td>EU - 27</td><td>#{@eu.value.value} days</td></tr>"
html += "<tr><td>#{@source.location.value}</td><td>#{@source.value.value } days></td></tr>" unless @source.location.value.blank?
html += "<tr><td>#{@cv.country.name}</td><td>No Data Available</td></tr>" if @source.location.value.blank?
html += "<tr><td>#{@target.location.value}</td><td>#{@target.value.value } days></td></tr>" unless @target.location.value.blank?
html += "<tr><td>#{@vacancy.country.name}</td><td>#{@target.value.value } days></td></tr>" if @target.location.value.blank?
html += "</table>"
%>
$('semantic').insert('<%= escape_javascript(html) %>');
I can cleary go through the code with the browser, but the last line is causing me troubles. It encodes the stuff in html to html entities, and I don't want this, cause it breaks the javascript. The response in Fiddler looks like this:
> $('semantic').replace('<div id="semantic"></div>');
> $('semantic').insert('<table
> class=\"ajax\"><tr><td>EU -
> 27<\/td><td>28
> days<\/td><\/tr><tr><td>gb<\/td><td>No
> Data Available<\/td><\/tr><tr><td>United
> Kingdom<\/td><td>29
> days><\/td><\/tr><\/table>');
How can I prevent the page from encoding the html variable?
I tried using ***<%! html %>*** but that returns nothing. | javascript | ruby-on-rails | ajax | prototype | null | null | open | Output HTML in a RJ ERB template
===
This might be something silly really, but I can't get it to work at all...
I have vacation.js.erb which generates some javascript to update a page when the ajax call is done. The source of the file looks like this:
$('semantic').replace('<div id="semantic"></div>');
<%
html = '<table class="ajax">'
html += "<tr><td>EU - 27</td><td>#{@eu.value.value} days</td></tr>"
html += "<tr><td>#{@source.location.value}</td><td>#{@source.value.value } days></td></tr>" unless @source.location.value.blank?
html += "<tr><td>#{@cv.country.name}</td><td>No Data Available</td></tr>" if @source.location.value.blank?
html += "<tr><td>#{@target.location.value}</td><td>#{@target.value.value } days></td></tr>" unless @target.location.value.blank?
html += "<tr><td>#{@vacancy.country.name}</td><td>#{@target.value.value } days></td></tr>" if @target.location.value.blank?
html += "</table>"
%>
$('semantic').insert('<%= escape_javascript(html) %>');
I can cleary go through the code with the browser, but the last line is causing me troubles. It encodes the stuff in html to html entities, and I don't want this, cause it breaks the javascript. The response in Fiddler looks like this:
> $('semantic').replace('<div id="semantic"></div>');
> $('semantic').insert('<table
> class=\"ajax\"><tr><td>EU -
> 27<\/td><td>28
> days<\/td><\/tr><tr><td>gb<\/td><td>No
> Data Available<\/td><\/tr><tr><td>United
> Kingdom<\/td><td>29
> days><\/td><\/tr><\/table>');
How can I prevent the page from encoding the html variable?
I tried using ***<%! html %>*** but that returns nothing. | 0 |
3,668,345 | 09/08/2010 13:47:22 | 363,503 | 06/10/2010 13:34:37 | 210 | 12 | Calculate percentage in rails ?? | Is there any method available to calculate percentage in rails or ruby ?? | ruby-on-rails | ruby | null | null | null | 09/08/2010 19:15:23 | not a real question | Calculate percentage in rails ??
===
Is there any method available to calculate percentage in rails or ruby ?? | 1 |
9,600,325 | 03/07/2012 11:08:34 | 1,228,062 | 02/23/2012 10:14:53 | 3 | 0 | Image was broken after inserting bone tool while move it | This is my first task using bone tool. while im working on seeing some tutorial. just i crop the image and import to flash. after that selecting layers (image)--> Breakapart. then remove the unwanted space. after that i insert bones and just try to move it. After that some portion of image has been deleted . i dont know what is happening. Help me in this situation | flash | flash-cs5 | photoshop | null | null | 03/07/2012 21:00:59 | off topic | Image was broken after inserting bone tool while move it
===
This is my first task using bone tool. while im working on seeing some tutorial. just i crop the image and import to flash. after that selecting layers (image)--> Breakapart. then remove the unwanted space. after that i insert bones and just try to move it. After that some portion of image has been deleted . i dont know what is happening. Help me in this situation | 2 |
5,931,757 | 05/09/2011 01:59:31 | 45,944 | 12/13/2008 09:14:40 | 840 | 40 | Hard PHP nut : how to insert items into one associate array? | Yes, this is a bit of a trick question; **one** array (without copies), as opposed to any odd array. Let me explain, so let's start here ;
$a = array ( 'one' => 1, 'two' => 2, 'three' => 3 ) ;
Pretend that this array is long, over a hundred long. I loop through it, step by step, but at some point (let's make up that this happens at the 20th item) something happens. Maybe the data is funky. Nevertheless, we need to add some items to it for later processing, and then keep looping through it, without loosing the current position. Basically, I would like something like this ;
array_insert ( 'the_key_where_I_want_to_insert', array ( 'new_key' => $data, ... ) ) ;
And I want to not to shift the current position in the array. Whenever you use array_splice, array_slice, array_push or most of the other array fiddling functions, you basically create a copy of the array, and then you can copy it back, but this breaks the reference to the original array and the position as well, and my loop above breaks. I could use direct reference (ie. `$a['new_item'] = 'whatever;`) or put it at the end, but none of these will insert items into a given position.
Any takers? How can I do a true insert into an associative array directly (that's being processed elsewhere)? My only solution so far is to ;
1. record the position (`current()`)
2. Do the splice/insert (array_slice)
3. overwrite old array with new ($old = $new)
4. search the new position (first reset() then looping through to find it [!!!!!!])
Surely there's a better, simpler and more elegant way for doing something that's currently kludgy, heavy and poorly hobbled together? | php | arrays | null | null | null | null | open | Hard PHP nut : how to insert items into one associate array?
===
Yes, this is a bit of a trick question; **one** array (without copies), as opposed to any odd array. Let me explain, so let's start here ;
$a = array ( 'one' => 1, 'two' => 2, 'three' => 3 ) ;
Pretend that this array is long, over a hundred long. I loop through it, step by step, but at some point (let's make up that this happens at the 20th item) something happens. Maybe the data is funky. Nevertheless, we need to add some items to it for later processing, and then keep looping through it, without loosing the current position. Basically, I would like something like this ;
array_insert ( 'the_key_where_I_want_to_insert', array ( 'new_key' => $data, ... ) ) ;
And I want to not to shift the current position in the array. Whenever you use array_splice, array_slice, array_push or most of the other array fiddling functions, you basically create a copy of the array, and then you can copy it back, but this breaks the reference to the original array and the position as well, and my loop above breaks. I could use direct reference (ie. `$a['new_item'] = 'whatever;`) or put it at the end, but none of these will insert items into a given position.
Any takers? How can I do a true insert into an associative array directly (that's being processed elsewhere)? My only solution so far is to ;
1. record the position (`current()`)
2. Do the splice/insert (array_slice)
3. overwrite old array with new ($old = $new)
4. search the new position (first reset() then looping through to find it [!!!!!!])
Surely there's a better, simpler and more elegant way for doing something that's currently kludgy, heavy and poorly hobbled together? | 0 |
9,549,157 | 03/03/2012 19:30:15 | 1,247,242 | 03/03/2012 19:21:32 | 1 | 0 | Can't seem to use a variable to redefine itself | I have a pretty straight forward program that graphs future growth based of a principal, apr, and years. This line of code works for me always in C++... so any ideas why this won't work?
principal = principal * (1 + apr)
| python | null | null | null | null | 03/03/2012 21:05:51 | not a real question | Can't seem to use a variable to redefine itself
===
I have a pretty straight forward program that graphs future growth based of a principal, apr, and years. This line of code works for me always in C++... so any ideas why this won't work?
principal = principal * (1 + apr)
| 1 |
8,108,295 | 11/12/2011 23:16:46 | 469,855 | 10/08/2010 04:59:23 | 406 | 3 | Intersection of sets | I'm trying to remember what the SQL solution is for this type of problem. Let's say I have the following tables:
`tagged_nodes`:
1. `nid` - Node id. Foreign key.
2. `tid` - Tag id. Foreign key.
3. `tnid` - Primary key (irrelevant to the problem at hand).
`nodes`:
1. `nid` - Node id. Primary key.
2. ... - Other columns are irrelevant.
Assuming I have a set of tag ids (`tid`), I want to return the set of associated nodes (intersection). How do I do this? | mysql | sql | null | null | null | null | open | Intersection of sets
===
I'm trying to remember what the SQL solution is for this type of problem. Let's say I have the following tables:
`tagged_nodes`:
1. `nid` - Node id. Foreign key.
2. `tid` - Tag id. Foreign key.
3. `tnid` - Primary key (irrelevant to the problem at hand).
`nodes`:
1. `nid` - Node id. Primary key.
2. ... - Other columns are irrelevant.
Assuming I have a set of tag ids (`tid`), I want to return the set of associated nodes (intersection). How do I do this? | 0 |
11,201,932 | 06/26/2012 06:39:50 | 428,073 | 08/23/2010 05:58:43 | 705 | 8 | How to read xml file in .net windows application in different directory? | I have one .net windows application I'm trying to read .xml file from c# windows application.
but i'm getting error :
>Could not find a part of the path 'c:\WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\~\Files\test.xml'.
but my file is in `Files` folder which is in application `WindowsFormsApplication1` only
not in `\bin\Debug`
then why it is searching into `\bin\Debug` ?
code in form.cs
DataSet dsAuthors = new DataSet("authors");
string filePath = @"~/Files/test.xml";
dsAuthors.ReadXml(filePath);
also please tell me is there any way to use Server.MapPath like we do it in web application.
| .net | xml | winforms | null | null | null | open | How to read xml file in .net windows application in different directory?
===
I have one .net windows application I'm trying to read .xml file from c# windows application.
but i'm getting error :
>Could not find a part of the path 'c:\WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\~\Files\test.xml'.
but my file is in `Files` folder which is in application `WindowsFormsApplication1` only
not in `\bin\Debug`
then why it is searching into `\bin\Debug` ?
code in form.cs
DataSet dsAuthors = new DataSet("authors");
string filePath = @"~/Files/test.xml";
dsAuthors.ReadXml(filePath);
also please tell me is there any way to use Server.MapPath like we do it in web application.
| 0 |
9,655,688 | 03/11/2012 14:17:19 | 1,128,551 | 01/03/2012 19:25:36 | 213 | 0 | Check State of Flat Button with PerfromClick() | How a flat button's check state could be changed with `PerformClick()`? This is needed when the form is loaded and that button should be checked as default. When I put `btn_General.PerformClick();` on load checkstate of button did not change. I mean there were no border around button. | c# | winforms | button | null | null | null | open | Check State of Flat Button with PerfromClick()
===
How a flat button's check state could be changed with `PerformClick()`? This is needed when the form is loaded and that button should be checked as default. When I put `btn_General.PerformClick();` on load checkstate of button did not change. I mean there were no border around button. | 0 |
7,583,110 | 09/28/2011 12:20:09 | 969,040 | 09/28/2011 12:16:52 | 1 | 0 | problem with sum of records in sql | I have a table where I have to two fields, cost and sales.
I am looking to get sum of values of these fields.
Now, if cost is missing, i must also neglect the corresponding sales field value when summing the fields.
How can I achieve this ? any suggestion,help is appreciated.
regards
Vijay V. | sum | common-table-expression | null | null | null | 09/29/2011 09:19:37 | not a real question | problem with sum of records in sql
===
I have a table where I have to two fields, cost and sales.
I am looking to get sum of values of these fields.
Now, if cost is missing, i must also neglect the corresponding sales field value when summing the fields.
How can I achieve this ? any suggestion,help is appreciated.
regards
Vijay V. | 1 |
8,446,475 | 12/09/2011 13:55:02 | 1,008,572 | 10/22/2011 13:15:45 | 78 | 0 | Java: Synchronize an ExecutorService necessary? | I have a class containing an ExecutorService that can be shared between threads, like:
class MyExecutor {
ExecutorService e = Executors.newSingleThreadExecutor();
....
....
public void add(Runnable r) {
e.executre(r);
}
}
Is it necessary to synchronize the ExecutorService object in the <code>add</code> method since the <code>add</code> method can be called from differens threads or is the ExecutorService thread safe?
| java | synchronization | executorservice | null | null | null | open | Java: Synchronize an ExecutorService necessary?
===
I have a class containing an ExecutorService that can be shared between threads, like:
class MyExecutor {
ExecutorService e = Executors.newSingleThreadExecutor();
....
....
public void add(Runnable r) {
e.executre(r);
}
}
Is it necessary to synchronize the ExecutorService object in the <code>add</code> method since the <code>add</code> method can be called from differens threads or is the ExecutorService thread safe?
| 0 |
8,214,646 | 11/21/2011 16:01:55 | 858,137 | 07/22/2011 14:35:13 | 7 | 0 | Fix PDF encoding | I have Arabic PDF Files and it seems that there are something wrong in its encoding .
When I try to search in the PDF for word inside it , it didn't find results
when I try to export the pdf contents to Excel using other programs it export data in a strange encoding
When I copy the data in the PDF to notepad , Notepad display strange encoding.
I am developing solution which will use these PDFs (about 950 file) so I must found a way to fix encoding.
Thanks in Advance | pdf | character-encoding | null | null | null | 11/22/2011 02:29:03 | too localized | Fix PDF encoding
===
I have Arabic PDF Files and it seems that there are something wrong in its encoding .
When I try to search in the PDF for word inside it , it didn't find results
when I try to export the pdf contents to Excel using other programs it export data in a strange encoding
When I copy the data in the PDF to notepad , Notepad display strange encoding.
I am developing solution which will use these PDFs (about 950 file) so I must found a way to fix encoding.
Thanks in Advance | 3 |
7,144,785 | 08/22/2011 08:26:58 | 905,481 | 08/22/2011 08:23:02 | 1 | 0 | problem on Virus queries and there working | I want to know how does virus attach itself to a program( eg exe,dll etc etc)
Whenever i google this question i only get the definition of virus and what it can do??
I hope anyone of you have my answers
Thank you | windows | null | null | null | null | 08/22/2011 10:29:43 | not a real question | problem on Virus queries and there working
===
I want to know how does virus attach itself to a program( eg exe,dll etc etc)
Whenever i google this question i only get the definition of virus and what it can do??
I hope anyone of you have my answers
Thank you | 1 |
9,202,573 | 02/08/2012 22:33:37 | 505,149 | 11/11/2010 23:00:59 | 1 | 0 | boost::bind placeholder issue when binding Handler to a boost::asio::strand |
void Connection::HandleRecvData(const boost::system::error_code & error)
{
boost::asio::async_read( m_socket, boost::asio::buffer( m_recv_buffer ),
m_io_strand.wrap( boost::bind( &Connection::HandleRecvData,
shared_from_this(), _1, _2 ) ) ); //works
boost::asio::async_read( m_socket, boost::asio::buffer( inbound_data_ ),
m_io_strand.wrap( boost::bind( &Connection::HandleRecv,
shared_from_this(), _1, _2 ) ) ); //doesn't work
}
Handler
void Connection::HandleRecv( const boost::system::error_code & error, int32_t actual_bytes )
{
if( error || HasError() || m_hive->HasStopped() )
{
StartError( error );
}
else
{
m_recv_buffer.resize( actual_bytes );
OnRecv( m_recv_buffer );
m_pending_recvs.pop_front();
if( !m_pending_recvs.empty() )
{
StartRecv( m_pending_recvs.front() );
}
}
}
Different buffer types:
std::vector< uint8_t > m_recv_buffer; //and
std::vector< char > m_recv_buffer;
I am not getting a compiler error but at runtime when the chain of events to recieve the data is kicked off the "&Connection::HandleRecv" is never called. I am assuming that it is because the function signature is incorrect when the placeholders are evaluated and the function is never called.
Can anyone help explain how the placeholders are evaluated/sub'd in.
I have checked the bind documentation and I see:
bind(&X::f, ref(x), _1)(i); // x.f(i)
bind(&X::f, &x, _1)(i); //(&x)->f(i)
bind(&X::f, x, _1)(i); // (internal copy of x).f(i)
bind(&X::f, p, _1)(i); // (internal copy of p)->f(i)
but there is no "(i)" when I am calling it.
boost::bind( &Connection::HandleRecvData, shared_from_this(), _1, _2 )
PS this is my first post any tips would be helpful as far as the level of detail I've provided and where I can be more clear in describing my issue next time. Thank you in advance. | c++ | boost | boost-asio | boost-bind | null | null | open | boost::bind placeholder issue when binding Handler to a boost::asio::strand
===
void Connection::HandleRecvData(const boost::system::error_code & error)
{
boost::asio::async_read( m_socket, boost::asio::buffer( m_recv_buffer ),
m_io_strand.wrap( boost::bind( &Connection::HandleRecvData,
shared_from_this(), _1, _2 ) ) ); //works
boost::asio::async_read( m_socket, boost::asio::buffer( inbound_data_ ),
m_io_strand.wrap( boost::bind( &Connection::HandleRecv,
shared_from_this(), _1, _2 ) ) ); //doesn't work
}
Handler
void Connection::HandleRecv( const boost::system::error_code & error, int32_t actual_bytes )
{
if( error || HasError() || m_hive->HasStopped() )
{
StartError( error );
}
else
{
m_recv_buffer.resize( actual_bytes );
OnRecv( m_recv_buffer );
m_pending_recvs.pop_front();
if( !m_pending_recvs.empty() )
{
StartRecv( m_pending_recvs.front() );
}
}
}
Different buffer types:
std::vector< uint8_t > m_recv_buffer; //and
std::vector< char > m_recv_buffer;
I am not getting a compiler error but at runtime when the chain of events to recieve the data is kicked off the "&Connection::HandleRecv" is never called. I am assuming that it is because the function signature is incorrect when the placeholders are evaluated and the function is never called.
Can anyone help explain how the placeholders are evaluated/sub'd in.
I have checked the bind documentation and I see:
bind(&X::f, ref(x), _1)(i); // x.f(i)
bind(&X::f, &x, _1)(i); //(&x)->f(i)
bind(&X::f, x, _1)(i); // (internal copy of x).f(i)
bind(&X::f, p, _1)(i); // (internal copy of p)->f(i)
but there is no "(i)" when I am calling it.
boost::bind( &Connection::HandleRecvData, shared_from_this(), _1, _2 )
PS this is my first post any tips would be helpful as far as the level of detail I've provided and where I can be more clear in describing my issue next time. Thank you in advance. | 0 |
11,635,579 | 07/24/2012 16:47:40 | 304,735 | 03/30/2010 02:01:37 | 160 | 18 | Twitter Embedded Tweets Remove @reply | Im trying to [embed a tweet][1] using twitter new embedded tweets but I dont want the @reply to show. Im hoping to embed multiple tweets from the same conversation but dont want redundant information.
[1]: https://dev.twitter.com/docs/embedded-tweets | javascript | api | twitter | embedded | tweets | null | open | Twitter Embedded Tweets Remove @reply
===
Im trying to [embed a tweet][1] using twitter new embedded tweets but I dont want the @reply to show. Im hoping to embed multiple tweets from the same conversation but dont want redundant information.
[1]: https://dev.twitter.com/docs/embedded-tweets | 0 |
7,341,780 | 09/08/2011 00:01:03 | 602,260 | 02/03/2011 21:22:13 | 364 | 19 | Putting hypertext link to external internet site inside javadoc | I want my javadoc to reference a dev manual that is on my intranet. I would like to know how to do this: I tried using see {@link http://json.org} but this just produced http://json.org and not a hypertext link. Lets say I wanted to point to some wiki page inside the javadoc. How can I do this. i am just trying to have link to external website. so I want somethink like Example as hypertext link and it points to a full url to website. Thanks | java | javadoc | null | null | null | null | open | Putting hypertext link to external internet site inside javadoc
===
I want my javadoc to reference a dev manual that is on my intranet. I would like to know how to do this: I tried using see {@link http://json.org} but this just produced http://json.org and not a hypertext link. Lets say I wanted to point to some wiki page inside the javadoc. How can I do this. i am just trying to have link to external website. so I want somethink like Example as hypertext link and it points to a full url to website. Thanks | 0 |
9,792,929 | 03/20/2012 18:40:26 | 1,200,442 | 02/09/2012 19:05:13 | 25 | 0 | Easiest Way To block a website programmatically | which is the easiest way to block a website in a PC programmatically?
I know about adding entry to hosts file, but there must be some other method..
i am looking for a method, which is a simple registry or file or settings hack which can be programmatically done (any language - but c/c# preferably)..
AND
**this method should work even under the least privilege...** (i mean even when user is not administrator) **and it should not issue any warning while blocking site**..
any such method? thanks | c# | c++ | c | registry | internet | 03/20/2012 18:56:37 | off topic | Easiest Way To block a website programmatically
===
which is the easiest way to block a website in a PC programmatically?
I know about adding entry to hosts file, but there must be some other method..
i am looking for a method, which is a simple registry or file or settings hack which can be programmatically done (any language - but c/c# preferably)..
AND
**this method should work even under the least privilege...** (i mean even when user is not administrator) **and it should not issue any warning while blocking site**..
any such method? thanks | 2 |
11,517,596 | 07/17/2012 07:09:41 | 954,029 | 09/20/2011 05:13:50 | 11 | 2 | Error installing Ubuntu in Windows 7 via wubi | am having problem in installing ubuntu in my windows 7. I had installed it earlier using Wubi but it got corrupted and now because of it i am not able to install any of the ubuntu version in Windows 7 via wubi. Someone please help me it is really getting frustrating. This is the error i have got
Exception: Error executing command
command=C:\Windows\sysnative\bcdedit.exe /create /d Ubuntu /application bootsector retval=1 stderr=The boot configuration data store could not be opened. The configuration registry database is corrupt.
Is there any way which will make my windows boot clean and remove ubuntu entry and let me install again. I am Rails Developer and it is very important for me to get ubuntu up and running
| ubuntu | installation | wubi | null | null | 07/17/2012 10:50:54 | off topic | Error installing Ubuntu in Windows 7 via wubi
===
am having problem in installing ubuntu in my windows 7. I had installed it earlier using Wubi but it got corrupted and now because of it i am not able to install any of the ubuntu version in Windows 7 via wubi. Someone please help me it is really getting frustrating. This is the error i have got
Exception: Error executing command
command=C:\Windows\sysnative\bcdedit.exe /create /d Ubuntu /application bootsector retval=1 stderr=The boot configuration data store could not be opened. The configuration registry database is corrupt.
Is there any way which will make my windows boot clean and remove ubuntu entry and let me install again. I am Rails Developer and it is very important for me to get ubuntu up and running
| 2 |
7,973,242 | 11/01/2011 21:36:21 | 745,240 | 05/09/2011 13:41:09 | 6 | 0 | NSIS - How to include all folders from source to Installer | I have an application which consists one exe, many dlls and a few folders.
I use NSIS to create an installer. It works but when I install the software, I don't see all the folders inside my application.
What do I have to do to bundle all the folders within my application into the installer?
This is the code I set the data source at this time:
File "c:\MyProject\MyApp\*"
Jdang
Thanks, | installer | include | nsis | folders | null | null | open | NSIS - How to include all folders from source to Installer
===
I have an application which consists one exe, many dlls and a few folders.
I use NSIS to create an installer. It works but when I install the software, I don't see all the folders inside my application.
What do I have to do to bundle all the folders within my application into the installer?
This is the code I set the data source at this time:
File "c:\MyProject\MyApp\*"
Jdang
Thanks, | 0 |
10,399,216 | 05/01/2012 14:34:30 | 1,096,407 | 12/13/2011 18:40:20 | 23 | 0 | One build for two different versions(4.6,4.7 and 5.0+above) in blackberry | I want to import facebook libraries for blackberry 5.0 and above and don't want to import those libraries for 4.6 and 4.7.
I tried to use preprocessors for 4.7 and above by following below link:
http://smartfone-more.blogspot.in/2010/05/coding-for-multiple-blackberry-devices.html
now its working fine with JDE 4.7 but not getting expected result for 5.0.
Please find the code below which i tried:
//#ifdef JDE_4_7_0
import net.rim.device.api.ui.component.ButtonField;
//#else
import net.rim.device.api.ui.component.LabelField;
//#endif
import net.rim.device.api.ui.container.MainScreen;
public class TestScreen extends MainScreen{
TestScreen(){
//#ifdef JDE_4_7_0
ButtonField btn = new ButtonField("Test Button");
add(btn);
//#else
LabelField lbl1 = new LabelField("Test Label 1");
add(lbl1);
//#endif
}
}
As per the code i am expecting the result written in else part for 5.0 and if part for 4.7.
I checked it on device as well as JDE both.
Please Help. | blackberry | preprocessor | blackberry-jde | null | null | null | open | One build for two different versions(4.6,4.7 and 5.0+above) in blackberry
===
I want to import facebook libraries for blackberry 5.0 and above and don't want to import those libraries for 4.6 and 4.7.
I tried to use preprocessors for 4.7 and above by following below link:
http://smartfone-more.blogspot.in/2010/05/coding-for-multiple-blackberry-devices.html
now its working fine with JDE 4.7 but not getting expected result for 5.0.
Please find the code below which i tried:
//#ifdef JDE_4_7_0
import net.rim.device.api.ui.component.ButtonField;
//#else
import net.rim.device.api.ui.component.LabelField;
//#endif
import net.rim.device.api.ui.container.MainScreen;
public class TestScreen extends MainScreen{
TestScreen(){
//#ifdef JDE_4_7_0
ButtonField btn = new ButtonField("Test Button");
add(btn);
//#else
LabelField lbl1 = new LabelField("Test Label 1");
add(lbl1);
//#endif
}
}
As per the code i am expecting the result written in else part for 5.0 and if part for 4.7.
I checked it on device as well as JDE both.
Please Help. | 0 |
7,343,683 | 09/08/2011 05:56:47 | 804,495 | 06/18/2011 12:31:15 | 672 | 35 | AS3 - Does timers interrupt current code? | I'm just curious about the implementation of timers as flash is single threaded.
If a timer event should fire, does it interrupt the current executing code, fire the event and then go back, or does it do something else?
Thanks | actionscript-3 | null | null | null | null | null | open | AS3 - Does timers interrupt current code?
===
I'm just curious about the implementation of timers as flash is single threaded.
If a timer event should fire, does it interrupt the current executing code, fire the event and then go back, or does it do something else?
Thanks | 0 |
7,323,288 | 09/06/2011 16:41:22 | 813,040 | 06/23/2011 20:23:55 | 146 | 7 | How does wcout work? | I noticed a weird problem while using wcout in a console application.
After calling a certain function, the rest of the wcout calls did not work at all. i.e. the output statements did not appear on the console.
I noticed that in the function, I had used a wide character array which was never assigned.
WCHAR wArray[1024];
wcout<<wArray<<endl;
It was after this call, all the other wcout's stopped working.
So, I was just curious to know what makes wcout different from cout, and why this problem occured, | c++ | visual-c++ | console | cout | null | null | open | How does wcout work?
===
I noticed a weird problem while using wcout in a console application.
After calling a certain function, the rest of the wcout calls did not work at all. i.e. the output statements did not appear on the console.
I noticed that in the function, I had used a wide character array which was never assigned.
WCHAR wArray[1024];
wcout<<wArray<<endl;
It was after this call, all the other wcout's stopped working.
So, I was just curious to know what makes wcout different from cout, and why this problem occured, | 0 |
9,080,875 | 01/31/2012 14:06:21 | 1,073,222 | 11/30/2011 11:24:57 | 78 | 3 | jQuery Flot: how to plot graph on top of background image? | How do I plot an graph on top of a background image?
I tried several methods, but nothing works. Argh ;)
With the code below only the images shows up, but no graph. How come? Maybe because the graph is plotted behind the image? I hope I can get some help.
Thanks in advance.
var data = [ [ ["overview_track_v2.png", -36627, -72447, 35374, 109983] ] , [ [-36627, 35374 ], [-72447, 109983] ] ];
var options = {
series: { images: { show: true } },
xaxis: { min: -36627, max: 35374 },
yaxis: { min: -72447, max: 109983 },
lines: { show: true },
grid: { hoverable: true, clickable: true },
};
var graph = $.plot.image.loadDataImages(data, options, function () {
$.plot($("#graphPosition"), data, options);
}); | jquery | flot | null | null | null | null | open | jQuery Flot: how to plot graph on top of background image?
===
How do I plot an graph on top of a background image?
I tried several methods, but nothing works. Argh ;)
With the code below only the images shows up, but no graph. How come? Maybe because the graph is plotted behind the image? I hope I can get some help.
Thanks in advance.
var data = [ [ ["overview_track_v2.png", -36627, -72447, 35374, 109983] ] , [ [-36627, 35374 ], [-72447, 109983] ] ];
var options = {
series: { images: { show: true } },
xaxis: { min: -36627, max: 35374 },
yaxis: { min: -72447, max: 109983 },
lines: { show: true },
grid: { hoverable: true, clickable: true },
};
var graph = $.plot.image.loadDataImages(data, options, function () {
$.plot($("#graphPosition"), data, options);
}); | 0 |
6,277,347 | 06/08/2011 10:27:11 | 785,966 | 06/06/2011 13:18:38 | 6 | 0 | Rails 3 performance | I want to implement a web app like stock exchange where the values will change all the time (let's say once in a sec). I probably will do it using ajax comet.
Because of the nature of the app the users will be somewhat concurrent and I'm worring a litle bit about perfomance.
These are my thoughts:
I want to make it in Rails 3, but I'm worring about performance. Any good hosting companies to choose? should I use cloud? Rails 3 in ruby 1.9.2 will be faster than php (including db queries)?
I could make it in Play framework, which probably has not perfomance issues, but i'd like to make changes on the fly (if needed) in production, without re-deploy etc. Also I like rails a bit more.
I could make it in PHP but it' will take more time, more code
I don't have experiance in *real* production systems with Rails or Play so i don't know much about performance. Can any one help? | php | ruby-on-rails | ruby-on-rails-3 | playframework | ruby-1.9.2 | 06/08/2011 11:16:03 | not a real question | Rails 3 performance
===
I want to implement a web app like stock exchange where the values will change all the time (let's say once in a sec). I probably will do it using ajax comet.
Because of the nature of the app the users will be somewhat concurrent and I'm worring a litle bit about perfomance.
These are my thoughts:
I want to make it in Rails 3, but I'm worring about performance. Any good hosting companies to choose? should I use cloud? Rails 3 in ruby 1.9.2 will be faster than php (including db queries)?
I could make it in Play framework, which probably has not perfomance issues, but i'd like to make changes on the fly (if needed) in production, without re-deploy etc. Also I like rails a bit more.
I could make it in PHP but it' will take more time, more code
I don't have experiance in *real* production systems with Rails or Play so i don't know much about performance. Can any one help? | 1 |
11,705,554 | 07/28/2012 23:44:07 | 1,560,299 | 07/28/2012 23:37:29 | 1 | 0 | make with vim using Intel Fortran | I have a project with Fortran and I use gvim as my editor. When I use gfortran as my compiler in my makefile, I encounter no problems. I also have a version of the makefile that uses intel fortran and that makefile also works fine when called from the terminal.
My problem is within gvim. Gfortran version of my makefile works great when called within vim with :make and it shows me the errors and jumps to them etc. However, when I use the ifort version, :make command in vim gives me an error saying he could not find ifort.
ifort works fine from the terminal. I have both ~/.bashrc and /etc/bash.bashrc edited so that it sources intel compilers. I use Crunchbang Waldorf (read: Debian Testing) and I remember having the same problem in LMDE.
Any help is greatly appreciated | vim | make | fortran | debian | null | null | open | make with vim using Intel Fortran
===
I have a project with Fortran and I use gvim as my editor. When I use gfortran as my compiler in my makefile, I encounter no problems. I also have a version of the makefile that uses intel fortran and that makefile also works fine when called from the terminal.
My problem is within gvim. Gfortran version of my makefile works great when called within vim with :make and it shows me the errors and jumps to them etc. However, when I use the ifort version, :make command in vim gives me an error saying he could not find ifort.
ifort works fine from the terminal. I have both ~/.bashrc and /etc/bash.bashrc edited so that it sources intel compilers. I use Crunchbang Waldorf (read: Debian Testing) and I remember having the same problem in LMDE.
Any help is greatly appreciated | 0 |
9,607,769 | 03/07/2012 19:25:52 | 518,298 | 11/24/2010 03:41:53 | 151 | 6 | Appstats and python27 | Are the Appstats examples on this page valid for webapp2/python27?
http://code.google.com/appengine/docs/python/tools/appstats.html
def webapp_add_wsgi_middleware(app):
from google.appengine.ext.appstats import recording
app = recording.appstats_wsgi_middleware(app)
return app
Carl | google-app-engine | python-2.7 | null | null | null | 03/07/2012 20:25:54 | too localized | Appstats and python27
===
Are the Appstats examples on this page valid for webapp2/python27?
http://code.google.com/appengine/docs/python/tools/appstats.html
def webapp_add_wsgi_middleware(app):
from google.appengine.ext.appstats import recording
app = recording.appstats_wsgi_middleware(app)
return app
Carl | 3 |
11,324,338 | 07/04/2012 07:29:29 | 1,500,756 | 07/04/2012 06:53:21 | 1 | 0 | Is it possible to define the inherited hook for the ActionController::Base class in Rails 2.3.11 | I am trying to implement the inherited method for ActionController::Base class. My purpose is to call methods on classes that inherit from ActionController::Base like ApplicationController to make them include certain modules.
At the momement my Code looks like this:
module MyModule
def inherited(child)
end
def my_test_method()
end
end
ActionController::Base.send(:extend, MyModule)
ActionController::Base.methods.include? 'my_test_method'
=> true
ActionController::Base.methods.include? 'inherited'
=> false
The code is called out of an init file of a plugin. | plugins | module | ruby-on-rails-2 | inherited | development-mode | null | open | Is it possible to define the inherited hook for the ActionController::Base class in Rails 2.3.11
===
I am trying to implement the inherited method for ActionController::Base class. My purpose is to call methods on classes that inherit from ActionController::Base like ApplicationController to make them include certain modules.
At the momement my Code looks like this:
module MyModule
def inherited(child)
end
def my_test_method()
end
end
ActionController::Base.send(:extend, MyModule)
ActionController::Base.methods.include? 'my_test_method'
=> true
ActionController::Base.methods.include? 'inherited'
=> false
The code is called out of an init file of a plugin. | 0 |
9,704,678 | 03/14/2012 15:12:09 | 1,257,505 | 03/08/2012 16:33:28 | 1 | 0 | play framework version 1.2.4 | i'm new to play framework using java. I decided to start with a simple To-do list. I found some documentation online but only supporting play 2.0 and they are importing views and using the predefined ToDo method, problem is i'm only working on version 1.2.4 so any help about what can be used instead of importing views and using ToDo the redefined method? | java | playframework | null | null | null | 03/15/2012 12:24:48 | off topic | play framework version 1.2.4
===
i'm new to play framework using java. I decided to start with a simple To-do list. I found some documentation online but only supporting play 2.0 and they are importing views and using the predefined ToDo method, problem is i'm only working on version 1.2.4 so any help about what can be used instead of importing views and using ToDo the redefined method? | 2 |
6,956,343 | 08/05/2011 12:34:35 | 575,281 | 01/14/2011 05:46:14 | 586 | 7 | How to yank between vi editors, without quitting one? | I have opened two vi editors: `vi file1 file2`. Now file1 opens first, and i want to yank some lines from file1 and put it to file 2 **without quitting file1, because more lines can be yanked**, so it is just switching between vi's and yanking.
How to achieve it? | vi | yank | null | null | null | null | open | How to yank between vi editors, without quitting one?
===
I have opened two vi editors: `vi file1 file2`. Now file1 opens first, and i want to yank some lines from file1 and put it to file 2 **without quitting file1, because more lines can be yanked**, so it is just switching between vi's and yanking.
How to achieve it? | 0 |
6,556,078 | 07/02/2011 09:08:08 | 42,188 | 12/01/2008 16:51:28 | 2,981 | 97 | How to read a CSV file from a stream and process each line as it is written? | I would like to read a CSV file from the standard input and process each row as it comes. My CSV outputting code writes rows one by one, but my reader waits the stream to be terminated before iterating the rows. Is this a limitation of `csv` module? Am I doing something wrong?
My reader code:
import csv
import sys
import time
reader = csv.reader(sys.stdin)
for row in reader:
print "Read: (%s) %r" % (time.time(), row)
My writer code:
import csv
import sys
import time
writer = csv.writer(sys.stdout)
for i in range(8):
writer.writerow(["R%d" % i, "$" * (i+1)])
sys.stdout.flush()
time.sleep(0.5)
Output of `python test_writer.py | python test_reader.py`:
Read: (1309597426.3) ['R0', '$']
Read: (1309597426.3) ['R1', '$$']
Read: (1309597426.3) ['R2', '$$$']
Read: (1309597426.3) ['R3', '$$$$']
Read: (1309597426.3) ['R4', '$$$$$']
Read: (1309597426.3) ['R5', '$$$$$$']
Read: (1309597426.3) ['R6', '$$$$$$$']
Read: (1309597426.3) ['R7', '$$$$$$$$']
As you can see all print statements are executed at the same time, but I expect there to be a 500ms gap. | python | csv | stream | line-by-line | null | null | open | How to read a CSV file from a stream and process each line as it is written?
===
I would like to read a CSV file from the standard input and process each row as it comes. My CSV outputting code writes rows one by one, but my reader waits the stream to be terminated before iterating the rows. Is this a limitation of `csv` module? Am I doing something wrong?
My reader code:
import csv
import sys
import time
reader = csv.reader(sys.stdin)
for row in reader:
print "Read: (%s) %r" % (time.time(), row)
My writer code:
import csv
import sys
import time
writer = csv.writer(sys.stdout)
for i in range(8):
writer.writerow(["R%d" % i, "$" * (i+1)])
sys.stdout.flush()
time.sleep(0.5)
Output of `python test_writer.py | python test_reader.py`:
Read: (1309597426.3) ['R0', '$']
Read: (1309597426.3) ['R1', '$$']
Read: (1309597426.3) ['R2', '$$$']
Read: (1309597426.3) ['R3', '$$$$']
Read: (1309597426.3) ['R4', '$$$$$']
Read: (1309597426.3) ['R5', '$$$$$$']
Read: (1309597426.3) ['R6', '$$$$$$$']
Read: (1309597426.3) ['R7', '$$$$$$$$']
As you can see all print statements are executed at the same time, but I expect there to be a 500ms gap. | 0 |
10,098,127 | 04/10/2012 23:58:55 | 437,223 | 09/01/2010 17:52:09 | 118 | 1 | How to get to shoulders localization on image photo? | I'm sorry, I'm writing it there. I'm doing it becouse I know that a lot of programers are interested in image processing, computer vision. If I did it wrong, I ask you to advise, which of forum is the most suitable.
I have a project on my university. I have to localize from video where are shoulders of person in movie.
Do have any advise how to get to this?
I thought about corner detection or some kind of shape detection. But I'm still not sure what next. We can treat video like image sequence (I wrote this, but I think is obvious) | image-processing | computer-vision | null | null | null | null | open | How to get to shoulders localization on image photo?
===
I'm sorry, I'm writing it there. I'm doing it becouse I know that a lot of programers are interested in image processing, computer vision. If I did it wrong, I ask you to advise, which of forum is the most suitable.
I have a project on my university. I have to localize from video where are shoulders of person in movie.
Do have any advise how to get to this?
I thought about corner detection or some kind of shape detection. But I'm still not sure what next. We can treat video like image sequence (I wrote this, but I think is obvious) | 0 |
8,794,344 | 01/09/2012 19:56:39 | 1,052,781 | 11/17/2011 22:05:10 | 1 | 0 | How do I build a large jquery-based website? | I want to start a new project, a large jquery application/website. I want the site to function a lot like twitter or github, very dynamic, very fluid/smooth, etc...
My problem is I don't know where to start. I've read countless blog posts, investigated many JS frameworks / templating & MVC type systems.
When I write JS code, should I put everything into a single file? Or should I breakout each plugin I write into separate files and then use a JS loader like Respond.JS?
I think I need a templating system though to get the hashtag navigation to work, so I'm looking at either Backbone.JS or Mustache/Handlebars.JS
Does anyone have a starting point for this? Perhaps a boilerplate solution / development pattern that I can follow?
Thanks! | jquery | jquery-ui | backbone.js | bootstrap | mustache.js | 01/10/2012 05:34:28 | not a real question | How do I build a large jquery-based website?
===
I want to start a new project, a large jquery application/website. I want the site to function a lot like twitter or github, very dynamic, very fluid/smooth, etc...
My problem is I don't know where to start. I've read countless blog posts, investigated many JS frameworks / templating & MVC type systems.
When I write JS code, should I put everything into a single file? Or should I breakout each plugin I write into separate files and then use a JS loader like Respond.JS?
I think I need a templating system though to get the hashtag navigation to work, so I'm looking at either Backbone.JS or Mustache/Handlebars.JS
Does anyone have a starting point for this? Perhaps a boilerplate solution / development pattern that I can follow?
Thanks! | 1 |
11,077,795 | 06/18/2012 06:22:07 | 1,141,387 | 01/10/2012 17:10:00 | 1 | 0 | Cross platform data syncing ( text data ) | Can anyone of you help me finding cross platform data (text data) syncing technology? | text | data | synchronization | cross-platform | null | 06/18/2012 14:51:45 | not constructive | Cross platform data syncing ( text data )
===
Can anyone of you help me finding cross platform data (text data) syncing technology? | 4 |
9,347,349 | 02/19/2012 06:50:44 | 1,191,763 | 02/06/2012 07:16:58 | 11 | 2 | Assigning a number to a level in cocos2d | Yo,
I want to make a method that adds a number to another number. This number will be assigned to the game level, and as the number goes up, the game gets harder. At the end of each level, I will play this method, and therefore the level number will go up. I know that this is really simple, I just can't seem to get my head around it, don't laugh!
Thank you. | ios | xcode | cocos2d-iphone | cocos2d | level | null | open | Assigning a number to a level in cocos2d
===
Yo,
I want to make a method that adds a number to another number. This number will be assigned to the game level, and as the number goes up, the game gets harder. At the end of each level, I will play this method, and therefore the level number will go up. I know that this is really simple, I just can't seem to get my head around it, don't laugh!
Thank you. | 0 |
7,251,858 | 08/31/2011 02:11:56 | 920,830 | 08/31/2011 02:11:56 | 1 | 0 | I need to match and expand a tiny url with javascript | I need to match and expand a tiny url with javascript:
http://t.co/qJEZPFk
No luck with
text.match(/http:\/\/t\.co.*/i) | javascript | url | tinyurl | null | null | null | open | I need to match and expand a tiny url with javascript
===
I need to match and expand a tiny url with javascript:
http://t.co/qJEZPFk
No luck with
text.match(/http:\/\/t\.co.*/i) | 0 |
8,710,062 | 01/03/2012 09:19:27 | 343,302 | 05/17/2010 17:43:03 | 296 | 15 | PHP: What is wrong with mysql_*? | In the SO PHP chat room some people discussed avoiding the mysql_* functions. I only read this hours afterward so could not ask what the reasons are. So, why should the mysql_* functions be avoided? What to use instead?
Thanks. | php | mysql | null | null | null | 01/03/2012 09:30:07 | not constructive | PHP: What is wrong with mysql_*?
===
In the SO PHP chat room some people discussed avoiding the mysql_* functions. I only read this hours afterward so could not ask what the reasons are. So, why should the mysql_* functions be avoided? What to use instead?
Thanks. | 4 |
5,659,959 | 04/14/2011 07:29:42 | 705,956 | 04/13/2011 11:45:17 | 1 | 0 | how to solve issue unencrypted login request | how to solve issue unencrypted login request
Thanks | c# | asp.net | null | null | null | 04/14/2011 07:39:22 | not a real question | how to solve issue unencrypted login request
===
how to solve issue unencrypted login request
Thanks | 1 |
11,367,234 | 07/06/2012 17:48:33 | 783,487 | 06/03/2011 23:29:44 | 13 | 4 | * { margin:0; padding:0; } in 2012 | What is the current state of differences in browser rendering? This method of "CSS Resetting" is certainly inefficient, is it ever necessary with today's modern browsers? | html | css | html5 | browser | cross-browser | 07/06/2012 19:01:54 | not constructive | * { margin:0; padding:0; } in 2012
===
What is the current state of differences in browser rendering? This method of "CSS Resetting" is certainly inefficient, is it ever necessary with today's modern browsers? | 4 |
3,958,569 | 10/18/2010 11:18:27 | 293,436 | 03/14/2010 15:21:50 | 206 | 9 | I have a problem of null pointer Exception in servlet . | HI, all
I have a problem of null pointer Exception in servlet .
I have a form a.jsp with check box if I do not select this check box and submit form then null pointer exception is occur in a.servlet.
How I Can handle this Exception
Thanks
| jsp | servlets | null | null | null | 10/19/2010 00:31:40 | not a real question | I have a problem of null pointer Exception in servlet .
===
HI, all
I have a problem of null pointer Exception in servlet .
I have a form a.jsp with check box if I do not select this check box and submit form then null pointer exception is occur in a.servlet.
How I Can handle this Exception
Thanks
| 1 |
1,852,409 | 12/05/2009 14:58:34 | 209,733 | 11/12/2009 15:51:19 | 1 | 1 | MFMailComposerController | hiii. i am new to iphone ..
i want to use MFMailComposer plz guide me how to use . i am not getting any right way to do..
if so possible give the code... | mfmailcomposeviewcontroll | null | null | null | null | 07/22/2012 13:49:09 | not a real question | MFMailComposerController
===
hiii. i am new to iphone ..
i want to use MFMailComposer plz guide me how to use . i am not getting any right way to do..
if so possible give the code... | 1 |
6,418,273 | 06/20/2011 22:22:35 | 265,706 | 02/03/2010 22:06:04 | 350 | 21 | SQL Server Proper Indefinite Article | Help me with my documentation, please.
Which is proper?
If you have a SQL Server... (*sequel* Server)
or
If you have an SQL Server... (*s-q-l* Server)
Thanks. | sql-server | documentation | null | null | null | 06/21/2011 09:02:09 | off topic | SQL Server Proper Indefinite Article
===
Help me with my documentation, please.
Which is proper?
If you have a SQL Server... (*sequel* Server)
or
If you have an SQL Server... (*s-q-l* Server)
Thanks. | 2 |
5,499,816 | 03/31/2011 12:26:36 | 621,665 | 02/17/2011 15:40:28 | 38 | 6 | Orchard CMS - theming | I have some questions regarding theming Orchard CMS. So, let's begin... I have a website that will have 5 pages and some of them have different layouts.
Pages and zones within it:
**Homepage** - Content, TripelFirst, TripelSecond, TripelThird
<br/>**Concept** and **Rentals** page - Content, AsideFirst, AsideSecond
<br/>**Press** and **Service Department** page - Content, AsideFirst, AsideSecond (different layout then the previous two pages)
Note: Even though all of the pages have the Content zone, except Homepage none of the pages uses it. Other pages only have HTML widgets located in one of the zones.
1) I've read that it is possible to create the layout for the specific ID, the problem is I can't find that ID to create the layout for specific ID.
2) As you can see, couple of pages have the same layout, how to assign them to the specific layout? For example, if I create the layout for **Concept** and **Rentals** page how can I assign the specific layout to them.
3) How to add the class tag to the body? The problem is that Orchard CMS creates the body before everything else so it isn't contained in the layout cshtml files.
Thank you in advance! | html | css | asp.net-mvc | orchardcms | theming | null | open | Orchard CMS - theming
===
I have some questions regarding theming Orchard CMS. So, let's begin... I have a website that will have 5 pages and some of them have different layouts.
Pages and zones within it:
**Homepage** - Content, TripelFirst, TripelSecond, TripelThird
<br/>**Concept** and **Rentals** page - Content, AsideFirst, AsideSecond
<br/>**Press** and **Service Department** page - Content, AsideFirst, AsideSecond (different layout then the previous two pages)
Note: Even though all of the pages have the Content zone, except Homepage none of the pages uses it. Other pages only have HTML widgets located in one of the zones.
1) I've read that it is possible to create the layout for the specific ID, the problem is I can't find that ID to create the layout for specific ID.
2) As you can see, couple of pages have the same layout, how to assign them to the specific layout? For example, if I create the layout for **Concept** and **Rentals** page how can I assign the specific layout to them.
3) How to add the class tag to the body? The problem is that Orchard CMS creates the body before everything else so it isn't contained in the layout cshtml files.
Thank you in advance! | 0 |
10,420,913 | 05/02/2012 20:10:34 | 1,250,957 | 03/05/2012 22:45:21 | 1 | 0 | Could someone help me write a very teensy-weensy js piece? | A WordPress plugin is misbehaving and creating event list entries which reload the page rather than anchor to the address desired.
All I want the script to say is "any anchors within #calendar do not go where they originally intended, and instead go to 'URL_of_my_choosing'"
Even just disabling the anchors would be better than having them reload the page. I want them to link to the full-sized calendar, though.
If you want to view the site, it is at http://www.recoursemediation.com/development/
The offending event list is housed in the sidebar. The full-sized calendar works fine.
Thanks for any help. I am very behind on this project and a serious JS amateur, or else I would just bite the bullet and spend an entire day trying to write it myself. | javascript | calendar | wordpress-plugin | null | null | 05/02/2012 20:17:47 | not a real question | Could someone help me write a very teensy-weensy js piece?
===
A WordPress plugin is misbehaving and creating event list entries which reload the page rather than anchor to the address desired.
All I want the script to say is "any anchors within #calendar do not go where they originally intended, and instead go to 'URL_of_my_choosing'"
Even just disabling the anchors would be better than having them reload the page. I want them to link to the full-sized calendar, though.
If you want to view the site, it is at http://www.recoursemediation.com/development/
The offending event list is housed in the sidebar. The full-sized calendar works fine.
Thanks for any help. I am very behind on this project and a serious JS amateur, or else I would just bite the bullet and spend an entire day trying to write it myself. | 1 |
9,263,279 | 02/13/2012 15:38:17 | 794,846 | 06/12/2011 15:09:11 | 97 | 0 | Detecting mp4 files on page and automatically wrapping them in jwplayer? | I am trying to add jw player to a custom cms where a user can add an mp4 file and it appears in the page as a link. But what I would like to do is detect each mp4 file on the page and have jw player wrap each mp4 file on the page and allow it to be played. Is this possible? If so is there an example of this somewhere.
| javascript | jquery | jwplayer | null | null | null | open | Detecting mp4 files on page and automatically wrapping them in jwplayer?
===
I am trying to add jw player to a custom cms where a user can add an mp4 file and it appears in the page as a link. But what I would like to do is detect each mp4 file on the page and have jw player wrap each mp4 file on the page and allow it to be played. Is this possible? If so is there an example of this somewhere.
| 0 |
1,977,717 | 12/30/2009 00:08:44 | 112,924 | 05/27/2009 06:11:29 | 44 | 5 | css tabs wont work as a link | here is the site i am having problems with
http://www.iaddesign.com/avola
when i try to click on the tabs it wont work. i have a hover affect with css and cant figure out how to make the tabs work.
let me know thanks. | css | null | null | null | null | 01/23/2012 21:11:09 | not a real question | css tabs wont work as a link
===
here is the site i am having problems with
http://www.iaddesign.com/avola
when i try to click on the tabs it wont work. i have a hover affect with css and cant figure out how to make the tabs work.
let me know thanks. | 1 |
19,442 | 08/21/2008 07:26:27 | 479 | 08/06/2008 08:37:10 | 142 | 10 | how to allow files starting with period and no extension in windows 2003 server? | How can I create this file in a directory in windows 2003 SP2:
.hgignore
I get error: You must type a file name.
| mercurial | windows2003server | null | null | null | 02/15/2011 19:56:23 | off topic | how to allow files starting with period and no extension in windows 2003 server?
===
How can I create this file in a directory in windows 2003 SP2:
.hgignore
I get error: You must type a file name.
| 2 |
11,311,493 | 07/03/2012 13:00:56 | 1,451,464 | 06/12/2012 14:22:33 | 8 | 0 | How to launch a windows mobile application on startup | I have a simple question about a windows mobile application I have written. I would like to run it every time the device boots (it checks OS version and installs apps). I read about an autorun.exe file but cant find enough information on it. How can I set up my application to be ran every time the device boots. Thank you | windows | mobile | reboot | autorun | null | 07/18/2012 16:15:21 | not a real question | How to launch a windows mobile application on startup
===
I have a simple question about a windows mobile application I have written. I would like to run it every time the device boots (it checks OS version and installs apps). I read about an autorun.exe file but cant find enough information on it. How can I set up my application to be ran every time the device boots. Thank you | 1 |
11,380,096 | 07/08/2012 01:56:21 | 1,292,279 | 03/26/2012 05:56:29 | 6 | 0 | iPhone button actions | The issue I am having is that when I am in my main storyboard for my iPhone app and I control-click and drag my button to the .h file i want to associate it with, nothing happens in the .h file and its really confusing me. I have other pages in the same storyboard that this method worked just fine with. I'm not sure why this is happening.
Not sure if it matters but the last time i tried the click drag was before i released this app, and now i am working on a update for it.
Any one else have this issue? i had found one possible solution that worked for someone (clearing the PRAM) but that did help me.
Thank You. | iphone | xcode | button | storyboard | null | null | open | iPhone button actions
===
The issue I am having is that when I am in my main storyboard for my iPhone app and I control-click and drag my button to the .h file i want to associate it with, nothing happens in the .h file and its really confusing me. I have other pages in the same storyboard that this method worked just fine with. I'm not sure why this is happening.
Not sure if it matters but the last time i tried the click drag was before i released this app, and now i am working on a update for it.
Any one else have this issue? i had found one possible solution that worked for someone (clearing the PRAM) but that did help me.
Thank You. | 0 |
10,071,257 | 04/09/2012 09:22:02 | 1,321,549 | 04/09/2012 09:19:24 | 1 | 0 | Need LinkedIn Developer Toolkit -- Anyone have it? | The LinkedIn Developer Toolkit on CodePlex has removed the download of that project and I urgently need to get started with the API; can I get it from anyone who has already downloaded it? Thanks in advance. | linkedin | null | null | null | null | null | open | Need LinkedIn Developer Toolkit -- Anyone have it?
===
The LinkedIn Developer Toolkit on CodePlex has removed the download of that project and I urgently need to get started with the API; can I get it from anyone who has already downloaded it? Thanks in advance. | 0 |
10,630,252 | 05/17/2012 05:24:40 | 1,278,315 | 03/19/2012 10:15:20 | 256 | 23 | Which one is better - datatable or datagrid? | Datatabe or Datagrid is better while displaying on a UI component like form or grid and while tranferring across applications?
Also,which one is better for updations like row insert,delete,etc ... from the code? | user-interface | datagrid | datatable | custom-component | displaying | 05/17/2012 22:24:24 | not constructive | Which one is better - datatable or datagrid?
===
Datatabe or Datagrid is better while displaying on a UI component like form or grid and while tranferring across applications?
Also,which one is better for updations like row insert,delete,etc ... from the code? | 4 |
3,540,760 | 08/22/2010 08:37:13 | 402,089 | 07/26/2010 09:14:55 | 26 | 0 | javascript - shortcut for calling a function at the same time it is defined | to call a function at the same time it's defined, i had been using:
var newfunc = function() {
alert('hi');
};
newfunc();
is the following the correct way of combining these 2:
var newfunc = function() {
alert('hi');
}(); | javascript | function | null | null | null | null | open | javascript - shortcut for calling a function at the same time it is defined
===
to call a function at the same time it's defined, i had been using:
var newfunc = function() {
alert('hi');
};
newfunc();
is the following the correct way of combining these 2:
var newfunc = function() {
alert('hi');
}(); | 0 |
8,738,252 | 01/05/2012 05:54:12 | 1,103,043 | 12/17/2011 03:35:50 | 1 | 0 | How To Remove ‌ in paragraph | Hell All,
When I copy some of the text from OpenOffice and I wrap that with p(paragraph) tag in an html file and when I open html file there are more space between the paragraphs and I search it why it have more space between the paragraph with the firebug and paragraph text show in firebug with zwnj; And I am sure I didn't add zwnj; in my paragraph text. | html | null | null | null | null | 01/06/2012 05:37:09 | off topic | How To Remove ‌ in paragraph
===
Hell All,
When I copy some of the text from OpenOffice and I wrap that with p(paragraph) tag in an html file and when I open html file there are more space between the paragraphs and I search it why it have more space between the paragraph with the firebug and paragraph text show in firebug with zwnj; And I am sure I didn't add zwnj; in my paragraph text. | 2 |
4,274,661 | 11/25/2010 07:35:18 | 154,353 | 08/11/2009 13:08:29 | 33 | 2 | Implementing a single sign on for a set of WCF services | I'm developing a set of WCF services that theoretically can be used stand-alone, but in practice have some sort of a client that usually makes multiple calls over the services in a single session.
Our backend authentication mechanism is quite heavy and requires calls to another authentication provider service.
However, I would like to avoid the overhead of doing the authentication on every invocation of a service.
looking for patterns /architectural guidance around this.
Thanks ! | wcf | single-sign-on | null | null | null | null | open | Implementing a single sign on for a set of WCF services
===
I'm developing a set of WCF services that theoretically can be used stand-alone, but in practice have some sort of a client that usually makes multiple calls over the services in a single session.
Our backend authentication mechanism is quite heavy and requires calls to another authentication provider service.
However, I would like to avoid the overhead of doing the authentication on every invocation of a service.
looking for patterns /architectural guidance around this.
Thanks ! | 0 |
2,566,027 | 04/02/2010 09:59:29 | 307,562 | 03/16/2010 07:16:13 | 1 | 0 | Wht is d use of typedef? | Wht is d use of typedef keyword in C ?
When we need it? | c | null | null | null | null | null | open | Wht is d use of typedef?
===
Wht is d use of typedef keyword in C ?
When we need it? | 0 |
254,048 | 10/31/2008 16:09:43 | 578 | 08/06/2008 22:07:45 | 332 | 24 | How to run an ASP.NET application with verbose debug messages of the ASP.NET runtime | How do I configure an ASP.NET application to write **verbose** log messages of what ASP.NET engine itself is doing. What I get with
<trace enabled="true"
pageOutput="false"
requestLimit="10000"
writeToDiagnosticsTrace="true"/>
is just as much as
> [2488] aspx.page: Begin PreInit
> [2488] aspx.page: End PreInit [2488]
> aspx.page: Begin Init [2488]
> Unhandled Execution Error: -- Object
> reference not set to an instance of an
> object.: at ...
>
> ...
>
> [2488] aspx.page: Begin PreInit
> [2488] aspx.page: End PreInit [2488]
> aspx.page: Begin Init [2488]
> aspx.page: End Init [2488] aspx.page:
> Begin InitComplete [2488] aspx.page:
> End InitComplete [2488] aspx.page:
> Begin PreLoad [2488] aspx.page: End
> PreLoad [2488] aspx.page: Begin Load
> [2488] aspx.page: End Load [2488]
> aspx.page: Begin LoadComplete [2488]
> aspx.page: End LoadComplete [2488]
> aspx.page: Begin PreRender [2488]
> aspx.page: End PreRender [2488]
> aspx.page: Begin PreRenderComplete
> [2488] aspx.page: End
> PreRenderComplete [2488] aspx.page:
> Begin SaveState [2488] aspx.page: End
> SaveState [2488] aspx.page: Begin
> SaveStateComplete [2488] aspx.page:
> End SaveStateComplete [2488]
> aspx.page: Begin Render [2488]
> aspx.page: End Render
I there a way to get more verbosity?
What's about the verbosity level of application_folder/logs/ files?
| asp.net | debugging | verbosity | null | null | null | open | How to run an ASP.NET application with verbose debug messages of the ASP.NET runtime
===
How do I configure an ASP.NET application to write **verbose** log messages of what ASP.NET engine itself is doing. What I get with
<trace enabled="true"
pageOutput="false"
requestLimit="10000"
writeToDiagnosticsTrace="true"/>
is just as much as
> [2488] aspx.page: Begin PreInit
> [2488] aspx.page: End PreInit [2488]
> aspx.page: Begin Init [2488]
> Unhandled Execution Error: -- Object
> reference not set to an instance of an
> object.: at ...
>
> ...
>
> [2488] aspx.page: Begin PreInit
> [2488] aspx.page: End PreInit [2488]
> aspx.page: Begin Init [2488]
> aspx.page: End Init [2488] aspx.page:
> Begin InitComplete [2488] aspx.page:
> End InitComplete [2488] aspx.page:
> Begin PreLoad [2488] aspx.page: End
> PreLoad [2488] aspx.page: Begin Load
> [2488] aspx.page: End Load [2488]
> aspx.page: Begin LoadComplete [2488]
> aspx.page: End LoadComplete [2488]
> aspx.page: Begin PreRender [2488]
> aspx.page: End PreRender [2488]
> aspx.page: Begin PreRenderComplete
> [2488] aspx.page: End
> PreRenderComplete [2488] aspx.page:
> Begin SaveState [2488] aspx.page: End
> SaveState [2488] aspx.page: Begin
> SaveStateComplete [2488] aspx.page:
> End SaveStateComplete [2488]
> aspx.page: Begin Render [2488]
> aspx.page: End Render
I there a way to get more verbosity?
What's about the verbosity level of application_folder/logs/ files?
| 0 |
9,267,969 | 02/13/2012 21:02:59 | 277,297 | 02/19/2010 20:26:29 | 69 | 3 | Why do I need a curried function to be able to pass function literals with short placeholder syntax? | Given this definition:
class Foo(var x: String) {}
object Helper {
def model[T](get: ⇒ T, set: T ⇒ Unit) : Model[T] = new Model[T] {
override def getObject(): T = get
override def setObject(obj: T) { set(obj) }
}
}
I try to call `model` like this:
val f = new Foo("initial")
val stringModel = model(f.x, f.x = _)
But that doesn't work, the compiler gives me this, complaining about the underscore:
missing parameter type for expanded function ((x$1) => f.x = x$1)
If I change the definition of `model` to use two parameter lists like this:
def model[T](get: ⇒ T)(set: T ⇒ Unit) // rest is unchanged
Then I can call it like this:
model(f.x)(f.x = _)
Which I find nice and concise. I don't really mind doing it like this, though it makes method overloading harder. I would like to understand, however, why the second variant works and the first one doesn't? | scala | null | null | null | null | null | open | Why do I need a curried function to be able to pass function literals with short placeholder syntax?
===
Given this definition:
class Foo(var x: String) {}
object Helper {
def model[T](get: ⇒ T, set: T ⇒ Unit) : Model[T] = new Model[T] {
override def getObject(): T = get
override def setObject(obj: T) { set(obj) }
}
}
I try to call `model` like this:
val f = new Foo("initial")
val stringModel = model(f.x, f.x = _)
But that doesn't work, the compiler gives me this, complaining about the underscore:
missing parameter type for expanded function ((x$1) => f.x = x$1)
If I change the definition of `model` to use two parameter lists like this:
def model[T](get: ⇒ T)(set: T ⇒ Unit) // rest is unchanged
Then I can call it like this:
model(f.x)(f.x = _)
Which I find nice and concise. I don't really mind doing it like this, though it makes method overloading harder. I would like to understand, however, why the second variant works and the first one doesn't? | 0 |
3,888,439 | 10/08/2010 07:21:52 | 430,803 | 08/25/2010 14:30:08 | 372 | 5 | how to write sqlquery for aggregate total value for a particular condition. | vote table
PK_ID ob_type ob_id VOTE user_id VOTED_ON
1 100 1 1 NISHANT 02/08/10
2 100 1 1 DEVI 02/08/10
3 100 1 1 VIRENDRA02/08/10
4 100 1 0 XYZ 02/08/10
5 200 1 1 XCXCX 02/08/10
6 200 1 1 CXC 03/02/11
7 200 1 0 XCCX 03/02/11
8 200 1 0 XCCX 03/02/11
9 300 1 1 XCCXXC 03/02/11
10 300 1 1 XCCX 03/02/11
11 300 1 1 SD 02/08/10
12 300 1 0 XCCXXCC 02/08/10
13 400 1 0 CXXCXC 02/08/10
14 400 1 0 XCCX 03/02/11
15 400 1 0 CXC 03/02/11
16 400 1 1 CXC 03/02/11
here i want to calculate total no of vote on a particular object type and id.
SELECT
COUNT (ALL [PK_ID]) AS [TOTAL_VOTE],
COALESCE (
( SELECT
[IS_THUMBS_UP]
FROM
[votetable]
WHERE
[ob_type] = 100 AND
[ob_id] = 4 AND
[FK_VOTED_BY] = Nishant ),-1) AS [MY_VOTING]
FROM
[votetable]
WHERE
[ob_type] = 100 AND
[ob_id] = 4
here it give result
total vote = 5
and my vote = 0
but here total voting is -2 (bcz 3 false(0) and 1 true)
so how i gate that value.
| sql | null | null | null | null | null | open | how to write sqlquery for aggregate total value for a particular condition.
===
vote table
PK_ID ob_type ob_id VOTE user_id VOTED_ON
1 100 1 1 NISHANT 02/08/10
2 100 1 1 DEVI 02/08/10
3 100 1 1 VIRENDRA02/08/10
4 100 1 0 XYZ 02/08/10
5 200 1 1 XCXCX 02/08/10
6 200 1 1 CXC 03/02/11
7 200 1 0 XCCX 03/02/11
8 200 1 0 XCCX 03/02/11
9 300 1 1 XCCXXC 03/02/11
10 300 1 1 XCCX 03/02/11
11 300 1 1 SD 02/08/10
12 300 1 0 XCCXXCC 02/08/10
13 400 1 0 CXXCXC 02/08/10
14 400 1 0 XCCX 03/02/11
15 400 1 0 CXC 03/02/11
16 400 1 1 CXC 03/02/11
here i want to calculate total no of vote on a particular object type and id.
SELECT
COUNT (ALL [PK_ID]) AS [TOTAL_VOTE],
COALESCE (
( SELECT
[IS_THUMBS_UP]
FROM
[votetable]
WHERE
[ob_type] = 100 AND
[ob_id] = 4 AND
[FK_VOTED_BY] = Nishant ),-1) AS [MY_VOTING]
FROM
[votetable]
WHERE
[ob_type] = 100 AND
[ob_id] = 4
here it give result
total vote = 5
and my vote = 0
but here total voting is -2 (bcz 3 false(0) and 1 true)
so how i gate that value.
| 0 |
7,132,802 | 08/20/2011 15:41:05 | 247,646 | 01/10/2010 21:27:35 | 51 | 1 | How to find the definition of a function or a class name using grep or find? | I am new to Linux development and I have to work with Mono project on Linux. I have the following function declaration:
static MonoString *ves_icall_System_MonoType_getFullName (MonoReflectionType *object, gboolean full_name,
gboolean assembly_qualified)
{
MonoDomain *domain = mono_object_domain (object);
...
I would like to find the definition of `MonoReflectionType` and the implementation of function `mono_object_domain`. How do I use grep and find to do this with two separate bash commands? Thank you in advance. | c | linux | bash | mono | grep | null | open | How to find the definition of a function or a class name using grep or find?
===
I am new to Linux development and I have to work with Mono project on Linux. I have the following function declaration:
static MonoString *ves_icall_System_MonoType_getFullName (MonoReflectionType *object, gboolean full_name,
gboolean assembly_qualified)
{
MonoDomain *domain = mono_object_domain (object);
...
I would like to find the definition of `MonoReflectionType` and the implementation of function `mono_object_domain`. How do I use grep and find to do this with two separate bash commands? Thank you in advance. | 0 |
11,072,147 | 06/17/2012 14:43:33 | 199,931 | 10/30/2009 21:00:58 | 470 | 0 | Template for ASP.net application | I am looking for a pretty looking template for ASP.net application. I am about to create a prototype for a small web app using VS.Net 2010.
Where can I get one for free.
I just need a header of different color and body and a footer.
Appreciate your help | asp.net | user-interface | null | null | null | 06/18/2012 12:11:35 | not a real question | Template for ASP.net application
===
I am looking for a pretty looking template for ASP.net application. I am about to create a prototype for a small web app using VS.Net 2010.
Where can I get one for free.
I just need a header of different color and body and a footer.
Appreciate your help | 1 |
11,747,850 | 07/31/2012 19:47:08 | 763,256 | 05/20/2011 18:51:20 | 560 | 9 | Django getting properties of model dynamically | I have a model like
class Document(models.Model):
comment = models.TextField(null=True,blank=True)
upload_date = models.DateTimeField(blank=False)
Document objects are listed in a template as
{% for doc in doc_list %}
{{ doc.comment }}
{{ doc.upload_date }}
{% endfor %}
However, I'd like to reach the properties of `doc` dynamically like
{{ doc."comment" }}
or
{{ doc|getField:"comment" }}
How can I do that?
Thanks
| django | django-models | null | null | null | null | open | Django getting properties of model dynamically
===
I have a model like
class Document(models.Model):
comment = models.TextField(null=True,blank=True)
upload_date = models.DateTimeField(blank=False)
Document objects are listed in a template as
{% for doc in doc_list %}
{{ doc.comment }}
{{ doc.upload_date }}
{% endfor %}
However, I'd like to reach the properties of `doc` dynamically like
{{ doc."comment" }}
or
{{ doc|getField:"comment" }}
How can I do that?
Thanks
| 0 |
6,122,552 | 05/25/2011 09:53:58 | 4,808 | 09/05/2008 17:41:47 | 436 | 11 | ASP.NET MVC 2 app runs in VS but errors on IIS | We inherited MVC 2 application that runs in Visual Studio but when we try to deploy it to production server (Win 2008 x86) or even the same local Win7 x64 machine but using IIS, AppPool on both is ASP.NET 4.0 w/ Integrated mode, we are getting the same NullReferenceException error:
Server Error in '/' Application.
--------------------------------------------------------------------------------
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an object.]
System.Web.PipelineModuleStepContainer.GetEventCount(RequestNotification notification, Boolean isPostEvent) +30
System.Web.PipelineStepManager.ResumeSteps(Exception error) +266
System.Web.HttpApplication.BeginProcessRequestNotification(HttpContext context, AsyncCallback cb) +132
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +709
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1
Anyone else experienced this? Any advise is appreciated.
Thanks! | asp.net-mvc-2 | iis7 | iis-7.5 | null | null | null | open | ASP.NET MVC 2 app runs in VS but errors on IIS
===
We inherited MVC 2 application that runs in Visual Studio but when we try to deploy it to production server (Win 2008 x86) or even the same local Win7 x64 machine but using IIS, AppPool on both is ASP.NET 4.0 w/ Integrated mode, we are getting the same NullReferenceException error:
Server Error in '/' Application.
--------------------------------------------------------------------------------
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an object.]
System.Web.PipelineModuleStepContainer.GetEventCount(RequestNotification notification, Boolean isPostEvent) +30
System.Web.PipelineStepManager.ResumeSteps(Exception error) +266
System.Web.HttpApplication.BeginProcessRequestNotification(HttpContext context, AsyncCallback cb) +132
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +709
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1
Anyone else experienced this? Any advise is appreciated.
Thanks! | 0 |
9,677,920 | 03/13/2012 03:18:35 | 1,073,181 | 11/30/2011 11:01:29 | 6 | 0 | Is there any tool for coverage test on mac os x | I searched in the network there are some like Rational purecoverage; Numega Turecoverage; Telelogic Logicscope.
Can you tell me which tool can be used in mac os x.
Thanks very much. | python | osx | testing | null | null | null | open | Is there any tool for coverage test on mac os x
===
I searched in the network there are some like Rational purecoverage; Numega Turecoverage; Telelogic Logicscope.
Can you tell me which tool can be used in mac os x.
Thanks very much. | 0 |
3,214,673 | 07/09/2010 16:35:37 | 93,311 | 04/20/2009 17:14:16 | 349 | 21 | Proper embedded Ruby Code writing | I am trying to write this :
%meta{ :name => "keywords", :content => "#{@page_city}, #{truncate_words(@page_keywords, 7) || 'Meta, Words, Are, Dope, For, SEO'}"}
Basically it sees if there is a local page that has a page city or keywords and adds those as they meta keywords. If it doesn't, it says the latter.
This works, but the only problem is that first comma after page_city is appearing. So right now it appears as ..
<meta content=', Meta, Words, Are, Dope, For, SEO' name='keywords' />
Does anyone know how to include that "," into the embedded variables as well?
| ruby-on-rails | ruby | metadata | haml | null | null | open | Proper embedded Ruby Code writing
===
I am trying to write this :
%meta{ :name => "keywords", :content => "#{@page_city}, #{truncate_words(@page_keywords, 7) || 'Meta, Words, Are, Dope, For, SEO'}"}
Basically it sees if there is a local page that has a page city or keywords and adds those as they meta keywords. If it doesn't, it says the latter.
This works, but the only problem is that first comma after page_city is appearing. So right now it appears as ..
<meta content=', Meta, Words, Are, Dope, For, SEO' name='keywords' />
Does anyone know how to include that "," into the embedded variables as well?
| 0 |
10,768,377 | 05/26/2012 17:31:49 | 203,173 | 11/05/2009 04:55:18 | 71 | 13 | Google App Engine NotSerializableException DatastoreServiceImpl | I am unable to resolve what is going wrong here. The local version of the code on my machine works with out throwing any exception. Here is the stack trace
Uncaught exception from servlet
java.lang.RuntimeException: java.io.NotSerializableException: com.google.appengine.api.datastore.DatastoreServiceImpl
at com.google.apphosting.runtime.jetty.SessionManager.serialize(SessionManager.java:373)
at com.google.apphosting.runtime.jetty.DatastoreSessionStore.createEntityForSession(DatastoreSessionStore.java:71)
at com.google.apphosting.runtime.jetty.DatastoreSessionStore.saveSession(DatastoreSessionStore.java:93)
at com.google.apphosting.runtime.jetty.SessionManager$AppEngineSession.save(SessionManager.java:164)
at com.google.apphosting.runtime.jetty.SaveSessionFilter.doFilter(SaveSessionFilter.java:41)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.handle(AppVersionHandlerMap.java:249)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:326)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:923)
at com.google.apphosting.runtime.jetty.RpcRequestParser.parseAvailable(RpcRequestParser.java:76)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
at com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:135)
at com.google.apphosting.runtime.JavaRuntime$RequestRunnable.run(JavaRuntime.java:477)
at com.google.tracing.TraceContext$TraceContextRunnable.runInContext(TraceContext.java:449)
at com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:455)
at com.google.tracing.TraceContext.runInContext(TraceContext.java:695)
at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:333)
at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:325)
at com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:453)
at com.google.apphosting.runtime.ThreadGroupPool$PoolEntry.run(ThreadGroupPool.java:251)
at java.lang.Thread.run(Thread.java:679)
I am using JSF 2 with primefaces 3.2
The same application works perfectly at localhost:8888
Thanks in advance.
| java | google-app-engine | java-ee | jsf-2.0 | null | 06/02/2012 15:47:48 | too localized | Google App Engine NotSerializableException DatastoreServiceImpl
===
I am unable to resolve what is going wrong here. The local version of the code on my machine works with out throwing any exception. Here is the stack trace
Uncaught exception from servlet
java.lang.RuntimeException: java.io.NotSerializableException: com.google.appengine.api.datastore.DatastoreServiceImpl
at com.google.apphosting.runtime.jetty.SessionManager.serialize(SessionManager.java:373)
at com.google.apphosting.runtime.jetty.DatastoreSessionStore.createEntityForSession(DatastoreSessionStore.java:71)
at com.google.apphosting.runtime.jetty.DatastoreSessionStore.saveSession(DatastoreSessionStore.java:93)
at com.google.apphosting.runtime.jetty.SessionManager$AppEngineSession.save(SessionManager.java:164)
at com.google.apphosting.runtime.jetty.SaveSessionFilter.doFilter(SaveSessionFilter.java:41)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.handle(AppVersionHandlerMap.java:249)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:326)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:923)
at com.google.apphosting.runtime.jetty.RpcRequestParser.parseAvailable(RpcRequestParser.java:76)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
at com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:135)
at com.google.apphosting.runtime.JavaRuntime$RequestRunnable.run(JavaRuntime.java:477)
at com.google.tracing.TraceContext$TraceContextRunnable.runInContext(TraceContext.java:449)
at com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:455)
at com.google.tracing.TraceContext.runInContext(TraceContext.java:695)
at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:333)
at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:325)
at com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:453)
at com.google.apphosting.runtime.ThreadGroupPool$PoolEntry.run(ThreadGroupPool.java:251)
at java.lang.Thread.run(Thread.java:679)
I am using JSF 2 with primefaces 3.2
The same application works perfectly at localhost:8888
Thanks in advance.
| 3 |
11,597,414 | 07/22/2012 02:37:37 | 1,083,648 | 12/06/2011 13:59:02 | 111 | 8 | Best Practices for Storing entity pointers (foreign keys) in Azure Table Storage | Azure Table Storage lets you look up an entity using Table Name, Partition Key, and Row Key.
But if I'm storing a pointer to one entity in another entity (i.e. a foreign key in rdb terms), is the best way to do that to concatenate those 3 values, or is there a more direct way of saying "this other entity exists *here*"? Like a URI that permanently points to the entity's location?
I'm 90% sure the answer IS no but 100% wishing it WERE yes.
Thanks! | azure-table-storage | null | null | null | null | null | open | Best Practices for Storing entity pointers (foreign keys) in Azure Table Storage
===
Azure Table Storage lets you look up an entity using Table Name, Partition Key, and Row Key.
But if I'm storing a pointer to one entity in another entity (i.e. a foreign key in rdb terms), is the best way to do that to concatenate those 3 values, or is there a more direct way of saying "this other entity exists *here*"? Like a URI that permanently points to the entity's location?
I'm 90% sure the answer IS no but 100% wishing it WERE yes.
Thanks! | 0 |
4,464,714 | 12/16/2010 19:41:44 | 545,257 | 12/16/2010 19:41:44 | 1 | 0 | MySQL Big FK identifier | I'm trying to create a fk but MySQL doesn't allow it ...
Identifier name 'foobarbaz_FK_CATALOG_PRODUCT_ENTITY_WEEE_DISCOUNT_PRODUCT_ENTITY' is too long [ CREATE TABLE `foobarbaz_weee_discount` ( `entity_id` int(10) unsigned NOT NULL DEFAULT '0', `website_id` smallint(5) unsigned NOT NULL DEFAULT '0', `customer_group_id` smallint(5) unsigned NOT NULL, `value` decimal(12,4) NOT NULL DEFAULT '0.0000', KEY `foobarbaz_FK_CATALOG_PRODUCT_ENTITY_WEEE_DISCOUNT_WEBSITE` (`website_id`), KEY `foobarbaz_FK_CATALOG_PRODUCT_ENTITY_WEEE_DISCOUNT_PRODUCT_ENTITY` (`entity_id`), KEY `foobarbaz_FK_CATALOG_PRODUCT_ENTITY_WEEE_DISCOUNT_GROUP` (`customer_group_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; ]
Is there a way to add big fks?
Thank you. | php | mysql | foreign-keys | foreign-key-relationship | restriction | null | open | MySQL Big FK identifier
===
I'm trying to create a fk but MySQL doesn't allow it ...
Identifier name 'foobarbaz_FK_CATALOG_PRODUCT_ENTITY_WEEE_DISCOUNT_PRODUCT_ENTITY' is too long [ CREATE TABLE `foobarbaz_weee_discount` ( `entity_id` int(10) unsigned NOT NULL DEFAULT '0', `website_id` smallint(5) unsigned NOT NULL DEFAULT '0', `customer_group_id` smallint(5) unsigned NOT NULL, `value` decimal(12,4) NOT NULL DEFAULT '0.0000', KEY `foobarbaz_FK_CATALOG_PRODUCT_ENTITY_WEEE_DISCOUNT_WEBSITE` (`website_id`), KEY `foobarbaz_FK_CATALOG_PRODUCT_ENTITY_WEEE_DISCOUNT_PRODUCT_ENTITY` (`entity_id`), KEY `foobarbaz_FK_CATALOG_PRODUCT_ENTITY_WEEE_DISCOUNT_GROUP` (`customer_group_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; ]
Is there a way to add big fks?
Thank you. | 0 |
6,554,219 | 07/01/2011 23:49:48 | 825,647 | 07/01/2011 23:49:48 | 1 | 0 | Output of Eclipse ia rubbish | I want to write a program in eclipse for a language different from English. When I system out from the program, it displays the output correctly in the console editor. But when I accept input from the console and output it, the output is rubbish. how can I solve it. Many thnaks | java | null | null | null | null | 07/02/2011 02:31:38 | not constructive | Output of Eclipse ia rubbish
===
I want to write a program in eclipse for a language different from English. When I system out from the program, it displays the output correctly in the console editor. But when I accept input from the console and output it, the output is rubbish. how can I solve it. Many thnaks | 4 |
11,121,293 | 06/20/2012 13:59:40 | 20,986 | 09/23/2008 09:09:45 | 952 | 29 | YUM/RPM - How to specify a requirement not installed with RPM | I have a package X depending on a software Y. Y is often compiled and installed manually by users but not always.
If I put a requirement in my spec file such as "requires: Y" the package Y will be downloaded by YUM and installed. If Y was installed by the user, it is simply overwritten which is not ok.
If I don't put a requirement, those who don't have Y will end up missing a necessary software to run X.
There is a way to know if Y is installed by checking the existence of a binary in a certain place or by checking an environment variable.
How to handle this situation ?
| dependencies | rpm | yum | null | null | null | open | YUM/RPM - How to specify a requirement not installed with RPM
===
I have a package X depending on a software Y. Y is often compiled and installed manually by users but not always.
If I put a requirement in my spec file such as "requires: Y" the package Y will be downloaded by YUM and installed. If Y was installed by the user, it is simply overwritten which is not ok.
If I don't put a requirement, those who don't have Y will end up missing a necessary software to run X.
There is a way to know if Y is installed by checking the existence of a binary in a certain place or by checking an environment variable.
How to handle this situation ?
| 0 |
5,905,654 | 05/06/2011 00:39:29 | 740,921 | 05/06/2011 00:39:29 | 1 | 0 | Execute code inside an if(0) block | A challenge for all the C experts out there:
On a linux machine, you have an already compiled C program, and you are given its source code:
...
char buffer[20];
int code;
gets(buffer);
if(code==1234) ...
...
...
if(0) func();
You don't posses root privileges and the program is read-only. Find a way to execute func. I am certain this is possible, so please don't post any "It isn't possible" answers.
Good luck!
| c | linux | if-statement | challenge | null | 05/06/2011 01:01:13 | not a real question | Execute code inside an if(0) block
===
A challenge for all the C experts out there:
On a linux machine, you have an already compiled C program, and you are given its source code:
...
char buffer[20];
int code;
gets(buffer);
if(code==1234) ...
...
...
if(0) func();
You don't posses root privileges and the program is read-only. Find a way to execute func. I am certain this is possible, so please don't post any "It isn't possible" answers.
Good luck!
| 1 |
11,457,473 | 07/12/2012 17:38:27 | 51,816 | 01/05/2009 21:39:06 | 15,109 | 23 | IComparer sorting by different criterias | I have a `ListView` and I am trying to sort them where items with a `BackColor` of red would be first, and then items with a `ForeColor` of red, and lastly the rest of the items, but all of them should be sorted by name within their group.
I wrote this code but I still get chunks of same items separated all over:
public int Compare (object x, object y)
{
int CompareResult;
ListViewItem a = (ListViewItem) x;
ListViewItem b = (ListViewItem) y;
if (a.BackColor == Color.FromArgb (200, 0, 0))
{
if (b.BackColor == Color.FromArgb(200, 0, 0))
{
return a.Text.CompareTo(b.Text);
}
else
{
return -1;
}
}
else
{
if (a.ForeColor == Color.FromArgb(200, 0, 0))
{
if (b.ForeColor == Color.FromArgb(200, 0, 0))
{
return a.Text.CompareTo(b.Text);
}
else
{
return -1;
}
}
else
{
return 1;
}
}
} | c# | .net | listview | sorting | icomparer | null | open | IComparer sorting by different criterias
===
I have a `ListView` and I am trying to sort them where items with a `BackColor` of red would be first, and then items with a `ForeColor` of red, and lastly the rest of the items, but all of them should be sorted by name within their group.
I wrote this code but I still get chunks of same items separated all over:
public int Compare (object x, object y)
{
int CompareResult;
ListViewItem a = (ListViewItem) x;
ListViewItem b = (ListViewItem) y;
if (a.BackColor == Color.FromArgb (200, 0, 0))
{
if (b.BackColor == Color.FromArgb(200, 0, 0))
{
return a.Text.CompareTo(b.Text);
}
else
{
return -1;
}
}
else
{
if (a.ForeColor == Color.FromArgb(200, 0, 0))
{
if (b.ForeColor == Color.FromArgb(200, 0, 0))
{
return a.Text.CompareTo(b.Text);
}
else
{
return -1;
}
}
else
{
return 1;
}
}
} | 0 |
5,972,097 | 05/12/2011 00:33:37 | 733,506 | 05/01/2011 17:27:52 | 16 | 0 | Where can I find the MIPS Archeture Animation | I have an Computer archeture Exam 2morrow and i need some animated MIPS link to help me understand how the process works ?? | mips | null | null | null | null | 05/13/2011 19:09:11 | not a real question | Where can I find the MIPS Archeture Animation
===
I have an Computer archeture Exam 2morrow and i need some animated MIPS link to help me understand how the process works ?? | 1 |
10,292,175 | 04/24/2012 05:28:05 | 645,924 | 11/27/2010 20:01:40 | 596 | 3 | should I store an encription key as hardcoded in my iOS or Android App | I plan on using One-Time Password encription for the comunication between the server and the client(which is a mobile app). But I need to hardcode the key in the mobile App. So all my mobile Apps installed by different users will have the same key.
How easy is to reverse engineer on the builds for Android and iOS and extrat the hardcoded value?
some other infomation about the security I plan:
I plan also to add extra security by sending each user an SMS with a 4 digit number that will be used to sign requests. This way I can assure that the user is who pretends to be.
I send over the internet the user's position, his phone number(once), his name(once).
What do you think about my ideea, and what would you recommnd? | android | ios | reverse-engineering | null | null | null | open | should I store an encription key as hardcoded in my iOS or Android App
===
I plan on using One-Time Password encription for the comunication between the server and the client(which is a mobile app). But I need to hardcode the key in the mobile App. So all my mobile Apps installed by different users will have the same key.
How easy is to reverse engineer on the builds for Android and iOS and extrat the hardcoded value?
some other infomation about the security I plan:
I plan also to add extra security by sending each user an SMS with a 4 digit number that will be used to sign requests. This way I can assure that the user is who pretends to be.
I send over the internet the user's position, his phone number(once), his name(once).
What do you think about my ideea, and what would you recommnd? | 0 |
3,662,603 | 09/07/2010 20:46:33 | 345,442 | 05/19/2010 19:53:35 | 70 | 5 | How to use the Insert Key (like in traditional windows) for a WPF 4 App? | Ok, I know that the new versions of windows do not use the insert key by default and you have to program for it. I want to be able to type in my text box and override the content that is in it just like in old windows when you could activate the insert key. This is just for my WPF 4, VB.net Application. | wpf | vb.net | visual-studio | keyboard | insert | null | open | How to use the Insert Key (like in traditional windows) for a WPF 4 App?
===
Ok, I know that the new versions of windows do not use the insert key by default and you have to program for it. I want to be able to type in my text box and override the content that is in it just like in old windows when you could activate the insert key. This is just for my WPF 4, VB.net Application. | 0 |
4,398,412 | 12/09/2010 12:54:36 | 274,426 | 02/16/2010 14:19:09 | 57 | 2 | Smooth zoom in mapview | When I use MapController.setZoom(x) and, for instance, zoom from level 5 to 15 the zoom is perform very fast and often the map tiles of the new level are not loaded.
This does not look so good to the user. Any Maps build in function to change this to a more slow zoom so tiles can be loaded, or at least almost loaded, before level 15 is reached?
Best regards
P | android | google-maps | zoom | null | null | null | open | Smooth zoom in mapview
===
When I use MapController.setZoom(x) and, for instance, zoom from level 5 to 15 the zoom is perform very fast and often the map tiles of the new level are not loaded.
This does not look so good to the user. Any Maps build in function to change this to a more slow zoom so tiles can be loaded, or at least almost loaded, before level 15 is reached?
Best regards
P | 0 |
11,165,689 | 06/23/2012 00:17:19 | 613,973 | 02/12/2011 05:46:35 | 579 | 13 | Rudimentary power function in Scala not working - strange compiler error | My code:
def power(x: Double, n: Int): Double = {
if (n % 2 == 0 && n > 0) power(power(x, n/2), 2)
else if (n % 2 == 1 && n > 0) x * power(x, n - 1)
else if (n == 0) 1
else if (n < 0) 1 / power(x, -n)
}
println(power(2, 2))
Terminal:
$ scala ch2ex10.scala
/scala/impatient/ch2ex10.scala:5: error: type mismatch;
found : Unit
required: Double
else if (n < 0) 1 / power(x, -n)
Where is this `Unit` coming from?
Thanks! | function | scala | recursion | null | null | null | open | Rudimentary power function in Scala not working - strange compiler error
===
My code:
def power(x: Double, n: Int): Double = {
if (n % 2 == 0 && n > 0) power(power(x, n/2), 2)
else if (n % 2 == 1 && n > 0) x * power(x, n - 1)
else if (n == 0) 1
else if (n < 0) 1 / power(x, -n)
}
println(power(2, 2))
Terminal:
$ scala ch2ex10.scala
/scala/impatient/ch2ex10.scala:5: error: type mismatch;
found : Unit
required: Double
else if (n < 0) 1 / power(x, -n)
Where is this `Unit` coming from?
Thanks! | 0 |
4,485,945 | 12/20/2010 00:22:23 | 770,022 | 08/30/2010 15:25:57 | 229 | 1 | I would like to have a name of a site that would be usless if Javascript was disabled. | The title says it all. I am looking for a site that if I disabled javascript the site would be usless, and what other functions would I not be able to use. Does anyone have a name of a site that I can look at? I want to know what no longer works. Thanks in advance. | javascript | null | null | null | null | 12/20/2010 00:38:44 | off topic | I would like to have a name of a site that would be usless if Javascript was disabled.
===
The title says it all. I am looking for a site that if I disabled javascript the site would be usless, and what other functions would I not be able to use. Does anyone have a name of a site that I can look at? I want to know what no longer works. Thanks in advance. | 2 |
7,307,408 | 09/05/2011 11:29:48 | 670,961 | 03/22/2011 10:00:26 | 7 | 1 | rermoveChild function nt working, i want to remove all the div coming under airtel div | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script type="text/javascript">
//function del () {
var x= new Date ();
var date= x.getDate ();
var hours= x.getHours();
var minutes=x.getMinutes();
var sec= x.getSeconds();
document.write(minutes +":"+ sec )
if (minutes=="1"){
document.getElementById('airtel').removeChild();
}
//}
</script>
</head>
<body>
<div id="airtel">
<div id="vodafone">vodaphone</div>
<div id="idea">idea</div>
</div>
</body>
</html>
| javascript | null | null | null | null | 09/05/2011 20:03:43 | not a real question | rermoveChild function nt working, i want to remove all the div coming under airtel div
===
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script type="text/javascript">
//function del () {
var x= new Date ();
var date= x.getDate ();
var hours= x.getHours();
var minutes=x.getMinutes();
var sec= x.getSeconds();
document.write(minutes +":"+ sec )
if (minutes=="1"){
document.getElementById('airtel').removeChild();
}
//}
</script>
</head>
<body>
<div id="airtel">
<div id="vodafone">vodaphone</div>
<div id="idea">idea</div>
</div>
</body>
</html>
| 1 |
9,687,065 | 03/13/2012 15:29:49 | 1,017,196 | 10/27/2011 19:27:39 | 80 | 0 | Game programming in C, where do I get started? | I started programming about 6 months back and have a decent knowledge in how to code in C. I have mainly used it to implement elementary algorithms or solve Project Euler questions (reached 50 now :) )
What I really want to learn since a long time is game programming. Ie make simple 2D games like snake, or pocket tanks. By simple, I no way mean the amount of work or effort it's going to take to make these games
I've tried searching the net but have had no luck with that. Could anyone point me in the right direction?
What exactly will I need to learn? Where do I start? | c | null | null | null | null | 03/14/2012 14:18:04 | not constructive | Game programming in C, where do I get started?
===
I started programming about 6 months back and have a decent knowledge in how to code in C. I have mainly used it to implement elementary algorithms or solve Project Euler questions (reached 50 now :) )
What I really want to learn since a long time is game programming. Ie make simple 2D games like snake, or pocket tanks. By simple, I no way mean the amount of work or effort it's going to take to make these games
I've tried searching the net but have had no luck with that. Could anyone point me in the right direction?
What exactly will I need to learn? Where do I start? | 4 |
556,820 | 02/17/2009 13:39:52 | 51,649 | 01/05/2009 13:47:38 | 34 | 3 | Bash script does not continue to read the next line of file | I have a shell script that saves the output of a command that is executed to a CSV file. It reads the command it has to execute from a shell script which is in this format:
ffmpeg -i /home/test/videos/avi/418kb.avi /home/test/videos/done/418kb.flv
ffmpeg -i /home/test/videos/avi/1253kb.avi /home/test/videos/done/1253kb.flv
ffmpeg -i /home/test/videos/avi/2093kb.avi /home/test/videos/done/2093kb.flv
You can see each line is an ffmpeg command. However, the script just executes the first line. Just a minute ago it was doing nearly all of the commands. It was missing half for some reason. I edited the text file that contained the commands and now it will only do the first line. Here is my bash script:
#!/bin/bash
# Shell script utility to read a file line line.
# Once line is read it will run processLine() function
#Function processLine
processLine(){
line="$@"
START=$(date +%s.%N)
eval $line > /dev/null 2>&1
END=$(date +%s.%N)
DIFF=$(echo "$END - $START" | bc)
echo "$line, $START, $END, $DIFF" >> file.csv 2>&1
echo "It took $DIFF seconds"
echo $line
}
# Store file name
FILE=""
# get file name as command line argument
# Else read it from standard input device
if [ "$1" == "" ]; then
FILE="/dev/stdin"
else
FILE="$1"
# make sure file exist and readable
if [ ! -f $FILE ]; then
echo "$FILE : does not exists"
exit 1
elif [ ! -r $FILE ]; then
echo "$FILE: can not read"
exit 2
fi
fi
# read $FILE using the file descriptors
# Set loop separator to end of line
BAKIFS=$IFS
IFS=$(echo -en "\n\b")
exec 3<&0
exec 0<$FILE
while read line
do
# use $line variable to process line in processLine() function
processLine $line
done
exec 0<&3
# restore $IFS which was used to determine what the field separators are
BAKIFS=$ORIGIFS
exit 0
Thank you for any help.
| bash | scripting | shell | command-line | linux | null | open | Bash script does not continue to read the next line of file
===
I have a shell script that saves the output of a command that is executed to a CSV file. It reads the command it has to execute from a shell script which is in this format:
ffmpeg -i /home/test/videos/avi/418kb.avi /home/test/videos/done/418kb.flv
ffmpeg -i /home/test/videos/avi/1253kb.avi /home/test/videos/done/1253kb.flv
ffmpeg -i /home/test/videos/avi/2093kb.avi /home/test/videos/done/2093kb.flv
You can see each line is an ffmpeg command. However, the script just executes the first line. Just a minute ago it was doing nearly all of the commands. It was missing half for some reason. I edited the text file that contained the commands and now it will only do the first line. Here is my bash script:
#!/bin/bash
# Shell script utility to read a file line line.
# Once line is read it will run processLine() function
#Function processLine
processLine(){
line="$@"
START=$(date +%s.%N)
eval $line > /dev/null 2>&1
END=$(date +%s.%N)
DIFF=$(echo "$END - $START" | bc)
echo "$line, $START, $END, $DIFF" >> file.csv 2>&1
echo "It took $DIFF seconds"
echo $line
}
# Store file name
FILE=""
# get file name as command line argument
# Else read it from standard input device
if [ "$1" == "" ]; then
FILE="/dev/stdin"
else
FILE="$1"
# make sure file exist and readable
if [ ! -f $FILE ]; then
echo "$FILE : does not exists"
exit 1
elif [ ! -r $FILE ]; then
echo "$FILE: can not read"
exit 2
fi
fi
# read $FILE using the file descriptors
# Set loop separator to end of line
BAKIFS=$IFS
IFS=$(echo -en "\n\b")
exec 3<&0
exec 0<$FILE
while read line
do
# use $line variable to process line in processLine() function
processLine $line
done
exec 0<&3
# restore $IFS which was used to determine what the field separators are
BAKIFS=$ORIGIFS
exit 0
Thank you for any help.
| 0 |
7,022,026 | 08/11/2011 07:01:33 | 883,969 | 08/08/2011 11:32:15 | 1 | 0 | Can we able to create iframe app from any api | I am adding app to fan page as a tab.I wanted to create many tab to my facebook page.Does I need to create diffrent app for that.Can we create app through code or any api? | facebook | null | null | null | null | 11/04/2011 17:58:04 | not a real question | Can we able to create iframe app from any api
===
I am adding app to fan page as a tab.I wanted to create many tab to my facebook page.Does I need to create diffrent app for that.Can we create app through code or any api? | 1 |
4,119,044 | 11/07/2010 18:27:10 | 331,462 | 05/03/2010 13:58:32 | 72 | 3 | Post doesn't show up in dashboard - wordpress, MySQL | I recently redesigned my site, complete with a new database, but I wanted to grab all of the posts from my old wp site to have in the new one. There were only three. I imported all of the rows in the database that pertained to said posts to my new database. Only two of the posts showed up.
When I tried to manually import the third post, I get this:
SQL query:
-- -- Database: `erisdesi_wp` -- -- -- Dumping data for table `wp_posts` -- INSERT INTO `wp_posts` (`ID`, `post_author`, `post_date`, `post_date_gmt`, `post_content`, `post_title`, `post_excerpt`, `post_status`, `comment_status`, `ping_status`, `post_password`, `post_name`, `to_ping`, `pinged`, `post_modified`, `post_modified_gmt`, `post_content_filtered`, `post_parent`, `guid`, `menu_order`, `post_type`, `post_mime_type`, `comment_count`) VALUES (188, 1, '2010-08-26 04:42:37', '2010-08-26 04:42:37', 'Hold yr horses! We’re building it!\r\n
\r\n\r\n
', 'Design Blog', '', 'inherit', 'open', 'open', '', '110-revision-6', '', '', '2010-08-26 04:42:37', '2010-08-26 04:42:37', '', 110, 'http://www.erisdesigns.net/http:/www.erisdesigns.net/wordpress/', 0, 'revision', '', 0), (2, 1, '2010-07-17 18:28:39', '2010-07-17 18:28:39', 'Documentation #1062 - Duplicate entry
I'm pretty new to MySQL...any help is appreciated. Thanks in advance for furthering my knowledge. | mysql | database | wordpress | null | null | null | open | Post doesn't show up in dashboard - wordpress, MySQL
===
I recently redesigned my site, complete with a new database, but I wanted to grab all of the posts from my old wp site to have in the new one. There were only three. I imported all of the rows in the database that pertained to said posts to my new database. Only two of the posts showed up.
When I tried to manually import the third post, I get this:
SQL query:
-- -- Database: `erisdesi_wp` -- -- -- Dumping data for table `wp_posts` -- INSERT INTO `wp_posts` (`ID`, `post_author`, `post_date`, `post_date_gmt`, `post_content`, `post_title`, `post_excerpt`, `post_status`, `comment_status`, `ping_status`, `post_password`, `post_name`, `to_ping`, `pinged`, `post_modified`, `post_modified_gmt`, `post_content_filtered`, `post_parent`, `guid`, `menu_order`, `post_type`, `post_mime_type`, `comment_count`) VALUES (188, 1, '2010-08-26 04:42:37', '2010-08-26 04:42:37', 'Hold yr horses! We’re building it!\r\n
\r\n\r\n
', 'Design Blog', '', 'inherit', 'open', 'open', '', '110-revision-6', '', '', '2010-08-26 04:42:37', '2010-08-26 04:42:37', '', 110, 'http://www.erisdesigns.net/http:/www.erisdesigns.net/wordpress/', 0, 'revision', '', 0), (2, 1, '2010-07-17 18:28:39', '2010-07-17 18:28:39', 'Documentation #1062 - Duplicate entry
I'm pretty new to MySQL...any help is appreciated. Thanks in advance for furthering my knowledge. | 0 |
8,965,271 | 01/22/2012 22:24:11 | 350,128 | 05/25/2010 17:04:17 | 120 | 8 | Best practice to route requests to delegate them to different methods in netty? | 1. Does netty have built-in support for this somehow?
2. If it doesn't have, where should I do this, and how should this be implemented? | java | delegates | routes | web | netty | null | open | Best practice to route requests to delegate them to different methods in netty?
===
1. Does netty have built-in support for this somehow?
2. If it doesn't have, where should I do this, and how should this be implemented? | 0 |
2,096,828 | 01/19/2010 20:28:54 | 163,699 | 08/26/2009 17:43:38 | 205 | 15 | How can I check the new value of a text field on keypress? | I have a single form field and I need to be able to detect when the field changes and execute some additional code using the ***new*** value of the field. I only want to execute the code if the key pushed actually changes the value of the text box. Here's the solution I came up with.
function onkeypress(e) {
var value = this.value;
// do something with
}
function onkeyup(e) {
if ( e.which == 8 || e.keyCode == 46 ) { // delete or backspace keys
this.onkeypress(e);
}
}
There's just one problem though. onkeypress is fired before the field's value is updated, so when I grab the value, I'm getting the previous value. I would use keyup exclusively if I knew a way to test whether the key changed the value or not, but some characters (like the arrow keys) have no effect on the field's value.
Any ideas? | javascript | keycode | fromcharcode | onkeypress | onkeyup | null | open | How can I check the new value of a text field on keypress?
===
I have a single form field and I need to be able to detect when the field changes and execute some additional code using the ***new*** value of the field. I only want to execute the code if the key pushed actually changes the value of the text box. Here's the solution I came up with.
function onkeypress(e) {
var value = this.value;
// do something with
}
function onkeyup(e) {
if ( e.which == 8 || e.keyCode == 46 ) { // delete or backspace keys
this.onkeypress(e);
}
}
There's just one problem though. onkeypress is fired before the field's value is updated, so when I grab the value, I'm getting the previous value. I would use keyup exclusively if I knew a way to test whether the key changed the value or not, but some characters (like the arrow keys) have no effect on the field's value.
Any ideas? | 0 |
5,743,143 | 04/21/2011 10:56:55 | 718,800 | 04/21/2011 10:56:55 | 1 | 0 | How to implement time series graph. | How to implement time series graph i have downloaded it from code.google.com bt dont know how to use it. Can anyone tell me please. Thanks in advance. | javascript | jquery | flash | null | null | 04/21/2011 21:11:08 | not a real question | How to implement time series graph.
===
How to implement time series graph i have downloaded it from code.google.com bt dont know how to use it. Can anyone tell me please. Thanks in advance. | 1 |
3,462,833 | 08/11/2010 21:05:35 | 417,728 | 08/11/2010 21:05:35 | 1 | 0 | $_POST multidemensional array looping | So I've created a form wich, by the post function, send me several values.
$_POST[groups] sends me, using 4 different checkboxes values 1,2,4 and 8.
$_POST[retailgroup] does the samt, but only the values 1,2 and 4.
The problem is that I want these to add up together and then send the sum of the values to a MySQL table.
I've managed to do one using the following foreach loop:
foreach ( $_POST as $val ){
foreach ( $val as $key=>$final_val ){
$group = $group+$final_val;
}
The problem starts when I need to have these two apart from each other since they are going into separate columns in the table.
To be clear I've assigned different groups different values (always taking the prev value times two, just like counting binary) like 1,2,4 and 8. By adding them togheter i can determine membership in the groups by doing a subtraction "backwards". Since there are different kinds of groups I want them into two separate fields of the table.
I hope everything is clear.
Any idea on how to do this? | php | arrays | foreach | multidimensional | null | null | open | $_POST multidemensional array looping
===
So I've created a form wich, by the post function, send me several values.
$_POST[groups] sends me, using 4 different checkboxes values 1,2,4 and 8.
$_POST[retailgroup] does the samt, but only the values 1,2 and 4.
The problem is that I want these to add up together and then send the sum of the values to a MySQL table.
I've managed to do one using the following foreach loop:
foreach ( $_POST as $val ){
foreach ( $val as $key=>$final_val ){
$group = $group+$final_val;
}
The problem starts when I need to have these two apart from each other since they are going into separate columns in the table.
To be clear I've assigned different groups different values (always taking the prev value times two, just like counting binary) like 1,2,4 and 8. By adding them togheter i can determine membership in the groups by doing a subtraction "backwards". Since there are different kinds of groups I want them into two separate fields of the table.
I hope everything is clear.
Any idea on how to do this? | 0 |
9,142,509 | 02/04/2012 16:44:34 | 86,751 | 04/03/2009 14:03:44 | 6,796 | 167 | How to put a cropped image on a Tkinter Canvas in Python | I found a lot of similar questions, but not quite the solution to this case :
I want to
1. Load an image file from disk
2. Crop it (lazy or not)
3. Place it on a TKinter canvas
And oh, it would even be better that step 1 would not need to be a gif-file, but even if it has to be I'll be happy. That's it..
I can load a file, I can crop it (In PIL) I can place it on a canvas (In TKinter), but I don't seem able to combine it all.. (So maybe a simple cast from PIL to TKinter is enough?) I'm a newbee in TKinter of course.
| python | tkinter | pil | crop | null | null | open | How to put a cropped image on a Tkinter Canvas in Python
===
I found a lot of similar questions, but not quite the solution to this case :
I want to
1. Load an image file from disk
2. Crop it (lazy or not)
3. Place it on a TKinter canvas
And oh, it would even be better that step 1 would not need to be a gif-file, but even if it has to be I'll be happy. That's it..
I can load a file, I can crop it (In PIL) I can place it on a canvas (In TKinter), but I don't seem able to combine it all.. (So maybe a simple cast from PIL to TKinter is enough?) I'm a newbee in TKinter of course.
| 0 |
6,053,105 | 05/19/2011 02:22:22 | 735,425 | 05/03/2011 03:50:11 | 1 | 0 | OpenGL Camera Rotation Not Working | I know this is a common question (as I have read many threads on here and other forums about it) but for the life of me I can not get the camera rotation that I desire. I want the camera to be able to 'look around' and not for it to 'orbit' around a point, this point being the OpenGL origin.
I am aware that 'there is no camera in OpenGL', the terrain moves and not the viewpoint, etc. and all of those similar concepts but it has not helped me in solving this.
Unfortunately I am stubborn and want to write my code with no deprecated features and so this eliminates 99% of the similar situations I have read about since most of those solutions were with gluLook and similar functions.
The matrix class I am using is similar to the one that is used by the OpenGL SuperBible 5th Edition ( [source](http://oglsuperbible5.googlecode.com/svn/trunk/Src/GLTools/), GLFrame.h is the main file of interest) but have adapted it to use the [OpenGL Mathematics Library](http://glm.g-truc.net/).
The typical response to this question is to translate to the origin, rotate, then translate back, but this does nothing for me.
Some code:
void rotateLocalX( GLfloat p_Angle )
{
if( ( m_Roll < m_RollLimit ) && ( m_Roll > ( -m_RollLimit ) ) )
{
//store away the current location so I can translate back to it
glm::vec3 tempOrigin = getOrigin( );
m_Roll += p_Angle;
// Go to the Origin
//you can also subtract the current location to get to 0.f
//also doing glm::translate( m_Matrix, -( tempOrigin ) ); -> rotate ->
//glm::translate( m_Matrix, tempOrigin ) has the same result
m_Matrix[ 3 ][ 0 ] = 0.f;
m_Matrix[ 3 ][ 1 ] = 0.f;
m_Matrix[ 3 ][ 2 ] = 0.f;
m_Matrix[ 3 ][ 3 ] = 1.f;
// Rotate the matrix
m_Matrix = glm::rotate( m_Matrix, p_Angle, glm::vec3( 1.f, 0.f, 0.f ) );
// Go back to the original location
m_Matrix[ 3 ][ 0 ] = tempOrigin.x;
m_Matrix[ 3 ][ 1 ] = tempOrigin.y;
m_Matrix[ 3 ][ 2 ] = tempOrigin.z;
m_Matrix[ 3 ][ 3 ] = 1.f;
normalize( );
}
}
And if it is of any consequence, I am treating the camera matrix as the view matrix (with a separate model matrix [view*model=modelview] and a perspective projection matrix).
Finally a typical frame goes like this: check for input (move/rotate camera as appropriate), render skybox (ignoring the origin/location column of the view/camera matrix), draw everything else (taking into account the entire view matrix).
I apologize for asking such a common question but two days of searching and trying various different solutions has yielded no positive results.
Thank you. | c++ | visual-studio | opengl | null | null | null | open | OpenGL Camera Rotation Not Working
===
I know this is a common question (as I have read many threads on here and other forums about it) but for the life of me I can not get the camera rotation that I desire. I want the camera to be able to 'look around' and not for it to 'orbit' around a point, this point being the OpenGL origin.
I am aware that 'there is no camera in OpenGL', the terrain moves and not the viewpoint, etc. and all of those similar concepts but it has not helped me in solving this.
Unfortunately I am stubborn and want to write my code with no deprecated features and so this eliminates 99% of the similar situations I have read about since most of those solutions were with gluLook and similar functions.
The matrix class I am using is similar to the one that is used by the OpenGL SuperBible 5th Edition ( [source](http://oglsuperbible5.googlecode.com/svn/trunk/Src/GLTools/), GLFrame.h is the main file of interest) but have adapted it to use the [OpenGL Mathematics Library](http://glm.g-truc.net/).
The typical response to this question is to translate to the origin, rotate, then translate back, but this does nothing for me.
Some code:
void rotateLocalX( GLfloat p_Angle )
{
if( ( m_Roll < m_RollLimit ) && ( m_Roll > ( -m_RollLimit ) ) )
{
//store away the current location so I can translate back to it
glm::vec3 tempOrigin = getOrigin( );
m_Roll += p_Angle;
// Go to the Origin
//you can also subtract the current location to get to 0.f
//also doing glm::translate( m_Matrix, -( tempOrigin ) ); -> rotate ->
//glm::translate( m_Matrix, tempOrigin ) has the same result
m_Matrix[ 3 ][ 0 ] = 0.f;
m_Matrix[ 3 ][ 1 ] = 0.f;
m_Matrix[ 3 ][ 2 ] = 0.f;
m_Matrix[ 3 ][ 3 ] = 1.f;
// Rotate the matrix
m_Matrix = glm::rotate( m_Matrix, p_Angle, glm::vec3( 1.f, 0.f, 0.f ) );
// Go back to the original location
m_Matrix[ 3 ][ 0 ] = tempOrigin.x;
m_Matrix[ 3 ][ 1 ] = tempOrigin.y;
m_Matrix[ 3 ][ 2 ] = tempOrigin.z;
m_Matrix[ 3 ][ 3 ] = 1.f;
normalize( );
}
}
And if it is of any consequence, I am treating the camera matrix as the view matrix (with a separate model matrix [view*model=modelview] and a perspective projection matrix).
Finally a typical frame goes like this: check for input (move/rotate camera as appropriate), render skybox (ignoring the origin/location column of the view/camera matrix), draw everything else (taking into account the entire view matrix).
I apologize for asking such a common question but two days of searching and trying various different solutions has yielded no positive results.
Thank you. | 0 |
4,982,145 | 02/13/2011 02:52:54 | 428,582 | 08/23/2010 15:47:44 | 54 | 0 | Extesible biased number generator - Python | I am trying to get a random number generator that will be biased in that it takes a number, and prints a number that is likely to be close. Here's what I have now:
def biasedRandom(rangen, rangex, target, biaslevel=1):
if rangen > rangex:
raise ValueError("Min value is less than max value.")
return
if not target in range(rangen, rangex):
raise ValueError("Bias target not inside range of random.")
return
num = random.randint(rangen, rangex)
for i in range(biaslevel):
distance = abs(num - target)
num -= random.randint(0, distance)
return num
This works pretty well, however it has on occasion given completely outrageous numbers; e.g. it once gave `-246174068358` for `(1,100,30,60)`. I figure there is just a bug in there that I am not seeing.
Thanks in advance. | python | random | null | null | null | null | open | Extesible biased number generator - Python
===
I am trying to get a random number generator that will be biased in that it takes a number, and prints a number that is likely to be close. Here's what I have now:
def biasedRandom(rangen, rangex, target, biaslevel=1):
if rangen > rangex:
raise ValueError("Min value is less than max value.")
return
if not target in range(rangen, rangex):
raise ValueError("Bias target not inside range of random.")
return
num = random.randint(rangen, rangex)
for i in range(biaslevel):
distance = abs(num - target)
num -= random.randint(0, distance)
return num
This works pretty well, however it has on occasion given completely outrageous numbers; e.g. it once gave `-246174068358` for `(1,100,30,60)`. I figure there is just a bug in there that I am not seeing.
Thanks in advance. | 0 |
2,915,174 | 05/26/2010 17:06:43 | 171,523 | 09/10/2009 15:34:09 | 180 | 13 | Tools for Window service performacne test | I would like to know what are the open source and commerical tools for window Service Testing. Like memeory usage and code leakes etc ..
C# 2.0 - Window Service. | c# | performance | windows-services | null | null | null | open | Tools for Window service performacne test
===
I would like to know what are the open source and commerical tools for window Service Testing. Like memeory usage and code leakes etc ..
C# 2.0 - Window Service. | 0 |
11,386,637 | 07/08/2012 20:55:12 | 1,510,554 | 07/08/2012 20:47:44 | 1 | 0 | Is pydblite a good replacement for mysql for a website | I'm an avid python programmer and I'm considering using pydblite as the DB backend as opposed to MYSQL. Regardless of whether your anti python or pro sql does anyone have an unbiased opinion on whether its a good alternative in terms of security? | python | mysql | alternative | null | null | 07/09/2012 00:34:06 | not constructive | Is pydblite a good replacement for mysql for a website
===
I'm an avid python programmer and I'm considering using pydblite as the DB backend as opposed to MYSQL. Regardless of whether your anti python or pro sql does anyone have an unbiased opinion on whether its a good alternative in terms of security? | 4 |
4,764,251 | 01/21/2011 22:00:42 | 585,115 | 01/21/2011 22:00:42 | 1 | 0 | snake in assembly language | how can i do the snake game in assembly language on tasm program ? | assembly | tasm | null | null | null | 01/21/2011 23:09:16 | not a real question | snake in assembly language
===
how can i do the snake game in assembly language on tasm program ? | 1 |
2,716,990 | 04/26/2010 21:22:26 | 319,859 | 04/18/2010 20:40:53 | 1 | 1 | HTTP Basic Authentication credentials passed in URL and encryption | I have a question about HTTPS and HTTP Authentication credentials.
Suppose I secure a url with HTTP Authentication:
<Directory /var/www/webcallback>
AuthType Basic
AuthName "Restricted Area"
AuthUserFile /var/www/passwd/passwords
Require user gooduser
</Directory>
I then access that URL from a remote system via HTTPS, passing the credentials in the URL:
https://gooduser:secretpassword@www.example.com/webcallback?foo=bar
Will the username and password be automatically SSL encrypted? Is the same true for GETs and POSTs? I'm having a hard time locating a credible source with this information.
Thanks! | https | basic-authentication | null | null | null | null | open | HTTP Basic Authentication credentials passed in URL and encryption
===
I have a question about HTTPS and HTTP Authentication credentials.
Suppose I secure a url with HTTP Authentication:
<Directory /var/www/webcallback>
AuthType Basic
AuthName "Restricted Area"
AuthUserFile /var/www/passwd/passwords
Require user gooduser
</Directory>
I then access that URL from a remote system via HTTPS, passing the credentials in the URL:
https://gooduser:secretpassword@www.example.com/webcallback?foo=bar
Will the username and password be automatically SSL encrypted? Is the same true for GETs and POSTs? I'm having a hard time locating a credible source with this information.
Thanks! | 0 |
11,554,882 | 07/19/2012 06:10:14 | 1,362,472 | 02/09/2012 10:21:53 | 8 | 1 | Beta builder supports IOS 5.0 and later | Beta builder version 1.0 supports only the IOS 4.0 or early users. But, we require IOS 5.0 or later users. So, is there any Beta builder which is support the IOS 5.0 or later users?
Thanks in advance,
Mahesh,
IOS Developer.
| iphone | ios | ipad | builder | beta | 07/20/2012 00:06:02 | off topic | Beta builder supports IOS 5.0 and later
===
Beta builder version 1.0 supports only the IOS 4.0 or early users. But, we require IOS 5.0 or later users. So, is there any Beta builder which is support the IOS 5.0 or later users?
Thanks in advance,
Mahesh,
IOS Developer.
| 2 |
2,985,413 | 06/06/2010 18:41:56 | 198,128 | 10/28/2009 14:05:36 | 545 | 20 | PHP Frameworks: Codeigniter vs. Yii vs. Custom? | I have used codeigniter for a some years now. Why I chosed to work with codeigniter back then? Pretty much for the extensive documentation that were available and the big user community. It made me as a totally newbie to the MVC pattern able to get a site up and running really fast.
I think what is priorited from my side is that the framework doesn't affect performance too much, which Codeigniter seems to be pretty good at (when compared to other frameworks out there) and Yii, an even better option.
Since the time has gone from when I started out with codeigniter, the project sizes have also increased and thereby the demand of the framework and it's footprint on the code. I have thought a few times about writing a whole new MVC framework to do only the thing's I want it to do, but it feels like reinventing the wheel and I cannot yet justify it.
I am not sure whether or not it's a good solution to build a site that have the potential to become really big on either Yii or Codeigniter.
I have tried to find as much as possible documentation about this comparision/issue online before posting here, but have found very few real-life arguments and stories from people that have shifted between the two PHP frameworks or have been in the same situation as me.
So - what's your thoughts about Codeigniter vs. Yii vs. going custom?
References:
- http://daniel.carrera.bz/2009/01/comparison-of-php-frameworks-part-i/
- http://www.beyondcoding.com/2009/03/02/choosing-a-php-framework-round-2-yii-vs-kohana-vs-codeigniter/ | php | php5 | codeigniter | frameworks | yii | 05/24/2012 18:23:03 | not constructive | PHP Frameworks: Codeigniter vs. Yii vs. Custom?
===
I have used codeigniter for a some years now. Why I chosed to work with codeigniter back then? Pretty much for the extensive documentation that were available and the big user community. It made me as a totally newbie to the MVC pattern able to get a site up and running really fast.
I think what is priorited from my side is that the framework doesn't affect performance too much, which Codeigniter seems to be pretty good at (when compared to other frameworks out there) and Yii, an even better option.
Since the time has gone from when I started out with codeigniter, the project sizes have also increased and thereby the demand of the framework and it's footprint on the code. I have thought a few times about writing a whole new MVC framework to do only the thing's I want it to do, but it feels like reinventing the wheel and I cannot yet justify it.
I am not sure whether or not it's a good solution to build a site that have the potential to become really big on either Yii or Codeigniter.
I have tried to find as much as possible documentation about this comparision/issue online before posting here, but have found very few real-life arguments and stories from people that have shifted between the two PHP frameworks or have been in the same situation as me.
So - what's your thoughts about Codeigniter vs. Yii vs. going custom?
References:
- http://daniel.carrera.bz/2009/01/comparison-of-php-frameworks-part-i/
- http://www.beyondcoding.com/2009/03/02/choosing-a-php-framework-round-2-yii-vs-kohana-vs-codeigniter/ | 4 |
8,885,293 | 01/16/2012 19:32:48 | 1,090,062 | 12/09/2011 16:03:43 | 8 | 0 | best way to implement a customer review app | Hello I just wanted to get an opinion from some more skilled programmers. I am creating an app where users can write and read comments regarding certain products. I would like it to display where a user can add a comment in a comment box and below that have other users reviews displayed What is the best option to do this? Like should I create a webpage then implement a web view?
Or have it where the information is directly tied to a database where the information is both passed and pulled from mySQL?
What option would be more efficient and or user friendly? And if anyone has good links for tutorials on the option you suggest that would be greatly appreciated. Thanks
| android | android-layout | null | null | null | 01/17/2012 19:48:55 | not constructive | best way to implement a customer review app
===
Hello I just wanted to get an opinion from some more skilled programmers. I am creating an app where users can write and read comments regarding certain products. I would like it to display where a user can add a comment in a comment box and below that have other users reviews displayed What is the best option to do this? Like should I create a webpage then implement a web view?
Or have it where the information is directly tied to a database where the information is both passed and pulled from mySQL?
What option would be more efficient and or user friendly? And if anyone has good links for tutorials on the option you suggest that would be greatly appreciated. Thanks
| 4 |
11,444,968 | 07/12/2012 04:21:38 | 1,519,500 | 07/12/2012 02:15:28 | 1 | 0 | How I play my audios with match all text in text box | string line = textBox1.Text.ToString();
string[] words = line.Split();
foreach (string word in words)
{
if (word.Contains("ඉ"))
{
SoundPlayer sndplayr = new SoundPlayer(WindowsFormsApplication1.Properties.Resources._a);
sndplayr.Play();
}
if (word.Contains("අ"))
{
SoundPlayer sndplayr = new SoundPlayer(WindowsFormsApplication1.Properties.Resources.la);
sndplayr.Play();
}
}
}
}
i used this but it play only text box last character audio. so what can i do. please help me............ | c# | c#-4.0 | null | null | null | 07/12/2012 12:34:51 | not a real question | How I play my audios with match all text in text box
===
string line = textBox1.Text.ToString();
string[] words = line.Split();
foreach (string word in words)
{
if (word.Contains("ඉ"))
{
SoundPlayer sndplayr = new SoundPlayer(WindowsFormsApplication1.Properties.Resources._a);
sndplayr.Play();
}
if (word.Contains("අ"))
{
SoundPlayer sndplayr = new SoundPlayer(WindowsFormsApplication1.Properties.Resources.la);
sndplayr.Play();
}
}
}
}
i used this but it play only text box last character audio. so what can i do. please help me............ | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.