PostId int64 13 11.8M | PostCreationDate stringlengths 19 19 | OwnerUserId int64 3 1.57M | OwnerCreationDate stringlengths 10 19 | ReputationAtPostCreation int64 -33 210k | OwnerUndeletedAnswerCountAtPostTime int64 0 5.77k | Title stringlengths 10 250 | BodyMarkdown stringlengths 12 30k | Tag1 stringlengths 1 25 ⌀ | Tag2 stringlengths 1 25 ⌀ | Tag3 stringlengths 1 25 ⌀ | Tag4 stringlengths 1 25 ⌀ | Tag5 stringlengths 1 25 ⌀ | PostClosedDate stringlengths 19 19 ⌀ | OpenStatus stringclasses 5 values | unified_texts stringlengths 47 30.1k | OpenStatus_id int64 0 4 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
11,741,061 | 07/31/2012 13:20:14 | 1,317,928 | 04/06/2012 17:06:56 | 31 | 2 | Bitcoind wallet fake coins | I have used the Move command through JSON using C# and now I am stuck with 825 "fake" coins my account I can't seem to get rid off.
How can I fix my wallet to get rid of those "fake" coins? I don't have any backups. | c# | json | bitcoin | null | null | 07/31/2012 15:17:14 | off topic | Bitcoind wallet fake coins
===
I have used the Move command through JSON using C# and now I am stuck with 825 "fake" coins my account I can't seem to get rid off.
How can I fix my wallet to get rid of those "fake" coins? I don't have any backups. | 2 |
11,083,479 | 06/18/2012 13:02:10 | 948,128 | 09/16/2011 04:24:51 | 87 | 7 | Emacs, GDB, and multiple X windows | I use `gdb-many-windows` in `emacs` for my debugging.
Recently, I discovered how to move a buffer to [another X window][1] using `C-x 5 2`.
I find it convenient: since I use multiple displays, I can have one window with source and variables, and gdb's command line in another window.
But my problem is when I perform a step-by-step in `gdb`: when it opens another source file, it does that in the same window where the command line is located, while I expect it to be updated in the other window.
Does anybody know how to tweak `gdb` or `emacs` to do that? Thanks,
[1]: https://www.gnu.org/software/emacs/manual/html_node/emacs/Creating-Frames.html | emacs | gdb | null | null | null | null | open | Emacs, GDB, and multiple X windows
===
I use `gdb-many-windows` in `emacs` for my debugging.
Recently, I discovered how to move a buffer to [another X window][1] using `C-x 5 2`.
I find it convenient: since I use multiple displays, I can have one window with source and variables, and gdb's command line in another window.
But my problem is when I perform a step-by-step in `gdb`: when it opens another source file, it does that in the same window where the command line is located, while I expect it to be updated in the other window.
Does anybody know how to tweak `gdb` or `emacs` to do that? Thanks,
[1]: https://www.gnu.org/software/emacs/manual/html_node/emacs/Creating-Frames.html | 0 |
9,171,746 | 02/07/2012 06:08:28 | 571,946 | 01/11/2011 22:14:19 | 564 | 15 | javascript chart API? | ok, so this is is kinda complicated... I'm working on a executive dashboard where I will be displaying some tables and charts... due to the n ature of the project I can't use any server side technology (don´t ask me why is a dumb policy I know), so I have to consume a webservie via ajax and get some arrays of data to my app, I´ve tried several API´s but all of them seem to have a limitation or something that kills it, unfortunately the corporate users rely on IE 7 and this can't be changed so I need a solution that wokrs perfectly on it, I already try google charts, graphael,bluff, flot, plotkit, jquery visualize and jqplot.
Ok so the only API that meets absolutely is highcarts, unfortunately it requires a commercial licence which management is unwilling to pay. Bluff charts get really weird when scaled to more than 800px, flot has a very limited API and the tooltips on multi axis dont work, plotkit and jquery visualize doesnt have tooltips and I couldnt find any good documentation on gpraphael, my best shot was Jqplot which was meeting all my needs until I tried to print it on paper, they print unaligned.. seems to be a problem with excanvas...
so I was wondering if someone could offer any other alternative that has tooltips, doesnt require server side, is free and is printable on IE . | javascript | jquery | graph | charts | null | 02/08/2012 19:05:10 | not constructive | javascript chart API?
===
ok, so this is is kinda complicated... I'm working on a executive dashboard where I will be displaying some tables and charts... due to the n ature of the project I can't use any server side technology (don´t ask me why is a dumb policy I know), so I have to consume a webservie via ajax and get some arrays of data to my app, I´ve tried several API´s but all of them seem to have a limitation or something that kills it, unfortunately the corporate users rely on IE 7 and this can't be changed so I need a solution that wokrs perfectly on it, I already try google charts, graphael,bluff, flot, plotkit, jquery visualize and jqplot.
Ok so the only API that meets absolutely is highcarts, unfortunately it requires a commercial licence which management is unwilling to pay. Bluff charts get really weird when scaled to more than 800px, flot has a very limited API and the tooltips on multi axis dont work, plotkit and jquery visualize doesnt have tooltips and I couldnt find any good documentation on gpraphael, my best shot was Jqplot which was meeting all my needs until I tried to print it on paper, they print unaligned.. seems to be a problem with excanvas...
so I was wondering if someone could offer any other alternative that has tooltips, doesnt require server side, is free and is printable on IE . | 4 |
11,725,957 | 07/30/2012 16:47:58 | 866,262 | 07/27/2011 20:30:43 | 134 | 0 | How to install Xcode 4.4? | I currently have Xcode 4.2.1, Mac OS X 10.7.4, and Lion. When I try to click the install button for Xcode 4.4 from the App Store. It shows this waiting sign:
http://www.rdmag.com/WorkArea/images/application/loading_big.gif But other than that nothing else happens. | xcode | xcode4 | null | null | null | null | open | How to install Xcode 4.4?
===
I currently have Xcode 4.2.1, Mac OS X 10.7.4, and Lion. When I try to click the install button for Xcode 4.4 from the App Store. It shows this waiting sign:
http://www.rdmag.com/WorkArea/images/application/loading_big.gif But other than that nothing else happens. | 0 |
6,581,269 | 07/05/2011 10:31:27 | 829,491 | 07/05/2011 10:27:40 | 1 | 1 | VB.Net Application | I am trying to create a .Net application to edit a excel file by deleting some columns and keeping the columns which we need and then removing the duplicate values based on the first column which is going to be the Serial no. which should have a check to have 6 digits by default like 2563 should be displayed as 002563.
Please help me..
| winforms | application | null | null | null | 07/05/2011 19:24:39 | not a real question | VB.Net Application
===
I am trying to create a .Net application to edit a excel file by deleting some columns and keeping the columns which we need and then removing the duplicate values based on the first column which is going to be the Serial no. which should have a check to have 6 digits by default like 2563 should be displayed as 002563.
Please help me..
| 1 |
2,597,718 | 04/08/2010 05:13:31 | 52,745 | 01/08/2009 02:48:42 | 444 | 2 | How to do SoapClient on php | I'm new in soapclient, I have tried to do some study online and also tried coding on soap, but seem this is still not working to me, just wandering anyone here can point out and perhaps give me some example how can I actually use the soapclint to get the feedback from the following web server?
POST /webservices/tempconvert.asmx HTTP/1.1
Host: www.w3schools.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://tempuri.org/CelsiusToFahrenheit"
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<CelsiusToFahrenheit xmlns="http://tempuri.org/">
<Celsius>string</Celsius>
</CelsiusToFahrenheit>
</soap:Body>
</soap:Envelope>
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<CelsiusToFahrenheitResponse xmlns="http://tempuri.org/">
<CelsiusToFahrenheitResult>string</CelsiusToFahrenheitResult>
</CelsiusToFahrenheitResponse>
</soap:Body>
</soap:Envelope>
<?php
$url = "http://www.w3schools.com/webservices/tempconvert.asmx?WSDL";
$client = new SoapClient($url);
?>
What should I do for the next steps so that I can get the respond ?? | php | soap | null | null | null | null | open | How to do SoapClient on php
===
I'm new in soapclient, I have tried to do some study online and also tried coding on soap, but seem this is still not working to me, just wandering anyone here can point out and perhaps give me some example how can I actually use the soapclint to get the feedback from the following web server?
POST /webservices/tempconvert.asmx HTTP/1.1
Host: www.w3schools.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://tempuri.org/CelsiusToFahrenheit"
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<CelsiusToFahrenheit xmlns="http://tempuri.org/">
<Celsius>string</Celsius>
</CelsiusToFahrenheit>
</soap:Body>
</soap:Envelope>
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<CelsiusToFahrenheitResponse xmlns="http://tempuri.org/">
<CelsiusToFahrenheitResult>string</CelsiusToFahrenheitResult>
</CelsiusToFahrenheitResponse>
</soap:Body>
</soap:Envelope>
<?php
$url = "http://www.w3schools.com/webservices/tempconvert.asmx?WSDL";
$client = new SoapClient($url);
?>
What should I do for the next steps so that I can get the respond ?? | 0 |
5,929,896 | 05/08/2011 19:50:21 | 744,176 | 05/08/2011 19:50:21 | 1 | 0 | Linq/SQL help compare unique id's from prev/next month to count new | I am trying to get a list of months from a table of payments that tells me how many customers are in a program that month. I can do that, the hard part is i need to know how many customers each month were NOT in the month before, and then also who WAS in the month before but is no longer. Basically to count joining/quitting people. The reason i can't do this with a min or max is that sometimes they will be out of the program a few months and come back in.
Here is what i have in LINQ that gets me the original count, now i just need a way to compare each month to see how many unique "Customer Id"'s from the prev month and next month.
var query2 =
from p in Payments
where (p.Products == "c30" || p.Products == "c3") && (p.PayType != "Credit" || p.PayType != "Return" || p.PayType != "Refund" || p.PayType != "Charge Back" || p.PayType != "Adjustment")
&& p.PayAmt > 0 //&& p.Date == queryDate
//order by p.Date.Value.Month descending
group p by p.Date.Value.Year into yearGroups
select new
{
Year = yearGroups.Key,
Months =
from mg in yearGroups
group mg.ContactId by mg.Date.Value.Month into monthGroup
select new
{
Month = monthGroup.Key,
AdvMembers = monthGroup.Distinct().Count(),
}
}; | sql | linq | linq-to-sql | null | null | 07/11/2011 11:19:23 | not a real question | Linq/SQL help compare unique id's from prev/next month to count new
===
I am trying to get a list of months from a table of payments that tells me how many customers are in a program that month. I can do that, the hard part is i need to know how many customers each month were NOT in the month before, and then also who WAS in the month before but is no longer. Basically to count joining/quitting people. The reason i can't do this with a min or max is that sometimes they will be out of the program a few months and come back in.
Here is what i have in LINQ that gets me the original count, now i just need a way to compare each month to see how many unique "Customer Id"'s from the prev month and next month.
var query2 =
from p in Payments
where (p.Products == "c30" || p.Products == "c3") && (p.PayType != "Credit" || p.PayType != "Return" || p.PayType != "Refund" || p.PayType != "Charge Back" || p.PayType != "Adjustment")
&& p.PayAmt > 0 //&& p.Date == queryDate
//order by p.Date.Value.Month descending
group p by p.Date.Value.Year into yearGroups
select new
{
Year = yearGroups.Key,
Months =
from mg in yearGroups
group mg.ContactId by mg.Date.Value.Month into monthGroup
select new
{
Month = monthGroup.Key,
AdvMembers = monthGroup.Distinct().Count(),
}
}; | 1 |
9,913,064 | 03/28/2012 17:53:57 | 325,068 | 04/24/2010 19:08:08 | 229 | 4 | How can you make sure a username won't conflict with an existing route? | So I'd like to have urls on my site like http://foobar.com/hadees that goes to someone's profile. However when registering usernames how do I make sure they don't pick something that will conflict with my existing routes?
I'm guessing I need to get a list of the existing routes but I'm not sure how to do it. | ruby-on-rails-3 | routing | null | null | null | null | open | How can you make sure a username won't conflict with an existing route?
===
So I'd like to have urls on my site like http://foobar.com/hadees that goes to someone's profile. However when registering usernames how do I make sure they don't pick something that will conflict with my existing routes?
I'm guessing I need to get a list of the existing routes but I'm not sure how to do it. | 0 |
10,793,335 | 05/29/2012 05:05:37 | 1,386,887 | 05/10/2012 11:00:06 | 1 | 0 | how can i ganerate a path by user touch using lines and arcs in iphone? | i was trying to develop a app that creates the dynamic paths and store for further use
The paths i want to created using lines and arcs drawn on user touch.
if you have any answer relating plz give it | dynamic | null | null | null | null | 06/06/2012 12:17:46 | not a real question | how can i ganerate a path by user touch using lines and arcs in iphone?
===
i was trying to develop a app that creates the dynamic paths and store for further use
The paths i want to created using lines and arcs drawn on user touch.
if you have any answer relating plz give it | 1 |
878,245 | 05/18/2009 15:15:49 | 366 | 08/05/2008 06:49:49 | 227 | 10 | How do I update only the properties of my models that have changed in MVC? | I'm developing a webapp that allows the editing of records. There is a possibility that two users could be working on the same screen at a time and I want to minimise the damage done, if they both click save.
If User1 requests the page and then makes changes to the Address, Telephone and Contact Details, but before he clicks Save, User2 requests the same page.
User1 then clicks save and the whole model is updated using TryUpdateModel(), if User2 simply appends some detail to the Notes field, when he saves, the TryUpdateModel() method will overwrite the new details User1 saved, with the old details.
I've considered storing the original values for all the model's properties in a hidden form field, and then writing a custom TryUpdateModel to only update the properties that have changed, but this feels a little too like the Viewstate we've all been more than happy to leave behind by moving to MVC.
Is there a pattern for dealing with this problem that I'm not aware of?
How would you handle it?
Anthony | asp.net-mvc | mvc | entity-framework | null | null | null | open | How do I update only the properties of my models that have changed in MVC?
===
I'm developing a webapp that allows the editing of records. There is a possibility that two users could be working on the same screen at a time and I want to minimise the damage done, if they both click save.
If User1 requests the page and then makes changes to the Address, Telephone and Contact Details, but before he clicks Save, User2 requests the same page.
User1 then clicks save and the whole model is updated using TryUpdateModel(), if User2 simply appends some detail to the Notes field, when he saves, the TryUpdateModel() method will overwrite the new details User1 saved, with the old details.
I've considered storing the original values for all the model's properties in a hidden form field, and then writing a custom TryUpdateModel to only update the properties that have changed, but this feels a little too like the Viewstate we've all been more than happy to leave behind by moving to MVC.
Is there a pattern for dealing with this problem that I'm not aware of?
How would you handle it?
Anthony | 0 |
4,487,609 | 12/20/2010 07:17:06 | 542,866 | 12/15/2010 03:40:16 | 12 | 0 | How To Design 4 bit Binary Multiplier | How To Design 4 bit Binary Multiplier | architecture | null | null | null | null | 12/20/2010 07:34:53 | not a real question | How To Design 4 bit Binary Multiplier
===
How To Design 4 bit Binary Multiplier | 1 |
8,831,991 | 01/12/2012 08:28:08 | 626,523 | 02/21/2011 12:05:10 | 85 | 4 | What is the best way to make html button with link behavior? | I have table which has about 50 rows. Each row has link, but I need replace this link by button. And I have a few way to do this but I don't know which way is the best.
First way:
<form method="POST" action="some url">
<input type="submit" value="Clickable Button">
</form>
Second way:
<input type="button" value="Action button"
onclick="window.location='http://www.w3schools.com'" />
Third way:
<input type="button" class="actionButton" value="Action button"
data-link="http://www.w3schools.com"/>
And after I will add javascript code with jQuery:
$("input.actionButton").click(function () {
window.location = $(this).attr("data-link");
});
So, what is the best way? | javascript | html | null | null | null | null | open | What is the best way to make html button with link behavior?
===
I have table which has about 50 rows. Each row has link, but I need replace this link by button. And I have a few way to do this but I don't know which way is the best.
First way:
<form method="POST" action="some url">
<input type="submit" value="Clickable Button">
</form>
Second way:
<input type="button" value="Action button"
onclick="window.location='http://www.w3schools.com'" />
Third way:
<input type="button" class="actionButton" value="Action button"
data-link="http://www.w3schools.com"/>
And after I will add javascript code with jQuery:
$("input.actionButton").click(function () {
window.location = $(this).attr("data-link");
});
So, what is the best way? | 0 |
1,631,328 | 10/27/2009 14:48:08 | 6,682 | 09/15/2008 12:29:13 | 2,130 | 25 | Minimal, good-citizen, console application boilerplate (C#) | When anyone goes out to create a **Console Application** project using Visual Studio (up to 2008 at the time of writing), you are presented with a boilerplate `Program.cs` that looks like this:
class Program
{
static void Main(string[] args)
{
}
}
However, there are a few things that everyone needs to do to make a console application a _minimally_ good citizen. For example, if an exception occurs, then write out a clean message to standard error ([Console.Error][1]) and not standard output ([Console.Out][2]). Likewise, set the error code to a non-zero value in the event of some error so that calling processes can detect failures.
**What would be the _minimal_ boilerplate code for a C# console application entry-point that would make it a _well-behaved_ citizen? What would you add or remove to the following?**
using System;
using System.Diagnostics;
using System.Linq;
static class Program
{
static void Run(string[] args)
{
// TODO Replace line-echoing sample with actual application code
string line;
while ((line = Console.ReadLine()) != null)
Console.WriteLine(line);
}
static int Main(string[] args)
{
// TODO Use a more robust arguments parser
if (args.Any(arg => arg.Equals("/v") || arg.Equals("-v"))) // verbose?
Trace.Listeners.Add(new ConsoleTraceListener(true));
try
{
Run(args);
return Environment.ExitCode;
}
catch (Exception e)
{
Console.Error.WriteLine(e.Message);
Trace.TraceError(e.ToString());
return Environment.ExitCode != 0
? Environment.ExitCode : 100;
}
}
}
What this boilerplate achieves:
- If an exception is thrown:
- a clean message is printed to standard error
- the full details are traced
- the exit code is set to an arbitrary non-zero value (100) unless already set
- Tracing can be turned on dynamically via a _verbose switch_
- Tracing is sent to standard error to not interfere the _real output_
- On successful completion, the exit code reflects the last [Environment.ExitCode][3] value, which is usually zero but can be changed by downstream code
Non-goals of this question:
- Identify command-line arguments handling code or library
- Identify an external logging or tracing library
[1]: http://msdn.microsoft.com/en-us/library/system.console.error.aspx
[2]: http://msdn.microsoft.com/en-us/library/system.console.out.aspx
[3]: http://msdn.microsoft.com/en-us/library/system.environment.exitcode.aspx | command-line | c# | null | null | null | 06/14/2012 20:44:57 | not constructive | Minimal, good-citizen, console application boilerplate (C#)
===
When anyone goes out to create a **Console Application** project using Visual Studio (up to 2008 at the time of writing), you are presented with a boilerplate `Program.cs` that looks like this:
class Program
{
static void Main(string[] args)
{
}
}
However, there are a few things that everyone needs to do to make a console application a _minimally_ good citizen. For example, if an exception occurs, then write out a clean message to standard error ([Console.Error][1]) and not standard output ([Console.Out][2]). Likewise, set the error code to a non-zero value in the event of some error so that calling processes can detect failures.
**What would be the _minimal_ boilerplate code for a C# console application entry-point that would make it a _well-behaved_ citizen? What would you add or remove to the following?**
using System;
using System.Diagnostics;
using System.Linq;
static class Program
{
static void Run(string[] args)
{
// TODO Replace line-echoing sample with actual application code
string line;
while ((line = Console.ReadLine()) != null)
Console.WriteLine(line);
}
static int Main(string[] args)
{
// TODO Use a more robust arguments parser
if (args.Any(arg => arg.Equals("/v") || arg.Equals("-v"))) // verbose?
Trace.Listeners.Add(new ConsoleTraceListener(true));
try
{
Run(args);
return Environment.ExitCode;
}
catch (Exception e)
{
Console.Error.WriteLine(e.Message);
Trace.TraceError(e.ToString());
return Environment.ExitCode != 0
? Environment.ExitCode : 100;
}
}
}
What this boilerplate achieves:
- If an exception is thrown:
- a clean message is printed to standard error
- the full details are traced
- the exit code is set to an arbitrary non-zero value (100) unless already set
- Tracing can be turned on dynamically via a _verbose switch_
- Tracing is sent to standard error to not interfere the _real output_
- On successful completion, the exit code reflects the last [Environment.ExitCode][3] value, which is usually zero but can be changed by downstream code
Non-goals of this question:
- Identify command-line arguments handling code or library
- Identify an external logging or tracing library
[1]: http://msdn.microsoft.com/en-us/library/system.console.error.aspx
[2]: http://msdn.microsoft.com/en-us/library/system.console.out.aspx
[3]: http://msdn.microsoft.com/en-us/library/system.environment.exitcode.aspx | 4 |
7,745,359 | 10/12/2011 19:21:10 | 982,288 | 10/06/2011 13:49:05 | 13 | 0 | jquery, js: how to read specific line from external file? | How do you read a specific line, say line 3, from an external file using jquery or javascript?
many thanks. | jquery | file | external | null | null | 10/13/2011 15:53:11 | not a real question | jquery, js: how to read specific line from external file?
===
How do you read a specific line, say line 3, from an external file using jquery or javascript?
many thanks. | 1 |
1,470,100 | 09/24/2009 06:44:38 | 168,350 | 09/04/2009 06:55:27 | 24 | 5 | Wordpress OR Joomla? | Which is better, Wordpress OR Joomla?
What are their pros and cons?
In which case you use Wordpress over Joomla and vice versa?
For development which one I can use as development framework? | wordpress | joomla | php | frameworks | null | 07/16/2012 11:30:21 | not constructive | Wordpress OR Joomla?
===
Which is better, Wordpress OR Joomla?
What are their pros and cons?
In which case you use Wordpress over Joomla and vice versa?
For development which one I can use as development framework? | 4 |
6,637,020 | 07/09/2011 19:34:11 | 837,033 | 07/09/2011 19:34:11 | 1 | 0 | Choosing parameter names in Java | How should I choose which method names and parameter names/types to use in Java (or any other language for that matter)? And why are there so many ways to choose? If many people work on a project, it's annoying to see different ways of naming in different parts of the code, especially if people are inconsequent about their usage. Why didn't the inventors of the language simply state a standard -- "This is the EXACT way methods and parameters should be named. Period."? It would be easier to do programming then. I get stressed by having to choose between a gazillion different parameter/method names each time I write a method and trying to be consequent about how I choose throuhgout the code ;(
---
Example 1:
public void handleFile(String file)
or
public void handleFile(String fileName)
or
public void handleFile(File file)
---
Example 2:
public void exec(String command)
or
public void exec(String cmd)
or
public void exec(String commandString)
or
public void exec(String cmdString)
or
public void execute(String command)
or
public void execute(Command command)
or
public void execute(Command cmdObj)
etc. etc.
| java | null | null | null | null | 07/12/2011 02:37:13 | not constructive | Choosing parameter names in Java
===
How should I choose which method names and parameter names/types to use in Java (or any other language for that matter)? And why are there so many ways to choose? If many people work on a project, it's annoying to see different ways of naming in different parts of the code, especially if people are inconsequent about their usage. Why didn't the inventors of the language simply state a standard -- "This is the EXACT way methods and parameters should be named. Period."? It would be easier to do programming then. I get stressed by having to choose between a gazillion different parameter/method names each time I write a method and trying to be consequent about how I choose throuhgout the code ;(
---
Example 1:
public void handleFile(String file)
or
public void handleFile(String fileName)
or
public void handleFile(File file)
---
Example 2:
public void exec(String command)
or
public void exec(String cmd)
or
public void exec(String commandString)
or
public void exec(String cmdString)
or
public void execute(String command)
or
public void execute(Command command)
or
public void execute(Command cmdObj)
etc. etc.
| 4 |
3,247,772 | 07/14/2010 15:31:47 | 174,718 | 09/17/2009 02:41:23 | 766 | 8 | IE7: Item doesn't float | I am attempting to float a span to the right within an h2 element. In IE8 and Firefox this works fine; in IE7 it is not floating.
The HTML:
<h2>
<span id="spanA"> /*Should be floated to the right*/
<span id="spanB">
<span id="spanC">
</h2>
The CSS:
#spanA{
float: right;
}
Any ideas as to what could be wrong? | css | internet-explorer-7 | float | null | null | null | open | IE7: Item doesn't float
===
I am attempting to float a span to the right within an h2 element. In IE8 and Firefox this works fine; in IE7 it is not floating.
The HTML:
<h2>
<span id="spanA"> /*Should be floated to the right*/
<span id="spanB">
<span id="spanC">
</h2>
The CSS:
#spanA{
float: right;
}
Any ideas as to what could be wrong? | 0 |
6,561,256 | 07/03/2011 05:32:19 | 738,798 | 05/04/2011 20:55:23 | 15 | 1 | MVC Unit Testing | can anyone explain me the real concept of doing unit testing for model classes.
`enter code here`public class category
{
public int ID;
public string Name;
}
In my test class, i saw people writing code like this
[TestClass]
public class CategoryTest
{
[TestMethod]
public void Category_Test()
{
//Arrange
category = new Category() { intialisation};
//Act
//Assert
check again you have same values are not;
}
}
I couldn't see any value of testing model classes testing without interacting to databases?
Thanks in advance | asp.net-mvc-3 | null | null | null | null | 05/14/2012 14:12:52 | not constructive | MVC Unit Testing
===
can anyone explain me the real concept of doing unit testing for model classes.
`enter code here`public class category
{
public int ID;
public string Name;
}
In my test class, i saw people writing code like this
[TestClass]
public class CategoryTest
{
[TestMethod]
public void Category_Test()
{
//Arrange
category = new Category() { intialisation};
//Act
//Assert
check again you have same values are not;
}
}
I couldn't see any value of testing model classes testing without interacting to databases?
Thanks in advance | 4 |
5,328,312 | 03/16/2011 16:21:06 | 16,593 | 09/17/2008 18:48:28 | 158 | 2 | How to fill an Ext.form.CheckboxGroup with checkboxes generated based on a JSON object returned from a server | I'm trying to dynamically fill an `Ext.form.CheckboxGroup` with `Ext.form.Checkbox`s derived from a JSON object pulled from a jsp page. My JSON object looks like this:
{"sensors": [ { "id": 200, "name": "name - B - A" }, { "id": 201, "name":
"name - B - B" }, { "id": 202, "name": "name - C - A" }, { "id": 203, "name":
"name - C - B" } ]}
I can load these objects into an `Ext.data.JsonStore` with code like this:
new Ext.data.JsonStore({
id: 'sensorStore',
autoLoad: true,
method: 'GET',
baseParams: {
jobType: 'sensor'
},
url: 'getstatus.jsp',
root: 'sensors',
sortInfo: { field: 'id', direction: 'ASC' },
fields: [ 'id', 'name' ]
}),
My understanding is that this will give me access to a set of `Ext.data.Record` objects, but I can't figure out how to go about iterating through those Records to create any `Ext.form.Checkbox`s, or if there's some other way of achieving the same result.
I'm not trying to set the values of the checkboxes, though I will need to be able to reference them when I submit the form. | javascript | json | extjs | null | null | null | open | How to fill an Ext.form.CheckboxGroup with checkboxes generated based on a JSON object returned from a server
===
I'm trying to dynamically fill an `Ext.form.CheckboxGroup` with `Ext.form.Checkbox`s derived from a JSON object pulled from a jsp page. My JSON object looks like this:
{"sensors": [ { "id": 200, "name": "name - B - A" }, { "id": 201, "name":
"name - B - B" }, { "id": 202, "name": "name - C - A" }, { "id": 203, "name":
"name - C - B" } ]}
I can load these objects into an `Ext.data.JsonStore` with code like this:
new Ext.data.JsonStore({
id: 'sensorStore',
autoLoad: true,
method: 'GET',
baseParams: {
jobType: 'sensor'
},
url: 'getstatus.jsp',
root: 'sensors',
sortInfo: { field: 'id', direction: 'ASC' },
fields: [ 'id', 'name' ]
}),
My understanding is that this will give me access to a set of `Ext.data.Record` objects, but I can't figure out how to go about iterating through those Records to create any `Ext.form.Checkbox`s, or if there's some other way of achieving the same result.
I'm not trying to set the values of the checkboxes, though I will need to be able to reference them when I submit the form. | 0 |
140,815 | 09/26/2008 17:29:41 | 19,734 | 09/20/2008 18:41:06 | 690 | 43 | Are you a code neat freak? | How do you handle ugly code? Are you a code neat freak?
- Do you feel that you have to clean up a file of source code before you can do anything useful?
- Do you have the urge to refactor bad structure when you see it?
I admit that I'm often tempted to clean up other people's code when I have to modify the code anyway. Bad code is a pet peeve of mine.
How about you? | clean-code | neat-freak | ugliness-of-code | refactoring | null | 01/18/2012 22:27:58 | not constructive | Are you a code neat freak?
===
How do you handle ugly code? Are you a code neat freak?
- Do you feel that you have to clean up a file of source code before you can do anything useful?
- Do you have the urge to refactor bad structure when you see it?
I admit that I'm often tempted to clean up other people's code when I have to modify the code anyway. Bad code is a pet peeve of mine.
How about you? | 4 |
2,048,625 | 01/12/2010 11:47:11 | 107,339 | 05/14/2009 21:02:33 | 11 | 2 | TestNG call sequence of @AfterMethod and ITestListener#onFailure | Does anybody know what is called first if a test fails? | testng | null | null | null | null | null | open | TestNG call sequence of @AfterMethod and ITestListener#onFailure
===
Does anybody know what is called first if a test fails? | 0 |
125,016 | 09/24/2008 02:09:18 | 15,846 | 09/17/2008 13:08:19 | 132 | 15 | Switching to a Standing Desk | At work I have a standard desk (4 legs, flat surface, you get the picture). For a while now I've been thinking about converting to a standing desk. What would be the best way to go about this on a limited budget? Are there some good laptop/keyboard stands I could place on my existing desk? Which ones are the best?
I'm trying to avoid requesting a whole new desk, and keeping things as simple as possible. | ergonomics | desk | enviornment | null | null | 11/02/2011 08:43:18 | off topic | Switching to a Standing Desk
===
At work I have a standard desk (4 legs, flat surface, you get the picture). For a while now I've been thinking about converting to a standing desk. What would be the best way to go about this on a limited budget? Are there some good laptop/keyboard stands I could place on my existing desk? Which ones are the best?
I'm trying to avoid requesting a whole new desk, and keeping things as simple as possible. | 2 |
8,063,836 | 11/09/2011 10:45:48 | 722,002 | 04/23/2011 18:44:12 | 89 | 0 | os.mkdir's rights assigning doesn't work as expected | I'm trying to create directory with 777 rights.
os.mkdir(Xmldocument.directory, 0777)
However what I get is 775
drwxrwxr-x. 2 mwysoki mwysoki 4096 Nov 9 11:38 VeloDBBrowser
I'm sure that I have appropriate rights because chmod 777 works just fine. | python | unix | null | null | null | null | open | os.mkdir's rights assigning doesn't work as expected
===
I'm trying to create directory with 777 rights.
os.mkdir(Xmldocument.directory, 0777)
However what I get is 775
drwxrwxr-x. 2 mwysoki mwysoki 4096 Nov 9 11:38 VeloDBBrowser
I'm sure that I have appropriate rights because chmod 777 works just fine. | 0 |
8,251,669 | 11/24/2011 02:46:30 | 1,063,094 | 11/24/2011 02:30:56 | 1 | 0 | (J2ME) How to get list of files/resources inside my jar app | So, I am creating a mobile application using j2me and lwuit.
In that application the user will open a file.
My question is how do I get list of files inside my jar application..
Ex : Inside a res folder there are :
File1.fl,
File2.fl,
File3.fl,
We can open a single file using `getResourceAsStream()` function.
But how do I get the list of file names inside the folder.
I came across with `FileConnection` but it seems that it is used to access files in the local phone.
In java we can do this using the `File` class.. Anyone can help me with these...
Thanks guys.. | java | java-me | jme | null | null | null | open | (J2ME) How to get list of files/resources inside my jar app
===
So, I am creating a mobile application using j2me and lwuit.
In that application the user will open a file.
My question is how do I get list of files inside my jar application..
Ex : Inside a res folder there are :
File1.fl,
File2.fl,
File3.fl,
We can open a single file using `getResourceAsStream()` function.
But how do I get the list of file names inside the folder.
I came across with `FileConnection` but it seems that it is used to access files in the local phone.
In java we can do this using the `File` class.. Anyone can help me with these...
Thanks guys.. | 0 |
4,050,644 | 10/29/2010 09:35:19 | 491,120 | 10/29/2010 09:35:19 | 1 | 0 | To start Android Applications from website | I am a c# programmer that loves android phones knowing that I am never going to learn Java.
What I want to to is an ordinary website that starts the relevant applications from my android phone (Legend) with parameters like:
This works:
<a href="mailto:john@doe.com">Mail</a> - this opens the email klient with correct to=john@doe.com
href="tel:+4512345678" opens the phone with the correct digits on the screen
href="geo:something" opens google map and show you your location
This does not work:
href="sms:+4512345678, body=Hello You"
href="geo:+address" - I want to enten an adress I can navigate to...
Is the last ones possible do do or something like it?
Can you send me link or description
Help would be very appreciated
Thanks in advance
/Bo
| html | android | null | null | null | null | open | To start Android Applications from website
===
I am a c# programmer that loves android phones knowing that I am never going to learn Java.
What I want to to is an ordinary website that starts the relevant applications from my android phone (Legend) with parameters like:
This works:
<a href="mailto:john@doe.com">Mail</a> - this opens the email klient with correct to=john@doe.com
href="tel:+4512345678" opens the phone with the correct digits on the screen
href="geo:something" opens google map and show you your location
This does not work:
href="sms:+4512345678, body=Hello You"
href="geo:+address" - I want to enten an adress I can navigate to...
Is the last ones possible do do or something like it?
Can you send me link or description
Help would be very appreciated
Thanks in advance
/Bo
| 0 |
4,599,985 | 01/05/2011 01:05:41 | 406,531 | 07/30/2010 08:27:40 | 65 | 2 | Why after animating height setting this property directly stops working | I have problem which is killing me. Below is simple example
<Grid Name="_grid">
<Button Content="Button" Height="23" HorizontalAlignment="Left" Margin="36,33,0,0" Name="button" VerticalAlignment="Top" Width="75" />
<Button Content="Enlarge through animation" Height="23" Margin="172,33,24,0" Name="_animateButton" VerticalAlignment="Top" Click="_animateButton_Click" />
<Button Content="Enlarge through simple heigh changing" Height="23" Margin="172,62,24,0" Name="_resizeButton" VerticalAlignment="Top" Click="_resizeButton_Click" />
</Grid>
And in code behind
private void _resizeButton_Click(object sender, RoutedEventArgs e)
{
button.Height += 10;
}
private void _animateButton_Click(object sender, RoutedEventArgs e)
{
Storyboard storyboard = new Storyboard();
DoubleAnimation animation = new DoubleAnimation(button.Height + 10, new Duration(new TimeSpan(0, 0, 0, 1)));
storyboard.Children.Add(animation);
Storyboard.SetTargetName(animation, button.Name);
Storyboard.SetTargetProperty(animation, new PropertyPath(HeightProperty));
storyboard.Begin(_grid);
}
Application looks like this
![alt text][1]
After pressing _resizeButton left button enlarge immediately. Then I'm pressing _animateButton - left button is enlarging slowly. After this I'm pressing _resizeButton again and nothing is happening. Why is that?
I have noticed that the same thing is when animating Top property
[1]: http://i.stack.imgur.com/jYtjv.png | c# | wpf | animation | dependency-properties | null | null | open | Why after animating height setting this property directly stops working
===
I have problem which is killing me. Below is simple example
<Grid Name="_grid">
<Button Content="Button" Height="23" HorizontalAlignment="Left" Margin="36,33,0,0" Name="button" VerticalAlignment="Top" Width="75" />
<Button Content="Enlarge through animation" Height="23" Margin="172,33,24,0" Name="_animateButton" VerticalAlignment="Top" Click="_animateButton_Click" />
<Button Content="Enlarge through simple heigh changing" Height="23" Margin="172,62,24,0" Name="_resizeButton" VerticalAlignment="Top" Click="_resizeButton_Click" />
</Grid>
And in code behind
private void _resizeButton_Click(object sender, RoutedEventArgs e)
{
button.Height += 10;
}
private void _animateButton_Click(object sender, RoutedEventArgs e)
{
Storyboard storyboard = new Storyboard();
DoubleAnimation animation = new DoubleAnimation(button.Height + 10, new Duration(new TimeSpan(0, 0, 0, 1)));
storyboard.Children.Add(animation);
Storyboard.SetTargetName(animation, button.Name);
Storyboard.SetTargetProperty(animation, new PropertyPath(HeightProperty));
storyboard.Begin(_grid);
}
Application looks like this
![alt text][1]
After pressing _resizeButton left button enlarge immediately. Then I'm pressing _animateButton - left button is enlarging slowly. After this I'm pressing _resizeButton again and nothing is happening. Why is that?
I have noticed that the same thing is when animating Top property
[1]: http://i.stack.imgur.com/jYtjv.png | 0 |
11,591,890 | 07/21/2012 11:46:05 | 1,337,478 | 04/16/2012 23:40:54 | 6 | 0 | blindly rename files - linux | I have quite a large number of files that has long filenames, symbols, spaces etc. I want to randomly and blindly to rename all of them all at once while giving them a random filename from 1-9a-Z. I do not want to manipulate each file name as sometime it throw out errors due to the symbols, spaces, length, etc.
Any kind of help is great appreciated. Thank you in advance. | linux | bash | rename | null | null | 07/23/2012 17:50:41 | off topic | blindly rename files - linux
===
I have quite a large number of files that has long filenames, symbols, spaces etc. I want to randomly and blindly to rename all of them all at once while giving them a random filename from 1-9a-Z. I do not want to manipulate each file name as sometime it throw out errors due to the symbols, spaces, length, etc.
Any kind of help is great appreciated. Thank you in advance. | 2 |
7,179,448 | 08/24/2011 17:06:52 | 361,001 | 06/08/2010 03:48:42 | 745 | 12 | Changing effect / fx of Malsup Cycle based on slide index | I have a gallery that I am using [malsup's cycle][1] on and I would like to change the effect based on the link that was clicked index (scrollLeft or scrollRight). I know `.live()` would probably work in this situation but I am not sure how to implement programatically. Below is the code to give an idea of what I would like to do.
var animDir = 'scrollLeft';
var animIndex = 0;
$("#colors").cycle({
fx : animYarisDir,
timeout : 0
});
$("#color-controls > li a").click(function(e){
e.preventDefault();
$this = $(this),
i = $this.parent().index() -2;
if (i > animIndex ){
animDir = "scrollLeft";
} else {
animDir = "scrollRight";
};
$("#colors").cycle(i);
animIndex = i;
})
Thank you in advance,
JN
[1]: http://jquery.malsup.com/cycle/ | javascript | jquery | html | cycle | null | null | open | Changing effect / fx of Malsup Cycle based on slide index
===
I have a gallery that I am using [malsup's cycle][1] on and I would like to change the effect based on the link that was clicked index (scrollLeft or scrollRight). I know `.live()` would probably work in this situation but I am not sure how to implement programatically. Below is the code to give an idea of what I would like to do.
var animDir = 'scrollLeft';
var animIndex = 0;
$("#colors").cycle({
fx : animYarisDir,
timeout : 0
});
$("#color-controls > li a").click(function(e){
e.preventDefault();
$this = $(this),
i = $this.parent().index() -2;
if (i > animIndex ){
animDir = "scrollLeft";
} else {
animDir = "scrollRight";
};
$("#colors").cycle(i);
animIndex = i;
})
Thank you in advance,
JN
[1]: http://jquery.malsup.com/cycle/ | 0 |
1,429,403 | 09/15/2009 20:20:34 | 173,940 | 09/15/2009 19:59:45 | 1 | 0 | Using GetExtendedTcpTable in Python | I am trying to use GetExtendedTcpTable via a Python program. Basically I am trying to convert "ActiveState Code Recipe 392572: Using the Win32 IPHelper API" to ["Getting the active TCP/UDP connections using the GetExtendedTcpTable function"][1].
My problem is that I cannot seem to get the Python script to recognize TCP\_TABLE\_CLASS.TCP\_TABL\E_OWNER\_PID\_ALL.
I have tried
> ctypes.windll.iphlpapi.GetExtendedTcpTable(NULL, ctypes.byref(dwSize), bOrder, AF_INET, TCP\_TABLE\_CLASS.TCP\_TABLE\_OWNER\_PID\_ALL, 0)
but this always bails with "AttributeError: function 'TCP\_TABLE\_CLASS' not found"
I have also tried
> ctypes.windll.iphlpapi.GetExtendedTcpTable(NULL, ctypes.byref(dwSize), bOrder, AF_INET, ctypes.windll.iphlpapi.TCP\_TABLE\_CLASS.TCP\_TABLE\_OWNER\_PID\_ALL, 0)
which receives the same results.
Any recommendations are appreciated.
Cutaway
[1]: http://www.codeproject.com/KB/IP/iphlpapi2.aspx | python | winapi | null | null | null | null | open | Using GetExtendedTcpTable in Python
===
I am trying to use GetExtendedTcpTable via a Python program. Basically I am trying to convert "ActiveState Code Recipe 392572: Using the Win32 IPHelper API" to ["Getting the active TCP/UDP connections using the GetExtendedTcpTable function"][1].
My problem is that I cannot seem to get the Python script to recognize TCP\_TABLE\_CLASS.TCP\_TABL\E_OWNER\_PID\_ALL.
I have tried
> ctypes.windll.iphlpapi.GetExtendedTcpTable(NULL, ctypes.byref(dwSize), bOrder, AF_INET, TCP\_TABLE\_CLASS.TCP\_TABLE\_OWNER\_PID\_ALL, 0)
but this always bails with "AttributeError: function 'TCP\_TABLE\_CLASS' not found"
I have also tried
> ctypes.windll.iphlpapi.GetExtendedTcpTable(NULL, ctypes.byref(dwSize), bOrder, AF_INET, ctypes.windll.iphlpapi.TCP\_TABLE\_CLASS.TCP\_TABLE\_OWNER\_PID\_ALL, 0)
which receives the same results.
Any recommendations are appreciated.
Cutaway
[1]: http://www.codeproject.com/KB/IP/iphlpapi2.aspx | 0 |
7,242,360 | 08/30/2011 11:22:42 | 481,493 | 10/20/2010 09:28:00 | 384 | 15 | JSP processing message | probalby quite a dummy question, but that is not the area I work with usually...
I have html page "start.html" there is form which calls a serverlet via a post request. This servlet (JSP) is action.java there I have:
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
//please show a message that I am working
// here is some code which takes some time
response.sendRedirect(http://result.html);
}
So I do some processing then I show a page result.html. This all works fine, the problem is that upon pressing the send button in start.html I only see this little spinning wheel in IE that the system is processing and then I get the result. Most people probably would miss that little indicator. I would like to have an intermediate page or something with a progress bar, spinning wheel or even only a message "please be patient". As simple as possible. How can I achieve this?
Thanks! | jsp | servlets | null | null | null | null | open | JSP processing message
===
probalby quite a dummy question, but that is not the area I work with usually...
I have html page "start.html" there is form which calls a serverlet via a post request. This servlet (JSP) is action.java there I have:
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
//please show a message that I am working
// here is some code which takes some time
response.sendRedirect(http://result.html);
}
So I do some processing then I show a page result.html. This all works fine, the problem is that upon pressing the send button in start.html I only see this little spinning wheel in IE that the system is processing and then I get the result. Most people probably would miss that little indicator. I would like to have an intermediate page or something with a progress bar, spinning wheel or even only a message "please be patient". As simple as possible. How can I achieve this?
Thanks! | 0 |
8,126,497 | 11/14/2011 18:44:56 | 1,028,135 | 11/03/2011 16:24:52 | 9 | 4 | Emulation file system and a system registry | I use BoxedApp for emulating a file system and a system registry. I know that it is used in Delphi and C + +, and in other environments that do? it is used in C # and VB6? | c# | c++ | delphi | vb6 | null | 11/14/2011 19:53:08 | not a real question | Emulation file system and a system registry
===
I use BoxedApp for emulating a file system and a system registry. I know that it is used in Delphi and C + +, and in other environments that do? it is used in C # and VB6? | 1 |
9,732,353 | 03/16/2012 05:25:25 | 1,273,278 | 03/16/2012 05:21:20 | 1 | 0 | Unable to migrate database in Entity Framework 4.3.1 | DbMigrationsConfiguration configuration = new Configuration();
DbMigrator dbMigrator = new DbMigrator(configuration);
dbMigrator.Update();
Unable to update database to match the current model because there are pending changes and automatic migration is disabled. Either write the pending model changes to a code-based migration or enable automatic migration. Set DbMigrationsConfiguration.AutomaticMigrationsEnabled to true to enable automatic migration. | entity-framework-4 | null | null | null | null | 03/16/2012 21:55:51 | not a real question | Unable to migrate database in Entity Framework 4.3.1
===
DbMigrationsConfiguration configuration = new Configuration();
DbMigrator dbMigrator = new DbMigrator(configuration);
dbMigrator.Update();
Unable to update database to match the current model because there are pending changes and automatic migration is disabled. Either write the pending model changes to a code-based migration or enable automatic migration. Set DbMigrationsConfiguration.AutomaticMigrationsEnabled to true to enable automatic migration. | 1 |
4,880,035 | 02/02/2011 21:24:38 | 429,909 | 08/24/2010 18:34:39 | 149 | 4 | Alter MSSQL Column in PDO | I am trying to make an existing ID column in a MSSQL database AUTO_INCREMENT. I do not have access to the GUI.
I am trying this query.
$stmt = $this->conn()->prepare('ALTER TABLE myTable ALTER COLUMN ID int NOT NULL auto_increment');
if($stmt->execute()){
}else{
echo "<pre>";
print_r($stmt->errorInfo());
echo "</pre>";
}
This gives the following error `[2] => Incorrect syntax near 'auto_increment'. [20018] (severity 5) [(null)]`
Thanks for the help.
| mysql | sql-server | pdo | null | null | null | open | Alter MSSQL Column in PDO
===
I am trying to make an existing ID column in a MSSQL database AUTO_INCREMENT. I do not have access to the GUI.
I am trying this query.
$stmt = $this->conn()->prepare('ALTER TABLE myTable ALTER COLUMN ID int NOT NULL auto_increment');
if($stmt->execute()){
}else{
echo "<pre>";
print_r($stmt->errorInfo());
echo "</pre>";
}
This gives the following error `[2] => Incorrect syntax near 'auto_increment'. [20018] (severity 5) [(null)]`
Thanks for the help.
| 0 |
7,391,737 | 09/12/2011 17:39:56 | 941,073 | 09/12/2011 17:39:56 | 1 | 0 | Dynamically Allocated Array of a Class | I've declared
private:
Comment *commentArray;
int arrSize;
in the header for the class in which it is used, called CommentManager. These are initialized in the constructer, as follows:
arrSize = 1;
commentArray = new Comment[arrSize];
If I'm understanding this correctly, this should create an "array" of one Comment. Then I set up the core function of this class:
void CommentManager::addComment(QString commText, int start, int end)
{
Comment *saveArray;
saveArray = new Comment[arrSize + 1];
for (int i = 0; i < arrSize; i++)
saveArray[i] = commentArray[i];
delete[] commentArray;
commentArray = saveArray;
arrSize += 1;
This should enlarge the size of commentArray by one. Then I want to add the comment data, which is done through a function declared in Comment:
Header:
private:
QString comment;
int startPosition;
int endPosition;
Function:
void Comment::setComment(QString comm,int newStartPos, int newEndPos)
{
comment = comm;
startPosition = newStartPos;
endPosition = newEndPos;
}
I call this function as follows:
commentArray[arrSize].setComment(commText,start,end);
This results in a segfault: according to the debugger 'comment' doesn't exist. As a result, I attempted to initialize the individual comment(s) in commentArray, but the compiler wouldn't compile that. I'm not sure what's gone wrong here, and any help would be much appreciated.
| c++ | null | null | null | null | null | open | Dynamically Allocated Array of a Class
===
I've declared
private:
Comment *commentArray;
int arrSize;
in the header for the class in which it is used, called CommentManager. These are initialized in the constructer, as follows:
arrSize = 1;
commentArray = new Comment[arrSize];
If I'm understanding this correctly, this should create an "array" of one Comment. Then I set up the core function of this class:
void CommentManager::addComment(QString commText, int start, int end)
{
Comment *saveArray;
saveArray = new Comment[arrSize + 1];
for (int i = 0; i < arrSize; i++)
saveArray[i] = commentArray[i];
delete[] commentArray;
commentArray = saveArray;
arrSize += 1;
This should enlarge the size of commentArray by one. Then I want to add the comment data, which is done through a function declared in Comment:
Header:
private:
QString comment;
int startPosition;
int endPosition;
Function:
void Comment::setComment(QString comm,int newStartPos, int newEndPos)
{
comment = comm;
startPosition = newStartPos;
endPosition = newEndPos;
}
I call this function as follows:
commentArray[arrSize].setComment(commText,start,end);
This results in a segfault: according to the debugger 'comment' doesn't exist. As a result, I attempted to initialize the individual comment(s) in commentArray, but the compiler wouldn't compile that. I'm not sure what's gone wrong here, and any help would be much appreciated.
| 0 |
2,477,508 | 03/19/2010 13:11:26 | 297,368 | 03/19/2010 13:11:26 | 1 | 0 | Does Safari have a timeout issue? | I have a website that works fine in Firefox and IE but never finishes loading in Safari 4.0.4.
The live website loads a menu then loads a Google map. Using Safari, the Google map never loads.
I have a test website on the same server that uses the exact same code for loading a Google map and Safari can load the map (this is the one that won't load on my live web). This test website does not have the menu - only the Google map.
In both cases (live and test) the main web page calls a loadmap.js file.
I've been pulling everything apart to try to identify why Safari won't finish loading. Has anyone run across any problems/solutions with Safari that may help me find a resolution to this problem? | safari | javascript | timeout | null | null | null | open | Does Safari have a timeout issue?
===
I have a website that works fine in Firefox and IE but never finishes loading in Safari 4.0.4.
The live website loads a menu then loads a Google map. Using Safari, the Google map never loads.
I have a test website on the same server that uses the exact same code for loading a Google map and Safari can load the map (this is the one that won't load on my live web). This test website does not have the menu - only the Google map.
In both cases (live and test) the main web page calls a loadmap.js file.
I've been pulling everything apart to try to identify why Safari won't finish loading. Has anyone run across any problems/solutions with Safari that may help me find a resolution to this problem? | 0 |
5,218,888 | 03/07/2011 11:04:45 | 648,008 | 03/07/2011 10:54:32 | 1 | 0 | iPhone4-image problem | iPhone4-image-issue:
I am getting different pixel values for the same image when I tried the same image in iPhone3GS and iPhone4. Could anybody please help me to resolve this problem | objective-c | null | null | null | null | 03/07/2011 14:40:06 | not a real question | iPhone4-image problem
===
iPhone4-image-issue:
I am getting different pixel values for the same image when I tried the same image in iPhone3GS and iPhone4. Could anybody please help me to resolve this problem | 1 |
10,797,372 | 05/29/2012 10:31:11 | 1,423,428 | 05/29/2012 10:24:51 | 1 | 0 | Modal dilaog behaves differently starting from windows server 2008 | I have a webform with ajax extender. I used a panel and within the panel there's an ascx control plased. Localy and with Chrome it works fine when I click the modal dialoge. But when I install the web application on the server, and open the site in IE, the popup doesn't show the content. It popups but it's like strip and the background is grayed out. The webcontrol only contains a html table. The application is built in .NET 4.0.
Can anyone help me?
Code sample:
<asp:LinkButton ID="LinkButtonAddCommodity" runat="server" OnClick="LinkButtonAddCommodity_Click">Add commodity</asp:LinkButton>
<ajaxToolkit:ModalPopupExtender BackgroundCssClass="modalBackground" DropShadow="true"
runat="server" PopupControlID="Panel1" ID="ModalPopupExtender1" TargetControlID="LinkButtonAddCommodity" />
<ajaxToolkit:RoundedCornersExtender ID="rce" runat="server" TargetControlID="Panel1"
Radius="10" Corners="All" />
<asp:Panel ID="Panel1" runat="server" CssClass="modalPopup" Style="display: none;">
<web:WebControl ID="CommodityControl" runat="server" />
<div style="text-align: right;">
<asp:LinkButton ID="LinkButtonOk" OnClick="LinkButtonAddCommodity_Click" runat="server">Save commodity</asp:LinkButton>
<asp:LinkButton ID="LinkButtonCancel" runat="server" OnClick="LinkButtonCancelCommodity_Click">Cancel</asp:LinkButton>
</div>
</asp:Panel> | asp.net | .net | null | null | null | null | open | Modal dilaog behaves differently starting from windows server 2008
===
I have a webform with ajax extender. I used a panel and within the panel there's an ascx control plased. Localy and with Chrome it works fine when I click the modal dialoge. But when I install the web application on the server, and open the site in IE, the popup doesn't show the content. It popups but it's like strip and the background is grayed out. The webcontrol only contains a html table. The application is built in .NET 4.0.
Can anyone help me?
Code sample:
<asp:LinkButton ID="LinkButtonAddCommodity" runat="server" OnClick="LinkButtonAddCommodity_Click">Add commodity</asp:LinkButton>
<ajaxToolkit:ModalPopupExtender BackgroundCssClass="modalBackground" DropShadow="true"
runat="server" PopupControlID="Panel1" ID="ModalPopupExtender1" TargetControlID="LinkButtonAddCommodity" />
<ajaxToolkit:RoundedCornersExtender ID="rce" runat="server" TargetControlID="Panel1"
Radius="10" Corners="All" />
<asp:Panel ID="Panel1" runat="server" CssClass="modalPopup" Style="display: none;">
<web:WebControl ID="CommodityControl" runat="server" />
<div style="text-align: right;">
<asp:LinkButton ID="LinkButtonOk" OnClick="LinkButtonAddCommodity_Click" runat="server">Save commodity</asp:LinkButton>
<asp:LinkButton ID="LinkButtonCancel" runat="server" OnClick="LinkButtonCancelCommodity_Click">Cancel</asp:LinkButton>
</div>
</asp:Panel> | 0 |
9,580,185 | 03/06/2012 08:27:37 | 1,251,652 | 03/06/2012 08:07:58 | 1 | 0 | nodes of network connected in a mesh | how do we write a code for "n" nodes which are connected in a mesh network(nxn).
I appreciate your effort for the help.
Thank you. | java | javascript | c++ | null | null | 03/06/2012 08:31:49 | not a real question | nodes of network connected in a mesh
===
how do we write a code for "n" nodes which are connected in a mesh network(nxn).
I appreciate your effort for the help.
Thank you. | 1 |
5,849,782 | 05/01/2011 16:43:46 | 600,539 | 02/02/2011 19:36:05 | 139 | 1 | Isometric Game Engine for Android | Are there any existing open source or commercial solutions for this? | android | null | null | null | null | 02/14/2012 14:26:18 | not a real question | Isometric Game Engine for Android
===
Are there any existing open source or commercial solutions for this? | 1 |
6,383,357 | 06/17/2011 08:43:11 | 436,498 | 09/01/2010 00:53:27 | 68 | 2 | Write/delete content file text as raw resource android | I make android application that read textfile.txt from resource/raw. And it's work fine. Here is the code:
BufferedReader bufferreader = new BufferedReader(new
InputStreamReader(getResources().openRawResource(R.raw.textfile)));
String bufferLine;
String tempText = "";
try{
while ((bufferLine = bufferreader.readLine()) != null){
tempText = tempText + bufferLine;
}
} catch (IOException e){
}
Now, I need also to access this raw resource textfile by modify(write) or delete the content. Is there anyway to do it on android ? | android | null | null | null | null | null | open | Write/delete content file text as raw resource android
===
I make android application that read textfile.txt from resource/raw. And it's work fine. Here is the code:
BufferedReader bufferreader = new BufferedReader(new
InputStreamReader(getResources().openRawResource(R.raw.textfile)));
String bufferLine;
String tempText = "";
try{
while ((bufferLine = bufferreader.readLine()) != null){
tempText = tempText + bufferLine;
}
} catch (IOException e){
}
Now, I need also to access this raw resource textfile by modify(write) or delete the content. Is there anyway to do it on android ? | 0 |
6,018,299 | 05/16/2011 13:40:25 | 459,367 | 08/02/2010 06:02:44 | 42 | 0 | iText5.1.0 set header and footer in document | i m using servlet to view pdf file as using response setContentType pdf.
I want to set Header and Footer of Document generated by IText 5.1.0.
Please Help..
| java | servlets | itext | null | null | 05/18/2011 12:13:01 | not a real question | iText5.1.0 set header and footer in document
===
i m using servlet to view pdf file as using response setContentType pdf.
I want to set Header and Footer of Document generated by IText 5.1.0.
Please Help..
| 1 |
8,492,857 | 12/13/2011 16:44:59 | 893,039 | 08/13/2011 12:32:31 | 159 | 0 | good book for basics of networking and os | i need good book for basics of networking and about os. I am first year cse student, I want to get into hacking world so need to get knowledge of networking and working of os. right now I have no knowledge of this, so can u please suggest some good book for starting on these topics. thaks. | networking | operating-system | null | null | null | null | open | good book for basics of networking and os
===
i need good book for basics of networking and about os. I am first year cse student, I want to get into hacking world so need to get knowledge of networking and working of os. right now I have no knowledge of this, so can u please suggest some good book for starting on these topics. thaks. | 0 |
9,153,698 | 02/05/2012 22:30:21 | 1,141,188 | 01/10/2012 15:23:51 | 5 | 1 | Best C++ ***Editor*** for windows | When I first began programming, I used Visual Studio.
I liked it; the code completion, code folding, and syntax highlighting features were surprisingly convenient. Now, 5 years later, I am beginning to program with GCC and makefiles. However, I have been unable to find a good alternative to Visual Studio that has code completion, code folding, and syntax highlighting.
I wouldn't mind spending a bit of money to get a good editor. But I want an **editor**. I've tried netbeans, code::blocks, and everything in between.
If you know a good *****EDITOR***** with code completion, code folding, and syntax highlighting, please don't hesitate to tell me about it. | c++ | editor | syntax-highlighting | code-folding | null | 02/05/2012 22:41:21 | not constructive | Best C++ ***Editor*** for windows
===
When I first began programming, I used Visual Studio.
I liked it; the code completion, code folding, and syntax highlighting features were surprisingly convenient. Now, 5 years later, I am beginning to program with GCC and makefiles. However, I have been unable to find a good alternative to Visual Studio that has code completion, code folding, and syntax highlighting.
I wouldn't mind spending a bit of money to get a good editor. But I want an **editor**. I've tried netbeans, code::blocks, and everything in between.
If you know a good *****EDITOR***** with code completion, code folding, and syntax highlighting, please don't hesitate to tell me about it. | 4 |
6,529,151 | 06/30/2011 01:44:33 | 840,461 | 06/28/2011 16:06:07 | 8 | 5 | Help me function getListCategory() | function getCategoryList()
{
global $conn;
$result = @mysql_query("Select * From categories", $conn);
$ret = array();
while($row = mysql_fetch_assoc($result))
{
$ret[] = $row;
}
return $ret;
}
=> output = null
Although database not null (ex: category(1, laptop, 500))
I think it wrong in $ret[] = $row;
Help me with | php | mysql | null | null | null | null | open | Help me function getListCategory()
===
function getCategoryList()
{
global $conn;
$result = @mysql_query("Select * From categories", $conn);
$ret = array();
while($row = mysql_fetch_assoc($result))
{
$ret[] = $row;
}
return $ret;
}
=> output = null
Although database not null (ex: category(1, laptop, 500))
I think it wrong in $ret[] = $row;
Help me with | 0 |
5,282,382 | 03/12/2011 12:07:46 | 648,290 | 03/07/2011 14:25:02 | 42 | 0 | can anyone give me a link to download my sql rdbms onto my system | can anyone give me a link to download my sql rdbms onto my system | mysql | null | null | null | null | 03/12/2011 13:04:34 | not a real question | can anyone give me a link to download my sql rdbms onto my system
===
can anyone give me a link to download my sql rdbms onto my system | 1 |
5,091,562 | 02/23/2011 13:30:44 | 207,047 | 11/09/2009 15:32:49 | 1,200 | 34 | Wordpress and custom login page | I don't want to use standard WordPress login. Instead I want to provide my own login page. On that page I want to provide my own design and also my certain specific fields.
What it best practice? How can i do that? One option would be create new page with form and form handlers (with certain copypast from wp-login.php) and then replace all *login-logout-register* links whenever I see them.
Or do I have to provide my own wp-login.php template? Do i have to hook certain methods in a plugin? | wordpress | wordpress-plugin | wordpress-theming | null | null | null | open | Wordpress and custom login page
===
I don't want to use standard WordPress login. Instead I want to provide my own login page. On that page I want to provide my own design and also my certain specific fields.
What it best practice? How can i do that? One option would be create new page with form and form handlers (with certain copypast from wp-login.php) and then replace all *login-logout-register* links whenever I see them.
Or do I have to provide my own wp-login.php template? Do i have to hook certain methods in a plugin? | 0 |
10,961,149 | 06/09/2012 12:46:55 | 567,390 | 01/07/2011 19:37:53 | 366 | 44 | How to make a native windows application? | I do most of my development for the Android platform, and have developed applications for Windows in the past too. However, when I have developed windows applications, I've always used the .NET framework. This requires the end user to have the .NET framework installed on their machine.
What programming languages and associated tools can I use to create an application that will run on a windows PC (XP and greater) (other operating systems are welcome) with no need to have frameworks such as .NET and Java installed first?
Many thanks, Todd | windows | native | null | null | null | 06/09/2012 18:11:25 | not constructive | How to make a native windows application?
===
I do most of my development for the Android platform, and have developed applications for Windows in the past too. However, when I have developed windows applications, I've always used the .NET framework. This requires the end user to have the .NET framework installed on their machine.
What programming languages and associated tools can I use to create an application that will run on a windows PC (XP and greater) (other operating systems are welcome) with no need to have frameworks such as .NET and Java installed first?
Many thanks, Todd | 4 |
3,227,373 | 07/12/2010 09:43:34 | 308,826 | 03/18/2010 11:56:37 | 56 | 2 | Signals in fork | What is signal behavior in the fork.
Should all signals are inherited in fork If not then which one and why?
| unix | fork | signals | null | null | null | open | Signals in fork
===
What is signal behavior in the fork.
Should all signals are inherited in fork If not then which one and why?
| 0 |
6,909,527 | 08/02/2011 08:56:57 | 428,110 | 08/23/2010 06:44:38 | 587 | 60 | Objective C object not recognized in C function | I am adding an Audio session property listener for kAudioSessionProperty_AudioRouteChange and in the callback I want to call the takePicture function of UIImagePickerController. The problem is that I cannot access my picker in the callback.
I am initializing my picker in viewDidLoad. I have tried declaring the picker as both a private and public object and accessing with picker or self.picker but it always gives the "Use of undeclared identifier" error. I use this code to add the listener:
AudioSessionInitialize(nil, nil, nil, nil);
AudioSessionSetActive(true);
AudioSessionAddPropertyListener(
kAudioSessionProperty_AudioRouteChange,
applicationAudioRouteDidChange,
self);
This is my callback:
void applicationVolumeDidChange(void *inClientData,
AudioSessionPropertyID inID,
UInt32 inDataSize, const void *inData)
{
NSLog(@"Volume changed");
//[picker takePicture]; Error
}
I also declared an NSArray to see if this was the problem with UIImagePickerController only but the array also gives the same error.
| objective-c | c | ios4 | audiosessionservices | null | null | open | Objective C object not recognized in C function
===
I am adding an Audio session property listener for kAudioSessionProperty_AudioRouteChange and in the callback I want to call the takePicture function of UIImagePickerController. The problem is that I cannot access my picker in the callback.
I am initializing my picker in viewDidLoad. I have tried declaring the picker as both a private and public object and accessing with picker or self.picker but it always gives the "Use of undeclared identifier" error. I use this code to add the listener:
AudioSessionInitialize(nil, nil, nil, nil);
AudioSessionSetActive(true);
AudioSessionAddPropertyListener(
kAudioSessionProperty_AudioRouteChange,
applicationAudioRouteDidChange,
self);
This is my callback:
void applicationVolumeDidChange(void *inClientData,
AudioSessionPropertyID inID,
UInt32 inDataSize, const void *inData)
{
NSLog(@"Volume changed");
//[picker takePicture]; Error
}
I also declared an NSArray to see if this was the problem with UIImagePickerController only but the array also gives the same error.
| 0 |
4,846,151 | 01/30/2011 22:58:05 | 174,728 | 09/17/2009 03:45:43 | 25,710 | 1,165 | Using local resources in an iPhone webview | Suppose an app has a webview that uses JQuery for example.
The server delivers the page with appropriate links to load JQuery, and the view works fine, but I would like it to not need to download JQuery (yes it may be cached, but it won't be the first time the app runs and I would rather not count on it)
So I can include the JQuery files with the app, but then how should I embed the links?
The server certainly doesn't know the bundle path.
I thought I could load the url into a string and then replace the JQuery paths with the local paths before displaying in the webview.
Is there an easier way? | iphone | uiwebview | null | null | null | null | open | Using local resources in an iPhone webview
===
Suppose an app has a webview that uses JQuery for example.
The server delivers the page with appropriate links to load JQuery, and the view works fine, but I would like it to not need to download JQuery (yes it may be cached, but it won't be the first time the app runs and I would rather not count on it)
So I can include the JQuery files with the app, but then how should I embed the links?
The server certainly doesn't know the bundle path.
I thought I could load the url into a string and then replace the JQuery paths with the local paths before displaying in the webview.
Is there an easier way? | 0 |
10,956,135 | 06/08/2012 21:16:34 | 165,898 | 08/31/2009 09:12:29 | 704 | 2 | Any Recommendations for a .NET, C# Word 2010 Component? | I have the need for a Microsoft Office Word 2010 component for my .NET application. I need to be able to do:
1. Office to NOT be installed on machine
2. Mail Merge
3. Save to PDF
What are the best components out there for this? I've used Aspose, and they have all the features, but it's $1,000 for a single dev license, and I'd like to find a more wallet friendly alternative.
Any suggestions / recommendations? | c# | ms-word | components | office | null | 06/09/2012 18:10:54 | off topic | Any Recommendations for a .NET, C# Word 2010 Component?
===
I have the need for a Microsoft Office Word 2010 component for my .NET application. I need to be able to do:
1. Office to NOT be installed on machine
2. Mail Merge
3. Save to PDF
What are the best components out there for this? I've used Aspose, and they have all the features, but it's $1,000 for a single dev license, and I'd like to find a more wallet friendly alternative.
Any suggestions / recommendations? | 2 |
3,484,344 | 08/14/2010 17:17:44 | 420,481 | 08/14/2010 16:16:52 | 1 | 0 | display data in tree structure using php | I want to display data in tree strucure using php. The data should be read from xml file.
The root direcory information will be in 1st file(ex level0.xml).the sub directories of root will be in level1.xml file and so on.I need to get the values from these file and display in tree structure. When i click the directory it should read the next level file & display its sub directories and files. How can i do this? Is there any other approach or language to display? | php5 | null | null | null | null | 07/12/2012 22:19:56 | not a real question | display data in tree structure using php
===
I want to display data in tree strucure using php. The data should be read from xml file.
The root direcory information will be in 1st file(ex level0.xml).the sub directories of root will be in level1.xml file and so on.I need to get the values from these file and display in tree structure. When i click the directory it should read the next level file & display its sub directories and files. How can i do this? Is there any other approach or language to display? | 1 |
7,792,874 | 10/17/2011 11:08:45 | 999,010 | 10/17/2011 11:04:31 | 1 | 0 | How to parse & update a flat file using UNIX script | I am trying to parse a flat file which has columns by the titles NAME COMPANY DETAILS STATUS etc (where the data is dissimilar among itself). I need to update the STATUS column when I run a script with that file as input, with the STATUS being updated depending on other columns' details. sed & vi cannot be used, as obvious. Please help. | file | shell | unix | script | flat | 10/18/2011 08:22:49 | not a real question | How to parse & update a flat file using UNIX script
===
I am trying to parse a flat file which has columns by the titles NAME COMPANY DETAILS STATUS etc (where the data is dissimilar among itself). I need to update the STATUS column when I run a script with that file as input, with the STATUS being updated depending on other columns' details. sed & vi cannot be used, as obvious. Please help. | 1 |
9,286,114 | 02/15/2012 00:05:44 | 1,210,245 | 02/15/2012 00:00:39 | 1 | 0 | Install Ant on Mac | I need to install the latest version of Ant on Mac OS X. The instructions I've seen were not clear since never used the Terminal before. | osx | apache | ant | install | null | 02/15/2012 07:25:53 | off topic | Install Ant on Mac
===
I need to install the latest version of Ant on Mac OS X. The instructions I've seen were not clear since never used the Terminal before. | 2 |
9,612,868 | 03/08/2012 04:25:38 | 1,256,236 | 03/08/2012 04:19:28 | 1 | 0 | variable resets upon frame | I have a layer named GlobalActions Layer that is on the main timeline, that holds the variable called EnergyNumber. On frame 2, but same scene, I have a button that subtracts 10 from the variable that's on the GlobalAction. Finally, I have a button that returns you to frame 1. I click that button that sends me back to frame 1, and the EnergyNumber would reset back to 100. How can I fix this? | variables | reset | null | null | null | null | open | variable resets upon frame
===
I have a layer named GlobalActions Layer that is on the main timeline, that holds the variable called EnergyNumber. On frame 2, but same scene, I have a button that subtracts 10 from the variable that's on the GlobalAction. Finally, I have a button that returns you to frame 1. I click that button that sends me back to frame 1, and the EnergyNumber would reset back to 100. How can I fix this? | 0 |
6,116,221 | 05/24/2011 20:07:52 | 754,392 | 05/15/2011 10:55:02 | 1 | 0 | Receiving text and email | I need to know if it is possible to develop an application to read and reply to SMS and email. If so, how could this be done (what library/class needs to be used). I've searched all apps there isn't an app that does this. There's only an app that requires you to set your email and constantly checks for new message however SMS I'm not sure if there's an app that does this thereby I'm not sure if it could be done. Thanks,
Regards,
Heba | iphone | null | null | null | null | 05/24/2011 20:28:52 | not a real question | Receiving text and email
===
I need to know if it is possible to develop an application to read and reply to SMS and email. If so, how could this be done (what library/class needs to be used). I've searched all apps there isn't an app that does this. There's only an app that requires you to set your email and constantly checks for new message however SMS I'm not sure if there's an app that does this thereby I'm not sure if it could be done. Thanks,
Regards,
Heba | 1 |
9,451,081 | 02/26/2012 06:27:55 | 990,835 | 10/12/2011 06:13:29 | 17 | 1 | Suggestion for Caching in Java | I am creating Tree like a structure using HashMap.
For Eg:
Map child = new HashMap("child","value");
Map subparent = new HashMap("subparent",child);
Map parent = new HashMap("",subparent);
Using recursion technique to set Hashmap in Parent HasphMap's Value.
Tree I build takes long time, So I want to put in Cache so that I cant get it from Cache.
And If I add or edit tree it should get reflected.
One suggestion in HashMap, But for that I have to clear manually. I want good way build cache. | java | caching | map | lru | null | 02/26/2012 18:30:47 | not a real question | Suggestion for Caching in Java
===
I am creating Tree like a structure using HashMap.
For Eg:
Map child = new HashMap("child","value");
Map subparent = new HashMap("subparent",child);
Map parent = new HashMap("",subparent);
Using recursion technique to set Hashmap in Parent HasphMap's Value.
Tree I build takes long time, So I want to put in Cache so that I cant get it from Cache.
And If I add or edit tree it should get reflected.
One suggestion in HashMap, But for that I have to clear manually. I want good way build cache. | 1 |
4,233,724 | 11/20/2010 16:30:01 | 276,959 | 02/19/2010 12:45:43 | 822 | 6 | How can I pass an entire string of data from an html element using jquery? | I need to pass data from an HTML element and serialize it. At the moment I can do it by naming each individual attribute in the HTML tag. But It seems verbose and complicated.
<a data-type="2" data-post="101" data-parent="100">Up</a>
var myData = $(this).data("type")+$(this).data("parent")+$(this).data("post")
Can I pass all of the data with a single call instead of naming each individual attribute? For example:
var myData = $(this).data(all the attributes go here in some sort of string/serialized string)
| jquery | null | null | null | null | null | open | How can I pass an entire string of data from an html element using jquery?
===
I need to pass data from an HTML element and serialize it. At the moment I can do it by naming each individual attribute in the HTML tag. But It seems verbose and complicated.
<a data-type="2" data-post="101" data-parent="100">Up</a>
var myData = $(this).data("type")+$(this).data("parent")+$(this).data("post")
Can I pass all of the data with a single call instead of naming each individual attribute? For example:
var myData = $(this).data(all the attributes go here in some sort of string/serialized string)
| 0 |
4,849,722 | 01/31/2011 10:20:04 | 395,565 | 07/19/2010 07:07:56 | 1 | 1 | How to call Unix command through pyjamas | I am trying to create web based system using pyjamas and hangs on one functionality.
The functionality is, to click a button and it should run some python programs in back-end. I have to display the logs generated by back-end python program in the same page(where the clicked button is).
I really appreciate your help guys!!! | python | pyjamas | null | null | null | null | open | How to call Unix command through pyjamas
===
I am trying to create web based system using pyjamas and hangs on one functionality.
The functionality is, to click a button and it should run some python programs in back-end. I have to display the logs generated by back-end python program in the same page(where the clicked button is).
I really appreciate your help guys!!! | 0 |
3,707,215 | 09/14/2010 08:28:30 | 104,304 | 05/10/2009 10:26:12 | 482 | 8 | Back with another math question | What happens when memdiff and/or totaldiff are negative? I was hoping for a negative memperc, but it doesn't seem like that's happening. Messing around in Python gives all sorts of confusing results when I plug in negative numbers.
local mem, percent, memdiff, totalMem, totaldiff = GetMemUsage("StarTip")
if mem then
if totaldiff == 0 then totaldiff = 0.001 end
memperc = (memdiff / totaldiff * 100)
local num = memperc
if num < 1 then num = 1 end
if num > 100 then num = 100 end
local r, g, b = gradient[num][1], gradient[num][2], gradient[num][3]
return GetColorCode(format("%s (%.2f%%)", memshort(mem), memperc), r, g, b)
end
| math | null | null | null | null | 09/15/2010 00:45:46 | not a real question | Back with another math question
===
What happens when memdiff and/or totaldiff are negative? I was hoping for a negative memperc, but it doesn't seem like that's happening. Messing around in Python gives all sorts of confusing results when I plug in negative numbers.
local mem, percent, memdiff, totalMem, totaldiff = GetMemUsage("StarTip")
if mem then
if totaldiff == 0 then totaldiff = 0.001 end
memperc = (memdiff / totaldiff * 100)
local num = memperc
if num < 1 then num = 1 end
if num > 100 then num = 100 end
local r, g, b = gradient[num][1], gradient[num][2], gradient[num][3]
return GetColorCode(format("%s (%.2f%%)", memshort(mem), memperc), r, g, b)
end
| 1 |
10,108,848 | 04/11/2012 15:14:43 | 874,571 | 08/02/2011 12:07:15 | 45 | 1 | orm for .net compact framework | I'm looking for an Object Relational Mapping framework to use with .net compact framework,
I have found a simple one called Dapper. and i want to know if it's suitable for a such
developpement envirenement ?
thanks in advance. | c# | orm | compact-framework | null | null | 04/11/2012 16:26:50 | off topic | orm for .net compact framework
===
I'm looking for an Object Relational Mapping framework to use with .net compact framework,
I have found a simple one called Dapper. and i want to know if it's suitable for a such
developpement envirenement ?
thanks in advance. | 2 |
9,506,967 | 02/29/2012 21:33:19 | 1,149,422 | 01/14/2012 15:50:27 | 20 | 0 | App is force closing when i run it? Unable to start app activity | When i run it i get an immediate force close. I can never understand the logcat errors. I am using Eclipse along with the Android SDK. Here is the Logcat error but what does it mean?
02-29 12:59:35.875: E/AndroidRuntime(9759): FATAL EXCEPTION: main
02-29 12:59:35.875: E/AndroidRuntime(9759): java.lang.RuntimeException: Unable to start activity ComponentInfo{izzy.n/izzy.n.IzzynActivity}: android.view.InflateException: Binary XML file line #2: Error inflating class <unknown>
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1651)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.os.Handler.dispatchMessage(Handler.java:99)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.os.Looper.loop(Looper.java:130)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.app.ActivityThread.main(ActivityThread.java:3687)
02-29 12:59:35.875: E/AndroidRuntime(9759): at java.lang.reflect.Method.invokeNative(Native Method)
02-29 12:59:35.875: E/AndroidRuntime(9759): at java.lang.reflect.Method.invoke(Method.java:507)
02-29 12:59:35.875: E/AndroidRuntime(9759): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:842)
02-29 12:59:35.875: E/AndroidRuntime(9759): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
02-29 12:59:35.875: E/AndroidRuntime(9759): at dalvik.system.NativeStart.main(Native Method)
02-29 12:59:35.875: E/AndroidRuntime(9759): Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class <unknown>
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.createView(LayoutInflater.java:518)
02-29 12:59:35.875: E/AndroidRuntime(9759): at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:568)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.parseInclude(LayoutInflater.java:684)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.rInflate(LayoutInflater.java:619)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.parseInclude(LayoutInflater.java:707)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.rInflate(LayoutInflater.java:619)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.parseInclude(LayoutInflater.java:707)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.rInflate(LayoutInflater.java:619)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.parseInclude(LayoutInflater.java:707)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.rInflate(LayoutInflater.java:619)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.parseInclude(LayoutInflater.java:707)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.rInflate(LayoutInflater.java:619)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.parseInclude(LayoutInflater.java:707)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.rInflate(LayoutInflater.java:619)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.parseInclude(LayoutInflater.java:707)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.rInflate(LayoutInflater.java:619)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.parseInclude(LayoutInflater.java:707)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.rInflate(LayoutInflater.java:619)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.parseInclude(LayoutInflater.java:707)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.rInflate(LayoutInflater.java:619)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.parseInclude(LayoutInflater.java:707)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.rInflate(LayoutInflater.java:619)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.parseInclude(LayoutInflater.java:707)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.rInflate(LayoutInflater.java:619)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.parseInclude(LayoutInflater.java:707)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.rInflate(LayoutInflater.java:619)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.parseInclude(LayoutInflater.java:707)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.rInflate(LayoutInflater.java:619)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.parseInclude(LayoutInflater.java:707)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.rInflate(LayoutInflater.java:619)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.parseInclude(LayoutInflater.java:707)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.rInflate(LayoutInflater.java:619)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.parseInclude(LayoutInflater.java:707)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.rInflate(LayoutInflater.java:619)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.parseInclude(LayoutInflater.java:707)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.rInflate(LayoutInflater.java:619)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.parseInclude(LayoutInflater.java:707)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.rInflate(LayoutInflater.java:619)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.parseInclude(LayoutInflater.java:707)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.rInflate(LayoutInflater.java:619)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.parseInclude(LayoutInflater.java:707)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.rInflate(LayoutInflater.java:619)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.Layout
02-29 12:59:43.347: I/Process(9759): Sending signal. PID: 9759 SIG: 9
Thanks for the Help anyone
and here is main.xml:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/bg"
android:orientation="vertical" >
<ImageView
android:id="@+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<include
android:id="@+id/include1"
android:layout_width="160dp"
android:layout_height="200dp"
android:layout_marginRight="15dp"
android:layout_marginTop="280dp"
layout="@layout/main" />
<Button
android:id="@+id/button1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_marginBottom="69dp"
android:text="@string/button1" />
</RelativeLayout>
Here is AndroidActivity(Java file for main.xml)
package izzy.n;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.Manifest;
public class IzzynActivity extends Activity{
/** Called when the activity is first created. */
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Button wg = (Button) findViewById(R.id.button1);
wg.setOnClickListener(new View.OnClickListener() {
public void onClick(View view) {
Intent myIntent = new Intent(IzzynActivity.this, notes.class);
IzzynActivity.this.startActivity(myIntent);
}
});
}
}
Here is Android Manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="izzy.n"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="10" />
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<activity
android:name="izzy.n.IzzynActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="izzy.n.notes"
android:label="@string/notes"></activity>
</application>
</manifest>
| java | android | android-manifest | logcat | null | null | open | App is force closing when i run it? Unable to start app activity
===
When i run it i get an immediate force close. I can never understand the logcat errors. I am using Eclipse along with the Android SDK. Here is the Logcat error but what does it mean?
02-29 12:59:35.875: E/AndroidRuntime(9759): FATAL EXCEPTION: main
02-29 12:59:35.875: E/AndroidRuntime(9759): java.lang.RuntimeException: Unable to start activity ComponentInfo{izzy.n/izzy.n.IzzynActivity}: android.view.InflateException: Binary XML file line #2: Error inflating class <unknown>
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1651)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.os.Handler.dispatchMessage(Handler.java:99)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.os.Looper.loop(Looper.java:130)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.app.ActivityThread.main(ActivityThread.java:3687)
02-29 12:59:35.875: E/AndroidRuntime(9759): at java.lang.reflect.Method.invokeNative(Native Method)
02-29 12:59:35.875: E/AndroidRuntime(9759): at java.lang.reflect.Method.invoke(Method.java:507)
02-29 12:59:35.875: E/AndroidRuntime(9759): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:842)
02-29 12:59:35.875: E/AndroidRuntime(9759): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
02-29 12:59:35.875: E/AndroidRuntime(9759): at dalvik.system.NativeStart.main(Native Method)
02-29 12:59:35.875: E/AndroidRuntime(9759): Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class <unknown>
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.createView(LayoutInflater.java:518)
02-29 12:59:35.875: E/AndroidRuntime(9759): at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:568)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.parseInclude(LayoutInflater.java:684)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.rInflate(LayoutInflater.java:619)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.parseInclude(LayoutInflater.java:707)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.rInflate(LayoutInflater.java:619)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.parseInclude(LayoutInflater.java:707)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.rInflate(LayoutInflater.java:619)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.parseInclude(LayoutInflater.java:707)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.rInflate(LayoutInflater.java:619)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.parseInclude(LayoutInflater.java:707)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.rInflate(LayoutInflater.java:619)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.parseInclude(LayoutInflater.java:707)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.rInflate(LayoutInflater.java:619)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.parseInclude(LayoutInflater.java:707)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.rInflate(LayoutInflater.java:619)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.parseInclude(LayoutInflater.java:707)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.rInflate(LayoutInflater.java:619)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.parseInclude(LayoutInflater.java:707)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.rInflate(LayoutInflater.java:619)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.parseInclude(LayoutInflater.java:707)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.rInflate(LayoutInflater.java:619)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.parseInclude(LayoutInflater.java:707)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.rInflate(LayoutInflater.java:619)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.parseInclude(LayoutInflater.java:707)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.rInflate(LayoutInflater.java:619)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.parseInclude(LayoutInflater.java:707)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.rInflate(LayoutInflater.java:619)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.parseInclude(LayoutInflater.java:707)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.rInflate(LayoutInflater.java:619)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.parseInclude(LayoutInflater.java:707)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.rInflate(LayoutInflater.java:619)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.parseInclude(LayoutInflater.java:707)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.rInflate(LayoutInflater.java:619)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.parseInclude(LayoutInflater.java:707)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.rInflate(LayoutInflater.java:619)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.parseInclude(LayoutInflater.java:707)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.rInflate(LayoutInflater.java:619)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.parseInclude(LayoutInflater.java:707)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.rInflate(LayoutInflater.java:619)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.parseInclude(LayoutInflater.java:707)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.rInflate(LayoutInflater.java:619)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.Layout
02-29 12:59:43.347: I/Process(9759): Sending signal. PID: 9759 SIG: 9
Thanks for the Help anyone
and here is main.xml:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/bg"
android:orientation="vertical" >
<ImageView
android:id="@+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<include
android:id="@+id/include1"
android:layout_width="160dp"
android:layout_height="200dp"
android:layout_marginRight="15dp"
android:layout_marginTop="280dp"
layout="@layout/main" />
<Button
android:id="@+id/button1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_marginBottom="69dp"
android:text="@string/button1" />
</RelativeLayout>
Here is AndroidActivity(Java file for main.xml)
package izzy.n;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.Manifest;
public class IzzynActivity extends Activity{
/** Called when the activity is first created. */
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Button wg = (Button) findViewById(R.id.button1);
wg.setOnClickListener(new View.OnClickListener() {
public void onClick(View view) {
Intent myIntent = new Intent(IzzynActivity.this, notes.class);
IzzynActivity.this.startActivity(myIntent);
}
});
}
}
Here is Android Manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="izzy.n"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="10" />
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<activity
android:name="izzy.n.IzzynActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="izzy.n.notes"
android:label="@string/notes"></activity>
</application>
</manifest>
| 0 |
7,041,490 | 08/12/2011 14:22:32 | 365,251 | 06/12/2010 13:37:57 | 1,704 | 1 | have the same hight for a select and input (IE7) | I have [this][1] code.
On IE7 (as you can see) the height of the input is not a real `height:18px` (there is a sort of padding/margin?).
They have more height than select box. How can I adjust them?
[1]: http://jsfiddle.net/GurmR/19/ | html | css | null | null | null | null | open | have the same hight for a select and input (IE7)
===
I have [this][1] code.
On IE7 (as you can see) the height of the input is not a real `height:18px` (there is a sort of padding/margin?).
They have more height than select box. How can I adjust them?
[1]: http://jsfiddle.net/GurmR/19/ | 0 |
216,565 | 10/19/2008 15:47:41 | 209 | 08/03/2008 13:54:19 | 305 | 19 | Why exactly isn't MEF a DI/IoC Container? | It's been said on the blogosphere and by MS themselves that MEF isn't another IoC Container.
Ok...but why? It seems the same to me. Maybe it's not as good as Unity or castle Windsor, but it still fits the definition, doesn't it?
Can anyone explain why MEF isn't an IoC Container like Unity or Castle Windsor? | microsoft | dependency-injection | .net | null | null | null | open | Why exactly isn't MEF a DI/IoC Container?
===
It's been said on the blogosphere and by MS themselves that MEF isn't another IoC Container.
Ok...but why? It seems the same to me. Maybe it's not as good as Unity or castle Windsor, but it still fits the definition, doesn't it?
Can anyone explain why MEF isn't an IoC Container like Unity or Castle Windsor? | 0 |
8,127,308 | 11/14/2011 19:59:52 | 731,255 | 04/29/2011 14:32:31 | 594 | 0 | HTML on page totally broken | I have made some changes to an HTML page where there is a lot going on, and I think I put something out of place, and now it is totally strange :)
This page: http://www.problemio.com/problems/problem.php?problem_id=223
When you look at it from Firebug, it looks like the layout is closed way early, the footer is for some reason on the right side of the page, and links like "Existing Group Plans" are broken.
After staring at this for a while, I am not sure what is wrong. Any idea what happened? | html | css | null | null | null | 11/14/2011 22:38:11 | too localized | HTML on page totally broken
===
I have made some changes to an HTML page where there is a lot going on, and I think I put something out of place, and now it is totally strange :)
This page: http://www.problemio.com/problems/problem.php?problem_id=223
When you look at it from Firebug, it looks like the layout is closed way early, the footer is for some reason on the right side of the page, and links like "Existing Group Plans" are broken.
After staring at this for a while, I am not sure what is wrong. Any idea what happened? | 3 |
8,374,306 | 12/04/2011 09:05:34 | 967,969 | 09/27/2011 21:43:38 | 9 | 2 | Is there a way to break text through actionscript (convert text to a shape) | Is there a way to break text through actionscript so that it becomes a shape?
I know that I can hit CTRL+B two times to break apart text and convert it to a shape, but I need to do it through actionscript, so that a user can enter some text, and then I have some effects applied to it.
Thanks. | flash | actionscript-3 | null | null | null | null | open | Is there a way to break text through actionscript (convert text to a shape)
===
Is there a way to break text through actionscript so that it becomes a shape?
I know that I can hit CTRL+B two times to break apart text and convert it to a shape, but I need to do it through actionscript, so that a user can enter some text, and then I have some effects applied to it.
Thanks. | 0 |
11,586,359 | 07/20/2012 20:13:27 | 1,482,873 | 06/26/2012 13:22:46 | 1 | 0 | i have in join in mysql query | i have 3 tables in my database.
i want to fetch rows in the following manner
in each section no of assign ticket and section_admin_id's. my expected table should like
section_id section_name no_admin(particular section_id) no_ticket_id(particular section)
---------- ------------ ------------------------------- ---------------------------------
1 ATM Cards 2 3
2 Account 3 1
please help me for this query.
thanks in advacne | join | null | null | null | null | 07/24/2012 01:45:24 | not a real question | i have in join in mysql query
===
i have 3 tables in my database.
i want to fetch rows in the following manner
in each section no of assign ticket and section_admin_id's. my expected table should like
section_id section_name no_admin(particular section_id) no_ticket_id(particular section)
---------- ------------ ------------------------------- ---------------------------------
1 ATM Cards 2 3
2 Account 3 1
please help me for this query.
thanks in advacne | 1 |
3,810,136 | 09/28/2010 06:14:05 | 430,297 | 08/25/2010 05:20:55 | 11 | 0 | Data import wizard library for .Net? |
Does anyone know of a 3rd party data import wizard that can be embedded into applications? It should import from Excel, Access, SQLServer, csv, tab-separated flat file, XML, Oracle etc. We have a fixed data structure within our application and the user should be able to configure the wizard to match his/her import fields to our own data structure.
The wizard should be a library of sorts – preferably a .Net type library. We may want to have it both web-based and desktop based (hence we may need an ASP.Net controls version and a Winforms version). We may also want integration with WPF and Silverlight.
If there’s no UI wizard available, does anyone know of a non-UI library that supports easily configurable import from many, many different datasources?
| c# | null | null | null | null | null | open | Data import wizard library for .Net?
===
Does anyone know of a 3rd party data import wizard that can be embedded into applications? It should import from Excel, Access, SQLServer, csv, tab-separated flat file, XML, Oracle etc. We have a fixed data structure within our application and the user should be able to configure the wizard to match his/her import fields to our own data structure.
The wizard should be a library of sorts – preferably a .Net type library. We may want to have it both web-based and desktop based (hence we may need an ASP.Net controls version and a Winforms version). We may also want integration with WPF and Silverlight.
If there’s no UI wizard available, does anyone know of a non-UI library that supports easily configurable import from many, many different datasources?
| 0 |
8,466,082 | 12/11/2011 17:45:45 | 89,771 | 04/11/2009 14:41:25 | 26,284 | 1,058 | Responsive Grid-Based Web Design | I've been a bit confused how responsive web design plays along with CSS grid systems like **[960.gs][1]**.
Nathan Smith (the creator or 960.gs) came up with adapt.js some time ago, and by examining the bundled stylesheets ([mobile.css][2], [720.css][3] and [960.css][4] to name a few) it's clear that the number of grid columns is untouched, only the widths of the individual columns and the way they stack together change.
**[978.gs][5]** on the other hand seems to follow a different pattern:
- the 300px grid has 8 columns
- both the 748px and 978px grids have 12 columns
- both the 1218px and 1378px grids have 16 columns
At first, I though this didn't make much sense so I talked to the developer about it. He replied by stating that it's common practice to serve different CSS ***and** different markups* depending on the device width.
This approach still seems a bit strange to me, because if you're willing to rewrite your whole HTML markup you might as well use the same grid system (16 for instance) and just change all your `.grid_{x}` classes to `.grid_{x*2}` to accommodate smaller screens... Right?
The adapt.js approach seems easier to implement and manage, but I can spot a few caveats too: how will an image or snippet of text fit nicely inside a `grid_3` class? Being that its width can range from `auto`, to `220px` to even `610px` in the [2520.css][6] variant?
So, what is the current best practice regarding responsive web design and grid systems? And should CSS media queries affect the grid (column widths)? As it is, I'm inclined to believe that the best approach might be to serve a single markup and stylesheet and let the browser do it's rendering / scaling.
I'm pretty green at this, so any help is appreciated -- thanks.
[1]: http://960.gs/
[2]: http://adapt.960.gs/assets/css/mobile.css
[3]: http://adapt.960.gs/assets/css/720.css
[4]: http://adapt.960.gs/assets/css/960.css
[5]: http://978.gs/
[6]: http://adapt.960.gs/assets/css/2520.css | css | css3 | media-queries | 960.gs | responsive-design | 12/12/2011 01:16:12 | not constructive | Responsive Grid-Based Web Design
===
I've been a bit confused how responsive web design plays along with CSS grid systems like **[960.gs][1]**.
Nathan Smith (the creator or 960.gs) came up with adapt.js some time ago, and by examining the bundled stylesheets ([mobile.css][2], [720.css][3] and [960.css][4] to name a few) it's clear that the number of grid columns is untouched, only the widths of the individual columns and the way they stack together change.
**[978.gs][5]** on the other hand seems to follow a different pattern:
- the 300px grid has 8 columns
- both the 748px and 978px grids have 12 columns
- both the 1218px and 1378px grids have 16 columns
At first, I though this didn't make much sense so I talked to the developer about it. He replied by stating that it's common practice to serve different CSS ***and** different markups* depending on the device width.
This approach still seems a bit strange to me, because if you're willing to rewrite your whole HTML markup you might as well use the same grid system (16 for instance) and just change all your `.grid_{x}` classes to `.grid_{x*2}` to accommodate smaller screens... Right?
The adapt.js approach seems easier to implement and manage, but I can spot a few caveats too: how will an image or snippet of text fit nicely inside a `grid_3` class? Being that its width can range from `auto`, to `220px` to even `610px` in the [2520.css][6] variant?
So, what is the current best practice regarding responsive web design and grid systems? And should CSS media queries affect the grid (column widths)? As it is, I'm inclined to believe that the best approach might be to serve a single markup and stylesheet and let the browser do it's rendering / scaling.
I'm pretty green at this, so any help is appreciated -- thanks.
[1]: http://960.gs/
[2]: http://adapt.960.gs/assets/css/mobile.css
[3]: http://adapt.960.gs/assets/css/720.css
[4]: http://adapt.960.gs/assets/css/960.css
[5]: http://978.gs/
[6]: http://adapt.960.gs/assets/css/2520.css | 4 |
5,423,094 | 03/24/2011 17:28:20 | 226,473 | 12/07/2009 15:51:55 | 1,017 | 36 | i've been asked to teach a class on OOP/python | I've recently been asked about my interest level in teaching some non-/beginner-developers about python and OOP methodologies.Most people will be coming from a bash scripting background and some will have only little experience with python. Teaching has always been something I've been really interested in but I'm by no means an expert in python (though I have worked with it for a few years, I'm not particularly advanced with it). Having never taught a class at all, let alone one about python, what receommnedations can you make about texts, online resources and sample syllabii that might help me excel at this? | python | oop | null | null | null | 03/24/2011 18:41:51 | off topic | i've been asked to teach a class on OOP/python
===
I've recently been asked about my interest level in teaching some non-/beginner-developers about python and OOP methodologies.Most people will be coming from a bash scripting background and some will have only little experience with python. Teaching has always been something I've been really interested in but I'm by no means an expert in python (though I have worked with it for a few years, I'm not particularly advanced with it). Having never taught a class at all, let alone one about python, what receommnedations can you make about texts, online resources and sample syllabii that might help me excel at this? | 2 |
11,325,045 | 07/04/2012 08:14:44 | 1,395,782 | 05/15/2012 09:30:54 | 53 | 3 | How to create HotSpot in C#? | I want to create a hotspon an image that I put in my winform application. I followed the solution posted [HERE][1], but I did not know where I should put the coordinates to make this method works:
protected override void OnMouseMove(MouseEventArgs mouseEvent)
{
string X = mouseEvent.X.ToString();
string Y = mouseEvent.Y.ToString();
}
Where should I put the coordinates? I have two coordinates (X,Y): 110, 45
[1]: http://stackoverflow.com/questions/1270147/creating-hotspots-in-c-sharp | c# | winforms | null | null | null | null | open | How to create HotSpot in C#?
===
I want to create a hotspon an image that I put in my winform application. I followed the solution posted [HERE][1], but I did not know where I should put the coordinates to make this method works:
protected override void OnMouseMove(MouseEventArgs mouseEvent)
{
string X = mouseEvent.X.ToString();
string Y = mouseEvent.Y.ToString();
}
Where should I put the coordinates? I have two coordinates (X,Y): 110, 45
[1]: http://stackoverflow.com/questions/1270147/creating-hotspots-in-c-sharp | 0 |
697,060 | 03/30/2009 12:53:01 | 77,226 | 03/12/2009 13:45:07 | 7 | 1 | Why ruby ? | I beginner to ruby. But some of my friend said that ruby is slower than java... We should always think about the performance of the application not about the lines of code you written..
Ruby has no static mechanism... It wont suit for large projects .... all these comments I've heard ...
I am so confused.. How ruby is better than java.... Will ruby be a popular language??
Please clear my doubts??
Thank you!! | ruby | null | null | null | null | 03/30/2009 17:42:40 | not constructive | Why ruby ?
===
I beginner to ruby. But some of my friend said that ruby is slower than java... We should always think about the performance of the application not about the lines of code you written..
Ruby has no static mechanism... It wont suit for large projects .... all these comments I've heard ...
I am so confused.. How ruby is better than java.... Will ruby be a popular language??
Please clear my doubts??
Thank you!! | 4 |
8,496,971 | 12/13/2011 22:13:46 | 879,664 | 08/05/2011 00:03:11 | 864 | 21 | What does Force Quit do in OS X? | I've been using OS X for quite a while. However I'm relatively new to using the Terminal and command line in *nix-based operating systems. I'm reading about the Unix `kill` command.
**Does `Force Quit` use the Unix `kill` command in any way?** Perhaps it uses `kill -9`? | osx | freebsd | kill | kill-process | null | 12/14/2011 02:16:53 | off topic | What does Force Quit do in OS X?
===
I've been using OS X for quite a while. However I'm relatively new to using the Terminal and command line in *nix-based operating systems. I'm reading about the Unix `kill` command.
**Does `Force Quit` use the Unix `kill` command in any way?** Perhaps it uses `kill -9`? | 2 |
9,338,933 | 02/18/2012 05:41:19 | 928,568 | 09/05/2011 09:11:51 | 27 | 1 | Android HttpRequest | In Android i'm sending multiple request to the server for each request server will send a response.Now my problem is identify for which request response is received.
please suggest someway of sending your HTTP request using a Tag. | android | http | asynchronous | android-asynctask | null | null | open | Android HttpRequest
===
In Android i'm sending multiple request to the server for each request server will send a response.Now my problem is identify for which request response is received.
please suggest someway of sending your HTTP request using a Tag. | 0 |
11,681,705 | 07/27/2012 05:00:33 | 524,881 | 11/30/2010 08:47:28 | 1 | 0 | Is there a common API standard or framework available for Authenticating against NTLM/KerberOS/LDAP/SAML? | I am looking for a library/standard for common authentication APIs for NTLM, Kerberos, LDAP (Active Directory) and SAML. I have seen GSS-API but not sure how they can work with NTLM, AD and SAML.
| authentication | open-source | kerberos | ntlm | saml | null | open | Is there a common API standard or framework available for Authenticating against NTLM/KerberOS/LDAP/SAML?
===
I am looking for a library/standard for common authentication APIs for NTLM, Kerberos, LDAP (Active Directory) and SAML. I have seen GSS-API but not sure how they can work with NTLM, AD and SAML.
| 0 |
6,845,772 | 07/27/2011 14:05:37 | 305,818 | 03/31/2010 08:30:41 | 1,495 | 62 | REST URI convention | I'm new to REST and I've observed that in some RESTful services they use different resource URI for update/get/delete and Create. Such as
- Create - using ***/resources*** with POST method (observe plural) at some places only ***/resource*** (singular)
- Update - using ***/resource/123*** with PUT method
- Get - Using ***/resource/123*** with GET method
I'm little bit confused about this URI naming convention. What should we use plural or singular for resource creation? What should be the criteria while deciding that? | rest | resources | naming-conventions | uri | null | null | open | REST URI convention
===
I'm new to REST and I've observed that in some RESTful services they use different resource URI for update/get/delete and Create. Such as
- Create - using ***/resources*** with POST method (observe plural) at some places only ***/resource*** (singular)
- Update - using ***/resource/123*** with PUT method
- Get - Using ***/resource/123*** with GET method
I'm little bit confused about this URI naming convention. What should we use plural or singular for resource creation? What should be the criteria while deciding that? | 0 |
3,549,046 | 08/23/2010 15:28:39 | 428,559 | 08/23/2010 15:28:38 | 1 | 0 | Jquery Internet Explorer compatibility (toggle and animate) | Why this small piece of jQuery code is not working on Internet Explorer? IT works fine in all the Webkit browsers.
$('#logo').toggle(function() {
$('#about').animate({'top': '-400px'},'slow');
}, function() {
$('#about').animate({'top': '0px'},'slow');
}); | javascript | jquery | animate | null | null | null | open | Jquery Internet Explorer compatibility (toggle and animate)
===
Why this small piece of jQuery code is not working on Internet Explorer? IT works fine in all the Webkit browsers.
$('#logo').toggle(function() {
$('#about').animate({'top': '-400px'},'slow');
}, function() {
$('#about').animate({'top': '0px'},'slow');
}); | 0 |
8,149,624 | 11/16/2011 09:51:17 | 889,773 | 08/11/2011 11:14:03 | 1 | 0 | Algorithim to find missing card | You have a shuffled deck of calendar cards, 1 for each day of the year and one is missing. Provide an O(n) method of establishing the missing card? | data-structures | null | null | null | null | 11/16/2011 16:02:09 | not a real question | Algorithim to find missing card
===
You have a shuffled deck of calendar cards, 1 for each day of the year and one is missing. Provide an O(n) method of establishing the missing card? | 1 |
2,568,777 | 04/02/2010 19:37:14 | 111,327 | 05/22/2009 22:02:49 | 1,360 | 48 | Is RGBRast included with .NET 3.5 SP1? | I need to use the RGBRast software renderer for a DirectX application I'm developing. Currently I'm just including the DLL with my install.
I have read a few places that it is also included with .NET 3.5 SP1. Is this true? If so, where is the DLL located?
----
This redistributable component can be downloaded from:
http://www.microsoft.com/downloads/details.aspx?familyid=57d03491-6c49-4429-bff7-130408b5f410 | directx | .net | null | null | null | null | open | Is RGBRast included with .NET 3.5 SP1?
===
I need to use the RGBRast software renderer for a DirectX application I'm developing. Currently I'm just including the DLL with my install.
I have read a few places that it is also included with .NET 3.5 SP1. Is this true? If so, where is the DLL located?
----
This redistributable component can be downloaded from:
http://www.microsoft.com/downloads/details.aspx?familyid=57d03491-6c49-4429-bff7-130408b5f410 | 0 |
9,261,661 | 02/13/2012 13:49:54 | 1,022,280 | 10/31/2011 15:55:35 | 36 | 2 | which method is best for Bulk Insert? | i have to insert more than 2 lakh record in sqlserver DB..
my concept is add the data into DATA TABLE then doing Bulk Insert, but my TL Said Insert the data into CSV file format and do the bulk insert.
Which type is best ? which is time consuming?
thanks in advance.. | sql | vb.net | sql-server-2005 | null | null | null | open | which method is best for Bulk Insert?
===
i have to insert more than 2 lakh record in sqlserver DB..
my concept is add the data into DATA TABLE then doing Bulk Insert, but my TL Said Insert the data into CSV file format and do the bulk insert.
Which type is best ? which is time consuming?
thanks in advance.. | 0 |
5,928,168 | 05/08/2011 14:58:37 | 347,432 | 05/21/2010 20:10:05 | 23 | 0 | Stupid mistakes in C. Break, Switch, If. 1990 Crash of Telephone Network | I was hesitating to ask this, since it seems very easy.
What is wrong in this pseudocode?
In the switching software (written in C), there was a long
"do... while" construct, which contained
a "switch" statement, which contained
an "if' clause, which contained a
"break," which was intended for
the "if" clause, but instead broke from
the "switch" statement.
This caused a crash of the telefone system in 1990.
http://users.csc.calpoly.edu/~jdalbey/SWE/Papers/att_collapse.html
I need a very simple, explaination, why this code is wrong. I think the most simple answer is that within a if clause a break is not possible? So what statement needs to be written instead of a break within a if clause for getting the wanted effect, which is breaking the if clause?
| c | history | common-mistakes | null | null | 05/09/2011 13:49:27 | not a real question | Stupid mistakes in C. Break, Switch, If. 1990 Crash of Telephone Network
===
I was hesitating to ask this, since it seems very easy.
What is wrong in this pseudocode?
In the switching software (written in C), there was a long
"do... while" construct, which contained
a "switch" statement, which contained
an "if' clause, which contained a
"break," which was intended for
the "if" clause, but instead broke from
the "switch" statement.
This caused a crash of the telefone system in 1990.
http://users.csc.calpoly.edu/~jdalbey/SWE/Papers/att_collapse.html
I need a very simple, explaination, why this code is wrong. I think the most simple answer is that within a if clause a break is not possible? So what statement needs to be written instead of a break within a if clause for getting the wanted effect, which is breaking the if clause?
| 1 |
11,687,325 | 07/27/2012 11:58:23 | 851,818 | 07/19/2011 11:07:36 | 102 | 4 | Shell script: Execute command after running "exit" command in the shell script | I have a situation where in I have a command in my shell script that must be executed after a **exit** command is executed in the same script (_I know!! It sounds crazy!!_)
I want to find a solution for something like
#!/bin/sh
ls -l ~/.
exit $?
touch ~/abc.txt
Here I want the command `touch ~/abc.txt` execute after `exit $?` has run and the command `touch ~/abc.txt` can be any command.
**Constraints:** 1) I cannot modify the 1st three lines of the above script. 2) The command must be executed only after the `exit $?` command.
I'm not sure if there is a solution for this but any help is appreciated. | shell | unix | exit | command-execution | null | null | open | Shell script: Execute command after running "exit" command in the shell script
===
I have a situation where in I have a command in my shell script that must be executed after a **exit** command is executed in the same script (_I know!! It sounds crazy!!_)
I want to find a solution for something like
#!/bin/sh
ls -l ~/.
exit $?
touch ~/abc.txt
Here I want the command `touch ~/abc.txt` execute after `exit $?` has run and the command `touch ~/abc.txt` can be any command.
**Constraints:** 1) I cannot modify the 1st three lines of the above script. 2) The command must be executed only after the `exit $?` command.
I'm not sure if there is a solution for this but any help is appreciated. | 0 |
8,459,104 | 12/10/2011 19:10:45 | 1,080,578 | 12/04/2011 22:08:38 | 23 | 1 | How to get background under my user control | I've got user control and I need to get background(under this control) in Paint event. But if I use this.Parent.DrawToBitmap then my control is already there.
To hack it I can put my user control over PictureBox and then this.Parent.DrawToBitmap returns me bitmap without my control, but it's very ugly solution.
Could anybody help me?
I use Visual Studio 2010 Express. | c# | usercontrols | background | paint | null | 12/12/2011 19:46:18 | not a real question | How to get background under my user control
===
I've got user control and I need to get background(under this control) in Paint event. But if I use this.Parent.DrawToBitmap then my control is already there.
To hack it I can put my user control over PictureBox and then this.Parent.DrawToBitmap returns me bitmap without my control, but it's very ugly solution.
Could anybody help me?
I use Visual Studio 2010 Express. | 1 |
2,973,671 | 06/04/2010 11:31:35 | 356,634 | 06/02/2010 16:08:36 | 3 | 0 | Fluent NHibermate and Polymorphism and a Newbie! | I'm a fluent nhibernate newbie and I'm struggling mapping a hierarchy of polymorhophic objects. I've produced the following Model that recreates the essence of what I'm doing in my real application.
I have a ProductList and several specialised type of products;
public class MyProductList
{
public virtual int Id { get; set; }
public virtual string Name {get;set;}
public virtual IList<Product> Products { get; set; }
public MyProductList()
{
Products = new List<Product>();
}
}
public class Product
{
public virtual int Id { get; set; }
public virtual string ProductDescription {get;set;}
}
public class SizedProduct : Product
{
public virtual decimal Size {get;set;}
}
public class BundleProduct : Product
{
public virtual Product BundleItem1 {get;set;}
public virtual Product BundleItem2 {get;set;}
}
Note that I have a specialised type of Product called BundleProduct that has two products attached.
I can add any of the specialised types of product to MyProductList and a bundle Product can be made up of any of the specialised types of product too.
Here is the fluent nhibernate mapping that I'm using;
public class MyListMap : ClassMap<MyList>
{
public MyListMap()
{
Id(ml => ml.Id);
Map(ml => ml.Name);
HasManyToMany(ml => ml.Products).Cascade.All();
}
}
public class ProductMap : ClassMap<Product>
{
public ProductMap()
{
Id(prod => prod.Id);
Map(prod => prod.ProductDescription);
}
}
public class SizedProductMap : SubclassMap<SizedProduct>
{
public SizedProductMap()
{
Map(sp => sp.Size);
}
}
public class BundleProductMap : SubclassMap<BundleProduct>
{
public BundleProductMap()
{
References(bp => bp.BundleItem1).Cascade.All();
References(bp => bp.BundleItem2).Cascade.All();
}
}
I haven't configured have any reverse mappings, so a product doesn't know which Lists it belongs to or which bundles it is part of.
Next I add some products to my list;
MyList ml = new MyList() { Name = "Example" };
ml.Products.Add(new Product() { ProductDescription = "PSU" });
ml.Products.Add(new SizedProduct() { ProductDescription = "Extension Cable", Size = 2.0M });
ml.Products.Add(new BundleProduct()
{
ProductDescription = "Fan & Cable",
BundleItem1 = new Product() { ProductDescription = "Fan Power Cable" },
BundleItem2 = new SizedProduct() { ProductDescription = "80mm Fan", Size = 80M }
});
When I persist my list to the database and reload it, the list itself contains the items I expect ie `MyList[0]` has a type of `Product`, `MyList[1]` has a type of `SizedProduct`, and `MyList[2]` has a type of `BundleProduct` - great!
If I navigate to the `BundleProduct`, I'm not able to see the types of Product attached to the `BundleItem1` or `BundleItem2` instead they are always proxies to the `Product` - in this example BundleItem2 should be a SizedProduct.
Is there anything I can do to resove this either in my model or the mapping?
Thanks in advance for your help.
| fluent-nhibernate | nhibernate-mapping | null | null | null | null | open | Fluent NHibermate and Polymorphism and a Newbie!
===
I'm a fluent nhibernate newbie and I'm struggling mapping a hierarchy of polymorhophic objects. I've produced the following Model that recreates the essence of what I'm doing in my real application.
I have a ProductList and several specialised type of products;
public class MyProductList
{
public virtual int Id { get; set; }
public virtual string Name {get;set;}
public virtual IList<Product> Products { get; set; }
public MyProductList()
{
Products = new List<Product>();
}
}
public class Product
{
public virtual int Id { get; set; }
public virtual string ProductDescription {get;set;}
}
public class SizedProduct : Product
{
public virtual decimal Size {get;set;}
}
public class BundleProduct : Product
{
public virtual Product BundleItem1 {get;set;}
public virtual Product BundleItem2 {get;set;}
}
Note that I have a specialised type of Product called BundleProduct that has two products attached.
I can add any of the specialised types of product to MyProductList and a bundle Product can be made up of any of the specialised types of product too.
Here is the fluent nhibernate mapping that I'm using;
public class MyListMap : ClassMap<MyList>
{
public MyListMap()
{
Id(ml => ml.Id);
Map(ml => ml.Name);
HasManyToMany(ml => ml.Products).Cascade.All();
}
}
public class ProductMap : ClassMap<Product>
{
public ProductMap()
{
Id(prod => prod.Id);
Map(prod => prod.ProductDescription);
}
}
public class SizedProductMap : SubclassMap<SizedProduct>
{
public SizedProductMap()
{
Map(sp => sp.Size);
}
}
public class BundleProductMap : SubclassMap<BundleProduct>
{
public BundleProductMap()
{
References(bp => bp.BundleItem1).Cascade.All();
References(bp => bp.BundleItem2).Cascade.All();
}
}
I haven't configured have any reverse mappings, so a product doesn't know which Lists it belongs to or which bundles it is part of.
Next I add some products to my list;
MyList ml = new MyList() { Name = "Example" };
ml.Products.Add(new Product() { ProductDescription = "PSU" });
ml.Products.Add(new SizedProduct() { ProductDescription = "Extension Cable", Size = 2.0M });
ml.Products.Add(new BundleProduct()
{
ProductDescription = "Fan & Cable",
BundleItem1 = new Product() { ProductDescription = "Fan Power Cable" },
BundleItem2 = new SizedProduct() { ProductDescription = "80mm Fan", Size = 80M }
});
When I persist my list to the database and reload it, the list itself contains the items I expect ie `MyList[0]` has a type of `Product`, `MyList[1]` has a type of `SizedProduct`, and `MyList[2]` has a type of `BundleProduct` - great!
If I navigate to the `BundleProduct`, I'm not able to see the types of Product attached to the `BundleItem1` or `BundleItem2` instead they are always proxies to the `Product` - in this example BundleItem2 should be a SizedProduct.
Is there anything I can do to resove this either in my model or the mapping?
Thanks in advance for your help.
| 0 |
8,115,249 | 11/13/2011 22:27:01 | 1,044,665 | 11/13/2011 22:24:30 | 1 | 0 | Need advice...Application for windows + mac | i know a simple google search brings out a billion topics and threads regarding this question. I have looked at most of them , but my requirements are very simple and to the point.
I want to develop a simple application with just one screen and a couple of tabs and i will use a simple database (with 2 tables) as backend. I would be putting up the app on my website for download and i would like it to work both on mac and windows so i have a version that works for most of my users. I want the front end to look very simple and look the same on both platforms if possible although not essential.
I have been programming with vb6 and vb.net since the last 2 years so i m really comfortable with the visual studio development environment. I also have some experience with java but its very limited to simple apps using bluej. I have no experience with the higher-end ide's such as eclipse,netbeans etc.
After doing some research, i found 3 solutions so far :
1. Code the application in .net and use mono on mac. I just had a brief look at the mono project website, so i really dont understand how this option would work . Do i have to develop in vb.net and just use mono to create a setup file for the mac, if this is true, this would just be the ideal option. Also, what should i use as database backend, will access be fine ??
2. Use Realbasic to code my application. realbasic is very similar to vb6 so the learning process would be fine. But there isnt much support for it and i have to figure out loads of things myself. Again i have no idea which database as backend should be used here.
3. Use java to code my application. I have no clue where to start, which ide to use and which version to target. I have also heard that java is very slow on mac, is this true ? will a simple app like mine lag on mac if i code it in java.
These are really the three things i could figure thus far. I would like your suggestions and advice on which method would be the best to adopt and what challenges/bottlenecks i will face? Please note my app is very simple, just a simple database as backend and 2 tabs to read and write to database and perform some calculations.
All inputs from you guys will be really appreciated. Thank you for your time. | java | vb.net | osx | application | mono | 11/14/2011 02:07:10 | not constructive | Need advice...Application for windows + mac
===
i know a simple google search brings out a billion topics and threads regarding this question. I have looked at most of them , but my requirements are very simple and to the point.
I want to develop a simple application with just one screen and a couple of tabs and i will use a simple database (with 2 tables) as backend. I would be putting up the app on my website for download and i would like it to work both on mac and windows so i have a version that works for most of my users. I want the front end to look very simple and look the same on both platforms if possible although not essential.
I have been programming with vb6 and vb.net since the last 2 years so i m really comfortable with the visual studio development environment. I also have some experience with java but its very limited to simple apps using bluej. I have no experience with the higher-end ide's such as eclipse,netbeans etc.
After doing some research, i found 3 solutions so far :
1. Code the application in .net and use mono on mac. I just had a brief look at the mono project website, so i really dont understand how this option would work . Do i have to develop in vb.net and just use mono to create a setup file for the mac, if this is true, this would just be the ideal option. Also, what should i use as database backend, will access be fine ??
2. Use Realbasic to code my application. realbasic is very similar to vb6 so the learning process would be fine. But there isnt much support for it and i have to figure out loads of things myself. Again i have no idea which database as backend should be used here.
3. Use java to code my application. I have no clue where to start, which ide to use and which version to target. I have also heard that java is very slow on mac, is this true ? will a simple app like mine lag on mac if i code it in java.
These are really the three things i could figure thus far. I would like your suggestions and advice on which method would be the best to adopt and what challenges/bottlenecks i will face? Please note my app is very simple, just a simple database as backend and 2 tabs to read and write to database and perform some calculations.
All inputs from you guys will be really appreciated. Thank you for your time. | 4 |
5,613,271 | 04/10/2011 16:56:15 | 668,829 | 03/21/2011 03:56:47 | 5 | 1 | perform "not in" query using linq from 2 datatables | i have a datatable which contains "InvalidCodes".
Before uploading the data to database(data is still in datatable), i want to perform linq on the datatable to remove Invalid entries and move them in another datatable
datatable allEntries ( entries yet to be uploaded in database)
datatable InvalidCodes(single column datatable - retrieved from database)
datatable invalidEntries
right now "allEnties" contains valid entries and invalid entries. the linq query on "allEntries" should move the nonexistend code entries to invalidEntries datatable.
plz help me perform this.
below is the query i formed but its not valid
string query = "select [CityCode] from [StateCity] ";
DataTable citylist = getDataTableFromSelect(query);
var result = from myrow in inputDt.AsEnumerable()
where !myrow.Field<string>("CityCode").Contains(from myrow2 in citylist.AsEnumerable() select myrow2.Field<string>("CityCode") )
select myrow;
| asp.net | linq | null | null | null | null | open | perform "not in" query using linq from 2 datatables
===
i have a datatable which contains "InvalidCodes".
Before uploading the data to database(data is still in datatable), i want to perform linq on the datatable to remove Invalid entries and move them in another datatable
datatable allEntries ( entries yet to be uploaded in database)
datatable InvalidCodes(single column datatable - retrieved from database)
datatable invalidEntries
right now "allEnties" contains valid entries and invalid entries. the linq query on "allEntries" should move the nonexistend code entries to invalidEntries datatable.
plz help me perform this.
below is the query i formed but its not valid
string query = "select [CityCode] from [StateCity] ";
DataTable citylist = getDataTableFromSelect(query);
var result = from myrow in inputDt.AsEnumerable()
where !myrow.Field<string>("CityCode").Contains(from myrow2 in citylist.AsEnumerable() select myrow2.Field<string>("CityCode") )
select myrow;
| 0 |
11,538,364 | 07/18/2012 09:33:27 | 1,489,938 | 06/28/2012 23:05:52 | 24 | 0 | (a/b) mod m when m is not a prime | I need to find (a/b) mod m where
m = 500000002
and
`m = 148721 * 41 * 41 * 2` (prime factors)
basically I need to find 2nCn where `an = an-1 * ((4*n-2)/n)`
I am using Chinese remainder theorm to solvee but unable to get the correct ans?
Can someone help?? | c | null | null | null | null | 07/19/2012 20:32:19 | not a real question | (a/b) mod m when m is not a prime
===
I need to find (a/b) mod m where
m = 500000002
and
`m = 148721 * 41 * 41 * 2` (prime factors)
basically I need to find 2nCn where `an = an-1 * ((4*n-2)/n)`
I am using Chinese remainder theorm to solvee but unable to get the correct ans?
Can someone help?? | 1 |
9,051,758 | 01/29/2012 07:54:24 | 1,176,188 | 01/29/2012 07:32:24 | 1 | 0 | Running a external executable in Xcode 4 to use Xcode 4 as a debugger | I have a C program which I normally compile by using Makefile on the terminal, and I would like to run my executable on Xcode 4 for debugging purposes. The graphical debugger on Xcode 4 seems extremely useful.
I read a bunch of related posts about adding external executables, but I can't seem to figure it out.
I tried to things.
First, I started an empty project, and created a new scheme and set the executable to my executable. This failed when I build..it says "The run destination My Mac 64-bit is not valid for Running the scheme 'new_scheme'."
Second, I tried making an External Build System project by setting the tool path to /usr/bin/make, and putting all my source file and my makefile in the project. This also failed on build..here's the error:
make: *** No targets specified and no makefile found. Stop.
Command /usr/bin/make failed with exit code 2
I'm not sure what to do at this point, but basically I would like to debug my C program using XCode 4.
Thanks for the help!!
| c | debugging | xcode4 | makefile | null | null | open | Running a external executable in Xcode 4 to use Xcode 4 as a debugger
===
I have a C program which I normally compile by using Makefile on the terminal, and I would like to run my executable on Xcode 4 for debugging purposes. The graphical debugger on Xcode 4 seems extremely useful.
I read a bunch of related posts about adding external executables, but I can't seem to figure it out.
I tried to things.
First, I started an empty project, and created a new scheme and set the executable to my executable. This failed when I build..it says "The run destination My Mac 64-bit is not valid for Running the scheme 'new_scheme'."
Second, I tried making an External Build System project by setting the tool path to /usr/bin/make, and putting all my source file and my makefile in the project. This also failed on build..here's the error:
make: *** No targets specified and no makefile found. Stop.
Command /usr/bin/make failed with exit code 2
I'm not sure what to do at this point, but basically I would like to debug my C program using XCode 4.
Thanks for the help!!
| 0 |
1,589,423 | 10/19/2009 15:36:48 | 26,226 | 10/08/2008 17:47:43 | 1,109 | 74 | How to use Floor/Ceiling in a ReportModel expression field? | I'm building an SSRS 2005 ReportModel. I want to create an expression field that does the same as this C# method:
private static int GetClosestWholeNumberToward0(double delta)
{
return (int) (delta > 0 ? Math.Ceiling(delta) : Math.Floor(delta));
}
I tried this:
IF(delta > 0, Ceiling(delta), Floor(delta))
But it seems that SSRS doesn't support the Ceiling or Floor functions. Is there a way to do this? | reporting-services | reportingservices-2005 | null | null | null | null | open | How to use Floor/Ceiling in a ReportModel expression field?
===
I'm building an SSRS 2005 ReportModel. I want to create an expression field that does the same as this C# method:
private static int GetClosestWholeNumberToward0(double delta)
{
return (int) (delta > 0 ? Math.Ceiling(delta) : Math.Floor(delta));
}
I tried this:
IF(delta > 0, Ceiling(delta), Floor(delta))
But it seems that SSRS doesn't support the Ceiling or Floor functions. Is there a way to do this? | 0 |
5,910,957 | 05/06/2011 11:47:45 | 513,164 | 08/19/2010 09:28:25 | 112 | 2 | c filesystem programming and implementaion | Everybody out there
I have a strange question i have to file ram.txt or shyam.txt which got some text.
Now I want to join them mean the info in shyam append to ram ,or shayam info should be displayed in ram .
I write a c program of file handling i opened the file ram in append mode and put the information of shyam in it.
Now my question is that how it is implemented.
How does append mode work in reality ?
Means what actually happened inside the system ?
What is actually going in the memory and what is operating system doing?
How file system provide the facility of appending file ?
| c | file | operating-system | null | null | 05/06/2011 11:57:29 | not a real question | c filesystem programming and implementaion
===
Everybody out there
I have a strange question i have to file ram.txt or shyam.txt which got some text.
Now I want to join them mean the info in shyam append to ram ,or shayam info should be displayed in ram .
I write a c program of file handling i opened the file ram in append mode and put the information of shyam in it.
Now my question is that how it is implemented.
How does append mode work in reality ?
Means what actually happened inside the system ?
What is actually going in the memory and what is operating system doing?
How file system provide the facility of appending file ?
| 1 |
7,376,164 | 09/11/2011 03:38:38 | 938,813 | 09/11/2011 03:28:59 | 1 | 0 | Help related to reading values from a form and writing it to a destination file using PHP | Presently working on extracting values out of a form and writing it to a file.
My form has two text fields and a dropdown.
The dropdown gets its elements from a text file.
A destination file needs to be created everytime a user edits the form.
The form looks like:
<form method="get" action="index.php" name="">
<input type="text" name="val1" size="" value="">
<input type="text" name="val2" size="" value="">
<?php
$spfile = file("path_of_the_text_file_elements_are_extracted_from");
echo "<select name='sp' value=''>";
foreach($spfile as $value) {
echo "<option value='spval'>$value</option>";
}
echo "</select>";
?>
<input type="submit" name="submit" value="Submit" />
Below is the code I was trying to use to create the file when the user edits the form:
<?php
{
$dest = "destination_file.txt";
$file = fopen($dest,'w');
fwrite($file,"Value1:");
//$value1=$_GET['val1'];
//fputs($file,$Value1);
fwrite($file,"\n");
fwrite($file,"Value2:");
fwrite($file,"\n");
fwrite($file,"Value3:");
fclose($file);
}
Having problem at:
1. Reading the values of the edited form and writing the values in the destination file.
2. Not sure how to use $_GET for the dropdown to read the selected value off of the dropdown list, and to write it to the destination file.
The destination file should look like:
Value1:(value read from the form)
Value2:(Value read from the form)
Value3:(Value read from the form)
| php | null | null | null | null | null | open | Help related to reading values from a form and writing it to a destination file using PHP
===
Presently working on extracting values out of a form and writing it to a file.
My form has two text fields and a dropdown.
The dropdown gets its elements from a text file.
A destination file needs to be created everytime a user edits the form.
The form looks like:
<form method="get" action="index.php" name="">
<input type="text" name="val1" size="" value="">
<input type="text" name="val2" size="" value="">
<?php
$spfile = file("path_of_the_text_file_elements_are_extracted_from");
echo "<select name='sp' value=''>";
foreach($spfile as $value) {
echo "<option value='spval'>$value</option>";
}
echo "</select>";
?>
<input type="submit" name="submit" value="Submit" />
Below is the code I was trying to use to create the file when the user edits the form:
<?php
{
$dest = "destination_file.txt";
$file = fopen($dest,'w');
fwrite($file,"Value1:");
//$value1=$_GET['val1'];
//fputs($file,$Value1);
fwrite($file,"\n");
fwrite($file,"Value2:");
fwrite($file,"\n");
fwrite($file,"Value3:");
fclose($file);
}
Having problem at:
1. Reading the values of the edited form and writing the values in the destination file.
2. Not sure how to use $_GET for the dropdown to read the selected value off of the dropdown list, and to write it to the destination file.
The destination file should look like:
Value1:(value read from the form)
Value2:(Value read from the form)
Value3:(Value read from the form)
| 0 |
176,524 | 10/06/2008 22:51:46 | 549 | 08/06/2008 16:20:06 | 26 | 3 | What are some good ways to stay mentally alert during the work day? | I've been a programmer for about 5 years now, and one of the things I've noticed is that some days I might code all day and feel fine, and some days I might have that "I've been staring at the screen too long" feeling by 11:30.
What are some ways you've come up with to make sure that you stay fresh and mentally alert during the 8-hour workday?
How do you know when you need to take a break?
What do you do to take a break in a way that won't attract unwanted managerial attention? | productivity | null | null | null | null | 07/06/2012 17:54:37 | off topic | What are some good ways to stay mentally alert during the work day?
===
I've been a programmer for about 5 years now, and one of the things I've noticed is that some days I might code all day and feel fine, and some days I might have that "I've been staring at the screen too long" feeling by 11:30.
What are some ways you've come up with to make sure that you stay fresh and mentally alert during the 8-hour workday?
How do you know when you need to take a break?
What do you do to take a break in a way that won't attract unwanted managerial attention? | 2 |
2,235,506 | 02/10/2010 08:59:20 | 218,377 | 11/25/2009 07:31:11 | 245 | 3 | looking for some books about asp.mvc and nhibernate | Hi i'm looking for some books about asp.net and nhibernate.
Any suggest?
thanks | books | asp.net-mvc | nhibernate | null | null | 10/01/2011 20:53:30 | off topic | looking for some books about asp.mvc and nhibernate
===
Hi i'm looking for some books about asp.net and nhibernate.
Any suggest?
thanks | 2 |
6,176,160 | 05/30/2011 12:14:14 | 776,216 | 05/30/2011 12:06:47 | 1 | 0 | The remote server returned an error: (503) Server Unavailable. | I am using this code if i uncomment the line
request.Proxy = new WebProxy("203.175.185.43", 8090);
then it throws error "The remote server returned an error: (503) Server Unavailable." if this line is commented then it works fine.
This is a public ip that is free and need no credentials.
Please give me feedback on this.
My Code is:
private static string GetSearchResult(string keyword)
{
if (keyword != null)
{
var url = "http://www.google.com/search?num=100&hl=en&q=" +
keyword.Replace(" ", "+") + "&nfpr=1&aq=f&aqi=&aql=&oq=";
var request = WebRequest.Create(url) as HttpWebRequest;
if (request != null)
{
request.KeepAlive = false;
request.Method = "GET";
request.UserAgent = "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1)";
request.ContentType = "text/html";
//request.Proxy = new WebProxy("203.175.185.43", 8090);
var response = request.GetResponse();
var reader = new StreamReader(response.GetResponseStream());
var content = reader.ReadToEnd();
return content;
}
}
return string.Empty;
} | c# | null | null | null | null | 05/30/2011 14:55:16 | too localized | The remote server returned an error: (503) Server Unavailable.
===
I am using this code if i uncomment the line
request.Proxy = new WebProxy("203.175.185.43", 8090);
then it throws error "The remote server returned an error: (503) Server Unavailable." if this line is commented then it works fine.
This is a public ip that is free and need no credentials.
Please give me feedback on this.
My Code is:
private static string GetSearchResult(string keyword)
{
if (keyword != null)
{
var url = "http://www.google.com/search?num=100&hl=en&q=" +
keyword.Replace(" ", "+") + "&nfpr=1&aq=f&aqi=&aql=&oq=";
var request = WebRequest.Create(url) as HttpWebRequest;
if (request != null)
{
request.KeepAlive = false;
request.Method = "GET";
request.UserAgent = "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1)";
request.ContentType = "text/html";
//request.Proxy = new WebProxy("203.175.185.43", 8090);
var response = request.GetResponse();
var reader = new StreamReader(response.GetResponseStream());
var content = reader.ReadToEnd();
return content;
}
}
return string.Empty;
} | 3 |
8,647,032 | 12/27/2011 16:45:30 | 527,516 | 12/02/2010 04:50:00 | 706 | 53 | Code Repository best practices | I work at a company that does a good deal of custom development for a wide variety of clients. Some projects are unique, but many of them also use a common set of code that we have developed over the years. This pattern has worked well for a long time. But we are currently in the process of moving from SVN to Mercurial (hg), and so I'm pondering how best to set up the different repositories.
Right now we have one repo for our internal work. These projects range from basic utilities such as logging, to custom apps for internal use. And it also has a good deal of old code that is not actively updated, but kept around in case some old legacy client code needs to be modified.
For each client we make a separate repo and put all of their code in the dedicated repo.
The nice thing about this structure is that if you want to work on a client's code, you just get everything from their repo, plus the "core" internal code, and you have everything you need. One downside is that the client code can become stale, and even out of synch with changes to our core code.
But I would like to hear what other people do as well. Does it make sense to have many client-specific repositories and one rather large internal one? Some client's code base is huge, while others' are very small. Does it make sense to have a repo for each?
Also - we put ALL client artifacts into each client repository. This includes not only source code, but also specs, contracts, signed PDFs, Excel, Visio, Word, and other such documents. This seems wasteful to me, and I'm pondering separating out the artifacts from the true code. How do others handle such things? | svn | version-control | mercurial | null | null | 06/01/2012 11:01:32 | not constructive | Code Repository best practices
===
I work at a company that does a good deal of custom development for a wide variety of clients. Some projects are unique, but many of them also use a common set of code that we have developed over the years. This pattern has worked well for a long time. But we are currently in the process of moving from SVN to Mercurial (hg), and so I'm pondering how best to set up the different repositories.
Right now we have one repo for our internal work. These projects range from basic utilities such as logging, to custom apps for internal use. And it also has a good deal of old code that is not actively updated, but kept around in case some old legacy client code needs to be modified.
For each client we make a separate repo and put all of their code in the dedicated repo.
The nice thing about this structure is that if you want to work on a client's code, you just get everything from their repo, plus the "core" internal code, and you have everything you need. One downside is that the client code can become stale, and even out of synch with changes to our core code.
But I would like to hear what other people do as well. Does it make sense to have many client-specific repositories and one rather large internal one? Some client's code base is huge, while others' are very small. Does it make sense to have a repo for each?
Also - we put ALL client artifacts into each client repository. This includes not only source code, but also specs, contracts, signed PDFs, Excel, Visio, Word, and other such documents. This seems wasteful to me, and I'm pondering separating out the artifacts from the true code. How do others handle such things? | 4 |
8,468,338 | 12/11/2011 23:21:17 | 1,091,726 | 12/10/2011 22:36:35 | 1 | 0 | I want to show image on php which is store in mysql database as blob type | I want to show image on php from mysql database. I use the following code:
$last_id = mysql_insert_id();
echo "Image Uploaded. <p /> Your image <p /> <img src=get.php?id=$last_id>";
<?php
mysql_connect("localhost","root","") or die(mysql_error());
mysql_select_db("image") or die(mysql_error());
$id = $_REQUEST['id'];
$result = mysql_query("SELECT * FROM image WHERE id = $id");
$image = $result['image'];
header("Content-type: image/jpeg");
echo $image;
?> | php | mysql | null | null | null | 12/12/2011 01:37:10 | not a real question | I want to show image on php which is store in mysql database as blob type
===
I want to show image on php from mysql database. I use the following code:
$last_id = mysql_insert_id();
echo "Image Uploaded. <p /> Your image <p /> <img src=get.php?id=$last_id>";
<?php
mysql_connect("localhost","root","") or die(mysql_error());
mysql_select_db("image") or die(mysql_error());
$id = $_REQUEST['id'];
$result = mysql_query("SELECT * FROM image WHERE id = $id");
$image = $result['image'];
header("Content-type: image/jpeg");
echo $image;
?> | 1 |
6,513,825 | 06/28/2011 22:28:47 | 688,212 | 04/01/2011 20:00:10 | 55 | 2 | Leverage browser caching optimization | I did a speed test to my website and got a **67/100** on **Leverage browser caching of static assets** with a list of graphics along this message:
*WARNING - (7.0 days) - http://www.example.com/myimage.png*
Also a **47/100**on **Remove ETag headers** with the same images along this message:
*FAILED - http://www.example.com/myimage.png*
I'm using this .htaccess for caching:
<FilesMatch "\.(html|css|js|gif|jpg|jpeg|png|ico|swf)$">
Header set Cache-Control "max-age=259200, proxy-revalidate"
</FilesMatch>
What do I need to change to optimize these factors?
Thanks | .htaccess | caching | optimization | null | null | 03/12/2012 14:28:14 | off topic | Leverage browser caching optimization
===
I did a speed test to my website and got a **67/100** on **Leverage browser caching of static assets** with a list of graphics along this message:
*WARNING - (7.0 days) - http://www.example.com/myimage.png*
Also a **47/100**on **Remove ETag headers** with the same images along this message:
*FAILED - http://www.example.com/myimage.png*
I'm using this .htaccess for caching:
<FilesMatch "\.(html|css|js|gif|jpg|jpeg|png|ico|swf)$">
Header set Cache-Control "max-age=259200, proxy-revalidate"
</FilesMatch>
What do I need to change to optimize these factors?
Thanks | 2 |
748,252 | 04/14/2009 15:57:21 | 37,838 | 11/14/2008 23:24:23 | 71 | 5 | A Programming Presentation for eight year olds | I have been given the opportunity to give a small presentation to a group of young children about what I do as a software developer.
I have a few ideas kicking around for how to make this interactive and entertaining for them while still getting my points across.
Ideally I would like to capture that feeling of working with pure ideas, but also getting to see something move and work. I was thinking of using legos to explain some of these concepts, and hey what kid doesn't like legos, but I was curious if the hive mind here at SA has any better suggestions. | presentations | education | children | interactive | null | 03/08/2012 15:52:35 | not constructive | A Programming Presentation for eight year olds
===
I have been given the opportunity to give a small presentation to a group of young children about what I do as a software developer.
I have a few ideas kicking around for how to make this interactive and entertaining for them while still getting my points across.
Ideally I would like to capture that feeling of working with pure ideas, but also getting to see something move and work. I was thinking of using legos to explain some of these concepts, and hey what kid doesn't like legos, but I was curious if the hive mind here at SA has any better suggestions. | 4 |
10,658,414 | 05/18/2012 19:07:24 | 1,036,474 | 11/08/2011 21:08:35 | 6 | 0 | Get html code from rich text editor into database html php | I am having issue with getting html code from the text entered in rich text editor. I want to have a rich text editor where user enters paragraphs, bold italic words, list etc etc. When the user clicks save button I want to get the html source code produced from the text entered in rich text editor and store in database.
I want to do this because I have to make site dynamic and user can enter data in whatever style he likes.... So if i have got text with html tags then I can decode it easily and display on my site.
Please help
Thanks | php | html | source-code | richtexteditor | null | 05/19/2012 09:03:26 | not a real question | Get html code from rich text editor into database html php
===
I am having issue with getting html code from the text entered in rich text editor. I want to have a rich text editor where user enters paragraphs, bold italic words, list etc etc. When the user clicks save button I want to get the html source code produced from the text entered in rich text editor and store in database.
I want to do this because I have to make site dynamic and user can enter data in whatever style he likes.... So if i have got text with html tags then I can decode it easily and display on my site.
Please help
Thanks | 1 |
11,166,048 | 06/23/2012 01:19:54 | 1,336,972 | 04/16/2012 18:06:17 | 22 | 0 | About google crawling php pages | I have a website , php based. I am wondering if google crawls php sites with same header but differet content.
http://www.nyitforums.com/professors/browse_all_prof.php?bdepartment=0
Each "view" button returns the same html template but with different results, So does google crawl all of them? If not, how can I do this?
Thanks in Advance. | google | null | null | null | null | null | open | About google crawling php pages
===
I have a website , php based. I am wondering if google crawls php sites with same header but differet content.
http://www.nyitforums.com/professors/browse_all_prof.php?bdepartment=0
Each "view" button returns the same html template but with different results, So does google crawl all of them? If not, how can I do this?
Thanks in Advance. | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.